From 72a771b6e4b3583a3f8b5ae118b60fc16b012ac9 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Wed, 3 Jul 2013 19:52:22 +1000 Subject: [PATCH 01/14] emacs24: fix build on darwin --- pkgs/applications/editors/emacs-24/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/emacs-24/default.nix b/pkgs/applications/editors/emacs-24/default.nix index a781cb37346..470d8f53cb8 100644 --- a/pkgs/applications/editors/emacs-24/default.nix +++ b/pkgs/applications/editors/emacs-24/default.nix @@ -44,7 +44,7 @@ EOF doCheck = true; - meta = { + meta = with stdenv.lib; { description = "GNU Emacs 24, the extensible, customizable text editor"; longDescription = '' @@ -67,7 +67,7 @@ EOF homepage = "http://www.gnu.org/software/emacs/"; license = "GPLv3+"; - maintainers = with stdenv.lib.maintainers; [ ludo simons chaoflow ]; - platforms = stdenv.lib.platforms.all; + maintainers = with maintainers; [ chaoflow lovek323 ludo simons ]; + platforms = platforms.all; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0000d81b861..134e2101043 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7232,6 +7232,12 @@ let alsaLib = null; imagemagick = null; texinfo = texinfo5; + + # use gccApple on darwin to deal with: unexec: 'my_edata is not in section + # __data' + stdenv = if stdenv.isDarwin + then stdenvAdapters.overrideGCC stdenv gccApple + else stdenv; }; emacsPackages = emacs: self: let callPackage = newScope self; in rec { From bdf5a5c20e8912f3e8115b9c7f9176da91fcacf3 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Wed, 3 Jul 2013 19:52:46 +1000 Subject: [PATCH 02/14] liboil: fix build on darwin * force --build=x86_64 --- pkgs/development/libraries/liboil/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/liboil/default.nix b/pkgs/development/libraries/liboil/default.nix index 45f75b4f805..de2ffdffca7 100644 --- a/pkgs/development/libraries/liboil/default.nix +++ b/pkgs/development/libraries/liboil/default.nix @@ -12,9 +12,15 @@ stdenv.mkDerivation rec { patches = [ ./x86_64-cpuid.patch ]; - meta = { - homepage = http://liboil.freedesktop.org; + # fix "argb_paint_i386.c:53:Incorrect register `%rax' used with `l' suffix" + # errors + configureFlags = stdenv.lib.optional stdenv.isDarwin "--build=x86_64"; + + meta = with stdenv.lib; { description = "A library of simple functions that are optimized for various CPUs"; - license = "BSD-2"; + homepage = http://liboil.freedesktop.org; + license = libraries.bsd2; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.all; }; } From 6307798b45347a298d39fa78ed79c7d69a8b9f15 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Wed, 3 Jul 2013 20:09:27 +1000 Subject: [PATCH 03/14] gnome.ORBit2: fix build on darwin * add libintlOrEmpty to build inputs --- .../gnome-2/platform/ORBit2/default.nix | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome-2/platform/ORBit2/default.nix b/pkgs/desktops/gnome-2/platform/ORBit2/default.nix index 22c22c6bcf5..94aaf30a49d 100644 --- a/pkgs/desktops/gnome-2/platform/ORBit2/default.nix +++ b/pkgs/desktops/gnome-2/platform/ORBit2/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl_gnome, pkgconfig, glib, libIDL}: +{ stdenv, fetchurl_gnome, pkgconfig, glib, libIDL, libintlOrEmpty }: stdenv.mkDerivation rec { name = src.pkgname; @@ -14,5 +14,24 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ pkgconfig ]; - propagatedBuildInputs = [ glib libIDL ]; + propagatedBuildInputs = [ glib libIDL ] ++ libintlOrEmpty; + + meta = with stdenv.lib; { + homepage = https://projects.gnome.org/ORBit2/; + description = "A a CORBA 2.4-compliant Object Request Broker"; + platforms = platforms.unix; + maintainers = with maintainers; [ lovek323 ]; + + longDescription = '' + ORBit2 is a CORBA 2.4-compliant Object Request Broker (ORB) featuring + mature C, C++ and Python bindings. Bindings (in various degrees of + completeness) are also available for Perl, Lisp, Pascal, Ruby, and TCL; + others are in-progress. It supports POA, DII, DSI, TypeCode, Any, IR and + IIOP. Optional features including INS and threading are available. ORBit2 + is engineered for the desktop workstation environment, with a focus on + performance, low resource usage, and security. The core ORB is written in + C, and runs under Linux, UNIX (BSD, Solaris, HP-UX, ...), and Windows. + ORBit2 is developed and released as open source software under GPL/LGPL. + ''; + }; } From 3b54af72b17c33bfafcd748156475f3f432bbdec Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Wed, 3 Jul 2013 22:00:52 +1000 Subject: [PATCH 04/14] cracklib: fix build on darwin * add libintlOrEmpty to build inputs --- pkgs/development/libraries/cracklib/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/cracklib/default.nix b/pkgs/development/libraries/cracklib/default.nix index 32d1c478a49..7fb9089420d 100644 --- a/pkgs/development/libraries/cracklib/default.nix +++ b/pkgs/development/libraries/cracklib/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, libintlOrEmpty }: stdenv.mkDerivation rec { name = "cracklib-2.8.16"; @@ -8,8 +8,12 @@ stdenv.mkDerivation rec { sha256 = "1g3mchdvra9nihxlkl3rdz96as3xnfw5m59hmr5k17l7qa9a8fpw"; }; - meta = { - homepage = http://sourceforge.net/projects/cracklib; + buildInputs = libintlOrEmpty; + + meta = with stdenv.lib; { + homepage = http://sourceforge.net/projects/cracklib; description = "A library for checking the strength of passwords"; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.unix; }; } From 84f5d870f38e753b2e5de505aa2958b4ac2e8e23 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Wed, 3 Jul 2013 22:01:34 +1000 Subject: [PATCH 05/14] glib: remove unnecessary restrictions on darwin --- pkgs/development/libraries/glib/default.nix | 24 ++++++--------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 7469b07ce86..b500967af78 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -24,7 +24,7 @@ let ''; in -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { name = "glib-2.36.1"; src = fetchurl { @@ -41,10 +41,7 @@ stdenv.mkDerivation (rec { configureFlags = "--with-pcre=system --disable-fam"; - postConfigure = "sed '/SANE_MALLOC_PROTOS/s,^,//,' -i config.h" # https://bugzilla.gnome.org/show_bug.cgi?id=698716 :-) - + stdenv.lib.optionalString stdenv.isDarwin '' - sed '24 i #include ' - ''; + postConfigure = "sed '/SANE_MALLOC_PROTOS/s,^,//,' -i config.h"; enableParallelBuilding = true; @@ -55,12 +52,12 @@ stdenv.mkDerivation (rec { inherit flattenInclude; }; - meta = { + meta = with stdenv.lib; { description = "GLib, a C library of programming buildings blocks"; homepage = http://www.gtk.org/; - license = "LGPLv2+"; - maintainers = with stdenv.lib.maintainers; [ raskin urkud lovek323 ]; - platforms = stdenv.lib.platforms.unix; + license = licenses.lgpl2Plus; + maintainers = with maintainers; [ lovek323 raskin urkud ]; + platforms = platforms.unix; longDescription = '' GLib provides the core application building blocks for libraries @@ -71,12 +68,3 @@ stdenv.mkDerivation (rec { }; } -// - -(stdenv.lib.optionalAttrs stdenv.isDarwin { - # XXX: Disable the NeXTstep back-end because stdenv.gcc doesn't support - # Objective-C. - postConfigure = - '' sed -i configure -e's/glib_have_cocoa=yes/glib_have_cocoa=no/g' - ''; -})) From 216d47be0c39df07c4cd3bfcf4f05b01a8409a78 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Wed, 3 Jul 2013 22:02:40 +1000 Subject: [PATCH 06/14] gobject-introspection: fix build on darwin * add otool expression (add otool to build inputs) * add libintlOrEmpty to build inputs --- .../gobject-introspection/default.nix | 24 ++++++++++---- pkgs/development/tools/misc/otool/default.nix | 31 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/tools/misc/otool/default.nix diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix index b96d5b25bb1..99a80640bb8 100644 --- a/pkgs/development/libraries/gobject-introspection/default.nix +++ b/pkgs/development/libraries/gobject-introspection/default.nix @@ -1,14 +1,17 @@ -{ stdenv, fetchurl, glib, flex, bison, pkgconfig, libffi, python, gdk_pixbuf }: +{ stdenv, fetchurl, glib, flex, bison, pkgconfig, libffi, python, gdk_pixbuf +, libintlOrEmpty, autoconf, automake, otool }: stdenv.mkDerivation rec { name = "gobject-introspection-1.34.2"; - buildInputs = [ flex bison glib pkgconfig python gdk_pixbuf ]; + buildInputs = [ flex bison glib pkgconfig python gdk_pixbuf ] + ++ libintlOrEmpty + ++ stdenv.lib.optional stdenv.isDarwin otool; propagatedBuildInputs = [ libffi ]; # Tests depend on cairo, which is undesirable (it pulls in lots of # other dependencies). - configureFlags = "--disable-tests"; + configureFlags = [ "--disable-tests" ]; src = fetchurl { url = "mirror://gnome/sources/gobject-introspection/1.34/${name}.tar.xz"; @@ -18,8 +21,17 @@ stdenv.mkDerivation rec { postInstall = "rm -rf $out/share/gtk-doc"; meta = with stdenv.lib; { - maintainers = [ maintainers.urkud ]; - platforms = platforms.linux; - homepage = http://live.gnome.org/GObjectIntrospection; + description = "A middleware layer between C libraries and language bindings"; + homepage = http://live.gnome.org/GObjectIntrospection; + maintainers = with maintainers; [ lovek323 urkud ]; + platforms = platforms.unix; + + longDescription = '' + GObject introspection is a middleware layer between C libraries (using + GObject) and language bindings. The C library can be scanned at compile + time and generate a metadata file, in addition to the actual native C + library. Then at runtime, language bindings can read this metadata and + automatically provide bindings to call into the C library. + ''; }; } diff --git a/pkgs/development/tools/misc/otool/default.nix b/pkgs/development/tools/misc/otool/default.nix new file mode 100644 index 00000000000..aa365fc29d5 --- /dev/null +++ b/pkgs/development/tools/misc/otool/default.nix @@ -0,0 +1,31 @@ +{ stdenv }: + +stdenv.mkDerivation { + name = "otool"; + + src = "/usr/bin/otool"; + + unpackPhase = "true"; + configurePhase = "true"; + buildPhase = "true"; + + installPhase = '' + mkdir -p "$out/bin" + cp /usr/bin/otool "$out/bin" + ''; + + meta = with stdenv.lib; { + description = "Object file displaying tool"; + homepage = https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/otool.1.html; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.darwin; + + longDescription = '' + The otool command displays specified parts of object files or libraries. + If the, -m option is not used, the file arguments may be of the form + libx.a(foo.o), to request information about only that object file and not + the entire library. + ''; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 134e2101043..8bbe1e14cca 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -444,6 +444,8 @@ let apg = callPackage ../tools/security/apg { }; + otool = callPackage ../development/tools/misc/otool { }; + xcodeenv = callPackage ../development/mobile/xcodeenv { }; titaniumenv_2_1 = import ../development/mobile/titaniumenv { From a42133a102a6c00d98de985b1d3073eed173c8aa Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Thu, 4 Jul 2013 00:21:46 +1000 Subject: [PATCH 07/14] gnome.GConf: fix build on darwin * disable polkit * add --enable-static to configureFlags --- pkgs/desktops/gnome-2/platform/GConf/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome-2/platform/GConf/default.nix b/pkgs/desktops/gnome-2/platform/GConf/default.nix index 4769247a516..847983e2c49 100644 --- a/pkgs/desktops/gnome-2/platform/GConf/default.nix +++ b/pkgs/desktops/gnome-2/platform/GConf/default.nix @@ -9,10 +9,16 @@ stdenv.mkDerivation { sha256 = "09ch709cb9fniwc4221xgkq0jf0x0lxs814sqig8p2dcll0llvzk"; }; - buildInputs = [ ORBit2 dbus_libs dbus_glib libxml2 polkit gtk ]; + buildInputs = [ ORBit2 dbus_libs dbus_glib libxml2 gtk ] + # polkit requires pam, which requires shadow.h, which is not available on + # darwin + ++ stdenv.lib.optional (!stdenv.isDarwin) polkit; + propagatedBuildInputs = [ glib ]; nativeBuildInputs = [ pkgconfig intltool ]; - configureFlags = "--with-gtk=2.0"; + configureFlags = [ "--with-gtk=2.0" ] + # fixes the "libgconfbackend-oldxml.so is not portable" error on darwin + ++ stdenv.lib.optional stdenv.isDarwin [ "--enable-static" ]; } From 3e14bb6fdf3e079e58e8b3556a7cf751a79e8835 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Thu, 4 Jul 2013 00:25:53 +1000 Subject: [PATCH 08/14] gst-plugins-base: fix build on darwin * remove alsaLib and cdparanoia from build inputs * add cairo to build inputs --- .../gstreamer/gst-plugins-base/default.nix | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix b/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix index 2ac325dc282..e29be91c34b 100644 --- a/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix +++ b/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix @@ -1,7 +1,5 @@ -{ fetchurl, stdenv, pkgconfig, python, gstreamer -, xlibs, alsaLib, cdparanoia, libogg -, libtheora, libvorbis, freetype, pango -, liboil, glib +{ fetchurl, stdenv, pkgconfig, python, gstreamer, xlibs, alsaLib, cdparanoia +, libogg, libtheora, libvorbis, freetype, pango, liboil, glib, cairo , # Whether to build no plugins that have external dependencies # (except the ALSA plugin). minimalDeps ? false @@ -25,22 +23,25 @@ stdenv.mkDerivation rec { # TODO : v4l, libvisual buildInputs = - [ pkgconfig glib alsaLib ] + [ pkgconfig glib cairo ] + # can't build alsaLib on darwin + ++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib ++ stdenv.lib.optionals (!minimalDeps) - [ xlibs.xlibs xlibs.libXv cdparanoia libogg libtheora libvorbis - freetype pango liboil - ]; + [ xlibs.xlibs xlibs.libXv libogg libtheora libvorbis freetype pango + liboil ] + # can't build cdparanoia on darwin + ++ stdenv.lib.optional (!minimalDeps && !stdenv.isDarwin) cdparanoia; propagatedBuildInputs = [ gstreamer ]; postInstall = "rm -rf $out/share/gtk-doc"; - meta = { - homepage = http://gstreamer.freedesktop.org; - + meta = with stdenv.lib; { + homepage = http://gstreamer.freedesktop.org; description = "Base plug-ins for GStreamer"; - - license = "LGPLv2+"; + license = licences.lgpl2Plus; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.unix; }; } From 67e5eb909ba6e5cf59d88dd7310b0a193ebabf82 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Thu, 4 Jul 2013 08:48:55 +1000 Subject: [PATCH 09/14] llvm: fix build on darwin * add DYLD_LIBRARY_PATH * don't build with shared libs --- pkgs/development/compilers/llvm/default.nix | 22 ++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index 59e2bdc5509..2385332e05c 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -18,19 +18,23 @@ stdenv.mkDerivation { propagatedBuildInputs = [ libffi ]; buildInputs = [ perl groff cmake python ]; # ToDo: polly, libc++; enable cxx11? - # created binaries need to be run before installation... I coudn't find a better way - preBuild = ''export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:"`pwd`/lib''; + # created binaries need to be run before installation... I coudn't find a + # better way + preBuild = ( if stdenv.isDarwin + then "export DYLD_LIBRARY_PATH='$DYLD_LIBRARY_PATH:'`pwd`/lib" + else "export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:'`pwd`/lib" ); - cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" "-DBUILD_SHARED_LIBS=ON" ]; + cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ] + ++ stdenv.lib.optional (!stdenv.isDarwin) [ "-DBUILD_SHARED_LIBS=ON" ]; enableParallelBuilding = true; - #doCheck = true; # tests are broken, don't know why + doCheck = true; # tests are broken, don't know why - meta = { - homepage = http://llvm.org/; + meta = with stdenv.lib; { description = "Collection of modular and reusable compiler and toolchain technologies"; - license = "BSD"; - maintainers = with stdenv.lib.maintainers; [viric shlevy raskin]; - platforms = with stdenv.lib.platforms; all; + homepage = http://llvm.org/; + license = licenses.bsd; + maintainers = with maintainers; [ lovek323 raskin shlevy viric ]; + platforms = platforms.all; }; } From 3babc55ae29fba3a6981a5722fa86186924aebfd Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Thu, 4 Jul 2013 08:49:30 +1000 Subject: [PATCH 10/14] wxGTK29: fix build on darwin * use clang to compile * add configure flags to enable building for 64-bit * add setFile to build inputs --- .../libraries/wxGTK-2.9/default.nix | 32 ++++++++++++------- pkgs/top-level/all-packages.nix | 5 +++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/wxGTK-2.9/default.nix b/pkgs/development/libraries/wxGTK-2.9/default.nix index fca5a4a278e..e8a661a3389 100644 --- a/pkgs/development/libraries/wxGTK-2.9/default.nix +++ b/pkgs/development/libraries/wxGTK-2.9/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, pkgconfig, gtk, libXinerama, libSM, libXxf86vm, xf86vidmodeproto -, gstreamer, gst_plugins_base, GConf +, gstreamer, gst_plugins_base, GConf, setFile , withMesa ? true, mesa ? null, compat24 ? false, compat26 ? true, unicode ? true, }: @@ -18,19 +18,23 @@ stdenv.mkDerivation { sha256 = "04jda4bns7cmp7xy68qz112yg0lribpc6xs5k9gilfqcyhshqlvc"; }; - buildInputs = [ gtk libXinerama libSM libXxf86vm xf86vidmodeproto gstreamer gst_plugins_base GConf ] - ++ optional withMesa mesa; + buildInputs = + [ gtk libXinerama libSM libXxf86vm xf86vidmodeproto gstreamer + gst_plugins_base GConf ] + ++ optional withMesa mesa + ++ optional stdenv.isDarwin setFile; nativeBuildInputs = [ pkgconfig ]; - configureFlags = [ - "--enable-gtk2" - (if compat24 then "--enable-compat24" else "--disable-compat24") - (if compat26 then "--enable-compat26" else "--disable-compat26") - "--disable-precomp-headers" - (if unicode then "--enable-unicode" else "") - "--enable-mediactrl" - ] ++ optional withMesa "--with-opengl"; + configureFlags = + [ "--enable-gtk2" "--disable-precomp-headers" "--enable-mediactrl" + (if compat24 then "--enable-compat24" else "--disable-compat24") + (if compat26 then "--enable-compat26" else "--disable-compat26") ] + ++ optional unicode "--enable-unicode" + ++ optional withMesa "--with-opengl" + ++ optionals stdenv.isDarwin + # allow building on 64-bit + [ "--with-cocoa" "--enable-universal-binaries" ]; SEARCH_LIB = optionalString withMesa "${mesa}/lib"; @@ -38,7 +42,11 @@ stdenv.mkDerivation { substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE=' substituteInPlace configure --replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB=' substituteInPlace configure --replace /usr /no-such-path - "; + " + optionalString stdenv.isDarwin '' + substituteInPlace configure --replace \ + 'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' \ + 'ac_cv_prog_SETFILE="${setFile}/bin/SetFile"' + ''; postInstall = " (cd $out/include && ln -s wx-*/* .) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8bbe1e14cca..c584c195c79 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5475,6 +5475,11 @@ let wxGTK29 = callPackage ../development/libraries/wxGTK-2.9/default.nix { inherit (gnome) GConf; withMesa = lib.elem system lib.platforms.mesaPlatforms; + + # use for Objective-C++ compiler + stdenv = if stdenv.isDarwin + then clangStdenv + else stdenv; }; wtk = callPackage ../development/libraries/wtk { }; From c2901da1b829a51f6490a2d0927fd4d668e45311 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Thu, 4 Jul 2013 08:50:37 +1000 Subject: [PATCH 11/14] setFile: add expression --- .../tools/misc/setFile/default.nix | 31 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/tools/misc/setFile/default.nix diff --git a/pkgs/development/tools/misc/setFile/default.nix b/pkgs/development/tools/misc/setFile/default.nix new file mode 100644 index 00000000000..9f86184634f --- /dev/null +++ b/pkgs/development/tools/misc/setFile/default.nix @@ -0,0 +1,31 @@ +{ stdenv }: + +stdenv.mkDerivation { + name = "setFile"; + + src = "/usr/bin/SetFile"; + + unpackPhase = "true"; + configurePhase = "true"; + buildPhase = "true"; + + installPhase = '' + mkdir -p "$out/bin" + cp $src "$out/bin" + ''; + + meta = with stdenv.lib; { + description = "Set attributes of files and directories"; + homepage = "http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/setfile.1.html"; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.darwin; + + longDescription = '' + SetFile is a tool to set the file attributes on files in an HFS+ + directory. It attempts to be similar to the setfile command in MPW. It can + apply rules to more than one file with the options apply- ing to all files + listed. + ''; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c584c195c79..b3a5b35ac47 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -446,6 +446,8 @@ let otool = callPackage ../development/tools/misc/otool { }; + setFile = callPackage ../development/tools/misc/setFile { }; + xcodeenv = callPackage ../development/mobile/xcodeenv { }; titaniumenv_2_1 = import ../development/mobile/titaniumenv { From 4c9cff322adbf2c8ea12b6b3d3f7a21e7b4ac511 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Thu, 4 Jul 2013 08:51:25 +1000 Subject: [PATCH 12/14] gnuplot: fix build on darwin * add readline to build inputs * don't use wxGTK --- pkgs/tools/graphics/gnuplot/default.nix | 22 +++++++++++++--------- pkgs/top-level/all-packages.nix | 5 +++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix index 485edf7335d..5dee1079ae2 100644 --- a/pkgs/tools/graphics/gnuplot/default.nix +++ b/pkgs/tools/graphics/gnuplot/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, zlib, gd, texinfo, makeWrapper +{ stdenv, fetchurl, zlib, gd, texinfo, makeWrapper, readline , texLive ? null , lua ? null , emacs ? null @@ -10,9 +10,9 @@ , pango ? null , cairo ? null , pkgconfig ? null -, readline -, fontconfig ? null, gnused ? null, coreutils ? null -}: +, fontconfig ? null +, gnused ? null +, coreutils ? null }: assert libX11 != null -> (fontconfig != null && gnused != null && coreutils != null); @@ -26,11 +26,14 @@ stdenv.mkDerivation rec { buildInputs = [ zlib gd texinfo readline emacs lua texLive libX11 libXt libXpm libXaw - wxGTK pango cairo pkgconfig makeWrapper - ]; + pango cairo pkgconfig makeWrapper ] + # compiling with wxGTK causes a malloc (double free) error on darwin + ++ stdenv.lib.optional (!stdenv.isDarwin) wxGTK; configureFlags = if libX11 != null then ["--with-x"] else ["--without-x"]; + NIX_CFLAGS_COMPILE = "-I${cairo}/include/cairo"; + postInstall = stdenv.lib.optionalString (libX11 != null) '' wrapProgram $out/bin/gnuplot \ --prefix PATH : '${gnused}/bin' \ @@ -39,9 +42,10 @@ stdenv.mkDerivation rec { --run '. ${./set-gdfontpath-from-fontconfig.sh}' ''; - meta = { - homepage = "http://www.gnuplot.info"; + meta = with stdenv.lib; { + homepage = http://www.gnuplot.info; description = "A portable command-line driven graphing utility for many platforms"; - platforms = stdenv.lib.platforms.all; + platforms = platforms.all; + maintainers = with maintainers; [ lovek323 ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b3a5b35ac47..bff4b0ef896 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -917,6 +917,11 @@ let gnuplot = callPackage ../tools/graphics/gnuplot { texLive = null; lua = null; + + # use gccApple to compile on darwin, seems to resolve a malloc error + stdenv = if stdenv.isDarwin + then stdenvAdapters.overrideGCC stdenv gccApple + else stdenv; }; gnused = callPackage ../tools/text/gnused { }; From 2a21046f246b9c3b1351d116c5193980477bc19e Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Thu, 4 Jul 2013 19:01:47 +1000 Subject: [PATCH 13/14] otool & setFile: only allow on darwin --- pkgs/development/tools/misc/otool/default.nix | 3 +++ pkgs/development/tools/misc/setFile/default.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pkgs/development/tools/misc/otool/default.nix b/pkgs/development/tools/misc/otool/default.nix index aa365fc29d5..21eb2b591c2 100644 --- a/pkgs/development/tools/misc/otool/default.nix +++ b/pkgs/development/tools/misc/otool/default.nix @@ -1,5 +1,8 @@ { stdenv }: +# this tool only exists on darwin +assert stdenv.isDarwin; + stdenv.mkDerivation { name = "otool"; diff --git a/pkgs/development/tools/misc/setFile/default.nix b/pkgs/development/tools/misc/setFile/default.nix index 9f86184634f..e3fbd2cbc6d 100644 --- a/pkgs/development/tools/misc/setFile/default.nix +++ b/pkgs/development/tools/misc/setFile/default.nix @@ -1,5 +1,8 @@ { stdenv }: +# this tool only exists on darwin +assert stdenv.isDarwin; + stdenv.mkDerivation { name = "setFile"; From 3b490b7ccbb365088feef242518af46d6dd3a19a Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Thu, 4 Jul 2013 19:02:40 +1000 Subject: [PATCH 14/14] llvm: re-disabling tests accidentally re-enabled doCheck, which isn't working yet --- pkgs/development/compilers/llvm/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index 2385332e05c..c06abe0db94 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation { ++ stdenv.lib.optional (!stdenv.isDarwin) [ "-DBUILD_SHARED_LIBS=ON" ]; enableParallelBuilding = true; - doCheck = true; # tests are broken, don't know why + # doCheck = true; # tests are broken, don't know why meta = with stdenv.lib; { description = "Collection of modular and reusable compiler and toolchain technologies";