motif: Add darwin support

+60 -11
+7
pkgs/development/libraries/motif/Add-X.Org-to-bindings-file.patch
···
··· 1 + --- a/bindings/xmbind.alias 2 + +++ b/bindings/xmbind.alias 3 + @@ -62,3 +62,4 @@ 4 + "Sun Microsystems, Inc." sun 5 + ! "Sun Microsystems, Inc." sun_at 6 + "Tektronix, Inc." tek 7 + +"The X.Org Foundation" tpc
+11
pkgs/development/libraries/motif/Do-not-compile-demos.patch
···
··· 1 + --- a/Makefile.am 2 + +++ b/Makefile.am 3 + @@ -27,7 +27,6 @@ SUBDIRS = bindings bitmaps \ 4 + include \ 5 + tools \ 6 + clients \ 7 + - doc \ 8 + - demos 9 + + doc 10 + AUTOMAKE_OPTIONS = 1.4 11 + ACLOCAL_AMFLAGS = -I .
+12
pkgs/development/libraries/motif/Remove-unsupported-weak-refs-on-darwin.patch
···
··· 1 + --- a/lib/Xm/XmP.h 2 + +++ b/lib/Xm/XmP.h 3 + @@ -1437,7 +1437,7 @@ extern void _XmDestroyParentCallback( 4 + 5 + #endif /* NO_XM_1_2_BC */ 6 + 7 + -#if __GNUC__ 8 + +#if __GNUC__ && ! __APPLE__ 9 + # define XM_DEPRECATED __attribute__((__deprecated__)) 10 + # define XM_ALIAS(sym) __attribute__((__weak__,alias(#sym))) 11 + #else 12 +
+19
pkgs/development/libraries/motif/Use-correct-header-for-malloc.patch
···
··· 1 + --- a/demos/programs/workspace/xrmLib.c 2 + +++ b/demos/programs/workspace/xrmLib.c 3 + @@ -30,7 +30,14 @@ static char rcsid[] = "$XConsortium: xrmLib.c /main/6 1995/07/14 10:01:41 drk $" 4 + #endif 5 + 6 + #include <stdio.h> 7 + -#include <malloc.h> 8 + +#if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__) 9 + +# include <stdlib.h> 10 + +# if defined(HAVE_MALLOC_H) 11 + +# include <malloc.h> 12 + +# elif defined(HAVE_SYS_MALLOC_H) 13 + +# include <sys/malloc.h> 14 + +# endif 15 + +#endif 16 + #include <Xm/Xm.h> 17 + #include "wsm.h" 18 + #include "wsmDebug.h" 19 +
+11 -11
pkgs/development/libraries/motif/default.nix
··· 17 }; 18 19 buildInputs = [ 20 - pkgconfig libtool 21 xlibsWrapper xbitmaps libXrender libXmu libXt 22 expat libjpeg libpng libiconv 23 - ] ++ stdenv.lib.optionals (!demoSupport) [ autoconf automake ]; 24 25 - nativeBuildInputs = [ flex ]; 26 27 propagatedBuildInputs = [ libXp libXau ]; 28 29 makeFlags = [ "CFLAGS=-fno-strict-aliasing" ]; 30 31 - patchPhase = '' 32 - rm lib/Xm/Xm.h 33 - echo -e '"The X.Org Foundation"\t\t\t\t\tpc' >>bindings/xmbind.alias 34 - '' + stdenv.lib.optionalString (!demoSupport) 35 - '' 36 - sed -i -e '/^SUBDIRS/{:x;/\\$/{N;bx;};s/[ \t\n\\]*demos//;}' Makefile.am 37 - ''; 38 39 meta = with stdenv.lib; { 40 homepage = http://motif.ics.com; 41 description = "Unix standard widget-toolkit and window-manager"; 42 - platforms = with platforms; linux; 43 license = with licenses; [ lgpl21 ]; 44 maintainers = with maintainers; [ ]; 45 };
··· 17 }; 18 19 buildInputs = [ 20 + libtool 21 xlibsWrapper xbitmaps libXrender libXmu libXt 22 expat libjpeg libpng libiconv 23 + ]; 24 25 + nativeBuildInputs = [ pkgconfig flex ] ++ stdenv.lib.optionals (!demoSupport) [ autoconf automake ]; 26 27 propagatedBuildInputs = [ libXp libXau ]; 28 29 makeFlags = [ "CFLAGS=-fno-strict-aliasing" ]; 30 31 + prePatch = ''rm lib/Xm/Xm.h''; 32 + 33 + patches = [ ./Remove-unsupported-weak-refs-on-darwin.patch 34 + ./Use-correct-header-for-malloc.patch 35 + ./Add-X.Org-to-bindings-file.patch 36 + ] 37 + ++ stdenv.lib.optional (!demoSupport) ./Do-not-compile-demos.patch; 38 39 meta = with stdenv.lib; { 40 homepage = http://motif.ics.com; 41 description = "Unix standard widget-toolkit and window-manager"; 42 + platforms = with platforms; linux ++ darwin; 43 license = with licenses; [ lgpl21 ]; 44 maintainers = with maintainers; [ ]; 45 };