lol

Merge branch 'darwin-stdenv' of github.com:joelteon/nixpkgs into staging

Conflicts:
pkgs/development/interpreters/ruby/ruby-19.nix
pkgs/development/libraries/libc++/default.nix
pkgs/development/libraries/libc++abi/default.nix
pkgs/tools/text/sgml/opensp/default.nix

+640 -117
+3 -3
pkgs/applications/editors/vim/default.nix
··· 3 3 stdenv.mkDerivation rec { 4 4 name = "vim-${version}"; 5 5 6 - version = "7.4.335"; 6 + version = "7.4.410"; 7 7 8 8 src = fetchhg { 9 9 url = "https://vim.googlecode.com/hg/"; 10 - rev = "v7-4-335"; 11 - sha256 = "0qnpzfcbi6fhz82pj68l4vrnigca1akq2ksrxz6krwlfhns6jhhj"; 10 + rev = "v7-4-410"; 11 + sha256 = "145llhj6gq2bh9b7p8xkxc388krrximq80b87f3cn4w4d4k9fhqp"; 12 12 }; 13 13 14 14 enableParallelBuilding = true;
+2 -3
pkgs/applications/editors/vim/macvim.nix
··· 1 - { stdenv, stdenvAdapters, gccApple, fetchFromGitHub, ncurses, gettext, 1 + { stdenv, stdenvAdapters, fetchFromGitHub, ncurses, gettext, 2 2 pkgconfig, cscope, python, ruby, tcl, perl, luajit 3 3 }: 4 4 5 - let inherit (stdenvAdapters.overrideGCC stdenv gccApple) mkDerivation; 6 - in mkDerivation rec { 5 + stdenv.mkDerivation rec { 7 6 name = "macvim-${version}"; 8 7 9 8 version = "7.4.355";
+7 -8
pkgs/applications/version-management/subversion/default.nix
··· 15 15 assert pythonBindings -> swig != null && python != null; 16 16 assert javahlBindings -> jdk != null && perl != null; 17 17 18 - stdenv.mkDerivation rec { 18 + stdenv.mkDerivation (rec { 19 19 20 20 version = "1.8.10"; 21 21 ··· 46 46 47 47 preBuild = '' 48 48 makeFlagsArray=(APACHE_LIBEXECDIR=$out/modules) 49 - '' + stdenv.lib.optionalString stdenv.isDarwin '' 50 - substituteInPlace configure --replace "-no-cpp-precomp" "" 51 49 ''; 52 50 53 51 postInstall = '' ··· 72 70 inherit perlBindings pythonBindings; 73 71 74 72 enableParallelBuilding = true; 75 - 76 - # Hack to build on Mac OS X. The system header files use C99-style 77 - # comments, but Subversion passes -std=c90. 78 - NIX_CFLAGS_COMPILE = "-std=c99"; 79 73 80 74 meta = { 81 75 description = "A version control system intended to be a compelling replacement for CVS in the open source community"; ··· 83 77 maintainers = with stdenv.lib.maintainers; [ eelco lovek323 ]; 84 78 hydraPlatforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; 85 79 }; 86 - } 80 + } // stdenv.lib.optionalAttrs stdenv.isDarwin { 81 + CXX = "clang++"; 82 + CC = "clang"; 83 + CPP = "clang -E"; 84 + CXXCPP = "clang++ -E"; 85 + })
+5
pkgs/build-support/cabal/default.nix
··· 214 214 configureFlags+=" --ghc-option=-j$NIX_BUILD_CORES" 215 215 ''} 216 216 217 + ${optionalString self.stdenv.isDarwin '' 218 + configureFlags+=" --with-gcc=clang" 219 + ''} 220 + 217 221 echo "configure flags: $extraConfigureFlags $configureFlags" 218 222 ./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \ 219 223 --libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \ ··· 236 240 237 241 export GHC_PACKAGE_PATH=$(${ghc.GHCPackages}) 238 242 test -n "$noHaddock" || ./Setup haddock --html --hoogle \ 243 + --ghc-options=-optP-P \ 239 244 ${optionalString self.hyperlinkSource "--hyperlink-source"} 240 245 241 246 eval "$postBuild"
+28 -12
pkgs/build-support/clang-wrapper/builder.sh
··· 28 28 fi 29 29 30 30 if test -n "$nativeTools"; then 31 - clangPath="$nativePrefix/bin" 31 + if [ -n "$isDarwin" ]; then 32 + clangPath="$clang/bin" 33 + else 34 + clangPath="$nativePrefix/bin" 35 + fi 32 36 ldPath="$nativePrefix/bin" 33 37 else 34 - basePath=`echo $gcc/lib/*/*/*` 35 - # Need libgcc until the llvm compiler-rt library is complete 36 - clangLDFlags="$clangLDFlags -L$basePath" 37 - if test -e "$gcc/lib64"; then 38 - clangLDFlags="$clangLDFlags -L$gcc/lib64" 39 - else 40 - clangLDFlags="$clangLDFlags -L$gcc/lib" 38 + clangLDFlags="" 39 + if test -d "$gcc/lib"; then 40 + basePath=`echo $gcc/lib/*/*/*` 41 + # Need libgcc until the llvm compiler-rt library is complete 42 + clangLDFlags="$clangLDFlags -L$basePath" 43 + if test -e "$gcc/lib64"; then 44 + clangLDFlags="$clangLDFlags -L$gcc/lib64" 45 + else 46 + clangLDFlags="$clangLDFlags -L$gcc/lib" 47 + fi 41 48 fi 42 49 43 - clangLDFlags="$clangLDFlags -L$clang/lib" 44 - echo "$clangLDFlags" > $out/nix-support/clang-ldflags 50 + if test -d "$clang/lib"; then 51 + clangLDFlags="$clangLDFlags -L$clang/lib" 52 + fi 53 + 54 + if [ -n "$clangLDFlags" ]; then 55 + echo "$clangLDFlags" > $out/nix-support/clang-ldflags 56 + fi 45 57 46 58 # Need files like crtbegin.o from gcc 47 59 # It's unclear if these will ever be provided by an LLVM project ··· 49 61 50 62 clangCFlags="$clangCFlags -isystem$clang/lib/clang/$clangVersion/include" 51 63 echo "$clangCFlags" > $out/nix-support/clang-cflags 52 - 53 - clangPath="$clang/bin" 64 + 54 65 ldPath="$binutils/bin" 66 + clangPath="$clang/bin" 55 67 fi 56 68 57 69 ··· 125 137 doSubstitute "$addFlags" "$out/nix-support/add-flags.sh" 126 138 127 139 doSubstitute "$setupHook" "$out/nix-support/setup-hook" 140 + cat >> "$out/nix-support/setup-hook" << EOF 141 + export CC=clang 142 + export CXX=clang++ 143 + EOF 128 144 129 145 cp -p $utils $out/nix-support/utils.sh 130 146
+2
pkgs/build-support/clang-wrapper/default.nix
··· 26 26 (if name != "" then name else clangName + "-wrapper") + 27 27 (if clang != null && clangVersion != "" then "-" + clangVersion else ""); 28 28 29 + isDarwin = stdenv.isDarwin; 30 + 29 31 builder = ./builder.sh; 30 32 setupHook = ./setup-hook.sh; 31 33 clangWrapper = ./clang-wrapper.sh;
+1
pkgs/development/compilers/gcc/4.2-apple64/default.nix
··· 4 4 , gmp ? null, mpfr ? null, bison ? null, flex ? null 5 5 }: 6 6 7 + assert false; 7 8 assert stdenv.isDarwin; 8 9 assert langF77 -> gmp != null; 9 10
+2 -1
pkgs/development/compilers/ghc/7.4.2-binary.nix
··· 62 62 '' else ""); 63 63 64 64 configurePhase = '' 65 - ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include 65 + ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include \ 66 + --with-clang 66 67 ''; 67 68 68 69 # Stripping combined with patchelf breaks the executables (they die
+93
pkgs/development/compilers/ghc/7.8.3-binary.nix
··· 1 + {stdenv, fetchurl, perl, ncurses, gmp}: 2 + 3 + stdenv.mkDerivation rec { 4 + version = "7.8.3"; 5 + 6 + name = "ghc-${version}-binary"; 7 + 8 + src = 9 + if stdenv.system == "i686-linux" then 10 + fetchurl { 11 + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; 12 + sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi"; 13 + } 14 + else if stdenv.system == "x86_64-linux" then 15 + fetchurl { 16 + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; 17 + sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns"; 18 + } 19 + else if stdenv.system == "i686-darwin" then 20 + fetchurl { 21 + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2"; 22 + sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0"; 23 + } 24 + else if stdenv.system == "x86_64-darwin" then 25 + fetchurl { 26 + url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2"; 27 + sha256 = "1ja0cq5xyjcvjpvjmm4nzhkpmwfs2kjlldbc48lxcs9rmqi7rnay"; 28 + } 29 + else throw "cannot bootstrap GHC on this platform"; 30 + 31 + buildInputs = [perl]; 32 + 33 + postUnpack = 34 + # Strip is harmful, see also below. It's important that this happens 35 + # first. The GHC Cabal build system makes use of strip by default and 36 + # has hardcoded paths to /usr/bin/strip in many places. We replace 37 + # those below, making them point to our dummy script. 38 + '' 39 + mkdir "$TMP/bin" 40 + for i in strip; do 41 + echo '#! ${stdenv.shell}' > "$TMP/bin/$i" 42 + chmod +x "$TMP/bin/$i" 43 + done 44 + PATH="$TMP/bin:$PATH" 45 + '' + 46 + # We have to patch the GMP paths for the integer-gmp package. 47 + '' 48 + find . -name integer-gmp.buildinfo \ 49 + -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp}/lib@" {} \; 50 + '' + 51 + # On Linux, use patchelf to modify the executables so that they can 52 + # find editline/gmp. 53 + (if stdenv.isLinux then '' 54 + find . -type f -perm +100 \ 55 + -exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ 56 + --set-rpath "${ncurses}/lib:${gmp}/lib" {} \; 57 + sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2 58 + sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2 59 + for prog in ld ar gcc strip ranlib; do 60 + find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \; 61 + done 62 + '' else ""); 63 + 64 + configurePhase = '' 65 + ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib \ 66 + --with-gmp-includes=${gmp}/include 67 + ''; 68 + 69 + # Stripping combined with patchelf breaks the executables (they die 70 + # with a segfault or the kernel even refuses the execve). (NIXPKGS-85) 71 + dontStrip = true; 72 + 73 + # No building is necessary, but calling make without flags ironically 74 + # calls install-strip ... 75 + buildPhase = "true"; 76 + 77 + postInstall = 78 + '' 79 + # Sanity check, can ghc create executables? 80 + cd $TMP 81 + mkdir test-ghc; cd test-ghc 82 + cat > main.hs << EOF 83 + module Main where 84 + main = putStrLn "yes" 85 + EOF 86 + $out/bin/ghc --make main.hs 87 + echo compilation ok 88 + [ $(./main) == "yes" ] 89 + ''; 90 + 91 + meta.license = stdenv.lib.licenses.bsd3; 92 + meta.platforms = ["x86_64-linux" "i686-linux" "i686-darwin" "x86_64-darwin"]; 93 + }
-2
pkgs/development/compilers/ghc/7.8.3.nix
··· 26 26 export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 27 27 ''; 28 28 29 - configureFlags = "--with-gcc=${stdenv.gcc}/bin/gcc"; 30 - 31 29 # required, because otherwise all symbols from HSffi.o are stripped, and 32 30 # that in turn causes GHCi to abort 33 31 stripDebugFlags = [ "-S" "--keep-file-symbols" ];
+4
pkgs/development/compilers/llvm/3.4/clang.nix
··· 1 1 { stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src }: 2 2 3 + # be sure not to rebuild clang on darwin; some packages request it specifically 4 + # we need to fix those 5 + assert stdenv.isDarwin -> stdenv.gcc.nativeTools; 6 + 3 7 stdenv.mkDerivation { 4 8 name = "clang-${version}"; 5 9
-1
pkgs/development/compilers/llvm/3.4/llvm.nix
··· 65 65 license = stdenv.lib.licenses.bsd3; 66 66 maintainers = with stdenv.lib.maintainers; [ shlevy lovek323 raskin viric ]; 67 67 platforms = stdenv.lib.platforms.all; 68 - broken = stdenv.isDarwin; 69 68 }; 70 69 }
+2
pkgs/development/compilers/ocaml/4.01.0.nix
··· 26 26 sha256 = "b1ca708994180236917ae79e17606da5bd334ca6acd6873a550027e1c0ec874a"; 27 27 }; 28 28 29 + patches = [ ./fix-clang-build-on-osx.diff ]; 30 + 29 31 prefixKey = "-prefix "; 30 32 configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" x11lib 31 33 "-x11include" x11inc ];
+20
pkgs/development/compilers/ocaml/fix-clang-build-on-osx.diff
··· 1 + diff --git a/configure b/configure 2 + index d45e88f..25d872b 100755 3 + --- a/configure 4 + +++ b/configure 5 + @@ -322,7 +322,14 @@ case "$bytecc,$target" in 6 + bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC" 7 + mathlib="";; 8 + *,*-*-darwin*) 9 + - bytecccompopts="-fno-defer-pop $gcc_warnings" 10 + + # On recent version of OSX, gcc is a symlink to clang 11 + + if $bytecc --version | grep -q clang; then 12 + + # -fno-defer-pop is not supported by clang, and make recent 13 + + # versions of clang to fail 14 + + bytecccompopts="$gcc_warnings" 15 + + else 16 + + bytecccompopts="-fno-defer-pop $gcc_warnings" 17 + + fi 18 + mathlib="" 19 + mkexe="$mkexe -Wl,-no_compact_unwind" 20 + # Tell gcc that we can use 32-bit code addresses for threaded code
+14
pkgs/development/interpreters/guile/clang.patch
··· 1 + diff --git a/lib/stdint.in.h b/lib/stdint.in.h 2 + index 889bca7..15d39b0 100644 3 + --- a/lib/stdint.in.h 4 + +++ b/lib/stdint.in.h 5 + @@ -74,7 +74,8 @@ 6 + in <inttypes.h> would reinclude us, skipping our contents because 7 + _@GUARD_PREFIX@_STDINT_H is defined. 8 + The include_next requires a split double-inclusion guard. */ 9 + -# @INCLUDE_NEXT@ @NEXT_STDINT_H@ 10 + +# include <inttypes.h> 11 + +// # @INCLUDE_NEXT@ @NEXT_STDINT_H@ 12 + #endif 13 + 14 + #if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+3 -3
pkgs/development/interpreters/guile/default.nix
··· 7 7 else stdenv.mkDerivation) 8 8 9 9 (rec { 10 - name = "guile-2.0.9"; 10 + name = "guile-2.0.11"; 11 11 12 12 src = fetchurl { 13 13 url = "mirror://gnu/guile/${name}.tar.xz"; 14 - sha256 = "0nw9y8vjyz4r61v06p9msks5lm58pd91irmzg4k487vmv743h2pp"; 14 + sha256 = "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"; 15 15 }; 16 16 17 17 nativeBuildInputs = [ makeWrapper gawk pkgconfig ]; ··· 29 29 30 30 enableParallelBuilding = true; 31 31 32 - patches = [ ./disable-gc-sensitive-tests.patch ./eai_system.patch ] ++ 32 + patches = [ ./disable-gc-sensitive-tests.patch ./eai_system.patch ./clang.patch ] ++ 33 33 (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch); 34 34 35 35 # Explicitly link against libgcc_s, to work around the infamous
+1 -1
pkgs/development/interpreters/lua-5/5.1.nix
··· 29 29 configurePhase = 30 30 if stdenv.isDarwin 31 31 then '' 32 - makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDFLAGS="" ) 32 + makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDFLAGS="" CC="$CC" ) 33 33 installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.5.1.5.dylib" INSTALL_DATA='cp -d' ) 34 34 '' else '' 35 35 makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC" LDFLAGS="-fPIC" )
-1
pkgs/development/interpreters/perl/5.16/default.nix
··· 31 31 # Miniperl needs -lm. perl needs -lrt. 32 32 configureFlags = 33 33 [ "-de" 34 - "-Dcc=gcc" 35 34 "-Uinstallusrbinperl" 36 35 "-Dinstallstyle=lib/perl5" 37 36 "-Duseshrplib"
+2
pkgs/development/interpreters/ruby/ruby-1.9.3.nix
··· 80 80 81 81 installFlags = stdenv.lib.optionalString docSupport "install-doc"; 82 82 83 + CFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.7"; 84 + 83 85 postInstall = '' 84 86 # Bundler tries to create this directory 85 87 mkdir -pv $out/${passthru.gemPath}
+18
pkgs/development/libraries/aspell/clang.patch
··· 1 + --- interfaces/cc/aspell.h 2013-10-13 20:29:33.000000000 +0200 2 + +++ interfaces/cc/aspell.h 2013-10-13 20:30:01.000000000 +0200 3 + @@ -237,6 +237,7 @@ 4 + /******************************** errors ********************************/ 5 + 6 + 7 + +#ifndef __cplusplus 8 + extern const struct AspellErrorInfo * const aerror_other; 9 + extern const struct AspellErrorInfo * const aerror_operation_not_supported; 10 + extern const struct AspellErrorInfo * const aerror_cant_copy; 11 + @@ -322,6 +323,7 @@ 12 + extern const struct AspellErrorInfo * const aerror_bad_magic; 13 + extern const struct AspellErrorInfo * const aerror_expression; 14 + extern const struct AspellErrorInfo * const aerror_invalid_expression; 15 + +#endif 16 + 17 + 18 + /******************************* speller *******************************/
+4
pkgs/development/libraries/aspell/default.nix
··· 8 8 sha256 = "1qgn5psfyhbrnap275xjfrzppf5a83fb67gpql0kfqv37al869gm"; 9 9 }; 10 10 11 + patchPhase = '' 12 + patch interfaces/cc/aspell.h < ${./clang.patch} 13 + ''; 14 + 11 15 buildInputs = [ perl ]; 12 16 13 17 doCheck = true;
+4 -2
pkgs/development/libraries/boost/1.55.nix
··· 1 1 { stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames 2 - , toolset ? null 2 + , toolset ? if stdenv.isDarwin then "clang" else null 3 3 , enableRelease ? true 4 4 , enableDebug ? false 5 5 , enableSingleThreaded ? false ··· 57 57 sha256 = "0lkv5dzssbl5fmh2nkaszi8x9qbj80pr4acf9i26sj3rvlih1w7z"; 58 58 }; 59 59 60 + patches = stdenv.lib.optional (toolset == "clang") [ ./boost-155-clang.patch ]; 61 + 60 62 enableParallelBuilding = true; 61 63 62 64 buildInputs = ··· 66 68 configureScript = "./bootstrap.sh"; 67 69 configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python" + withToolset; 68 70 69 - buildPhase = "${stdenv.lib.optionalString (toolset == "clang") "unset NIX_ENFORCE_PURITY; "}./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install${withToolset}"; 71 + buildPhase = "${stdenv.lib.optionalString (toolset == "clang") "unset NIX_ENFORCE_PURITY; "}./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install"; 70 72 71 73 # normal install does not install bjam, this is a separate step 72 74 installPhase = ''
+90
pkgs/development/libraries/boost/boost-155-clang.patch
··· 1 + diff --git a/boost/atomic/detail/cas128strong.hpp b/boost/atomic/detail/cas128strong.hpp 2 + index 906c13e..dcb4d7d 100644 3 + --- a/boost/atomic/detail/cas128strong.hpp 4 + +++ b/boost/atomic/detail/cas128strong.hpp 5 + @@ -196,15 +196,17 @@ class base_atomic<T, void, 16, Sign> 6 + 7 + public: 8 + BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) 9 + - explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) 10 + + explicit base_atomic(value_type const& v) BOOST_NOEXCEPT 11 + { 12 + + memset(&v_, 0, sizeof(v_)); 13 + memcpy(&v_, &v, sizeof(value_type)); 14 + } 15 + 16 + void 17 + store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT 18 + { 19 + - storage_type value_s = 0; 20 + + storage_type value_s; 21 + + memset(&value_s, 0, sizeof(value_s)); 22 + memcpy(&value_s, &value, sizeof(value_type)); 23 + platform_fence_before_store(order); 24 + platform_store128(value_s, &v_); 25 + @@ -247,7 +249,9 @@ class base_atomic<T, void, 16, Sign> 26 + memory_order success_order, 27 + memory_order failure_order) volatile BOOST_NOEXCEPT 28 + { 29 + - storage_type expected_s = 0, desired_s = 0; 30 + + storage_type expected_s, desired_s; 31 + + memset(&expected_s, 0, sizeof(expected_s)); 32 + + memset(&desired_s, 0, sizeof(desired_s)); 33 + memcpy(&expected_s, &expected, sizeof(value_type)); 34 + memcpy(&desired_s, &desired, sizeof(value_type)); 35 + 36 + diff --git a/boost/atomic/detail/gcc-atomic.hpp b/boost/atomic/detail/gcc-atomic.hpp 37 + index a130590..4af99a1 100644 38 + --- a/boost/atomic/detail/gcc-atomic.hpp 39 + +++ b/boost/atomic/detail/gcc-atomic.hpp 40 + @@ -958,14 +958,16 @@ class base_atomic<T, void, 16, Sign> 41 + 42 + public: 43 + BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) 44 + - explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) 45 + + explicit base_atomic(value_type const& v) BOOST_NOEXCEPT 46 + { 47 + + memset(&v_, 0, sizeof(v_)); 48 + memcpy(&v_, &v, sizeof(value_type)); 49 + } 50 + 51 + void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT 52 + { 53 + - storage_type tmp = 0; 54 + + storage_type tmp; 55 + + memset(&tmp, 0, sizeof(tmp)); 56 + memcpy(&tmp, &v, sizeof(value_type)); 57 + __atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); 58 + } 59 + @@ -980,7 +982,8 @@ class base_atomic<T, void, 16, Sign> 60 + 61 + value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT 62 + { 63 + - storage_type tmp = 0; 64 + + storage_type tmp; 65 + + memset(&tmp, 0, sizeof(tmp)); 66 + memcpy(&tmp, &v, sizeof(value_type)); 67 + tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); 68 + value_type res; 69 + @@ -994,7 +997,9 @@ class base_atomic<T, void, 16, Sign> 70 + memory_order success_order, 71 + memory_order failure_order) volatile BOOST_NOEXCEPT 72 + { 73 + - storage_type expected_s = 0, desired_s = 0; 74 + + storage_type expected_s, desired_s; 75 + + memset(&expected_s, 0, sizeof(expected_s)); 76 + + memset(&desired_s, 0, sizeof(desired_s)); 77 + memcpy(&expected_s, &expected, sizeof(value_type)); 78 + memcpy(&desired_s, &desired, sizeof(value_type)); 79 + const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false, 80 + @@ -1010,7 +1015,9 @@ class base_atomic<T, void, 16, Sign> 81 + memory_order success_order, 82 + memory_order failure_order) volatile BOOST_NOEXCEPT 83 + { 84 + - storage_type expected_s = 0, desired_s = 0; 85 + + storage_type expected_s, desired_s; 86 + + memset(&expected_s, 0, sizeof(expected_s)); 87 + + memset(&desired_s, 0, sizeof(desired_s)); 88 + memcpy(&expected_s, &expected, sizeof(value_type)); 89 + memcpy(&desired_s, &desired, sizeof(value_type)); 90 + const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true,
+4
pkgs/development/libraries/db/generic.nix
··· 18 18 19 19 patches = extraPatches; 20 20 21 + patchPhase = '' 22 + patch src/dbinc/atomic.h < ${./osx.patch} 23 + ''; 24 + 21 25 configureFlags = [ 22 26 (if cxxSupport then "--enable-cxx" else "--disable-cxx") 23 27 (if compat185 then "--enable-compat185" else "--disable-compat185")
+20
pkgs/development/libraries/db/osx.patch
··· 1 + --- src/dbinc/atomic.h 2013-03-12 14:07:22.000000000 -0400 2 + +++ src/dbinc/atomic.h.change 2013-03-12 14:06:35.000000000 -0400 3 + @@ -144,7 +144,7 @@ 4 + #define atomic_inc(env, p) __atomic_inc(p) 5 + #define atomic_dec(env, p) __atomic_dec(p) 6 + #define atomic_compare_exchange(env, p, o, n) \ 7 + - __atomic_compare_exchange((p), (o), (n)) 8 + + __atomic_compare_exchange_db((p), (o), (n)) 9 + static inline int __atomic_inc(db_atomic_t *p) 10 + { 11 + int temp; 12 + @@ -176,7 +176,7 @@ 13 + * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html 14 + * which configure could be changed to use. 15 + */ 16 + -static inline int __atomic_compare_exchange( 17 + +static inline int __atomic_compare_exchange_db( 18 + db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval) 19 + { 20 + atomic_value_t was;
+3
pkgs/development/libraries/gmp/5.1.x.nix
··· 16 16 # Build a "fat binary", with routines for several sub-architectures 17 17 # (x86), except on Solaris where some tests crash with "Memory fault". 18 18 # See <http://hydra.nixos.org/build/2760931>, for instance. 19 + # 20 + # no darwin because gmp uses ASM that clang doesn't like 19 21 optional (!stdenv.isSunOS) "--enable-fat" 20 22 ++ (if cxx then [ "--enable-cxx" ] 21 23 else [ "--disable-cxx" ]) 22 24 ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions" 25 + ++ optional stdenv.isDarwin "ABI=64" 23 26 ++ optional stdenv.is64bit "--with-pic" 24 27 ; 25 28
+1 -1
pkgs/development/libraries/libc++/default.nix
··· 26 26 description = "A new implementation of the C++ standard library, targeting C++11"; 27 27 license = "BSD"; 28 28 maintainers = [ stdenv.lib.maintainers.shlevy ]; 29 - platforms = stdenv.lib.platforms.linux; 29 + platforms = stdenv.lib.platforms.unix; 30 30 }; 31 31 }
+20 -10
pkgs/development/libraries/libc++abi/default.nix
··· 1 - { stdenv, fetchurl, libcxx, libunwind }: 1 + { stdenv, fetchurl, libcxx, libunwind, coreutils, gnused }: 2 2 3 3 let rev = "199626"; in 4 4 ··· 12 12 13 13 NIX_CFLAGS_LINK = "-L${libunwind}/lib -lunwind"; 14 14 15 + buildInputs = [ coreutils ]; 16 + 15 17 postUnpack = '' 16 18 unpackFile ${libcxx.src} 17 19 export NIX_CFLAGS_COMPILE="-I${libunwind}/include -I$PWD/include -I$(readlink -f libcxx-*)/include" 20 + '' + stdenv.lib.optionalString stdenv.isDarwin '' 21 + export TRIPLE=x86_64-apple-darwin 18 22 ''; 19 23 20 - installPhase = '' 21 - install -d -m 755 $out/include $out/lib 22 - install -m 644 lib/libc++abi.so.1.0 $out/lib 23 - install -m 644 include/cxxabi.h $out/include 24 - ln -s libc++abi.so.1.0 $out/lib/libc++abi.so 25 - ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 26 - ''; 24 + installPhase = if stdenv.isDarwin 25 + then '' 26 + install -d -m 755 $out/include $out/lib 27 + install -m 644 lib/libc++abi.dylib $out/lib 28 + install -m 644 include/cxxabi.h $out/include 29 + '' 30 + else '' 31 + install -d -m 755 $out/include $out/lib 32 + install -m 644 lib/libc++abi.so.1.0 $out/lib 33 + install -m 644 include/cxxabi.h $out/include 34 + ln -s libc++abi.so.1.0 $out/lib/libc++abi.so 35 + ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 36 + ''; 27 37 28 - patchPhase = "sed -e s,-lstdc++,, -i lib/buildit"; 38 + patchPhase = "${gnused}/bin/sed -e s,-lstdc++,, -i lib/buildit"; 29 39 30 40 buildPhase = "(cd lib; ./buildit)"; 31 41 ··· 34 44 description = "A new implementation of low level support for a standard C++ library"; 35 45 license = "BSD"; 36 46 maintainers = [ stdenv.lib.maintainers.shlevy ]; 37 - platforms = stdenv.lib.platforms.linux; 47 + platforms = stdenv.lib.platforms.unix; 38 48 }; 39 49 }
+9
pkgs/development/libraries/libdevil/default.nix
··· 16 16 17 17 configureFlags = [ "--enable-ILU" "--enable-ILUT" ]; 18 18 19 + preConfigure = '' 20 + sed -i 's, -std=gnu99,,g' configure 21 + sed -i 's,malloc.h,stdlib.h,g' src-ILU/ilur/ilur.c 22 + ''; 23 + 24 + postConfigure = '' 25 + sed -i '/RESTRICT_KEYWORD/d' include/IL/config.h 26 + ''; 27 + 19 28 patches = 20 29 [ ( fetchurl { 21 30 url = http://patch-tracker.debian.org/patch/series/dl/devil/1.7.8-6.1/03_CVE-2009-3994.diff;
+1 -1
pkgs/development/libraries/libedit/default.nix
··· 12 12 NROFF = "${groff}/bin/nroff"; 13 13 14 14 postInstall = '' 15 - sed -i s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc 15 + sed -i ${stdenv.lib.optionalString (stdenv.isDarwin && stdenv.gcc.nativeTools) "''"} s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc 16 16 ''; 17 17 18 18 # taken from gentoo http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/libedit/files/
+1 -1
pkgs/development/libraries/libffi/default.nix
··· 22 22 23 23 postInstall = 24 24 # Install headers in the right place. 25 - '' ln -s${if stdenv.isFreeBSD then "" else "r"}v "$out/lib/"libffi*/include "$out/include" 25 + '' ln -s${if stdenv.isBSD then "" else "r"}v "$out/lib/"libffi*/include "$out/include" 26 26 ''; 27 27 28 28 meta = {
+2
pkgs/development/libraries/libgcrypt/default.nix
··· 10 10 11 11 propagatedBuildInputs = [ libgpgerror ]; 12 12 13 + configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-asm"; 14 + 13 15 doCheck = stdenv.system != "i686-linux"; # "basic" test fails after stdenv+glibc-2.18 14 16 15 17 # For some reason the tests don't find `libgpg-error.so'.
+14
pkgs/development/libraries/libunistring/clang.patch
··· 1 + diff --git a/lib/stdint.in.h b/lib/stdint.in.h 2 + index 997e406..e0827f5 100644 3 + --- a/lib/stdint.in.h 4 + +++ b/lib/stdint.in.h 5 + @@ -53,7 +53,8 @@ 6 + in <inttypes.h> would reinclude us, skipping our contents because 7 + _GL_STDINT_H is defined. 8 + The include_next requires a split double-inclusion guard. */ 9 + -# @INCLUDE_NEXT@ @NEXT_STDINT_H@ 10 + +# include <inttypes.h> 11 + +// # @INCLUDE_NEXT@ @NEXT_STDINT_H@ 12 + #endif 13 + 14 + #if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+2
pkgs/development/libraries/libunistring/default.nix
··· 8 8 sha256 = "18q620269xzpw39dwvr9zpilnl2dkw5z5kz3mxaadnpv4k3kw3b1"; 9 9 }; 10 10 11 + patches = stdenv.lib.optional stdenv.isDarwin [ ./clang.patch ]; 12 + 11 13 propagatedBuildInputs = 12 14 stdenv.lib.optional ((! (stdenv ? glibc)) 13 15 || (stdenv ? cross &&
+15
pkgs/development/libraries/libunwind/native.nix
··· 1 + { stdenv }: 2 + 3 + stdenv.mkDerivation { 4 + name = "libunwind-native"; 5 + 6 + unpackPhase = ":"; 7 + dontBuild = true; 8 + 9 + installPhase = '' 10 + mkdir -p $out/lib 11 + cat ${/usr/lib/system/libunwind.dylib} > $out/lib/libunwind.dylib 12 + ''; 13 + 14 + meta.platforms = stdenv.lib.platforms.darwin; 15 + }
+1 -1
pkgs/development/libraries/mesa-darwin/default.nix
··· 1 - { stdenv, stdenvAdapters, gccApple, fetchurl, pkgconfig, intltool, flex, bison 1 + { stdenv, stdenvAdapters, fetchurl, pkgconfig, intltool, flex, bison 2 2 , python, libxml2Python, file, expat, makedepend, xorg, llvm, libffi, libvdpau 3 3 , enableTextureFloats ? false # Texture floats are patented, see docs/patents.txt 4 4 , enableExtraFeatures ? false # not maintained
+2
pkgs/development/libraries/mpc/default.nix
··· 10 10 11 11 buildInputs = [ gmp mpfr ]; 12 12 13 + CFLAGS = "-I${gmp}/include"; 14 + 13 15 doCheck = true; 14 16 15 17 meta = {
+2
pkgs/development/libraries/mpfr/default.nix
··· 10 10 11 11 buildInputs = [ gmp ]; 12 12 13 + CFLAGS = "-I${gmp}/include"; 14 + 13 15 configureFlags = 14 16 /* Work around a FreeBSD bug that otherwise leads to segfaults in the test suite: 15 17 http://hydra.bordeaux.inria.fr/build/34862
+42
pkgs/development/libraries/ncurses/clang.patch
··· 1 + diff -ruNp ncurses-5.8.orig/c++/cursesf.h ncurses-5.8/c++/cursesf.h 2 + --- ncurses-5.8.orig/c++/cursesf.h 2005-08-13 21:08:24.000000000 +0300 3 + +++ ncurses-5.8/c++/cursesf.h 2011-04-03 18:29:29.000000000 +0300 4 + @@ -681,7 +681,7 @@ public: 5 + const T* p_UserData = STATIC_CAST(T*)(0), 6 + bool with_frame=FALSE, 7 + bool autoDelete_Fields=FALSE) 8 + - : NCursesForm (Fields, with_frame, autoDelete_Fields) { 9 + + : NCursesForm (&Fields, with_frame, autoDelete_Fields) { 10 + if (form) 11 + set_user (const_cast<void *>(p_UserData)); 12 + }; 13 + @@ -694,7 +694,7 @@ public: 14 + const T* p_UserData = STATIC_CAST(T*)(0), 15 + bool with_frame=FALSE, 16 + bool autoDelete_Fields=FALSE) 17 + - : NCursesForm (Fields, nlines, ncols, begin_y, begin_x, 18 + + : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x, 19 + with_frame, autoDelete_Fields) { 20 + if (form) 21 + set_user (const_cast<void *>(p_UserData)); 22 + diff -ruNp ncurses-5.8.orig/c++/cursesm.h ncurses-5.8/c++/cursesm.h 23 + --- ncurses-5.8.orig/c++/cursesm.h 2005-08-13 21:10:36.000000000 +0300 24 + +++ ncurses-5.8/c++/cursesm.h 2011-04-03 18:31:42.000000000 +0300 25 + @@ -639,7 +639,7 @@ public: 26 + const T* p_UserData = STATIC_CAST(T*)(0), 27 + bool with_frame=FALSE, 28 + bool autoDelete_Items=FALSE) 29 + - : NCursesMenu (Items, with_frame, autoDelete_Items) { 30 + + : NCursesMenu (&Items, with_frame, autoDelete_Items) { 31 + if (menu) 32 + set_user (const_cast<void *>(p_UserData)); 33 + }; 34 + @@ -651,7 +651,7 @@ public: 35 + int begin_x = 0, 36 + const T* p_UserData = STATIC_CAST(T*)(0), 37 + bool with_frame=FALSE) 38 + - : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { 39 + + : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) { 40 + if (menu) 41 + set_user (const_cast<void *>(p_UserData)); 42 + };
+1 -3
pkgs/development/libraries/ncurses/default.nix
··· 18 18 sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh"; 19 19 }; 20 20 21 - patches = [ ./patch-ac ]; 21 + patches = [ ./patch-ac ./clang.patch ]; 22 22 23 23 configureFlags = '' 24 24 --with-shared --without-debug --enable-pc-files --enable-symlinks ··· 35 35 export configureFlags="$configureFlags --includedir=$out/include" 36 36 export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig" 37 37 mkdir -p "$PKG_CONFIG_LIBDIR" 38 - '' + lib.optionalString stdenv.isDarwin '' 39 - substituteInPlace configure --replace -no-cpp-precomp "" 40 38 ''; 41 39 42 40 selfNativeBuildInput = true;
-2
pkgs/development/libraries/qt-4.x/4.8/default.nix
··· 78 78 -translationdir $out/share/${name}/translations 79 79 " 80 80 '' + optionalString stdenv.isDarwin '' 81 - export CXX=clang++ 82 - export CC=clang 83 81 sed -i 's/QMAKE_CC = gcc/QMAKE_CC = clang/' mkspecs/common/g++-base.conf 84 82 sed -i 's/QMAKE_CXX = g++/QMAKE_CXX = clang++/' mkspecs/common/g++-base.conf 85 83 '';
+1
pkgs/development/libraries/readline/6.2.nix
··· 14 14 patches = 15 15 [ ./link-against-ncurses.patch 16 16 ./no-arch_only.patch 17 + ./clang.patch 17 18 ] 18 19 ++ 19 20 (let
+13
pkgs/development/libraries/readline/clang.patch
··· 1 + diff --git a/support/shobj-conf b/support/shobj-conf 2 + index 5a63e80..4b2a741 100644 3 + --- support/shobj-conf 4 + +++ support/shobj-conf 5 + @@ -189,7 +189,7 @@ darwin*|macosx*) 6 + darwin[789]*|darwin10*) SHOBJ_LDFLAGS='' 7 + SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' 8 + ;; 9 + - *) SHOBJ_LDFLAGS='-dynamic' 10 + + *) SHOBJ_LDFLAGS='-dynamiclib' 11 + SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' 12 + ;; 13 + esac
+9 -5
pkgs/development/libraries/serf/default.nix
··· 1 - { stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, krb5, pkgconfig }: 1 + { stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, krb5, pkgconfig, gnused }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "serf-1.3.7"; ··· 11 11 buildInputs = [ apr scons openssl aprutil zlib krb5 pkgconfig ]; 12 12 13 13 configurePhase = '' 14 - sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"PATH":os.environ["PATH"]})' -i SConstruct 15 - sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_CFLAGS_COMPILE":os.environ["NIX_CFLAGS_COMPILE"]})' -i SConstruct 16 - sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_LDFLAGS":os.environ["NIX_LDFLAGS"]})' -i SConstruct 14 + ${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"PATH":os.environ["PATH"]})' -i SConstruct 15 + ${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_CFLAGS_COMPILE":os.environ["NIX_CFLAGS_COMPILE"]})' -i SConstruct 16 + ${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_LDFLAGS":os.environ["NIX_LDFLAGS"]})' -i SConstruct 17 17 ''; 18 18 19 19 buildPhase = '' 20 20 scons PREFIX="$out" OPENSSL="${openssl}" ZLIB="${zlib}" APR="$(echo "${apr}"/bin/*-config)" \ 21 - APU="$(echo "${aprutil}"/bin/*-config)" GSSAPI="${krb5}" CC="${stdenv.gcc}/bin/gcc" 21 + APU="$(echo "${aprutil}"/bin/*-config)" GSSAPI="${krb5}" CC="${ 22 + if stdenv.isDarwin then "clang" else "${stdenv.gcc}/bin/gcc" 23 + }" 22 24 ''; 25 + 26 + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-L/usr/lib"; 23 27 24 28 installPhase = '' 25 29 scons install
+4
pkgs/development/tools/misc/distcc/masq.nix
··· 3 3 stdenv.mkDerivation { 4 4 name = "distcc-masq-${gccRaw.name}"; 5 5 6 + meta = { 7 + platforms = stdenv.lib.platforms.linux; 8 + }; 9 + 6 10 phases = [ "installPhase" ]; 7 11 installPhase = '' 8 12 mkdir -p $out/bin
+1
pkgs/development/tools/misc/sloccount/default.nix
··· 31 31 32 32 configurePhase = '' 33 33 sed -i "makefile" -"es|PREFIX[[:blank:]]*=.*$|PREFIX = $out|g" 34 + sed -i "makefile" -"es|gcc|$CC|g" 34 35 ''; 35 36 36 37 doCheck = true;
+1 -1
pkgs/servers/http/nginx/default.nix
··· 105 105 ++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio"; 106 106 107 107 108 - additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations"; 108 + additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations -Wno-error=conditional-uninitialized"; 109 109 110 110 preConfigure = '' 111 111 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags"
+8 -2
pkgs/servers/x11/xorg/overrides.nix
··· 69 69 }; 70 70 71 71 libX11 = attrs: attrs // { 72 - preConfigure = setMalloc0ReturnsNullCrossCompiling; 72 + preConfigure = setMalloc0ReturnsNullCrossCompiling + '' 73 + sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure 74 + ''; 73 75 postInstall = 74 76 '' 75 77 # Remove useless DocBook XML files. 76 78 rm -rf $out/share/doc 77 79 ''; 80 + CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -"; 78 81 }; 79 82 80 83 libXfont = attrs: attrs // { ··· 99 102 # Note: most of these are in Requires.private, so maybe builder.sh 100 103 # should propagate them automatically. 101 104 libXt = attrs: attrs // { 102 - preConfigure = setMalloc0ReturnsNullCrossCompiling; 105 + preConfigure = setMalloc0ReturnsNullCrossCompiling + '' 106 + sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure 107 + ''; 103 108 propagatedBuildInputs = [ xorg.libSM ]; 109 + CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -"; 104 110 }; 105 111 106 112 # See https://bugs.freedesktop.org/show_bug.cgi?id=47792
+5
pkgs/stdenv/adapters.nix
··· 299 299 ''; # */ 300 300 in overrideGCC stdenv (stdenv.gcc.override { binutils = binutils'; }); 301 301 302 + dropCxx = drv: drv.override { 303 + stdenv = if pkgs.stdenv.isDarwin 304 + then pkgs.allStdenvs.stdenvDarwinNaked 305 + else pkgs.stdenv; 306 + }; 302 307 }
+54
pkgs/stdenv/darwin/default.nix
··· 1 + { stdenv, pkgs, config 2 + , haveLibCxx ? true 3 + , useClang33 ? false }: 4 + 5 + import ../generic rec { 6 + inherit config; 7 + 8 + preHook = 9 + '' 10 + export NIX_ENFORCE_PURITY= 11 + export NIX_IGNORE_LD_THROUGH_GCC=1 12 + export NIX_DONT_SET_RPATH=1 13 + export NIX_NO_SELF_RPATH=1 14 + dontFixLibtool=1 15 + stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" 16 + xargsFlags=" " 17 + export MACOSX_DEPLOYMENT_TARGET=10.6 18 + export SDKROOT=$(/usr/bin/xcrun --show-sdk-path 2> /dev/null || true) 19 + export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT/usr/include -F$SDKROOT/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations" 20 + export NIX_LDFLAGS_AFTER+=" -L$SDKROOT/usr/lib" 21 + ''; 22 + 23 + initialPath = (import ../common-path.nix) {pkgs = pkgs;}; 24 + 25 + system = stdenv.system; 26 + 27 + gcc = import ../../build-support/clang-wrapper { 28 + nativeTools = false; 29 + nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr"; 30 + nativeLibc = true; 31 + inherit stdenv; 32 + libcxx = if haveLibCxx then pkgs.libcxx.override { 33 + libcxxabi = pkgs.libcxxabi.override { 34 + libunwind = pkgs.libunwindNative; 35 + }; 36 + } else null; 37 + binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}; 38 + clang = if useClang33 then pkgs.clang_33 else pkgs.clang; 39 + coreutils = pkgs.coreutils; 40 + shell = pkgs.bash + "/bin/sh"; 41 + }; 42 + 43 + shell = pkgs.bash + "/bin/sh"; 44 + 45 + fetchurlBoot = stdenv.fetchurlBoot; 46 + 47 + overrides = pkgs_: { 48 + inherit gcc; 49 + inherit (gcc) binutils; 50 + inherit (pkgs) 51 + gzip bzip2 xz bash coreutils diffutils findutils gawk 52 + gnumake gnused gnutar gnugrep gnupatch perl; 53 + }; 54 + }
+21 -1
pkgs/stdenv/default.nix
··· 33 33 pkgs = stdenvNativePkgs; 34 34 }; 35 35 36 + stdenvDarwin = import ./darwin { 37 + inherit config; 38 + stdenv = stdenvNative; 39 + pkgs = stdenvNativePkgs; 40 + }; 41 + 42 + stdenvDarwinNaked = import ./darwin { 43 + inherit config; 44 + stdenv = stdenvNative; 45 + pkgs = stdenvNativePkgs; 46 + haveLibCxx = false; 47 + }; 48 + 49 + stdenvDarwin33 = import ./darwin { 50 + inherit config; 51 + stdenv = stdenvNative; 52 + pkgs = stdenvNativePkgs; 53 + useClang33 = true; 54 + }; 55 + 36 56 37 57 # Linux standard environment. 38 58 stdenvLinux = (import ./linux { inherit system allPackages platform config lib; }).stdenvLinux; ··· 47 67 if system == "armv7l-linux" then stdenvLinux else 48 68 if system == "mips64el-linux" then stdenvLinux else 49 69 if system == "powerpc-linux" then /* stdenvLinux */ stdenvNative else 50 - if system == "x86_64-darwin" then stdenvNix else 70 + if system == "x86_64-darwin" then stdenvDarwin else 51 71 if system == "x86_64-solaris" then stdenvNix else 52 72 stdenvNative; 53 73 }
+2 -1
pkgs/stdenv/generic/default.nix
··· 162 162 isBSD = system == "i686-freebsd" 163 163 || system == "x86_64-freebsd" 164 164 || system == "i686-openbsd" 165 - || system == "x86_64-openbsd"; 165 + || system == "x86_64-openbsd" 166 + || system == "x86_64-darwin"; 166 167 isi686 = system == "i686-linux" 167 168 || system == "i686-gnu" 168 169 || system == "i686-freebsd"
+3 -3
pkgs/tools/archivers/sharutils/default.nix
··· 1 - { stdenv, fetchurl, gettext }: 1 + { stdenv, fetchurl, gettext, coreutils }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "sharutils-4.11.1"; ··· 12 12 '' 13 13 # Fix for building on Glibc 2.16. Won't be needed once the 14 14 # gnulib in sharutils is updated. 15 - sed -i '/gets is a security hole/d' lib/stdio.in.h 15 + sed -i ${stdenv.lib.optionalString (stdenv.isBSD && stdenv.gcc.nativeTools) "''"} '/gets is a security hole/d' lib/stdio.in.h 16 16 ''; 17 17 18 18 # GNU Gettext is needed on non-GNU platforms. 19 - buildInputs = [ gettext ]; 19 + buildInputs = [ gettext coreutils ]; 20 20 21 21 doCheck = true; 22 22
+2
pkgs/tools/compression/bzip2/default.nix
··· 26 26 sharedLibrary = 27 27 !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic; 28 28 29 + patchPhase = stdenv.lib.optionalString stdenv.isDarwin "substituteInPlace Makefile --replace 'CC=gcc' 'CC=clang'"; 30 + 29 31 preConfigure = "substituteInPlace Makefile --replace '$(PREFIX)/man' '$(PREFIX)/share/man'"; 30 32 31 33 makeFlags = if linkStatic then "LDFLAGS=-static" else "";
+3
pkgs/tools/misc/getopt/default.nix
··· 7 7 url = http://tarballs.nixos.org/getopt-1.1.4.tar.gz; 8 8 md5 = "02188ca68da27c4175d6e9f3da732101"; 9 9 }; 10 + preBuild = '' 11 + export buildFlags=CC="$CC" # for darwin 12 + ''; 10 13 }
+1 -1
pkgs/tools/networking/isync/default.nix
··· 16 16 license = [ "GPLv2+" ]; 17 17 18 18 maintainers = with stdenv.lib.maintainers; [ the-kenny viric ]; 19 - platforms = stdenv.lib.platforms.linux; 19 + platforms = stdenv.lib.platforms.unix; 20 20 }; 21 21 }
+4 -8
pkgs/tools/package-management/nix/default.nix
··· 66 66 enableParallelBuilding = true; 67 67 68 68 meta = { 69 - description = "Powerful package manager that makes package management reliable and reproducible"; 70 - longDescription = '' 71 - Nix is a powerful package manager for Linux and other Unix systems that 72 - makes package management reliable and reproducible. It provides atomic 73 - upgrades and rollbacks, side-by-side installation of multiple versions of 74 - a package, multi-user package management and easy setup of build 75 - environments. 76 - ''; 69 + # due to builder args bug; see 70 + # https://github.com/NixOS/nix/commit/b224ac15201c57b40ea855f5a98b1bd166c1c7f6 71 + broken = stdenv.isDarwin; 72 + description = "The Nix Deployment System"; 77 73 homepage = http://nixos.org/; 78 74 license = stdenv.lib.licenses.lgpl2Plus; 79 75 maintainers = [ stdenv.lib.maintainers.eelco ];
+3 -2
pkgs/tools/package-management/nix/unstable.nix
··· 1 1 { stdenv, fetchurl, perl, curl, bzip2, sqlite, openssl ? null 2 - , pkgconfig, boehmgc, perlPackages 2 + , pkgconfig, boehmgc, perlPackages, bash 3 3 , storeDir ? "/nix/store" 4 4 , stateDir ? "/nix/var" 5 5 }: ··· 24 24 postUnpack = 25 25 '' export CPATH="${bzip2}/include" 26 26 export LIBRARY_PATH="${bzip2}/lib" 27 + export CXXFLAGS="-O3 -Wno-error=reserved-user-defined-literal" 27 28 ''; 28 29 29 30 configureFlags = ··· 34 35 --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix} 35 36 --disable-init-state 36 37 --enable-gc 37 - CFLAGS=-O3 CXXFLAGS=-O3 38 + CFLAGS=-O3 38 39 ''; 39 40 40 41 makeFlags = "profiledir=$(out)/etc/profile.d";
+13
pkgs/tools/security/gnupg/clang.patch
··· 1 + diff --git a/gl/stdint_.h b/gl/stdint_.h 2 + index bc27595..303e81a 100644 3 + --- a/gl/stdint_.h 4 + +++ b/gl/stdint_.h 5 + @@ -62,7 +62,7 @@ 6 + int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. 7 + <inttypes.h> also defines intptr_t and uintptr_t. */ 8 + # define _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H 9 + -# include <inttypes.h> 10 + +// # include <inttypes.h> 11 + # undef _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H 12 + #elif @HAVE_SYS_INTTYPES_H@ 13 + /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
+1
pkgs/tools/security/gnupg/default.nix
··· 31 31 patchPhase = '' 32 32 find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i 33 33 find . -name pcsc-wrapper.c | xargs sed -i 's/typedef unsinged int pcsc_dword_t/typedef unsigned int pcsc_dword_t/' 34 + patch gl/stdint_.h < ${./clang.patch} 34 35 ''; 35 36 36 37 checkPhase="GNUPGHOME=`pwd` ./agent/gpg-agent --daemon make check";
+1
pkgs/tools/system/tree/default.nix
··· 37 37 prefix=$out 38 38 MANDIR=$out/share/man/man1 39 39 ${systemFlags} 40 + CC="$CC" 40 41 ) 41 42 ''; 42 43
+4
pkgs/tools/text/sgml/opensp/default.nix
··· 13 13 docsrc/*.xml 14 14 ''; 15 15 16 + configureFlags = optional stdenv.isDarwin [ 17 + "--with-libintl-prefix=/usr" 18 + "--with-libiconv-prefix=/usr" 19 + ]; 16 20 17 21 setupHook = ./setup-hook.sh; 18 22
+13
pkgs/tools/typesetting/tex/tetex/clang.patch
··· 1 + diff --git a/texk/ps2pkm/type1.c b/texk/ps2pkm/type1.c 2 + index 027bf1f..4dcbad0 100644 3 + --- a/texk/ps2pkm/type1.c 4 + +++ b/texk/ps2pkm/type1.c 5 + @@ -800,7 +800,7 @@ static void PSFakePush(Num) 6 + static DOUBLE PSFakePop () 7 + { 8 + if (PSFakeTop >= 0) return(PSFakeStack[PSFakeTop--]); 9 + - else Error0("PSFakePop : Stack empty\n"); 10 + + else { CC; IfTrace0(TRUE, "PSFakePop : Stack empty\n"); errflag = TRUE; return 0; } 11 + /*NOTREACHED*/ 12 + } 13 +
+1 -1
pkgs/tools/typesetting/tex/tetex/default.nix
··· 20 20 sed -i 57d texk/kpathsea/c-std.h 21 21 ''; 22 22 23 - patches = [ ./environment.patch ./getline.patch ]; 23 + patches = [ ./environment.patch ./getline.patch ./clang.patch ]; 24 24 25 25 setupHook = ./setup-hook.sh; 26 26
+1 -1
pkgs/tools/typesetting/tex/tex4ht/default.nix
··· 14 14 cd src 15 15 for f in tex4ht t4ht htcmd ; do 16 16 # -DENVFILE="$out/share/texmf-nix/tex4ht/base/unix/tex4ht.env" 17 - gcc -o $f $f.c -I${tetex}/include -L${tetex}/lib -DHAVE_DIRENT_H -DHAVE_DIRENT_H -DKPATHSEA -lkpathsea 17 + $CC -o $f $f.c -I${tetex}/include -L${tetex}/lib -DHAVE_DIRENT_H -DHAVE_DIRENT_H -DKPATHSEA -lkpathsea 18 18 done 19 19 cd - 20 20 '';
-1
pkgs/tools/typesetting/tex/texlive/default.nix
··· 22 22 setupHook = ./setup-hook.sh; 23 23 24 24 doMainBuild = fullDepEntry ( stdenv.lib.optionalString stdenv.isDarwin '' 25 - export MACOSX_DEPLOYMENT_TARGET=10.9 26 25 export DYLD_LIBRARY_PATH="${poppler}/lib" 27 26 '' + '' 28 27 mkdir -p $out
+23 -33
pkgs/top-level/all-packages.nix
··· 231 231 else 232 232 defaultStdenv; 233 233 234 - stdenvApple = stdenvAdapters.overrideGCC allStdenvs.stdenvNative gccApple; 235 - 236 234 forceNativeDrv = drv : if crossSystem == null then drv else 237 235 (drv // { crossDrv = drv.nativeDrv; }); 238 236 ··· 1825 1823 1826 1824 openssh_with_kerberos = pkgs.appendToName "with-kerberos" (openssh.override { withKerberos = true; }); 1827 1825 1828 - opensp = callPackage ../tools/text/sgml/opensp { }; 1826 + opensp = callPackage ../tools/text/sgml/opensp { 1827 + stdenv = if stdenv.isDarwin 1828 + then allStdenvs.stdenvDarwinNaked 1829 + else stdenv; 1830 + }; 1829 1831 1830 1832 spCompat = callPackage ../tools/text/sgml/opensp/compat.nix { }; 1831 1833 ··· 2719 2721 }; 2720 2722 2721 2723 clangUnwrapped = llvm: pkg: callPackage pkg { 2722 - stdenv = if stdenv.isDarwin then stdenvApple else stdenv; 2723 - inherit llvm; 2724 + inherit stdenv llvm; 2724 2725 }; 2725 2726 2726 2727 clangSelf = clangWrapSelf llvmPackagesSelf.clang; ··· 2737 2738 }; 2738 2739 2739 2740 #Use this instead of stdenv to build with clang 2740 - clangStdenv = lowPrio (stdenvAdapters.overrideGCC stdenv clang); 2741 + clangStdenv = if stdenv.isDarwin then stdenv else lowPrio (stdenvAdapters.overrideGCC stdenv clang); 2741 2742 libcxxStdenv = stdenvAdapters.overrideGCC stdenv (clangWrapSelf llvmPackages.clang); 2742 2743 2743 2744 clean = callPackage ../development/compilers/clean { }; ··· 2940 2941 then gnu.libpthreadCross 2941 2942 else null; 2942 2943 })); 2943 - 2944 - gccApple = 2945 - assert stdenv.isDarwin; 2946 - wrapGCC (makeOverridable (import ../development/compilers/gcc/4.2-apple64) { 2947 - inherit fetchurl noSysDirs; 2948 - profiledCompiler = true; 2949 - # Since it fails to build with GCC 4.6, build it with the "native" 2950 - # Apple-GCC. 2951 - stdenv = allStdenvs.stdenvNative; 2952 - }); 2953 2944 2954 2945 gfortran = gfortran48; 2955 2946 ··· 3251 3242 llvm_34 = llvmPackages_34.llvm; 3252 3243 llvm_33 = llvm_v ../development/compilers/llvm/3.3/llvm.nix; 3253 3244 3254 - llvm_v = path: callPackage path { 3255 - stdenv = if stdenv.isDarwin then stdenvApple else stdenv; 3256 - }; 3245 + llvm_v = path: callPackage path { }; 3257 3246 3258 - llvmPackages = if !stdenv.isDarwin then llvmPackages_34 else llvmPackages_34 // { 3259 - # until someone solves build problems with _34 3260 - llvm = llvm_33; 3261 - clang = clang_33; 3262 - }; 3247 + llvmPackages = llvmPackages_34; 3263 3248 3264 3249 llvmPackages_34 = recurseIntoAttrs (import ../development/compilers/llvm/3.4 { 3265 3250 inherit stdenv newScope fetchurl; ··· 4003 3988 bam = callPackage ../development/tools/build-managers/bam {}; 4004 3989 4005 3990 binutils = if stdenv.isDarwin 4006 - then stdenv.gcc.binutils 3991 + then import ../build-support/native-darwin-cctools-wrapper {inherit stdenv;} 4007 3992 else callPackage ../development/tools/misc/binutils { 4008 3993 inherit noSysDirs; 4009 3994 }; ··· 4144 4129 wrapGCC (distcc.links extraConfig)) {}; 4145 4130 distccStdenv = lowPrio (overrideGCC stdenv distccWrapper); 4146 4131 4147 - distccMasquerade = callPackage ../development/tools/misc/distcc/masq.nix { 4148 - gccRaw = gcc.gcc; 4149 - binutils = binutils; 4150 - }; 4132 + distccMasquerade = if stdenv.isDarwin 4133 + then null 4134 + else callPackage ../development/tools/misc/distcc/masq.nix { 4135 + gccRaw = gcc.gcc; 4136 + binutils = binutils; 4137 + }; 4151 4138 4152 4139 docutils = builderDefsPackage (import ../development/tools/documentation/docutils) { 4153 4140 inherit python pil makeWrapper; ··· 4635 4622 4636 4623 coredumper = callPackage ../development/libraries/coredumper { }; 4637 4624 4638 - ctl = callPackage ../development/libraries/ctl { }; 4625 + ctl = dropCxx (callPackage ../development/libraries/ctl { }); 4639 4626 4640 4627 cpp-netlib = callPackage ../development/libraries/cpp-netlib { }; 4641 4628 ··· 5146 5133 5147 5134 ilixi = callPackage ../development/libraries/ilixi { }; 5148 5135 5149 - ilmbase = callPackage ../development/libraries/ilmbase { }; 5136 + ilmbase = dropCxx (callPackage ../development/libraries/ilmbase { }); 5150 5137 5151 5138 imlib = callPackage ../development/libraries/imlib { 5152 5139 libpng = libpng12; ··· 5320 5307 5321 5308 libdc1394avt = callPackage ../development/libraries/libdc1394avt { }; 5322 5309 5323 - libdevil = callPackage ../development/libraries/libdevil { }; 5310 + libdevil = dropCxx (callPackage ../development/libraries/libdevil { }); 5324 5311 5325 5312 libdiscid = callPackage ../development/libraries/libdiscid { }; 5326 5313 ··· 5772 5759 5773 5760 libunwind = callPackage ../development/libraries/libunwind { }; 5774 5761 5762 + libunwindNative = callPackage ../development/libraries/libunwind/native.nix {}; 5763 + 5775 5764 libuvVersions = callPackage ../development/libraries/libuv { }; 5776 5765 5777 5766 libv4l = lowPrio (v4l_utils.override { ··· 6065 6054 # this ctl version is needed by openexr_viewers 6066 6055 openexr_ctl = callPackage ../development/libraries/openexr_ctl { }; 6067 6056 6068 - openexr = callPackage ../development/libraries/openexr { }; 6057 + openexr = dropCxx (callPackage ../development/libraries/openexr { }); 6069 6058 6070 6059 openldap = callPackage ../development/libraries/openldap { 6071 6060 stdenv = if stdenv.isDarwin ··· 11566 11555 }; 11567 11556 11568 11557 nixUnstable = callPackage ../tools/package-management/nix/unstable.nix { 11558 + stdenv = if stdenv.isDarwin then allStdenvs.stdenvDarwin33 else stdenv; 11569 11559 storeDir = config.nix.storeDir or "/nix/store"; 11570 11560 stateDir = config.nix.stateDir or "/nix/var"; 11571 11561 };
+3 -1
pkgs/top-level/haskell-defaults.nix
··· 205 205 gmp = pkgs.gmp4; 206 206 }); 207 207 208 + ghc783Binary = lowPrio (callPackage ../development/compilers/ghc/7.8.3-binary.nix {}); 209 + 208 210 ghc6101BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6101Binary; 209 211 ghc6121BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6121Binary; 210 212 ··· 225 227 226 228 packages_ghc783 = 227 229 packages { ghcPath = ../development/compilers/ghc/7.8.3.nix; 228 - ghcBinary = ghc742Binary; 230 + ghcBinary = if stdenv.isDarwin then ghc783Binary else ghc742Binary; 229 231 prefFun = ghc783Prefs; 230 232 }; 231 233