git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #17410 from knedlsepp/motif-on-darwin

motif: Add support for darwin

commit70bf9314989b7714672f861b010bbfc824584ee7 authorJoachim F <joachifm@users.noreply.github.com> dateWed 3 Aug 2016, 18:31 (10 years ago) parentef463883a910ee
7 files changed+66−16
pkgs/applications/editors/nedit/default.nix+5−4 pkgs/applications/misc/catclock/default.nix+1−1 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/applications/editors/nedit/default.nix+5−4
@@ -1,7 +1,5 @@
11{ stdenv, fetchurl, xlibsWrapper, motif, libXpm }:
22
3−assert stdenv.isLinux;
4−
53stdenv.mkDerivation rec {
64 name = "nedit-5.6a";
75
@@ -12,7 +10,9 @@ stdenv.mkDerivation rec {
1210
1311 buildInputs = [ xlibsWrapper motif libXpm ];
1412
15− buildFlags = if stdenv.isLinux then "linux" else "";
13+ buildFlags = if stdenv.isLinux then "linux" else
14+ # the linux config works fine on darwin too!
15+ if stdenv.isDarwin then "linux" else "";
1616
1717 NIX_CFLAGS_COMPILE="-DBUILD_UNTESTED_NEDIT -L${motif}/lib";
1818
@@ -21,7 +21,8 @@ stdenv.mkDerivation rec {
2121 cp -p source/nedit source/nc $out/bin
2222 '';
2323
24− meta = {
24+ meta = with stdenv.lib; {
2525 homepage = http://www.nedit.org;
26+ platforms = with platforms; linux ++ darwin;
2627 };
2728}
pkgs/applications/misc/catclock/default.nix+1−1
@@ -26,6 +26,6 @@ stdenv.mkDerivation rec {
2626 homepage = http://codefromabove.com/2014/05/catclock/;
2727 license = with licenses; mit;
2828 maintainers = with maintainers; [ ramkromberg ];
29− platforms = with platforms; linux;
29+ platforms = with platforms; linux ++ darwin;
3030 };
3131}
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 };