git.iko.soy/typeable/nixpkgs
on master help sign in
motif: Add darwin support
commitee16dba6303b69c1915bb930924544ef4676540b authorJosef Kemetmueller <josef.kemetmueller@aon.at> dateSat 30 Jul 2016, 12:42 (10 years ago) parent2f32588
5 files changed+60−11
pkgs/development/libraries/motif/Add-X.Org-to-bindings-file.patch+7 pkgs/development/libraries/motif/Do-not-compile-demos.patch+11 pkgs/development/libraries/motif/Remove-unsupported-weak-refs-on-darwin.patch+12 pkgs/development/libraries/motif/Use-correct-header-for-malloc.patch+19 pkgs/development/libraries/motif/default.nix+11−11
pkgs/development/libraries/motif/Add-X.Org-to-bindings-file.patchnew file+7
@@ -0,0 +1,7 @@
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
pkgs/development/libraries/motif/Do-not-compile-demos.patchnew file+11
@@ -0,0 +1,11 @@
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 .
pkgs/development/libraries/motif/Remove-unsupported-weak-refs-on-darwin.patchnew file+12
@@ -0,0 +1,12 @@
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+
pkgs/development/libraries/motif/Use-correct-header-for-malloc.patchnew file+19
@@ -0,0 +1,19 @@
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+
pkgs/development/libraries/motif/default.nix+11−11
@@ -17,29 +17,29 @@ stdenv.mkDerivation rec {
1717 };
1818
1919 buildInputs = [
20− pkgconfig libtool
20+ libtool
2121 xlibsWrapper xbitmaps libXrender libXmu libXt
2222 expat libjpeg libpng libiconv
23− ] ++ stdenv.lib.optionals (!demoSupport) [ autoconf automake ];
23+ ];
2424
25− nativeBuildInputs = [ flex ];
25+ nativeBuildInputs = [ pkgconfig flex ] ++ stdenv.lib.optionals (!demoSupport) [ autoconf automake ];
2626
2727 propagatedBuildInputs = [ libXp libXau ];
2828
2929 makeFlags = [ "CFLAGS=-fno-strict-aliasing" ];
3030
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− '';
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;
3838
3939 meta = with stdenv.lib; {
4040 homepage = http://motif.ics.com;
4141 description = "Unix standard widget-toolkit and window-manager";
42− platforms = with platforms; linux;
42+ platforms = with platforms; linux ++ darwin;
4343 license = with licenses; [ lgpl21 ];
4444 maintainers = with maintainers; [ ];
4545 };