@@ -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 };