diff --git a/pkgs/applications/audio/bs1770gain/default.nix b/pkgs/applications/audio/bs1770gain/default.nix index db6843f4535..862f5263695 100644 --- a/pkgs/applications/audio/bs1770gain/default.nix +++ b/pkgs/applications/audio/bs1770gain/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { buildInputs = [ ffmpeg sox ]; + NIX_CFLAGS_COMPILE = "-Wno-error"; + meta = { description = "A audio/video loudness scanner implementing ITU-R BS.1770"; license = stdenv.lib.licenses.gpl2Plus; diff --git a/pkgs/applications/audio/cd-discid/default.nix b/pkgs/applications/audio/cd-discid/default.nix index 5286362b50f..2cf9849e351 100644 --- a/pkgs/applications/audio/cd-discid/default.nix +++ b/pkgs/applications/audio/cd-discid/default.nix @@ -1,4 +1,5 @@ -{ fetchurl, stdenv }: +{ fetchurl, stdenv +, IOKit ? null }: stdenv.mkDerivation rec { name = "cd-discid-${version}"; @@ -11,6 +12,9 @@ stdenv.mkDerivation rec { installFlags = "PREFIX=$(out) INSTALL=install"; + buildInputs = [] + ++ stdenv.lib.optional stdenv.isDarwin [ IOKit ]; + meta = with stdenv.lib; { homepage = http://linukz.org/cd-discid.shtml; license = licenses.gpl2Plus; diff --git a/pkgs/applications/editors/geany/default.nix b/pkgs/applications/editors/geany/default.nix index cd93a4ed0e8..961c7ba0461 100644 --- a/pkgs/applications/editors/geany/default.nix +++ b/pkgs/applications/editors/geany/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { sha256 = "0nha21rbdhl10vdpaq8d5v5fszvggl1xar555pvrnvm2y443ffpp"; }; + NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null; + buildInputs = [ gtk2 which pkgconfig intltool file ]; doCheck = true; diff --git a/pkgs/applications/editors/mg/default.nix b/pkgs/applications/editors/mg/default.nix index 45a527c7484..95a6205125b 100644 --- a/pkgs/applications/editors/mg/default.nix +++ b/pkgs/applications/editors/mg/default.nix @@ -12,6 +12,9 @@ stdenv.mkDerivation rec { patches = [ ./configure.patch ]; patchFlags = "-p0"; + NIX_CFLAGS_COMPILE = "-Wno-error"; + buildFlags = [ "CC=cc" ]; + installPhase = '' mkdir -p $out/bin cp mg $out/bin diff --git a/pkgs/applications/graphics/gpicview/default.nix b/pkgs/applications/graphics/gpicview/default.nix index 4d01bbd126b..7e11c9dea3a 100644 --- a/pkgs/applications/graphics/gpicview/default.nix +++ b/pkgs/applications/graphics/gpicview/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, intltool, pkgconfig, gtk2 }: +{ stdenv, fetchurl, intltool, pkgconfig, gtk2, fetchpatch }: stdenv.mkDerivation { name = "gpicview-0.2.4"; @@ -8,6 +8,13 @@ stdenv.mkDerivation { sha256 = "1svcy1c8bgk0pl12yhyv16h2fl52x5vzzcv57z6qdcv5czgvgglr"; }; + patches = [ + (fetchpatch { + url = "https://raw.githubusercontent.com/nonas/debian-clang/master/buildlogs/gpicview/gpicview-0.2.4/debian/patches/clang_FTBFS_Wreturn-type.patch"; + sha256 = "02dm966bplnv10knpdx7rlpjipk884156ggd9ij05zhza0jl8xcs"; + }) + ]; + meta = with stdenv.lib; { description = "A simple and fast image viewer for X"; homepage = http://lxde.sourceforge.net/gpicview/; diff --git a/pkgs/applications/misc/gkrellm/default.nix b/pkgs/applications/misc/gkrellm/default.nix index ac8f876ad3f..23b705058df 100644 --- a/pkgs/applications/misc/gkrellm/default.nix +++ b/pkgs/applications/misc/gkrellm/default.nix @@ -1,4 +1,5 @@ -{ fetchurl, stdenv, gettext, pkgconfig, glib, gtk, libX11, libSM, libICE }: +{ fetchurl, stdenv, gettext, pkgconfig, glib, gtk, libX11, libSM, libICE +, IOKit ? null }: stdenv.mkDerivation rec { name = "gkrellm-2.3.5"; @@ -7,7 +8,8 @@ stdenv.mkDerivation rec { sha256 = "12rc6zaa7kb60b9744lbrlfkxxfniprm6x0mispv63h4kh75navh"; }; - buildInputs = [gettext pkgconfig glib gtk libX11 libSM libICE]; + buildInputs = [gettext pkgconfig glib gtk libX11 libSM libICE] + ++ stdenv.lib.optionals stdenv.isDarwin [ IOKit ]; # Makefiles are patched to fix references to `/usr/X11R6' and to add # `-lX11' to make sure libX11's store path is in the RPATH. diff --git a/pkgs/applications/networking/nload/default.nix b/pkgs/applications/networking/nload/default.nix index f3faa0128bb..879461c8acd 100644 --- a/pkgs/applications/networking/nload/default.nix +++ b/pkgs/applications/networking/nload/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { ''; homepage = http://www.roland-riegel.de/nload/index.html; license = stdenv.lib.licenses.gpl2; - platforms = stdenv.lib.platforms.unix; + platforms = stdenv.lib.platforms.linux; maintainers = [ stdenv.lib.maintainers.devhell ]; }; } diff --git a/pkgs/applications/window-managers/i3/blocks-gaps.nix b/pkgs/applications/window-managers/i3/blocks-gaps.nix index 36cf593a890..a80dbd38ec8 100644 --- a/pkgs/applications/window-managers/i3/blocks-gaps.nix +++ b/pkgs/applications/window-managers/i3/blocks-gaps.nix @@ -19,6 +19,6 @@ stdenv.mkDerivation rec { homepage = https://github.com/Airblader/i3blocks-gaps; license = licenses.gpl3; maintainers = [ "carlsverre" ]; - platforms = platforms.all; + platforms = platforms.linux; }; } diff --git a/pkgs/development/interpreters/erlang/R16.nix b/pkgs/development/interpreters/erlang/R16.nix index ffc4c27e662..02f9d1f98e8 100644 --- a/pkgs/development/interpreters/erlang/R16.nix +++ b/pkgs/development/interpreters/erlang/R16.nix @@ -2,7 +2,8 @@ , gnused, gawk, makeWrapper , odbcSupport ? false, unixODBC ? null , wxSupport ? false, mesa ? null, wxGTK ? null, xorg ? null -, enableDebugInfo ? false }: +, enableDebugInfo ? false +, Carbon ? null, Cocoa ? null }: assert wxSupport -> mesa != null && wxGTK != null && xorg != null; assert odbcSupport -> unixODBC != null; @@ -23,7 +24,8 @@ stdenv.mkDerivation rec { buildInputs = [ perl gnum4 ncurses openssl makeWrapper ] ++ optional wxSupport [ mesa wxGTK xorg.libX11 ] - ++ optional odbcSupport [ unixODBC ]; + ++ optional odbcSupport [ unixODBC ] + ++ optional stdenv.isDarwin [ Carbon Cocoa ]; patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure ''; diff --git a/pkgs/development/interpreters/rakudo/default.nix b/pkgs/development/interpreters/rakudo/default.nix index 51b1bb85be6..210570ad846 100644 --- a/pkgs/development/interpreters/rakudo/default.nix +++ b/pkgs/development/interpreters/rakudo/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, perl, icu, zlib, gmp, readline }: +{ stdenv, fetchurl, perl, icu, zlib, gmp, readline +, CoreServices, ApplicationServices }: stdenv.mkDerivation rec { name = "rakudo-star-${version}"; @@ -9,7 +10,8 @@ stdenv.mkDerivation rec { sha256 = "0czx7w1chf108mpyps7k7nqq8cbsy1rbb87ajms9xj65l4ywg8ka"; }; - buildInputs = [ icu zlib gmp readline perl ]; + buildInputs = [ icu zlib gmp readline perl ] + ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ]; configureScript = "perl ./Configure.pl"; configureFlags = [ "--backends=moar" diff --git a/pkgs/development/libraries/boringssl/default.nix b/pkgs/development/libraries/boringssl/default.nix index 778c368f0f1..3a537821298 100644 --- a/pkgs/development/libraries/boringssl/default.nix +++ b/pkgs/development/libraries/boringssl/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { buildInputs = [ cmake perl go ]; enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-Wno-error=cpp"; + NIX_CFLAGS_COMPILE = "-Wno-error"; installPhase = '' mkdir -p $out/bin $out/include $out/lib diff --git a/pkgs/development/libraries/dclxvi/default.nix b/pkgs/development/libraries/dclxvi/default.nix index 6207f3d2038..f7d7eee91ed 100644 --- a/pkgs/development/libraries/dclxvi/default.nix +++ b/pkgs/development/libraries/dclxvi/default.nix @@ -12,6 +12,14 @@ stdenv.mkDerivation { buildFlags = [ "libdclxvipairing.so" ]; + patchPhase = '' + substituteInPlace Makefile \ + --replace "gcc" "cc" + '' + stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace Makefile \ + --replace "-soname=libdclxvipairing.so" "-install_name,libdclxvipairing.so" + ''; + installPhase = '' mkdir -p $out/{include,lib} find . -name \*.h -exec cp {} $out/include \; diff --git a/pkgs/development/libraries/fox/default.nix b/pkgs/development/libraries/fox/default.nix index 2d44444ab40..78c8b864529 100644 --- a/pkgs/development/libraries/fox/default.nix +++ b/pkgs/development/libraries/fox/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, xlibsWrapper, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor, libXrandr, libXft }: +{ stdenv, fetchurl, xlibsWrapper, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor, libXrandr, libXft +, CoreServices ? null }: let version = "1.7.9"; @@ -12,7 +13,8 @@ stdenv.mkDerivation rec { sha256 = "1jb9368xsin3ppdf6979n5s7in3s9klbxqbwcp0z8misjixl7nzg"; }; - buildInputs = [ libpng xlibsWrapper libjpeg libtiff zlib bzip2 libXcursor libXrandr libXft ]; + buildInputs = [ libpng xlibsWrapper libjpeg libtiff zlib bzip2 libXcursor libXrandr libXft ] + ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices ]; doCheck = true; diff --git a/pkgs/development/libraries/gegl/default.nix b/pkgs/development/libraries/gegl/default.nix index 70b731f56dd..b54b3a38e76 100644 --- a/pkgs/development/libraries/gegl/default.nix +++ b/pkgs/development/libraries/gegl/default.nix @@ -1,5 +1,6 @@ { stdenv, fetchurl, pkgconfig, glib, babl, libpng, cairo, libjpeg -, librsvg, pango, gtk, bzip2, intltool }: +, librsvg, pango, gtk, bzip2, intltool +, OpenGL ? null }: stdenv.mkDerivation rec { name = "gegl-0.2.0"; @@ -21,7 +22,8 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null; - buildInputs = [ babl libpng cairo libjpeg librsvg pango gtk bzip2 intltool ]; + buildInputs = [ babl libpng cairo libjpeg librsvg pango gtk bzip2 intltool ] + ++ stdenv.lib.optional stdenv.isDarwin OpenGL; nativeBuildInputs = [ pkgconfig ]; diff --git a/pkgs/development/libraries/glew/1.10.nix b/pkgs/development/libraries/glew/1.10.nix index 8f153baf6cd..9d5ded5be15 100644 --- a/pkgs/development/libraries/glew/1.10.nix +++ b/pkgs/development/libraries/glew/1.10.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, mesa_glu, x11, libXmu, libXi }: +{ stdenv, fetchurl, mesa_glu, x11, libXmu, libXi +, AGL ? null }: with stdenv.lib; @@ -12,6 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ x11 libXmu libXi ]; propagatedNativeBuildInputs = [ mesa_glu ]; # GL/glew.h includes GL/glu.h + buildInputs = [] ++ optionals stdenv.isDarwin [ AGL ]; patchPhase = '' sed -i 's|lib64|lib|' config/Makefile.linux diff --git a/pkgs/development/libraries/libfreefare/default.nix b/pkgs/development/libraries/libfreefare/default.nix index 8c485fef47c..291f20a5db2 100644 --- a/pkgs/development/libraries/libfreefare/default.nix +++ b/pkgs/development/libraries/libfreefare/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, pkgconfig, libnfc, openssl }: +{ stdenv, fetchurl, pkgconfig, libnfc, openssl +, libobjc ? null }: stdenv.mkDerivation rec { name = "libfreefare-${version}"; @@ -9,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "0r5wfvwgf35lb1v65wavnwz2wlfyfdims6a9xpslf4lsm4a1v8xz"; }; - buildInputs = [ pkgconfig libnfc openssl ]; + buildInputs = [ pkgconfig libnfc openssl ] ++ stdenv.lib.optional stdenv.isDarwin libobjc; meta = with stdenv.lib; { description = "The libfreefare project aims to provide a convenient API for MIFARE card manipulations"; diff --git a/pkgs/development/libraries/libomxil-bellagio/default.nix b/pkgs/development/libraries/libomxil-bellagio/default.nix index 24e46c0802b..6328494c17e 100644 --- a/pkgs/development/libraries/libomxil-bellagio/default.nix +++ b/pkgs/development/libraries/libomxil-bellagio/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { homepage = http://sourceforge.net/projects/omxil/; description = "An opensource implementation of the Khronos OpenMAX Integration Layer API to access multimedia components"; license = licenses.lgpl21; - platforms = platforms.all; + platforms = platforms.linux; maintainers = with maintainers; [ wkennington ]; }; } diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix index adc76640dde..5aedc0df2b9 100644 --- a/pkgs/development/libraries/libsecret/default.nix +++ b/pkgs/development/libraries/libsecret/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { sha256 = "1cychxc3ff8fp857iikw0n2s13s2mhw2dn1mr632f7w3sn6vvrww"; }; + NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl"; + propagatedBuildInputs = [ glib ]; nativeBuildInputs = [ pkgconfig intltool libxslt docbook_xsl ]; buildInputs = [ libgcrypt gobjectIntrospection vala_0_32 ]; diff --git a/pkgs/development/libraries/libstatgrab/default.nix b/pkgs/development/libraries/libstatgrab/default.nix index 8ffb8f8bde9..036bb806f68 100644 --- a/pkgs/development/libraries/libstatgrab/default.nix +++ b/pkgs/development/libraries/libstatgrab/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl +, IOKit ? null }: stdenv.mkDerivation rec { name = "libstatgrab-0.91"; @@ -8,6 +9,8 @@ stdenv.mkDerivation rec { sha256 = "1azinx2yzs442ycwq6p15skl3mscmqj7fd5hq7fckhjp92735s83"; }; + buildInputs = [] ++ stdenv.lib.optional stdenv.isDarwin IOKit; + meta = with stdenv.lib; { homepage = http://www.i-scream.org/libstatgrab/; description = "A library that provides cross platforms access to statistics about the running system"; diff --git a/pkgs/development/libraries/nspr/default.nix b/pkgs/development/libraries/nspr/default.nix index 23f7ffb0ce8..e8ba9c7ec54 100644 --- a/pkgs/development/libraries/nspr/default.nix +++ b/pkgs/development/libraries/nspr/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl +, CoreServices ? null }: let version = "4.12"; in @@ -27,6 +28,8 @@ stdenv.mkDerivation { moveToOutput share "$dev" # just aclocal ''; + buildInputs = [] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices ]; + enableParallelBuilding = true; meta = { diff --git a/pkgs/development/libraries/stfl/default.nix b/pkgs/development/libraries/stfl/default.nix index 4e24268314e..1430c3aa9c2 100644 --- a/pkgs/development/libraries/stfl/default.nix +++ b/pkgs/development/libraries/stfl/default.nix @@ -11,6 +11,7 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses libiconv ]; buildPhase = '' + sed -i s/gcc/cc/g Makefile sed -i s%ncursesw/ncurses.h%ncurses.h% stfl_internals.h '' + ( stdenv.lib.optionalString stdenv.isDarwin '' sed -i 's/LDLIBS += -lncursesw/LDLIBS += -lncursesw -liconv/' Makefile diff --git a/pkgs/development/tools/analysis/cccc/default.nix b/pkgs/development/tools/analysis/cccc/default.nix index c672c7964e7..ea7f6d4f590 100644 --- a/pkgs/development/tools/analysis/cccc/default.nix +++ b/pkgs/development/tools/analysis/cccc/default.nix @@ -16,6 +16,7 @@ stdenv.mkDerivation { substituteInPlace install/install.mak --replace /usr/local/bin $out/bin substituteInPlace install/install.mak --replace MKDIR=mkdir "MKDIR=mkdir -p" ''; + buildFlags = [ "CCC=c++" "LD=c++" ]; meta = { description = "C and C++ Code Counter"; diff --git a/pkgs/development/tools/misc/stm32flash/default.nix b/pkgs/development/tools/misc/stm32flash/default.nix index 6b06bf385b3..f20343156e3 100644 --- a/pkgs/development/tools/misc/stm32flash/default.nix +++ b/pkgs/development/tools/misc/stm32flash/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation { sha256 = "04k631g9lzvp9xr4sw51xpq1g542np61s1l8fpwx9rbsc8m5l0i6"; }; + buildFlags = [ "CC=cc" ]; + installPhase = '' # Manually copy, make install copies to /usr/local/bin mkdir -pv $out/bin/ diff --git a/pkgs/development/tools/misc/tie/default.nix b/pkgs/development/tools/misc/tie/default.nix index 11f2d62b76c..c73dbfce8f8 100644 --- a/pkgs/development/tools/misc/tie/default.nix +++ b/pkgs/development/tools/misc/tie/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { }; buildPhase = '' - gcc tie.c -o tie + cc tie.c -o tie ''; installPhase = '' diff --git a/pkgs/misc/sailsd/default.nix b/pkgs/misc/sailsd/default.nix index 7ae0ebbf84a..36593794ed7 100644 --- a/pkgs/misc/sailsd/default.nix +++ b/pkgs/misc/sailsd/default.nix @@ -28,6 +28,11 @@ stdenv.mkDerivation rec { chmod 755 -R $sourceRoot/libsailing ''; + patchPhase = '' + substituteInPlace Makefile \ + --replace gcc cc + ''; + meta = with stdenv.lib; { description = "Simulator daemon for autonomous sailing boats"; homepage = https://github.com/sails-simulator/sailsd; diff --git a/pkgs/servers/mqtt/mosquitto/default.nix b/pkgs/servers/mqtt/mosquitto/default.nix index 0dacaf4cfe4..be7947a03d6 100644 --- a/pkgs/servers/mqtt/mosquitto/default.nix +++ b/pkgs/servers/mqtt/mosquitto/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, openssl, libuuid }: +{ stdenv, fetchurl, openssl, libuuid, cmake }: stdenv.mkDerivation rec { pname = "mosquitto"; @@ -11,7 +11,8 @@ stdenv.mkDerivation rec { sha256 = "1imw5ps0cqda41b574k8hgz9gdr8yy58f76fg8gw14pdnvf3l7sr"; }; - buildInputs = [ openssl libuuid ]; + buildInputs = [ openssl libuuid ] + ++ stdenv.lib.optional stdenv.isDarwin cmake; makeFlags = [ "DESTDIR=$(out)" diff --git a/pkgs/tools/X11/runningx/default.nix b/pkgs/tools/X11/runningx/default.nix index a4b3f05c94c..1323da585c8 100644 --- a/pkgs/tools/X11/runningx/default.nix +++ b/pkgs/tools/X11/runningx/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { phases = [ "buildPhase" "installPhase" ]; buildPhase = '' - gcc -O2 -o RunningX $(pkg-config --cflags --libs x11) $src + cc -O2 -o RunningX $(pkg-config --cflags --libs x11) $src ''; installPhase = '' diff --git a/pkgs/tools/X11/setroot/default.nix b/pkgs/tools/X11/setroot/default.nix index 74e0ed8d029..81b888ccb78 100644 --- a/pkgs/tools/X11/setroot/default.nix +++ b/pkgs/tools/X11/setroot/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 imlib2 ] ++ stdenv.lib.optional enableXinerama libXinerama; - buildFlags = if enableXinerama then "xinerama=1" else "xinerama=0"; + buildFlags = "CC=cc " + (if enableXinerama then "xinerama=1" else "xinerama=0"); installFlags = "DESTDIR=$(out) PREFIX="; diff --git a/pkgs/tools/filesystems/genromfs/default.nix b/pkgs/tools/filesystems/genromfs/default.nix index db1968fccdc..7bf771803c6 100644 --- a/pkgs/tools/filesystems/genromfs/default.nix +++ b/pkgs/tools/filesystems/genromfs/default.nix @@ -10,7 +10,9 @@ stdenv.mkDerivation rec { }; postPatch = '' - substituteInPlace Makefile --replace "prefix = /usr" "prefix = $out" + substituteInPlace Makefile \ + --replace "prefix = /usr" "prefix = $out" \ + --replace "gcc" "cc" ''; meta = with stdenv.lib; { diff --git a/pkgs/tools/misc/dumptorrent/default.nix b/pkgs/tools/misc/dumptorrent/default.nix index 60a2ed29bbf..892287fa2d7 100644 --- a/pkgs/tools/misc/dumptorrent/default.nix +++ b/pkgs/tools/misc/dumptorrent/default.nix @@ -9,6 +9,11 @@ stdenv.mkDerivation rec { sha256 = "073h03bmpfdy15qh37lvppayld2747i4acpyk0pm5nf2raiak0zm"; }; + patchPhase = '' + substituteInPlace Makefile \ + --replace "gcc" "cc" + ''; + installPhase = '' mkdir -p $out/bin cp ./dumptorrent $out/bin diff --git a/pkgs/tools/misc/fontforge/default.nix b/pkgs/tools/misc/fontforge/default.nix index 0d6cfb19c34..c04b9255afc 100644 --- a/pkgs/tools/misc/fontforge/default.nix +++ b/pkgs/tools/misc/fontforge/default.nix @@ -3,6 +3,7 @@ , python, freetype, zlib, glib, libungif, libpng, libjpeg, libtiff, libxml2, pango , withGTK ? false, gtk2 , withPython ? true +, Carbon ? null, Cocoa ? null }: stdenv.mkDerivation rec { @@ -30,7 +31,8 @@ stdenv.mkDerivation rec { python freetype zlib glib libungif libpng libjpeg libtiff libxml2 pango ] - ++ lib.optionals withGTK [ gtk2 ]; + ++ lib.optionals withGTK [ gtk2 ] + ++ lib.optionals (withGTK && stdenv.isDarwin) [ Carbon Cocoa ]; configureFlags = lib.optionals (!withPython) [ "--disable-python-scripting" "--disable-python-extension" ] diff --git a/pkgs/tools/misc/sl/default.nix b/pkgs/tools/misc/sl/default.nix index d21143f56e2..7a5ceb20449 100644 --- a/pkgs/tools/misc/sl/default.nix +++ b/pkgs/tools/misc/sl/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses ]; + buildFlags = [ "CC=cc" ]; + installPhase = '' mkdir -p $out/bin $out/share/man/man1 cp sl $out/bin diff --git a/pkgs/tools/misc/unclutter/default.nix b/pkgs/tools/misc/unclutter/default.nix index d8731f764b3..a8468f8387f 100644 --- a/pkgs/tools/misc/unclutter/default.nix +++ b/pkgs/tools/misc/unclutter/default.nix @@ -9,6 +9,8 @@ stdenv.mkDerivation { buildInputs = [xlibsWrapper]; + buildFlags = [ "CC=cc" ]; + installPhase = '' mkdir -pv "$out/bin" mkdir -pv "$out/share/man/man1" diff --git a/pkgs/tools/networking/tlsdate/default.nix b/pkgs/tools/networking/tlsdate/default.nix index 66ead809d0b..efea10eaa4d 100644 --- a/pkgs/tools/networking/tlsdate/default.nix +++ b/pkgs/tools/networking/tlsdate/default.nix @@ -46,6 +46,6 @@ stdenv.mkDerivation rec { description = "Secure parasitic rdate replacement"; homepage = https://github.com/ioerror/tlsdate; maintainers = with maintainers; [ tv fpletz ]; - platforms = platforms.allBut [ "darwin" ]; + platforms = platforms.allBut platforms.darwin; }; } diff --git a/pkgs/tools/security/pcsclite/default.nix b/pkgs/tools/security/pcsclite/default.nix index 509a8a12092..8116d0dfe9f 100644 --- a/pkgs/tools/security/pcsclite/default.nix +++ b/pkgs/tools/security/pcsclite/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, pkgconfig, udev, dbus_libs, perl, python2 }: +{ stdenv, fetchurl, pkgconfig, udev, dbus_libs, perl, python2 +, IOKit ? null }: stdenv.mkDerivation rec { name = "pcsclite-${version}"; @@ -26,7 +27,8 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ pkgconfig perl python2 ]; - buildInputs = stdenv.lib.optionals stdenv.isLinux [ udev dbus_libs ]; + buildInputs = stdenv.lib.optionals stdenv.isLinux [ udev dbus_libs ] + ++ stdenv.lib.optionals stdenv.isDarwin [ IOKit ]; meta = with stdenv.lib; { description = "Middleware to access a smart card using SCard API (PC/SC)"; diff --git a/pkgs/tools/security/stricat/default.nix b/pkgs/tools/security/stricat/default.nix index 3dd00718af7..ecc34ede556 100644 --- a/pkgs/tools/security/stricat/default.nix +++ b/pkgs/tools/security/stricat/default.nix @@ -9,6 +9,8 @@ stdenv.mkDerivation rec { sha256 = "1axg8r4g5n5kdqj5013pgck80nni3z172xkg506vz4zx1zcmrm4r"; }; + buildFlags = [ "CC=cc" ]; + installPhase = '' mkdir -p $out/bin mv stricat $out/bin diff --git a/pkgs/tools/system/dog/default.nix b/pkgs/tools/system/dog/default.nix index d05e2986204..a48c2678aa6 100644 --- a/pkgs/tools/system/dog/default.nix +++ b/pkgs/tools/system/dog/default.nix @@ -8,6 +8,11 @@ stdenv.mkDerivation rec { sha256 = "3ef25907ec5d1dfb0df94c9388c020b593fbe162d7aaa9bd08f35d2a125af056"; }; + patchPhase = '' + substituteInPlace Makefile \ + --replace "gcc" "cc" + ''; + installPhase = '' mkdir -p $out/bin mkdir -p $out/man/man1 diff --git a/pkgs/tools/system/hardlink/default.nix b/pkgs/tools/system/hardlink/default.nix index c34d81f6353..f464b7e9320 100644 --- a/pkgs/tools/system/hardlink/default.nix +++ b/pkgs/tools/system/hardlink/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation { installPhase = '' mkdir -p $out/bin $out/share/man/man1 - gcc -O2 hardlink.c -o $out/bin/hardlink + cc -O2 hardlink.c -o $out/bin/hardlink mv hardlink.1 $out/share/man/man1/hardlink.1 ''; diff --git a/pkgs/tools/system/smartmontools/default.nix b/pkgs/tools/system/smartmontools/default.nix index 8445767e7b7..cc30cd7a488 100644 --- a/pkgs/tools/system/smartmontools/default.nix +++ b/pkgs/tools/system/smartmontools/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl +, IOKit ? null }: let version = "6.4"; @@ -18,6 +19,8 @@ stdenv.mkDerivation rec { sha256 = "11bsxcghh7adzdklcslamlynydxb708vfz892d5w7agdq405ddza"; }; + buildInputs = [] ++ stdenv.lib.optional stdenv.isDarwin IOKit; + patchPhase = '' cp ${driverdb} drivedb.h sed -i -e 's@which which >/dev/null || exit 1@alias which="type -p"@' update-smart-drivedb.in diff --git a/pkgs/tools/system/tm/default.nix b/pkgs/tools/system/tm/default.nix index a297f937100..3326f535b5f 100644 --- a/pkgs/tools/system/tm/default.nix +++ b/pkgs/tools/system/tm/default.nix @@ -6,7 +6,9 @@ stdenv.mkDerivation { installPhase=''make install "PREFIX=$out"''; - patchPhase = ''sed -i 's@/usr/bin/install@install@g' Makefile''; + patchPhase = '' + sed -i 's@/usr/bin/install@install@g ; s/gcc/cc/g' Makefile + ''; crossAttrs = { makeFlags = "CC=${stdenv.cross.config}-gcc"; diff --git a/pkgs/tools/system/yeshup/default.nix b/pkgs/tools/system/yeshup/default.nix index 806d6cc5b94..8cea90b6758 100644 --- a/pkgs/tools/system/yeshup/default.nix +++ b/pkgs/tools/system/yeshup/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { homepage = https://github.com/RhysU/yeshup; - platforms = platforms.all; + platforms = platforms.linux; license = licenses.cc-by-sa-30; # From Stackoverflow answer maintainers = with maintainers; [ obadz ]; }; diff --git a/pkgs/tools/text/odt2txt/default.nix b/pkgs/tools/text/odt2txt/default.nix index b7134bf8e47..85f0f24b387 100644 --- a/pkgs/tools/text/odt2txt/default.nix +++ b/pkgs/tools/text/odt2txt/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, zlib }: +{ stdenv, fetchurl, zlib, libiconv }: stdenv.mkDerivation rec { name = "odt2txt-0.4"; @@ -10,7 +10,9 @@ stdenv.mkDerivation rec { configurePhase="export makeFlags=\"DESTDIR=$out\""; - buildInputs = [ zlib ]; + buildInputs = [ zlib libiconv ]; + + NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-liconv"; meta = { description = "Simple .odt to .txt converter"; diff --git a/pkgs/tools/text/unrtf/default.nix b/pkgs/tools/text/unrtf/default.nix index b1d8525c4da..34eea38eb73 100644 --- a/pkgs/tools/text/unrtf/default.nix +++ b/pkgs/tools/text/unrtf/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, autoconf, automake }: +{ stdenv, fetchurl, autoconf, automake, libiconv }: stdenv.mkDerivation rec { name = "unrtf-${version}"; @@ -11,6 +11,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoconf automake ]; + buildInputs = [ ] ++ stdenv.lib.optional stdenv.isDarwin libiconv; + NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-liconv"; + preConfigure = "./bootstrap"; outputs = [ "out" "man" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8c68b35a56f..845ee5fb406 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1607,6 +1607,7 @@ in fontforge = lowPrio (callPackage ../tools/misc/fontforge { }); fontforge-gtk = callPackage ../tools/misc/fontforge { withGTK = true; + inherit (darwin.apple_sdk.frameworks) Carbon Cocoa; }; fontmatrix = callPackage ../applications/graphics/fontmatrix {}; @@ -1619,6 +1620,7 @@ in fox = callPackage ../development/libraries/fox/default.nix { libpng = libpng12; + inherit (darwin.apple_sdk.frameworks) CoreServices; }; fox_1_6 = callPackage ../development/libraries/fox/fox-1.6.nix { }; @@ -3022,7 +3024,9 @@ in pciutils = callPackage ../tools/system/pciutils { }; - pcsclite = callPackage ../tools/security/pcsclite { }; + pcsclite = callPackage ../tools/security/pcsclite { + inherit (darwin.apple_sdk.frameworks) IOKit; + }; pcsctools = callPackage ../tools/security/pcsctools { inherit (perlPackages) pcscperl Glib Gtk2 Pango; @@ -3497,7 +3501,9 @@ in slsnif = callPackage ../tools/misc/slsnif { }; - smartmontools = callPackage ../tools/system/smartmontools { }; + smartmontools = callPackage ../tools/system/smartmontools { + inherit (darwin.apple_sdk.frameworks) IOKit; + }; smbldaptools = callPackage ../tools/networking/smbldaptools { inherit (perlPackages) NetLDAP CryptSmbHash DigestSHA1; @@ -5676,7 +5682,9 @@ in clooj = callPackage ../development/interpreters/clojure/clooj.nix { }; - erlangR16 = callPackage ../development/interpreters/erlang/R16.nix { }; + erlangR16 = callPackage ../development/interpreters/erlang/R16.nix { + inherit (darwin.apple_sdk.frameworks) Carbon Cocoa; + }; erlangR16_odbc = callPackage ../development/interpreters/erlang/R16.nix { odbcSupport = true; }; erlangR17 = callPackage ../development/interpreters/erlang/R17.nix { inherit (darwin.apple_sdk.frameworks) Carbon Cocoa; @@ -5962,7 +5970,9 @@ in racket = callPackage ../development/interpreters/racket { }; - rakudo = callPackage ../development/interpreters/rakudo { }; + rakudo = callPackage ../development/interpreters/rakudo { + inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; + }; rascal = callPackage ../development/interpreters/rascal { }; @@ -7317,7 +7327,9 @@ in gephi = callPackage ../applications/science/misc/gephi { }; - gegl = callPackage ../development/libraries/gegl { }; + gegl = callPackage ../development/libraries/gegl { + inherit (darwin.apple_sdk.frameworks) OpenGL; + }; gegl_0_3 = callPackage ../development/libraries/gegl/3.0.nix { }; @@ -7370,7 +7382,9 @@ in gle = callPackage ../development/libraries/gle { }; glew = callPackage ../development/libraries/glew { }; - glew110 = callPackage ../development/libraries/glew/1.10.nix { }; + glew110 = callPackage ../development/libraries/glew/1.10.nix { + inherit (darwin.apple_sdk.frameworks) AGL; + }; glfw = self.glfw3; glfw2 = callPackage ../development/libraries/glfw/2.x.nix { }; @@ -8117,7 +8131,9 @@ in libffi = callPackage ../development/libraries/libffi { }; - libfreefare = callPackage ../development/libraries/libfreefare { }; + libfreefare = callPackage ../development/libraries/libfreefare { + inherit (darwin) libobjc; + }; libftdi = callPackage ../development/libraries/libftdi { }; @@ -8501,7 +8517,9 @@ in libspatialite = callPackage ../development/libraries/libspatialite { }; - libstatgrab = callPackage ../development/libraries/libstatgrab { }; + libstatgrab = callPackage ../development/libraries/libstatgrab { + inherit (darwin.apple_sdk.frameworks) IOKit; + }; libsvm = callPackage ../development/libraries/libsvm { }; @@ -8877,7 +8895,9 @@ in non = callPackage ../applications/audio/non { }; - nspr = callPackage ../development/libraries/nspr { }; + nspr = callPackage ../development/libraries/nspr { + inherit (darwin.apple_sdk.frameworks) CoreServices; + }; nss = lowPrio (callPackage ../development/libraries/nss { }); nssTools = nss.tools; @@ -12496,7 +12516,9 @@ in cbc = callPackage ../applications/science/math/cbc { }; - cddiscid = callPackage ../applications/audio/cd-discid { }; + cddiscid = callPackage ../applications/audio/cd-discid { + inherit (darwin) IOKit; + }; cdparanoia = self.cdparanoiaIII; @@ -13329,7 +13351,9 @@ in svox = callPackage ../applications/audio/svox { }; - gkrellm = callPackage ../applications/misc/gkrellm { }; + gkrellm = callPackage ../applications/misc/gkrellm { + inherit (darwin) IOKit; + }; gmu = callPackage ../applications/audio/gmu { };