From 94362af1e8f310a0b118d8c9c3be6263d3a9cf44 Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 14 May 2015 15:12:04 -0400 Subject: [PATCH 1/9] libev: Fix compilation with clang --- pkgs/development/libraries/libev/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/libev/default.nix b/pkgs/development/libraries/libev/default.nix index 90cab2cc687..ce7d7b9e275 100644 --- a/pkgs/development/libraries/libev/default.nix +++ b/pkgs/development/libraries/libev/default.nix @@ -7,6 +7,11 @@ stdenv.mkDerivation rec { url = "http://dist.schmorp.de/libev/${name}.tar.gz"; sha256 = "1jyw7qbl0spxqa0dccj9x1jsw7cj7szff43cq4acmklnra4mzz48"; }; + + # Version 4.19 is not valid C11 (which Clang default to) + # Check if this is still necessary on upgrade + NIX_CFLAGS_COMPILE = if stdenv.cc.isClang then "-std=c99" else null; + meta = { description = "A high-performance event loop/event model with lots of features"; maintainers = [ stdenv.lib.maintainers.raskin ]; From a634c110756b7ed97ea16ada8a9c70517cca8a95 Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 14 May 2015 15:14:32 -0400 Subject: [PATCH 2/9] ruby_1_8_7: Fix on Darwin --- pkgs/development/interpreters/ruby/ruby-1.8.7.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/interpreters/ruby/ruby-1.8.7.nix b/pkgs/development/interpreters/ruby/ruby-1.8.7.nix index 3c2ea71ecf2..0ae1d1261ee 100644 --- a/pkgs/development/interpreters/ruby/ruby-1.8.7.nix +++ b/pkgs/development/interpreters/ruby/ruby-1.8.7.nix @@ -60,6 +60,9 @@ stdenv.mkDerivation rec { ]; configureFlags = [ "--enable-shared" "--enable-pthread" ] + # Without this fails due to not finding X11/Xlib.h + # Not sure why this isn't required on Linux + ++ ops stdenv.isDarwin [ "--without-tcl" "--without-tk" ] ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby"; installFlags = stdenv.lib.optionalString docSupport "install-doc"; From 7745dc5dcf47a67b07b649072e99a73840cd3b8c Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 14 May 2015 16:35:35 -0400 Subject: [PATCH 3/9] nghttp2: fix configure script to correctly find jemalloc --- pkgs/development/libraries/nghttp2/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/nghttp2/default.nix b/pkgs/development/libraries/nghttp2/default.nix index e442cc96d2f..bc8c599a901 100644 --- a/pkgs/development/libraries/nghttp2/default.nix +++ b/pkgs/development/libraries/nghttp2/default.nix @@ -42,6 +42,12 @@ stdenv.mkDerivation rec { sha256 = "000d50yzyysbr9ldhvnbpzn35vplqm08dnmh55wc5zk273gy383f"; }; + # Configure script searches for a symbol which does not exist in jemalloc on Darwin + # Reported upstream in https://github.com/tatsuhiro-t/nghttp2/issues/233 + postPatch = if (stdenv.isDarwin && optJemalloc != null) then '' + substituteInPlace configure --replace "malloc_stats_print" "je_malloc_stats_print" + '' else null; + nativeBuildInputs = [ pkgconfig ]; buildInputs = [ optJansson optBoost optLibxml2 optJemalloc ] ++ stdenv.lib.optionals hasApp [ optOpenssl optLibev optZlib ]; From 3f6b56812cd5b301769c764ac79173884bdafefc Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 14 May 2015 17:49:02 -0400 Subject: [PATCH 4/9] bwm_ng: clang fix --- pkgs/tools/networking/bwm-ng/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/bwm-ng/default.nix b/pkgs/tools/networking/bwm-ng/default.nix index 62dea1e6cd4..6fa0c20b0ac 100644 --- a/pkgs/tools/networking/bwm-ng/default.nix +++ b/pkgs/tools/networking/bwm-ng/default.nix @@ -7,9 +7,12 @@ stdenv.mkDerivation rec { url = "http://www.gropp.org/bwm-ng/${name}.tar.gz"; sha256 = "1pgzc8y2y73n72qvbd2g0dkbkw5h0f83k5h9id1rsck8w9c464y1"; }; - + buildInputs = [ ncurses ]; + # This code uses inline in the gnu89 sense: see http://clang.llvm.org/compatibility.html#inline + NIX_CFLAGS_COMPILE = if stdenv.cc.isClang then "-std=gnu89" else null; + meta = with stdenv.lib; { description = "A small and simple console-based live network and disk io bandwidth monitor"; homepage = "http://www.gropp.org/?id=projects&sub=bwm-ng"; From 4c76dda4dd6d9e85504d24bde076c24ed678a2a0 Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 14 May 2015 18:03:45 -0400 Subject: [PATCH 5/9] curl 7.15: Disable on Darwin Build is failing and this version of curl is not used for anything useful on Darwin, so it's not worth fixing. --- pkgs/tools/networking/curl/7.15.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/networking/curl/7.15.nix b/pkgs/tools/networking/curl/7.15.nix index 2b13437d95c..4e533878ec1 100644 --- a/pkgs/tools/networking/curl/7.15.nix +++ b/pkgs/tools/networking/curl/7.15.nix @@ -75,6 +75,6 @@ stdenv.mkDerivation rec { meta = { homepage = "http://curl.haxx.se/"; description = "A command line tool for transferring files with URL syntax"; - platforms = stdenv.lib.platforms.all; + platforms = with stdenv.lib.platforms; allBut darwin; }; } From e17dfe13e894b774b487b2794c076901b2c81eb2 Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 14 May 2015 18:08:43 -0400 Subject: [PATCH 6/9] bandwidth: clang fix --- pkgs/tools/misc/bandwidth/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/bandwidth/default.nix b/pkgs/tools/misc/bandwidth/default.nix index 35b13448b59..ff5e47336d3 100644 --- a/pkgs/tools/misc/bandwidth/default.nix +++ b/pkgs/tools/misc/bandwidth/default.nix @@ -19,7 +19,8 @@ stdenv.mkDerivation rec { buildInputs = [ nasm ]; - buildFlags = [ arch ]; + buildFlags = [ arch ] + ++ stdenv.lib.optionals stdenv.cc.isClang [ "CC=clang" "LD=clang" ]; installPhase = '' mkdir -p $out/bin From 2f6e9000e88ae8a99c1e8dc30771e0ce10290ec1 Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 14 May 2015 18:43:46 -0400 Subject: [PATCH 7/9] ent: clang fix --- pkgs/tools/misc/ent/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/misc/ent/default.nix b/pkgs/tools/misc/ent/default.nix index d6ad7f1d26b..71b4ec338df 100644 --- a/pkgs/tools/misc/ent/default.nix +++ b/pkgs/tools/misc/ent/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { buildInputs = [ unzip ]; + buildFlags = if stdenv.cc.isClang then [ "CC=clang" ] else null; + installPhase = '' mkdir -p $out/bin cp ent $out/bin/ From 7145859662a73632b075177e4322a6c9fe391c0f Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 14 May 2015 18:55:04 -0400 Subject: [PATCH 8/9] botan: clang fix --- pkgs/development/libraries/botan/generic.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/botan/generic.nix b/pkgs/development/libraries/botan/generic.nix index c843a00b836..5880ae772ce 100644 --- a/pkgs/development/libraries/botan/generic.nix +++ b/pkgs/development/libraries/botan/generic.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { buildInputs = [ python bzip2 zlib gmp openssl boost ]; configurePhase = '' - python configure.py --prefix=$out --with-bzip2 --with-zlib ${if openssl != null then "--with-openssl" else ""} ${extraConfigureFlags} + python configure.py --prefix=$out --with-bzip2 --with-zlib ${if openssl != null then "--with-openssl" else ""} ${extraConfigureFlags}${if stdenv.cc.isClang then " --cc=clang" else "" } ''; enableParallelBuilding = true; From 5d82c6712910fedc07574bbaa61d69cf52779b38 Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 14 May 2015 20:54:06 -0400 Subject: [PATCH 9/9] libdvbpsi: enable on Darwin --- pkgs/development/libraries/libdvbpsi/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libdvbpsi/default.nix b/pkgs/development/libraries/libdvbpsi/default.nix index 6af8e7a415e..f8b9e9ecef9 100644 --- a/pkgs/development/libraries/libdvbpsi/default.nix +++ b/pkgs/development/libraries/libdvbpsi/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { meta = { description = "A simple library designed for decoding and generation of MPEG TS and DVB PSI tables according to standards ISO/IEC 13818 and ITU-T H.222.0"; homepage = http://www.videolan.org/developers/libdvbpsi.html ; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; license = stdenv.lib.licenses.lgpl21; };