Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge remote-tracking branch 'origin/darwin-clang-stdenv' into staging

Conflicts:
pkgs/applications/editors/vim/macvim.nix

+1019 -1035
+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 -8
pkgs/applications/version-management/subversion/default.nix
··· 38 38 ${if pythonBindings || perlBindings then "--with-swig=${swig}" else "--without-swig"} 39 39 ${if javahlBindings then "--enable-javahl --with-jdk=${jdk}" else ""} 40 40 ${if stdenv.isDarwin then "--enable-keychain" else "--disable-keychain"} 41 - ${if saslSupport then "--enable-sasl --with-sasl=${sasl}" else "--disable-sasl"} 42 - ${if httpSupport then "--enable-serf --with-serf=${serf}" else "--disable-serf"} 41 + ${if saslSupport then "--with-sasl=${sasl}" else "--without-sasl"} 42 + ${if httpSupport then "--with-serf=${serf}" else "--without-serf"} 43 43 --with-zlib=${zlib} 44 44 --with-sqlite=${sqlite} 45 45 ''; 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";
+5
pkgs/build-support/cabal/default.nix
··· 218 218 configureFlags+=" --ghc-option=-optl=-Wl,-headerpad_max_install_names" 219 219 ''} 220 220 221 + ${optionalString self.stdenv.isDarwin '' 222 + configureFlags+=" --with-gcc=clang" 223 + ''} 224 + 221 225 echo "configure flags: $extraConfigureFlags $configureFlags" 222 226 ./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \ 223 227 --libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \ ··· 240 244 241 245 export GHC_PACKAGE_PATH=$(${ghc.GHCPackages}) 242 246 test -n "$noHaddock" || ./Setup haddock --html --hoogle \ 247 + --ghc-options=-optP-P \ 243 248 ${optionalString self.hyperlinkSource "--hyperlink-source"} 244 249 245 250 eval "$postBuild"
-24
pkgs/build-support/clang-wrapper/add-flags
··· 1 - # `-B@out@/bin' forces clang to use ld-wrapper.sh when calling ld. 2 - export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE" 3 - 4 - if test -e @out@/nix-support/libc-cflags; then 5 - export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE" 6 - fi 7 - 8 - if test -e @out@/nix-support/clang-cflags; then 9 - export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/clang-cflags) $NIX_CFLAGS_COMPILE" 10 - fi 11 - 12 - if test -e @out@/nix-support/libc-ldflags; then 13 - export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)" 14 - fi 15 - 16 - if test -e @out@/nix-support/clang-ldflags; then 17 - export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/clang-ldflags)" 18 - fi 19 - 20 - if test -e @out@/nix-support/libc-ldflags-before; then 21 - export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE" 22 - fi 23 - 24 - export NIX_GCC_WRAPPER_FLAGS_SET=1
-137
pkgs/build-support/clang-wrapper/builder.sh
··· 1 - source $stdenv/setup 2 - 3 - 4 - mkdir -p $out/bin 5 - mkdir -p $out/nix-support 6 - 7 - 8 - if test -z "$nativeLibc"; then 9 - dynamicLinker="$libc/lib/$dynamicLinker" 10 - echo $dynamicLinker > $out/nix-support/dynamic-linker 11 - 12 - if test -e $libc/lib/32/ld-linux.so.2; then 13 - echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32 14 - fi 15 - 16 - # The "-B$libc/lib/" flag is a quick hack to force clang to link 17 - # against the crt1.o from our own glibc, rather than the one in 18 - # /usr/lib. (This is only an issue when using an `impure' 19 - # compiler/linker, i.e., one that searches /usr/lib and so on.) 20 - echo "-B$libc/lib/ -idirafter $libc/include" > $out/nix-support/libc-cflags 21 - 22 - echo "-L$libc/lib" > $out/nix-support/libc-ldflags 23 - 24 - # The dynamic linker is passed in `ldflagsBefore' to allow 25 - # explicit overrides of the dynamic linker by callers to clang/ld 26 - # (the *last* value counts, so ours should come first). 27 - echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before 28 - fi 29 - 30 - if test -n "$nativeTools"; then 31 - clangPath="$nativePrefix/bin" 32 - ldPath="$nativePrefix/bin" 33 - 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" 41 - fi 42 - 43 - clangLDFlags="$clangLDFlags -L$clang/lib" 44 - echo "$clangLDFlags" > $out/nix-support/clang-ldflags 45 - 46 - # Need files like crtbegin.o from gcc 47 - # It's unclear if these will ever be provided by an LLVM project 48 - clangCFlags="$clangCFlags -B$basePath" 49 - 50 - clangCFlags="$clangCFlags -isystem$clang/lib/clang/$clangVersion/include" 51 - echo "$clangCFlags" > $out/nix-support/clang-cflags 52 - 53 - clangPath="$clang/bin" 54 - ldPath="$binutils/bin" 55 - fi 56 - 57 - 58 - doSubstitute() { 59 - local src=$1 60 - local dst=$2 61 - local uselibcxx= 62 - local uselibcxxabi= 63 - if test -n "$libcxx" && echo $dst | fgrep ++; then uselibcxx=$libcxx; fi 64 - if test -n "$libcxxabi" && echo $dst | fgrep ++; then uselibcxxabi=$libcxxabi; fi 65 - # Can't use substitute() here, because replace may not have been 66 - # built yet (in the bootstrap). 67 - sed \ 68 - -e "s^@out@^$out^g" \ 69 - -e "s^@shell@^$shell^g" \ 70 - -e "s^@libcxx@^$uselibcxx^g" \ 71 - -e "s^@libcxxabi@^$uselibcxxabi^g" \ 72 - -e "s^@clang@^$clang^g" \ 73 - -e "s^@clangProg@^$clangProg^g" \ 74 - -e "s^@binutils@^$binutils^g" \ 75 - -e "s^@coreutils@^$coreutils^g" \ 76 - -e "s^@libc@^$libc^g" \ 77 - -e "s^@ld@^$ldPath/ld^g" \ 78 - < "$src" > "$dst" 79 - } 80 - 81 - 82 - # Make wrapper scripts around clang and clang++. Also make symlinks 83 - # cc and c++ 84 - mkClangWrapper() { 85 - local dst=$1 86 - local src=$2 87 - 88 - if ! test -f "$src"; then 89 - echo "$src does not exist (skipping)" 90 - return 1 91 - fi 92 - 93 - clangProg="$src" 94 - doSubstitute "$clangWrapper" "$dst" 95 - chmod +x "$dst" 96 - } 97 - 98 - if mkClangWrapper $out/bin/clang $clangPath/clang 99 - then 100 - ln -sv clang $out/bin/cc 101 - fi 102 - 103 - if mkClangWrapper $out/bin/clang++ $clangPath/clang++ 104 - then 105 - ln -sv clang++ $out/bin/c++ 106 - fi 107 - 108 - 109 - # Create a symlink to as (the assembler). This is useful when a 110 - # clang-wrapper is installed in a user environment, as it ensures that 111 - # the right assembler is called. 112 - ln -s $ldPath/as $out/bin/as 113 - 114 - 115 - # Make a wrapper around the linker. 116 - doSubstitute "$ldWrapper" "$out/bin/ld" 117 - chmod +x "$out/bin/ld" 118 - 119 - 120 - # Emit a setup hook. Also store the path to the original Clang and 121 - # libc. 122 - test -n "$clang" && echo $clang > $out/nix-support/orig-clang 123 - test -n "$libc" && echo $libc > $out/nix-support/orig-libc 124 - 125 - doSubstitute "$addFlags" "$out/nix-support/add-flags.sh" 126 - 127 - doSubstitute "$setupHook" "$out/nix-support/setup-hook" 128 - 129 - cp -p $utils $out/nix-support/utils.sh 130 - 131 - 132 - # Propagate the wrapped clang so that if you install the wrapper, you get 133 - # llvm tools, the manpages, etc. as well (including for binutils 134 - # and Glibc). 135 - if test -z "$nativeTools"; then 136 - echo $clang $binutils $libc > $out/nix-support/propagated-user-env-packages 137 - fi
-150
pkgs/build-support/clang-wrapper/clang-wrapper.sh
··· 1 - #! @shell@ -e 2 - 3 - if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then 4 - source "$NIX_GCC_WRAPPER_START_HOOK" 5 - fi 6 - 7 - if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then 8 - source @out@/nix-support/add-flags.sh 9 - fi 10 - 11 - source @out@/nix-support/utils.sh 12 - 13 - 14 - # Figure out if linker flags should be passed. Clang prints annoying 15 - # warnings when they are not needed. (does it really? Copied from gcc-wrapper) 16 - dontLink=0 17 - getVersion=0 18 - nonFlagArgs=0 19 - 20 - for i in "$@"; do 21 - if test "$i" = "-c"; then 22 - dontLink=1 23 - elif test "$i" = "-S"; then 24 - dontLink=1 25 - elif test "$i" = "-E"; then 26 - dontLink=1 27 - elif test "$i" = "-E"; then 28 - dontLink=1 29 - elif test "$i" = "-M"; then 30 - dontLink=1 31 - elif test "$i" = "-MM"; then 32 - dontLink=1 33 - elif test "$i" = "-x"; then 34 - # At least for the cases c-header or c++-header we should set dontLink. 35 - # I expect no one use -x other than making precompiled headers. 36 - dontLink=1 37 - elif test "${i:0:1}" != "-"; then 38 - nonFlagArgs=1 39 - elif test "$i" = "-m32"; then 40 - if test -e @out@/nix-support/dynamic-linker-m32; then 41 - NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" 42 - fi 43 - fi 44 - done 45 - 46 - # If we pass a flag like -Wl, then clang will call the linker unless it 47 - # can figure out that it has to do something else (e.g., because of a 48 - # "-c" flag). So if no non-flag arguments are given, don't pass any 49 - # linker flags. This catches cases like "clang" (should just print 50 - # "clang: no input files") and "clang -v" (should print the version). 51 - if test "$nonFlagArgs" = "0"; then 52 - dontLink=1 53 - fi 54 - 55 - # Optionally filter out paths not refering to the store. 56 - params=("$@") 57 - if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then 58 - rest=() 59 - n=0 60 - while test $n -lt ${#params[*]}; do 61 - p=${params[n]} 62 - p2=${params[$((n+1))]} 63 - if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then 64 - skip $p 65 - elif test "$p" = "-L" && badPath "$p2"; then 66 - n=$((n + 1)); skip $p2 67 - elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then 68 - skip $p 69 - elif test "$p" = "-I" && badPath "$p2"; then 70 - n=$((n + 1)); skip $p2 71 - elif test "$p" = "-isystem" && badPath "$p2"; then 72 - n=$((n + 1)); skip $p2 73 - else 74 - rest=("${rest[@]}" "$p") 75 - fi 76 - n=$((n + 1)) 77 - done 78 - params=("${rest[@]}") 79 - NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE --sysroot=/var/empty" 80 - fi 81 - 82 - if test -n "@libcxx@"; then 83 - NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem@libcxx@/include/c++/v1 -stdlib=libc++" 84 - NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L@libcxx@/lib -stdlib=libc++ -L@libcxxabi@/lib -lc++abi" 85 - fi 86 - 87 - # Add the flags for the C compiler proper. 88 - extraAfter=($NIX_CFLAGS_COMPILE) 89 - extraBefore=() 90 - 91 - if test "$dontLink" != "1"; then 92 - 93 - # Add the flags that should only be passed to the compiler when 94 - # linking. 95 - extraAfter=(${extraAfter[@]} $NIX_CFLAGS_LINK) 96 - 97 - # Add the flags that should be passed to the linker (and prevent 98 - # `ld-wrapper' from adding NIX_LDFLAGS again). 99 - for i in $NIX_LDFLAGS_BEFORE; do 100 - extraBefore=(${extraBefore[@]} "-Wl,$i") 101 - done 102 - for i in $NIX_LDFLAGS; do 103 - if test "${i:0:3}" = "-L/"; then 104 - extraAfter=(${extraAfter[@]} "$i") 105 - else 106 - extraAfter=(${extraAfter[@]} "-Wl,$i") 107 - fi 108 - done 109 - export NIX_LDFLAGS_SET=1 110 - fi 111 - 112 - # As a very special hack, if the arguments are just `-v', then don't 113 - # add anything. This is to prevent `clang -v' (which normally prints 114 - # out the version number and returns exit code 0) from printing out 115 - # `No input files specified' and returning exit code 1. 116 - if test "$*" = "-v"; then 117 - extraAfter=() 118 - extraBefore=() 119 - fi 120 - 121 - # Optionally print debug info. 122 - if test "$NIX_DEBUG" = "1"; then 123 - echo "original flags to @clangProg@:" >&2 124 - for i in "${params[@]}"; do 125 - echo " $i" >&2 126 - done 127 - echo "extraBefore flags to @clangProg@:" >&2 128 - for i in ${extraBefore[@]}; do 129 - echo " $i" >&2 130 - done 131 - echo "extraAfter flags to @clangProg@:" >&2 132 - for i in ${extraAfter[@]}; do 133 - echo " $i" >&2 134 - done 135 - fi 136 - 137 - if test -n "$NIX_CLANG_WRAPPER_EXEC_HOOK"; then 138 - source "$NIX_CLANG_WRAPPER_EXEC_HOOK" 139 - fi 140 - 141 - # Call the real `clang'. Filter out warnings from stderr about unused 142 - # `-B' flags, since they confuse some programs. Deep bash magic to 143 - # apply grep to stderr (by swapping stdin/stderr twice). 144 - if test -z "$NIX_CLANG_NEEDS_GREP"; then 145 - @clangProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 146 - else 147 - (@clangProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ 148 - | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- 149 - exit $? 150 - fi
-89
pkgs/build-support/clang-wrapper/default.nix
··· 1 - # The Nix `clang' stdenv.mkDerivation is not directly usable, since it doesn't 2 - # know where the C library and standard header files are. Therefore 3 - # the compiler produced by that package cannot be installed directly 4 - # in a user environment and used from the command line. This 5 - # stdenv.mkDerivation provides a wrapper that sets up the right environment 6 - # variables so that the compiler and the linker just "work". 7 - 8 - { name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? "" 9 - , clang ? null, libc ? null, binutils ? null, coreutils ? null, shell ? "" 10 - , zlib ? null, libcxx ? null 11 - }: 12 - 13 - assert nativeTools -> nativePrefix != ""; 14 - assert !nativeTools -> clang != null && binutils != null && coreutils != null; 15 - assert !nativeLibc -> libc != null; 16 - 17 - let 18 - 19 - clangVersion = (builtins.parseDrvName clang.name).version; 20 - clangName = (builtins.parseDrvName clang.name).name; 21 - 22 - in 23 - 24 - stdenv.mkDerivation { 25 - name = 26 - (if name != "" then name else clangName + "-wrapper") + 27 - (if clang != null && clangVersion != "" then "-" + clangVersion else ""); 28 - 29 - builder = ./builder.sh; 30 - setupHook = ./setup-hook.sh; 31 - clangWrapper = ./clang-wrapper.sh; 32 - ldWrapper = ../gcc-wrapper/ld-wrapper.sh; 33 - utils = ../gcc-wrapper/utils.sh; 34 - addFlags = ./add-flags; 35 - 36 - inherit nativeTools nativeLibc nativePrefix clang clangVersion libcxx; 37 - 38 - libcxxabi = libcxx.abi or null; 39 - 40 - gcc = clang.gcc; 41 - libc = if nativeLibc then null else libc; 42 - binutils = if nativeTools then null else binutils; 43 - # The wrapper scripts use 'cat', so we may need coreutils 44 - coreutils = if nativeTools then null else coreutils; 45 - 46 - langC = true; 47 - langCC = true; 48 - shell = if shell == "" then stdenv.shell else 49 - if builtins.isAttrs shell then (shell + shell.shellPath) 50 - else shell; 51 - 52 - crossAttrs = { 53 - shell = shell.crossDrv + shell.crossDrv.shellPath; 54 - libc = libc.crossDrv; 55 - coreutils = coreutils.crossDrv; 56 - binutils = binutils.crossDrv; 57 - clang = clang.crossDrv; 58 - # 59 - # This is not the best way to do this. I think the reference should be 60 - # the style in the gcc-cross-wrapper, but to keep a stable stdenv now I 61 - # do this sufficient if/else. 62 - dynamicLinker = 63 - (if stdenv.cross.arch == "arm" then "ld-linux.so.3" else 64 - if stdenv.cross.arch == "mips" then "ld.so.1" else 65 - if stdenv.lib.hasSuffix "pc-gnu" stdenv.cross.config then "ld.so.1" else 66 - abort "don't know the name of the dynamic linker for this platform"); 67 - }; 68 - 69 - meta = 70 - let clang_ = if clang != null then clang else {}; in 71 - (if clang_ ? meta then removeAttrs clang.meta ["priority"] else {}) // 72 - { description = 73 - stdenv.lib.attrByPath ["meta" "description"] "System C compiler" clang_ 74 - + " (wrapper script)"; 75 - }; 76 - 77 - # The dynamic linker has different names on different Linux platforms. 78 - dynamicLinker = 79 - if !nativeLibc then 80 - (if stdenv.system == "i686-linux" then "ld-linux.so.2" else 81 - if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else 82 - if stdenv.isArm then "ld-linux.so.3" else 83 - if stdenv.system == "powerpc-linux" then "ld.so.1" else 84 - if stdenv.system == "mips64el-linux" then "ld.so.1" else 85 - abort "don't know the name of the dynamic linker for this platform") 86 - else ""; 87 - 88 - preferLocalBuild = true; 89 - }
-38
pkgs/build-support/clang-wrapper/setup-hook.sh
··· 1 - export NIX_GCC=@out@ 2 - 3 - addCVars () { 4 - if test -d $1/include; then 5 - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include" 6 - fi 7 - 8 - if test -d $1/lib64; then 9 - export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64" 10 - fi 11 - 12 - if test -d $1/lib; then 13 - export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib" 14 - fi 15 - } 16 - 17 - envHooks+=(addCVars) 18 - 19 - # Note: these come *after* $out in the PATH (see setup.sh). 20 - 21 - if test -n "@clang@"; then 22 - addToSearchPath PATH @clang@/bin 23 - fi 24 - 25 - if test -n "@binutils@"; then 26 - addToSearchPath PATH @binutils@/bin 27 - fi 28 - 29 - if test -n "@libc@"; then 30 - addToSearchPath PATH @libc@/bin 31 - fi 32 - 33 - if test -n "@coreutils@"; then 34 - addToSearchPath PATH @coreutils@/bin 35 - fi 36 - 37 - : ${CXX:=clang++} 38 - export CXX
+1 -10
pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh
··· 114 114 # We want gcc to call the wrapper linker, not that of binutils. 115 115 export PATH="@ldPath@:$PATH" 116 116 117 - # Call the real `gcc'. Filter out warnings from stderr about unused 118 - # `-B' flags, since they confuse some programs. Deep bash magic to 119 - # apply grep to stderr (by swapping stdin/stderr twice). 120 - if test -z "$NIX_GCC_NEEDS_GREP"; then 121 - @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 122 - else 123 - (@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ 124 - | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- 125 - exit $? 126 - fi 117 + exec @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
+8 -8
pkgs/build-support/gcc-wrapper/add-flags
··· 1 1 # `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld. 2 2 export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE" 3 3 4 - if test -e @out@/nix-support/libc-cflags; then 4 + if [ -e @out@/nix-support/libc-cflags ]; then 5 5 export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE" 6 6 fi 7 7 8 - if test -e @out@/nix-support/gcc-cflags; then 8 + if [ -e @out@/nix-support/gcc-cflags ]; then 9 9 export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE" 10 10 fi 11 11 12 - if test -e @out@/nix-support/gnat-cflags; then 12 + if [ -e @out@/nix-support/gnat-cflags ]; then 13 13 export NIX_GNATFLAGS_COMPILE="$(cat @out@/nix-support/gnat-cflags) $NIX_GNATFLAGS_COMPILE" 14 14 fi 15 15 16 - if test -e @out@/nix-support/libc-ldflags; then 17 - export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)" 16 + if [ -e @out@/nix-support/libc-ldflags ]; then 17 + export NIX_LDFLAGS+=" $(cat @out@/nix-support/libc-ldflags)" 18 18 fi 19 19 20 - if test -e @out@/nix-support/gcc-ldflags; then 21 - export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/gcc-ldflags)" 20 + if [ -e @out@/nix-support/gcc-ldflags ]; then 21 + export NIX_LDFLAGS+=" $(cat @out@/nix-support/gcc-ldflags)" 22 22 fi 23 23 24 - if test -e @out@/nix-support/libc-ldflags-before; then 24 + if [ -e @out@/nix-support/libc-ldflags-before ]; then 25 25 export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE" 26 26 fi 27 27
-214
pkgs/build-support/gcc-wrapper/builder.sh
··· 1 - source $stdenv/setup 2 - 3 - 4 - mkdir -p $out/bin 5 - mkdir -p $out/nix-support 6 - 7 - 8 - if test -z "$nativeLibc"; then 9 - dynamicLinker="$libc/lib/$dynamicLinker" 10 - echo $dynamicLinker > $out/nix-support/dynamic-linker 11 - 12 - if test -e $libc/lib/32/ld-linux.so.2; then 13 - echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32 14 - fi 15 - 16 - # The "-B$libc/lib/" flag is a quick hack to force gcc to link 17 - # against the crt1.o from our own glibc, rather than the one in 18 - # /usr/lib. (This is only an issue when using an `impure' 19 - # compiler/linker, i.e., one that searches /usr/lib and so on.) 20 - # 21 - # Unfortunately, setting -B appears to override the default search 22 - # path. Thus, the gcc-specific "../includes-fixed" directory is 23 - # now longer searched and glibc's <limits.h> header fails to 24 - # compile, because it uses "#include_next <limits.h>" to find the 25 - # limits.h file in ../includes-fixed. To remedy the problem, 26 - # another -idirafter is necessary to add that directory again. 27 - echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags 28 - 29 - echo "-L$libc/lib" > $out/nix-support/libc-ldflags 30 - 31 - # The dynamic linker is passed in `ldflagsBefore' to allow 32 - # explicit overrides of the dynamic linker by callers to gcc/ld 33 - # (the *last* value counts, so ours should come first). 34 - echo "-dynamic-linker" $dynamicLinker > $out/nix-support/libc-ldflags-before 35 - fi 36 - 37 - if test -n "$nativeTools"; then 38 - gccPath="$nativePrefix/bin" 39 - ldPath="$nativePrefix/bin" 40 - else 41 - if test -e "$gcc/lib64"; then 42 - gccLDFlags="$gccLDFlags -L$gcc/lib64" 43 - fi 44 - gccLDFlags="$gccLDFlags -L$gcc/lib" 45 - if [ -n "$langVhdl" ]; then 46 - gccLDFlags="$gccLDFlags -L$zlib/lib" 47 - fi 48 - echo "$gccLDFlags" > $out/nix-support/gcc-ldflags 49 - 50 - # GCC shows $gcc/lib in `gcc -print-search-dirs', but not 51 - # $gcc/lib64 (even though it does actually search there...).. 52 - # This confuses libtool. So add it to the compiler tool search 53 - # path explicitly. 54 - if test -e "$gcc/lib64"; then 55 - gccCFlags="$gccCFlags -B$gcc/lib64" 56 - fi 57 - 58 - # Find the gcc libraries path (may work only without multilib) 59 - if [ -n "$langAda" ]; then 60 - basePath=`echo $gcc/lib/*/*/*` 61 - gccCFlags="$gccCFlags -B$basePath -I$basePath/adainclude" 62 - 63 - gnatCFlags="-aI$basePath/adainclude -aO$basePath/adalib" 64 - echo "$gnatCFlags" > $out/nix-support/gnat-cflags 65 - fi 66 - echo "$gccCFlags" > $out/nix-support/gcc-cflags 67 - 68 - gccPath="$gcc/bin" 69 - # On Illumos/Solaris we might prefer native ld 70 - if test -n "$nativePrefix"; then 71 - ldPath="$nativePrefix/bin" 72 - else 73 - ldPath="$binutils/bin" 74 - fi; 75 - fi 76 - 77 - 78 - doSubstitute() { 79 - local src=$1 80 - local dst=$2 81 - local ld="$ldPath/ld" 82 - if $ld -V 2>&1 |grep Solaris; then 83 - # Use Solaris specific linker wrapper 84 - ld="$out/bin/ld-solaris" 85 - fi 86 - # Can't use substitute() here, because replace may not have been 87 - # built yet (in the bootstrap). 88 - sed \ 89 - -e "s^@out@^$out^g" \ 90 - -e "s^@shell@^$shell^g" \ 91 - -e "s^@gcc@^$gcc^g" \ 92 - -e "s^@gccProg@^$gccProg^g" \ 93 - -e "s^@gnatProg@^$gnatProg^g" \ 94 - -e "s^@gnatlinkProg@^$gnatlinkProg^g" \ 95 - -e "s^@binutils@^$binutils^g" \ 96 - -e "s^@coreutils@^$coreutils^g" \ 97 - -e "s^@libc@^$libc^g" \ 98 - -e "s^@ld@^$ld^g" \ 99 - < "$src" > "$dst" 100 - } 101 - 102 - 103 - # Make wrapper scripts around gcc, g++, and gfortran. Also make symlinks 104 - # cc, c++, and f77. 105 - mkGccWrapper() { 106 - local dst=$1 107 - local src=$2 108 - 109 - if ! test -f "$src"; then 110 - echo "$src does not exist (skipping)" 111 - return 1 112 - fi 113 - 114 - gccProg="$src" 115 - doSubstitute "$gccWrapper" "$dst" 116 - chmod +x "$dst" 117 - } 118 - 119 - mkGnatWrapper() { 120 - local dst=$1 121 - local src=$2 122 - 123 - if ! test -f "$src"; then 124 - echo "$src does not exist (skipping)" 125 - return 1 126 - fi 127 - 128 - gnatProg="$src" 129 - doSubstitute "$gnatWrapper" "$dst" 130 - chmod +x "$dst" 131 - } 132 - 133 - mkGnatLinkWrapper() { 134 - local dst=$1 135 - local src=$2 136 - 137 - if ! test -f "$src"; then 138 - echo "$src does not exist (skipping)" 139 - return 1 140 - fi 141 - 142 - gnatlinkProg="$src" 143 - doSubstitute "$gnatlinkWrapper" "$dst" 144 - chmod +x "$dst" 145 - } 146 - 147 - if mkGccWrapper $out/bin/gcc $gccPath/gcc 148 - then 149 - ln -sv gcc $out/bin/cc 150 - fi 151 - 152 - if mkGccWrapper $out/bin/g++ $gccPath/g++ 153 - then 154 - ln -sv g++ $out/bin/c++ 155 - fi 156 - 157 - mkGccWrapper $out/bin/cpp $gccPath/cpp || true 158 - 159 - if mkGccWrapper $out/bin/gfortran $gccPath/gfortran 160 - then 161 - ln -sv gfortran $out/bin/g77 162 - ln -sv gfortran $out/bin/f77 163 - fi 164 - 165 - mkGccWrapper $out/bin/gcj $gccPath/gcj || true 166 - 167 - mkGccWrapper $out/bin/gccgo $gccPath/gccgo || true 168 - 169 - mkGccWrapper $out/bin/gnatgcc $gccPath/gnatgcc || true 170 - mkGnatWrapper $out/bin/gnatmake $gccPath/gnatmake || true 171 - mkGnatWrapper $out/bin/gnatbind $gccPath/gnatbind || true 172 - mkGnatLinkWrapper $out/bin/gnatlink $gccPath/gnatlink || true 173 - 174 - if [ -f $gccPath/ghdl ]; then 175 - ln -sf $gccPath/ghdl $out/bin/ghdl 176 - fi 177 - 178 - 179 - # Create a symlink to as (the assembler). This is useful when a 180 - # gcc-wrapper is installed in a user environment, as it ensures that 181 - # the right assembler is called. 182 - ln -s $ldPath/as $out/bin/as 183 - 184 - 185 - # Make a wrapper around the linker. 186 - doSubstitute "$ldWrapper" "$out/bin/ld" 187 - chmod +x "$out/bin/ld" 188 - 189 - # Copy solaris ld wrapper if needed 190 - if $ldPath/ld -V 2>&1 |grep Solaris; then 191 - # Use Solaris specific linker wrapper 192 - sed -e "s^@ld@^$ldPath/ld^g" < "$ldSolarisWrapper" > "$out/bin/ld-solaris" 193 - chmod +x "$out/bin/ld-solaris" 194 - fi 195 - 196 - 197 - # Emit a setup hook. Also store the path to the original GCC and 198 - # Glibc. 199 - test -n "$gcc" && echo $gcc > $out/nix-support/orig-gcc 200 - test -n "$libc" && echo $libc > $out/nix-support/orig-libc 201 - 202 - doSubstitute "$addFlags" "$out/nix-support/add-flags.sh" 203 - 204 - doSubstitute "$setupHook" "$out/nix-support/setup-hook" 205 - 206 - cp -p $utils $out/nix-support/utils.sh 207 - 208 - 209 - # Propagate the wrapped gcc so that if you install the wrapper, you get 210 - # tools like gcov, the manpages, etc. as well (including for binutils 211 - # and Glibc). 212 - if test -z "$nativeTools"; then 213 - echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages 214 - fi
+199 -45
pkgs/build-support/gcc-wrapper/default.nix
··· 1 - # The Nix `gcc' stdenv.mkDerivation is not directly usable, since it doesn't 2 - # know where the C library and standard header files are. Therefore 3 - # the compiler produced by that package cannot be installed directly 4 - # in a user environment and used from the command line. This 5 - # stdenv.mkDerivation provides a wrapper that sets up the right environment 6 - # variables so that the compiler and the linker just "work". 1 + # The Nixpkgs GCC is not directly usable, since it doesn't know where 2 + # the C library and standard header files are. Therefore the compiler 3 + # produced by that package cannot be installed directly in a user 4 + # environment and used from the command line. So we use a wrapper 5 + # script that sets up the right environment variables so that the 6 + # compiler and the linker just "work". 7 7 8 8 { name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? "" 9 - , gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? "" 10 - , zlib ? null 9 + , gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell 10 + , zlib ? null, extraPackages ? [] 11 11 }: 12 12 13 + with stdenv.lib; 14 + 13 15 assert nativeTools -> nativePrefix != ""; 14 16 assert !nativeTools -> gcc != null && binutils != null && coreutils != null; 15 17 assert !nativeLibc -> libc != null; 16 18 17 - # For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper 18 - assert (gcc != null && gcc ? langVhdl && gcc.langVhdl) -> zlib != null; 19 + # For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper. 20 + assert gcc.langVhdl or false -> zlib != null; 19 21 20 22 let 21 23 22 24 gccVersion = (builtins.parseDrvName gcc.name).version; 23 25 gccName = (builtins.parseDrvName gcc.name).name; 24 26 25 - langGo = if nativeTools then false else gcc ? langGo && gcc.langGo; 26 27 in 27 28 28 29 stdenv.mkDerivation { ··· 30 31 (if name != "" then name else gccName + "-wrapper") + 31 32 (if gcc != null && gccVersion != "" then "-" + gccVersion else ""); 32 33 33 - builder = ./builder.sh; 34 - setupHook = ./setup-hook.sh; 35 - gccWrapper = ./gcc-wrapper.sh; 36 - gnatWrapper = ./gnat-wrapper.sh; 37 - gnatlinkWrapper = ./gnatlink-wrapper.sh; 38 - ldWrapper = ./ld-wrapper.sh; 39 - ldSolarisWrapper = ./ld-solaris-wrapper.sh; 40 - utils = ./utils.sh; 41 - addFlags = ./add-flags; 34 + preferLocalBuild = true; 42 35 43 - inherit nativeTools nativeLibc nativePrefix gcc; 36 + inherit gcc shell; 44 37 libc = if nativeLibc then null else libc; 45 38 binutils = if nativeTools then null else binutils; 46 - # The wrapper scripts use 'cat', so we may need coreutils 39 + # The wrapper scripts use 'cat', so we may need coreutils. 47 40 coreutils = if nativeTools then null else coreutils; 48 41 49 - langC = if nativeTools then true else gcc.langC; 50 - langCC = if nativeTools then true else gcc.langCC; 51 - langFortran = if nativeTools then false else gcc ? langFortran; 52 - langAda = if nativeTools then false else gcc ? langAda && gcc.langAda; 53 - langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl; 54 - zlib = if gcc != null && gcc ? langVhdl then zlib else null; 55 - shell = if shell == "" then stdenv.shell else 56 - if builtins.isAttrs shell then (shell + shell.shellPath) 57 - else shell; 42 + passthru = { inherit nativeTools nativeLibc nativePrefix; }; 43 + 44 + buildCommand = 45 + '' 46 + mkdir -p $out/bin $out/nix-support 47 + 48 + wrap() { 49 + local dst="$1" 50 + local wrapper="$2" 51 + export prog="$3" 52 + substituteAll "$wrapper" "$out/bin/$dst" 53 + chmod +x "$out/bin/$dst" 54 + } 55 + '' 56 + 57 + + optionalString (!nativeLibc) '' 58 + dynamicLinker="$libc/lib/$dynamicLinker" 59 + echo $dynamicLinker > $out/nix-support/dynamic-linker 60 + 61 + if [ -e $libc/lib/32/ld-linux.so.2 ]; then 62 + echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32 63 + fi 64 + 65 + # The "-B$libc/lib/" flag is a quick hack to force gcc to link 66 + # against the crt1.o from our own glibc, rather than the one in 67 + # /usr/lib. (This is only an issue when using an `impure' 68 + # compiler/linker, i.e., one that searches /usr/lib and so on.) 69 + # 70 + # Unfortunately, setting -B appears to override the default search 71 + # path. Thus, the gcc-specific "../includes-fixed" directory is 72 + # now longer searched and glibc's <limits.h> header fails to 73 + # compile, because it uses "#include_next <limits.h>" to find the 74 + # limits.h file in ../includes-fixed. To remedy the problem, 75 + # another -idirafter is necessary to add that directory again. 76 + echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags 77 + 78 + echo "-L$libc/lib" > $out/nix-support/libc-ldflags 79 + 80 + # The dynamic linker is passed in `ldflagsBefore' to allow 81 + # explicit overrides of the dynamic linker by callers to gcc/ld 82 + # (the *last* value counts, so ours should come first). 83 + echo "-dynamic-linker" $dynamicLinker > $out/nix-support/libc-ldflags-before 84 + 85 + echo $libc > $out/nix-support/orig-libc 86 + '' 87 + 88 + + (if nativeTools then '' 89 + gccPath="${nativePrefix}/bin" 90 + ldPath="${nativePrefix}/bin" 91 + '' else '' 92 + echo $gcc > $out/nix-support/orig-gcc 93 + 94 + # GCC shows $gcc/lib in `gcc -print-search-dirs', but not 95 + # $gcc/lib64 (even though it does actually search there...).. 96 + # This confuses libtool. So add it to the compiler tool search 97 + # path explicitly. 98 + if [ -e "$gcc/lib64" -a ! -L "$gcc/lib64" ]; then 99 + gccLDFlags+=" -L$gcc/lib64" 100 + gccCFlags+=" -B$gcc/lib64" 101 + fi 102 + gccLDFlags+=" -L$gcc/lib" 103 + 104 + ${optionalString gcc.langVhdl or false '' 105 + gccLDFlags+=" -L${zlib}/lib" 106 + ''} 107 + 108 + # Find the gcc libraries path (may work only without multilib). 109 + ${optionalString gcc.langAda or false '' 110 + basePath=`echo $gcc/lib/*/*/*` 111 + gccCFlags+=" -B$basePath -I$basePath/adainclude" 112 + gnatCFlags="-aI$basePath/adainclude -aO$basePath/adalib" 113 + echo "$gnatCFlags" > $out/nix-support/gnat-cflags 114 + ''} 115 + 116 + echo "$gccLDFlags" > $out/nix-support/gcc-ldflags 117 + echo "$gccCFlags" > $out/nix-support/gcc-cflags 118 + 119 + gccPath="$gcc/bin" 120 + ldPath="$binutils/bin" 121 + 122 + # Propagate the wrapped gcc so that if you install the wrapper, 123 + # you get tools like gcov, the manpages, etc. as well (including 124 + # for binutils and Glibc). 125 + echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages 126 + 127 + echo ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs 128 + '' 129 + 130 + + optionalString (stdenv.isSunOS && nativePrefix != "") '' 131 + # Solaris needs an additional ld wrapper. 132 + ldPath="${nativePrefix}/bin" 133 + ld="$out/bin/ld-solaris" 134 + wrap ld-solaris ${./ld-solaris-wrapper.sh} 135 + '') 136 + 137 + + '' 138 + # Create a symlink to as (the assembler). This is useful when a 139 + # gcc-wrapper is installed in a user environment, as it ensures that 140 + # the right assembler is called. 141 + if [ -e $ldPath/as ]; then 142 + ln -s $ldPath/as $out/bin/as 143 + fi 144 + 145 + wrap ld ${./ld-wrapper.sh} ''${ld:-$ldPath/ld} 146 + 147 + if [ -e $binutils/bin/ld.gold ]; then 148 + wrap ld.gold ${./ld-wrapper.sh} $binutils/bin/ld.gold 149 + fi 150 + 151 + if [ -e $binutils/bin/ld.bfd ]; then 152 + wrap ld.bfd ${./ld-wrapper.sh} $binutils/bin/ld.bfd 153 + fi 154 + 155 + if [ -e $gccPath/gcc ]; then 156 + wrap gcc ${./gcc-wrapper.sh} $gccPath/gcc 157 + ln -s gcc $out/bin/cc 158 + elif [ -e $gccPath/clang ]; then 159 + wrap clang ${./gcc-wrapper.sh} $gccPath/clang 160 + ln -s clang $out/bin/cc 161 + fi 162 + 163 + if [ -e $gccPath/g++ ]; then 164 + wrap g++ ${./gcc-wrapper.sh} $gccPath/g++ 165 + ln -s g++ $out/bin/c++ 166 + elif [ -e $gccPath/clang++ ]; then 167 + wrap clang++ ${./gcc-wrapper.sh} $gccPath/clang++ 168 + ln -s clang++ $out/bin/c++ 169 + fi 170 + 171 + if [ -e $gccPath/cpp ]; then 172 + wrap cpp ${./gcc-wrapper.sh} $gccPath/cpp 173 + fi 174 + '' 175 + 176 + + optionalString gcc.langFortran or false '' 177 + wrap gfortran ${./gcc-wrapper.sh} $gccPath/gfortran 178 + ln -sv gfortran $out/bin/g77 179 + ln -sv gfortran $out/bin/f77 180 + '' 181 + 182 + + optionalString gcc.langJava or false '' 183 + wrap gcj ${./gcc-wrapper.sh} $gccPath/gcj 184 + '' 185 + 186 + + optionalString gcc.langGo or false '' 187 + wrap gccgo ${./gcc-wrapper.sh} $gccPath/gccgo 188 + '' 189 + 190 + + optionalString gcc.langAda or false '' 191 + wrap gnatgcc ${./gcc-wrapper.sh} $gccPath/gnatgcc 192 + wrap gnatmake ${./gnat-wrapper.sh} $gccPath/gnatmake 193 + wrap gnatbind ${./gnat-wrapper.sh} $gccPath/gnatbind 194 + wrap gnatlink ${./gnatlink-wrapper.sh} $gccPath/gnatlink 195 + '' 196 + 197 + + optionalString gcc.langVhdl or false '' 198 + ln -s $gccPath/ghdl $out/bin/ghdl 199 + '' 200 + 201 + + '' 202 + substituteAll ${./setup-hook.sh} $out/nix-support/setup-hook 203 + substituteAll ${./add-flags} $out/nix-support/add-flags.sh 204 + cp -p ${./utils.sh} $out/nix-support/utils.sh 205 + 206 + if [ -e $out/bin/clang ]; then 207 + echo 'export CC; : ''${CC:=clang}' >> $out/nix-support/setup-hook 208 + fi 209 + 210 + if [ -e $out/bin/clang++ ]; then 211 + echo 'export CXX; : ''${CXX:=clang++}' >> $out/nix-support/setup-hook 212 + fi 213 + ''; 214 + 215 + # The dynamic linker has different names on different Linux platforms. 216 + dynamicLinker = 217 + if !nativeLibc then 218 + (if stdenv.system == "i686-linux" then "ld-linux.so.2" else 219 + if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else 220 + # ARM with a wildcard, which can be "" or "-armhf". 221 + if stdenv.isArm then "ld-linux*.so.3" else 222 + if stdenv.system == "powerpc-linux" then "ld.so.1" else 223 + if stdenv.system == "mips64el-linux" then "ld.so.1" else 224 + abort "Don't know the name of the dynamic linker for this platform.") 225 + else ""; 58 226 59 227 crossAttrs = { 60 228 shell = shell.crossDrv + shell.crossDrv.shellPath; ··· 73 241 abort "don't know the name of the dynamic linker for this platform"); 74 242 }; 75 243 76 - preferLocalBuild = true; 77 - 78 244 meta = 79 245 let gcc_ = if gcc != null then gcc else {}; in 80 246 (if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) // ··· 82 248 stdenv.lib.attrByPath ["meta" "description"] "System C compiler" gcc_ 83 249 + " (wrapper script)"; 84 250 }; 85 - 86 - # The dynamic linker has different names on different Linux platforms. 87 - dynamicLinker = 88 - if !nativeLibc then 89 - (if stdenv.system == "i686-linux" then "ld-linux.so.2" else 90 - if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else 91 - # ARM with a wildcard, which can be "" or "-armhf". 92 - if stdenv.isArm then "ld-linux*.so.3" else 93 - if stdenv.system == "powerpc-linux" then "ld.so.1" else 94 - if stdenv.system == "mips64el-linux" then "ld.so.1" else 95 - abort "don't know the name of the dynamic linker for this platform") 96 - else ""; 97 251 }
+35 -45
pkgs/build-support/gcc-wrapper/gcc-wrapper.sh
··· 1 1 #! @shell@ -e 2 2 3 - if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then 3 + if [ -n "$NIX_GCC_WRAPPER_START_HOOK" ]; then 4 4 source "$NIX_GCC_WRAPPER_START_HOOK" 5 5 fi 6 6 7 - if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then 7 + if [ -z "$NIX_GCC_WRAPPER_FLAGS_SET" ]; then 8 8 source @out@/nix-support/add-flags.sh 9 9 fi 10 10 ··· 18 18 nonFlagArgs=0 19 19 20 20 for i in "$@"; do 21 - if test "$i" = "-c"; then 21 + if [ "$i" = -c ]; then 22 22 dontLink=1 23 - elif test "$i" = "-S"; then 23 + elif [ "$i" = -S ]; then 24 24 dontLink=1 25 - elif test "$i" = "-E"; then 25 + elif [ "$i" = -E ]; then 26 26 dontLink=1 27 - elif test "$i" = "-E"; then 27 + elif [ "$i" = -E ]; then 28 28 dontLink=1 29 - elif test "$i" = "-M"; then 29 + elif [ "$i" = -M ]; then 30 30 dontLink=1 31 - elif test "$i" = "-MM"; then 31 + elif [ "$i" = -MM ]; then 32 32 dontLink=1 33 - elif test "$i" = "-x"; then 33 + elif [ "$i" = -x ]; then 34 34 # At least for the cases c-header or c++-header we should set dontLink. 35 35 # I expect no one use -x other than making precompiled headers. 36 36 dontLink=1 37 - elif test "${i:0:1}" != "-"; then 37 + elif [ "${i:0:1}" != - ]; then 38 38 nonFlagArgs=1 39 - elif test "$i" = "-m32"; then 40 - if test -e @out@/nix-support/dynamic-linker-m32; then 39 + elif [ "$i" = -m32 ]; then 40 + if [ -e @out@/nix-support/dynamic-linker-m32 ]; then 41 41 NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" 42 42 fi 43 43 fi ··· 48 48 # "-c" flag). So if no non-flag arguments are given, don't pass any 49 49 # linker flags. This catches cases like "gcc" (should just print 50 50 # "gcc: no input files") and "gcc -v" (should print the version). 51 - if test "$nonFlagArgs" = "0"; then 51 + if [ "$nonFlagArgs" = 0 ]; then 52 52 dontLink=1 53 53 fi 54 54 55 55 56 56 # Optionally filter out paths not refering to the store. 57 57 params=("$@") 58 - if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then 58 + if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then 59 59 rest=() 60 60 n=0 61 - while test $n -lt ${#params[*]}; do 61 + while [ $n -lt ${#params[*]} ]; do 62 62 p=${params[n]} 63 63 p2=${params[$((n+1))]} 64 - if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then 64 + if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then 65 65 skip $p 66 - elif test "$p" = "-L" && badPath "$p2"; then 66 + elif [ "$p" = -L ] && badPath "$p2"; then 67 67 n=$((n + 1)); skip $p2 68 - elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then 68 + elif [ "${p:0:3}" = -I/ ] && badPath "${p:2}"; then 69 69 skip $p 70 - elif test "$p" = "-I" && badPath "$p2"; then 70 + elif [ "$p" = -I ] && badPath "$p2"; then 71 71 n=$((n + 1)); skip $p2 72 - elif test "$p" = "-isystem" && badPath "$p2"; then 72 + elif [ "$p" = -isystem ] && badPath "$p2"; then 73 73 n=$((n + 1)); skip $p2 74 74 else 75 75 rest=("${rest[@]}" "$p") ··· 86 86 87 87 # When enforcing purity, pretend gcc can't find the current date and 88 88 # time 89 - if test "$NIX_ENFORCE_PURITY" = "1"; then 89 + if [ "$NIX_ENFORCE_PURITY" = 1 ]; then 90 90 extraAfter+=('-D__DATE__="Jan 01 1970"' 91 91 '-D__TIME__="00:00:01"' 92 92 -Wno-builtin-macro-redefined) 93 93 fi 94 94 95 95 96 - if test "$dontLink" != "1"; then 96 + if [ "$dontLink" != 1 ]; then 97 97 98 98 # Add the flags that should only be passed to the compiler when 99 99 # linking. ··· 105 105 extraBefore=(${extraBefore[@]} "-Wl,$i") 106 106 done 107 107 for i in $NIX_LDFLAGS; do 108 - if test "${i:0:3}" = "-L/"; then 109 - extraAfter+=("$i") 110 - else 111 - extraAfter+=("-Wl,$i") 112 - fi 108 + if [ "${i:0:3}" = -L/ ]; then 109 + extraAfter+=("$i") 110 + else 111 + extraAfter+=("-Wl,$i") 112 + fi 113 113 done 114 114 export NIX_LDFLAGS_SET=1 115 115 fi ··· 118 118 # add anything. This is to prevent `gcc -v' (which normally prints 119 119 # out the version number and returns exit code 0) from printing out 120 120 # `No input files specified' and returning exit code 1. 121 - if test "$*" = "-v"; then 121 + if [ "$*" = -v ]; then 122 122 extraAfter=() 123 123 extraBefore=() 124 - fi 124 + fi 125 125 126 126 # Optionally print debug info. 127 - if test "$NIX_DEBUG" = "1"; then 128 - echo "original flags to @gccProg@:" >&2 127 + if [ -n "$NIX_DEBUG" ]; then 128 + echo "original flags to @prog@:" >&2 129 129 for i in "${params[@]}"; do 130 130 echo " $i" >&2 131 131 done 132 - echo "extraBefore flags to @gccProg@:" >&2 132 + echo "extraBefore flags to @prog@:" >&2 133 133 for i in ${extraBefore[@]}; do 134 134 echo " $i" >&2 135 135 done 136 - echo "extraAfter flags to @gccProg@:" >&2 136 + echo "extraAfter flags to @prog@:" >&2 137 137 for i in ${extraAfter[@]}; do 138 138 echo " $i" >&2 139 139 done 140 140 fi 141 141 142 - if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then 142 + if [ -n "$NIX_GCC_WRAPPER_EXEC_HOOK" ]; then 143 143 source "$NIX_GCC_WRAPPER_EXEC_HOOK" 144 144 fi 145 145 146 - 147 - # Call the real `gcc'. Filter out warnings from stderr about unused 148 - # `-B' flags, since they confuse some programs. Deep bash magic to 149 - # apply grep to stderr (by swapping stdin/stderr twice). 150 - if test -z "$NIX_GCC_NEEDS_GREP"; then 151 - @gccProg@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}" 152 - else 153 - (@gccProg@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}" 3>&2 2>&1 1>&3- \ 154 - | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- 155 - exit $? 156 - fi 146 + exec @prog@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}"
+20 -30
pkgs/build-support/gcc-wrapper/gnat-wrapper.sh
··· 1 1 #! @shell@ -e 2 2 3 - if test -n "$NIX_GNAT_WRAPPER_START_HOOK"; then 3 + if [ -n "$NIX_GNAT_WRAPPER_START_HOOK" ]; then 4 4 source "$NIX_GNAT_WRAPPER_START_HOOK" 5 5 fi 6 6 7 - if test -z "$NIX_GNAT_WRAPPER_FLAGS_SET"; then 7 + if [ -z "$NIX_GNAT_WRAPPER_FLAGS_SET" ]; then 8 8 source @out@/nix-support/add-flags.sh 9 9 fi 10 10 ··· 18 18 nonFlagArgs=0 19 19 20 20 for i in "$@"; do 21 - if test "$i" = "-c"; then 21 + if [ "$i" = -c ]; then 22 22 dontLink=1 23 - elif test "$i" = "-M"; then 23 + elif [ "$i" = -M ]; then 24 24 dontLink=1 25 - elif test "${i:0:1}" != "-"; then 25 + elif [ "${i:0:1}" != - ]; then 26 26 nonFlagArgs=1 27 - elif test "$i" = "-m32"; then 28 - if test -e @out@/nix-support/dynamic-linker-m32; then 27 + elif [ "$i" = -m32 ]; then 28 + if [ -e @out@/nix-support/dynamic-linker-m32 ]; then 29 29 NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" 30 30 fi 31 31 fi ··· 36 36 # "-c" flag). So if no non-flag arguments are given, don't pass any 37 37 # linker flags. This catches cases like "gcc" (should just print 38 38 # "gcc: no input files") and "gcc -v" (should print the version). 39 - if test "$nonFlagArgs" = "0"; then 39 + if [ "$nonFlagArgs" = 0 ]; then 40 40 dontLink=1 41 41 fi 42 42 43 43 44 44 # Optionally filter out paths not refering to the store. 45 45 params=("$@") 46 - if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then 46 + if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then 47 47 rest=() 48 48 n=0 49 - while test $n -lt ${#params[*]}; do 49 + while [ $n -lt ${#params[*]} ]; do 50 50 p=${params[n]} 51 51 p2=${params[$((n+1))]} 52 - if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then 52 + if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then 53 53 skip $p 54 - elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then 54 + elif [ "${p:0:3}" = -I/ ] && badPath "${p:2}"; then 55 55 skip $p 56 - elif test "${p:0:4}" = "-aI/" && badPath "${p:3}"; then 56 + elif [ "${p:0:4}" = -aI/ ] && badPath "${p:3}"; then 57 57 skip $p 58 - elif test "${p:0:4}" = "-aO/" && badPath "${p:3}"; then 58 + elif [ "${p:0:4}" = -aO/ ] && badPath "${p:3}"; then 59 59 skip $p 60 60 else 61 61 rest=("${rest[@]}" "$p") ··· 81 81 #done 82 82 83 83 # Optionally print debug info. 84 - if test "$NIX_DEBUG" = "1"; then 85 - echo "original flags to @gnatProg@:" >&2 84 + if [ -n "$NIX_DEBUG" ]; then 85 + echo "original flags to @prog@:" >&2 86 86 for i in "${params[@]}"; do 87 87 echo " $i" >&2 88 88 done 89 - echo "extraBefore flags to @gnatProg@:" >&2 89 + echo "extraBefore flags to @prog@:" >&2 90 90 for i in ${extraBefore[@]}; do 91 91 echo " $i" >&2 92 92 done 93 - echo "extraAfter flags to @gnatProg@:" >&2 93 + echo "extraAfter flags to @prog@:" >&2 94 94 for i in ${extraAfter[@]}; do 95 95 echo " $i" >&2 96 96 done 97 97 fi 98 98 99 - if test -n "$NIX_GNAT_WRAPPER_EXEC_HOOK"; then 99 + if [ -n "$NIX_GNAT_WRAPPER_EXEC_HOOK" ]; then 100 100 source "$NIX_GNAT_WRAPPER_EXEC_HOOK" 101 101 fi 102 102 103 - 104 - # Call the real `gcc'. Filter out warnings from stderr about unused 105 - # `-B' flags, since they confuse some programs. Deep bash magic to 106 - # apply grep to stderr (by swapping stdin/stderr twice). 107 - if test -z "$NIX_GNAT_NEEDS_GREP"; then 108 - @gnatProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 109 - else 110 - (@gnatProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ 111 - | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- 112 - exit $? 113 - fi 103 + exec @prog@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
+1 -1
pkgs/build-support/gcc-wrapper/ld-solaris-wrapper.sh
··· 6 6 # I've also tried adding -z direct and -z lazyload, but it gave too many problems with C++ exceptions :'( 7 7 # Also made sure libgcc would not be lazy-loaded, as suggested here: https://www.illumos.org/issues/2534#note-3 8 8 # but still no success. 9 - cmd="@ld@ -z ignore" 9 + cmd="@prog@ -z ignore" 10 10 11 11 args=("$@"); 12 12
+31 -31
pkgs/build-support/gcc-wrapper/ld-wrapper.sh
··· 1 1 #! @shell@ -e 2 2 3 - if test -n "$NIX_LD_WRAPPER_START_HOOK"; then 3 + if [ -n "$NIX_LD_WRAPPER_START_HOOK" ]; then 4 4 source "$NIX_LD_WRAPPER_START_HOOK" 5 5 fi 6 6 7 - if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then 7 + if [ -z "$NIX_GCC_WRAPPER_FLAGS_SET" ]; then 8 8 source @out@/nix-support/add-flags.sh 9 9 fi 10 10 ··· 13 13 14 14 # Optionally filter out paths not refering to the store. 15 15 params=("$@") 16 - if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \ 17 - -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \); then 16 + if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" \ 17 + -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \) ]; then 18 18 rest=() 19 19 n=0 20 - while test $n -lt ${#params[*]}; do 20 + while [ $n -lt ${#params[*]} ]; do 21 21 p=${params[n]} 22 22 p2=${params[$((n+1))]} 23 - if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then 23 + if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then 24 24 skip $p 25 - elif test "$p" = "-L" && badPath "$p2"; then 25 + elif [ "$p" = -L ] && badPath "$p2"; then 26 26 n=$((n + 1)); skip $p2 27 - elif test "$p" = "-rpath" && badPath "$p2"; then 27 + elif [ "$p" = -rpath ] && badPath "$p2"; then 28 28 n=$((n + 1)); skip $p2 29 - elif test "$p" = "-dynamic-linker" && badPath "$p2"; then 29 + elif [ "$p" = -dynamic-linker ] && badPath "$p2"; then 30 30 n=$((n + 1)); skip $p2 31 - elif test "${p:0:1}" = "/" && badPath "$p"; then 31 + elif [ "${p:0:1}" = / ] && badPath "$p"; then 32 32 # We cannot skip this; barf. 33 33 echo "impure path \`$p' used in link" >&2 34 34 exit 1 35 - elif test "${p:0:9}" = "--sysroot"; then 35 + elif [ "${p:0:9}" = --sysroot ]; then 36 36 # Our ld is not built with sysroot support (Can we fix that?) 37 37 : 38 38 else ··· 47 47 extra=() 48 48 extraBefore=() 49 49 50 - if test -z "$NIX_LDFLAGS_SET"; then 50 + if [ -z "$NIX_LDFLAGS_SET" ]; then 51 51 extra+=($NIX_LDFLAGS) 52 52 extraBefore+=($NIX_LDFLAGS_BEFORE) 53 53 fi ··· 56 56 57 57 58 58 # Add all used dynamic libraries to the rpath. 59 - if test "$NIX_DONT_SET_RPATH" != "1"; then 59 + if [ "$NIX_DONT_SET_RPATH" != 1 ]; then 60 60 61 61 libPath="" 62 62 addToLibPath() { 63 63 local path="$1" 64 - if test "${path:0:1}" != "/"; then return 0; fi 64 + if [ "${path:0:1}" != / ]; then return 0; fi 65 65 case "$path" in 66 66 *..*|*./*|*/.*|*//*) 67 67 local path2 ··· 75 75 esac 76 76 libPath="$libPath $path " 77 77 } 78 - 78 + 79 79 addToRPath() { 80 80 # If the path is not in the store, don't add it to the rpath. 81 81 # This typically happens for libraries in /tmp that are later 82 82 # copied to $out/lib. If not, we're screwed. 83 - if test "${1:0:${#NIX_STORE}}" != "$NIX_STORE"; then return 0; fi 83 + if [ "${1:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then return 0; fi 84 84 case $rpath in 85 85 *\ $1\ *) return 0 ;; 86 86 esac ··· 97 97 # First, find all -L... switches. 98 98 allParams=("${params[@]}" ${extra[@]}) 99 99 n=0 100 - while test $n -lt ${#allParams[*]}; do 100 + while [ $n -lt ${#allParams[*]} ]; do 101 101 p=${allParams[n]} 102 102 p2=${allParams[$((n+1))]} 103 - if test "${p:0:3}" = "-L/"; then 103 + if [ "${p:0:3}" = -L/ ]; then 104 104 addToLibPath ${p:2} 105 - elif test "$p" = "-L"; then 105 + elif [ "$p" = -L ]; then 106 106 addToLibPath ${p2} 107 107 n=$((n + 1)) 108 - elif test "$p" = "-l"; then 108 + elif [ "$p" = -l ]; then 109 109 addToLibs ${p2} 110 110 n=$((n + 1)) 111 - elif test "${p:0:2}" = "-l"; then 111 + elif [ "${p:0:2}" = -l ]; then 112 112 addToLibs ${p:2} 113 - elif test "$p" = "-dynamic-linker"; then 114 - # Ignore the dynamic linker argument, or it 113 + elif [ "$p" = -dynamic-linker ]; then 114 + # Ignore the dynamic linker argument, or it 115 115 # will get into the next 'elif'. We don't want 116 116 # the dynamic linker path rpath to go always first. 117 117 n=$((n + 1)) ··· 129 129 # so, add the directory to the rpath. 130 130 # It's important to add the rpath in the order of -L..., so 131 131 # the link time chosen objects will be those of runtime linking. 132 - 132 + 133 133 for i in $libPath; do 134 134 for j in $libs; do 135 - if test -f "$i/lib$j.so"; then 135 + if [ -f "$i/lib$j.so" ]; then 136 136 addToRPath $i 137 137 break 138 138 fi 139 139 done 140 140 done 141 - 141 + 142 142 143 143 # Finally, add `-rpath' switches. 144 144 for i in $rpath; do ··· 148 148 149 149 150 150 # Optionally print debug info. 151 - if test "$NIX_DEBUG" = "1"; then 152 - echo "original flags to @ld@:" >&2 151 + if [ -n "$NIX_DEBUG" ]; then 152 + echo "original flags to @prog@:" >&2 153 153 for i in "${params[@]}"; do 154 154 echo " $i" >&2 155 155 done 156 - echo "extra flags to @ld@:" >&2 156 + echo "extra flags to @prog@:" >&2 157 157 for i in ${extra[@]}; do 158 158 echo " $i" >&2 159 159 done 160 160 fi 161 161 162 - if test -n "$NIX_LD_WRAPPER_EXEC_HOOK"; then 162 + if [ -n "$NIX_LD_WRAPPER_EXEC_HOOK" ]; then 163 163 source "$NIX_LD_WRAPPER_EXEC_HOOK" 164 164 fi 165 165 166 - exec @ld@ ${extraBefore[@]} "${params[@]}" ${extra[@]} 166 + exec @prog@ ${extraBefore[@]} "${params[@]}" ${extra[@]}
+10 -10
pkgs/build-support/gcc-wrapper/setup-hook.sh
··· 1 1 export NIX_GCC=@out@ 2 2 3 3 addCVars () { 4 - if test -d $1/include; then 5 - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include" 4 + if [ -d $1/include ]; then 5 + export NIX_CFLAGS_COMPILE+=" -isystem $1/include" 6 6 fi 7 7 8 - if test -d $1/lib64; then 9 - export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64" 8 + if [ -d $1/lib64 -a ! -L $1/lib64 ]; then 9 + export NIX_LDFLAGS+=" -L$1/lib64" 10 10 fi 11 11 12 - if test -d $1/lib; then 13 - export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib" 12 + if [ -d $1/lib ]; then 13 + export NIX_LDFLAGS+=" -L$1/lib" 14 14 fi 15 15 } 16 16 ··· 18 18 19 19 # Note: these come *after* $out in the PATH (see setup.sh). 20 20 21 - if test -n "@gcc@"; then 21 + if [ -n "@gcc@" ]; then 22 22 addToSearchPath PATH @gcc@/bin 23 23 fi 24 24 25 - if test -n "@binutils@"; then 25 + if [ -n "@binutils@" ]; then 26 26 addToSearchPath PATH @binutils@/bin 27 27 fi 28 28 29 - if test -n "@libc@"; then 29 + if [ -n "@libc@" ]; then 30 30 addToSearchPath PATH @libc@/bin 31 31 fi 32 32 33 - if test -n "@coreutils@"; then 33 + if [ -n "@coreutils@" ]; then 34 34 addToSearchPath PATH @coreutils@/bin 35 35 fi
+4 -4
pkgs/build-support/gcc-wrapper/utils.sh
··· 1 1 skip () { 2 - if test "$NIX_DEBUG" = "1"; then 2 + if [ -n "$NIX_DEBUG" ]; then 3 3 echo "skipping impure path $1" >&2 4 4 fi 5 5 } ··· 9 9 # `/nix/store/.../lib/foo.so' isn't. 10 10 badPath() { 11 11 local p=$1 12 - 12 + 13 13 # Relative paths are okay (since they're presumably relative to 14 14 # the temporary build directory). 15 - if test "${p:0:1}" != "/"; then return 1; fi 16 - 15 + if [ "${p:0:1}" != / ]; then return 1; fi 16 + 17 17 # Otherwise, the path should refer to the store or some temporary 18 18 # directory (including the build directory). 19 19 test \
+2 -4
pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh
··· 10 10 # their absolute path (using "install_name_tool -id"). It also 11 11 # rewrites references in other dylibs to absolute paths. 12 12 13 + postFixupHooks+=('fixDarwinDylibNamesIn $prefix') 14 + 13 15 fixDarwinDylibNames() { 14 16 local flags=() 15 17 local old_id ··· 29 31 local dir="$1" 30 32 fixDarwinDylibNames $(find "$dir" -name "*.dylib") 31 33 } 32 - 33 - postFixup() { 34 - fixDarwinDylibNamesIn "$prefix" 35 - }
+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
+4 -2
pkgs/development/compilers/llvm/3.4/llvm.nix
··· 27 27 mv compiler-rt-* $sourceRoot/projects/compiler-rt 28 28 ''; 29 29 30 - buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind; 30 + buildInputs = 31 + [ perl groff cmake libxml2 libffi ] 32 + ++ stdenv.lib.optional (!stdenv.isDarwin) python /* 33 + ++ stdenv.lib.optional stdenv.isLinux valgrind */; 31 34 32 35 propagatedBuildInputs = [ ncurses zlib ]; 33 36 ··· 65 68 license = stdenv.lib.licenses.bsd3; 66 69 maintainers = with stdenv.lib.maintainers; [ shlevy lovek323 raskin viric ]; 67 70 platforms = stdenv.lib.platforms.all; 68 - broken = stdenv.isDarwin; 69 71 }; 70 72 }
+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
··· 86 86 87 87 installFlags = stdenv.lib.optionalString docSupport "install-doc"; 88 88 89 + CFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.7"; 90 + 89 91 postInstall = '' 90 92 # Bundler tries to create this directory 91 93 mkdir -pv $out/${passthru.gemPath}
+2 -1
pkgs/development/libraries/apr-util/default.nix
··· 2 2 , sslSupport ? true, openssl 3 3 , bdbSupport ? false, db 4 4 , ldapSupport ? true, openldap 5 + , libiconvOrNull 5 6 }: 6 7 7 8 assert sslSupport -> openssl != null; ··· 28 29 ${stdenv.lib.optionalString ldapSupport "--with-ldap"} 29 30 ''; 30 31 31 - propagatedBuildInputs = [ makeWrapper apr expat ] 32 + propagatedBuildInputs = [ makeWrapper apr expat libiconvOrNull ] 32 33 ++ optional sslSupport openssl 33 34 ++ optional bdbSupport db 34 35 ++ optional ldapSupport openldap;
+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,
+6 -3
pkgs/development/libraries/cyrus-sasl/default.nix
··· 1 - { stdenv, fetchurl, openssl, db, gettext, pam }: 1 + { lib, stdenv, fetchurl, openssl, db, gettext, pam, fixDarwinDylibNames }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "cyrus-sasl-2.1.26"; ··· 8 8 sha256 = "1hvvbcsg21nlncbgs0cgn3iwlnb3vannzwsp6rwvnn9ba4v53g4g"; 9 9 }; 10 10 11 - buildInputs = [ openssl db gettext ] ++ stdenv.lib.optional stdenv.isLinux pam; 11 + buildInputs = 12 + [ openssl db gettext ] 13 + ++ lib.optional stdenv.isLinux pam 14 + ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 12 15 13 16 patches = [ ./missing-size_t.patch ]; # https://bugzilla.redhat.com/show_bug.cgi?id=906519 14 17 patchFlags = "-p0"; ··· 22 25 ) 23 26 ''; 24 27 25 - installFlags = if stdenv.isDarwin then [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ] else null; 28 + installFlags = lib.optional stdenv.isDarwin [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ]; 26 29 27 30 meta = { 28 31 homepage = "http://cyrusimap.web.cmu.edu/";
+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
+30
pkgs/development/libraries/libc++/darwin.patch
··· 1 + diff -ru -x '*~' libcxx-3.4.2.src-orig/lib/CMakeLists.txt libcxx-3.4.2.src/lib/CMakeLists.txt 2 + --- libcxx-3.4.2.src-orig/lib/CMakeLists.txt 2013-11-15 18:18:57.000000000 +0100 3 + +++ libcxx-3.4.2.src/lib/CMakeLists.txt 2014-09-24 14:04:01.000000000 +0200 4 + @@ -56,7 +56,7 @@ 5 + "-compatibility_version 1" 6 + "-current_version ${LIBCXX_VERSION}" 7 + "-install_name /usr/lib/libc++.1.dylib" 8 + - "-Wl,-reexport_library,/usr/lib/libc++abi.dylib" 9 + + "-Wl,-reexport_library,${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib" 10 + "-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp" 11 + "/usr/lib/libSystem.B.dylib") 12 + else() 13 + @@ -64,14 +64,14 @@ 14 + list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7) 15 + if (OSX_HAS_ARMV7) 16 + set(OSX_RE_EXPORT_LINE 17 + - "${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib" 18 + + "${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib" 19 + "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp") 20 + else() 21 + set(OSX_RE_EXPORT_LINE 22 + - "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib") 23 + + "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib") 24 + endif() 25 + else() 26 + - set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp") 27 + + set (OSX_RE_EXPORT_LINE "${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp") 28 + endif() 29 + 30 + list(APPEND link_flags
+20 -10
pkgs/development/libraries/libc++/default.nix
··· 1 - { stdenv, fetchurl, cmake, libcxxabi, python }: 1 + { lib, stdenv, fetchurl, cmake, libcxxabi, fixDarwinDylibNames }: 2 2 3 - let 4 - version = "3.4.2"; 3 + let version = "3.4.2"; in 5 4 6 - in stdenv.mkDerivation rec { 5 + stdenv.mkDerivation rec { 7 6 name = "libc++-${version}"; 8 7 9 8 src = fetchurl { ··· 11 10 sha256 = "0z3jdvgcq995khkpis5c5vaxhbmvbqjlalbhn09k6pgb5zp46rc2"; 12 11 }; 13 12 14 - buildInputs = [ cmake libcxxabi python ]; 13 + patches = [ ./darwin.patch ]; 15 14 16 - cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" 17 - "-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${libcxxabi}/include" 18 - "-DLIBCXX_CXX_ABI=libcxxabi" ]; 15 + buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 16 + 17 + cmakeFlags = 18 + [ "-DCMAKE_BUILD_TYPE=Release" 19 + "-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${libcxxabi}/include" 20 + "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib" 21 + "-DLIBCXX_LIBCPPABI_VERSION=2" 22 + "-DLIBCXX_CXX_ABI=libcxxabi" 23 + ]; 19 24 20 25 enableParallelBuilding = true; 21 26 22 - passthru.abi = libcxxabi; 27 + inherit libcxxabi; 28 + 29 + # Remove a Makefile that causes many retained dependencies. 30 + postInstall = "rm $out/include/c++/v1/Makefile"; 31 + 32 + setupHook = ./setup-hook.sh; 23 33 24 34 meta = { 25 35 homepage = http://libcxx.llvm.org/; 26 36 description = "A new implementation of the C++ standard library, targeting C++11"; 27 37 license = "BSD"; 28 38 maintainers = [ stdenv.lib.maintainers.shlevy ]; 29 - platforms = stdenv.lib.platforms.linux; 39 + platforms = stdenv.lib.platforms.unix; 30 40 }; 31 41 }
+2
pkgs/development/libraries/libc++/setup-hook.sh
··· 1 + export NIX_CFLAGS_COMPILE+=" -isystem @out@/include/c++/v1 -stdlib=libc++" 2 + export NIX_CFLAGS_LINK+=" -stdlib=libc++ -Wl,-rpath,@libcxxabi@/lib"
+17
pkgs/development/libraries/libc++abi/darwin.patch
··· 1 + diff -ru -x '*~' libcxxabi-orig/lib/buildit libcxxabi/lib/buildit 2 + --- libcxxabi-orig/lib/buildit 2014-09-18 16:54:14.000000000 +0200 3 + +++ libcxxabi/lib/buildit 2014-09-24 13:22:27.000000000 +0200 4 + @@ -51,12 +51,8 @@ 5 + -dynamiclib -nodefaultlibs \ 6 + -current_version ${RC_ProjectSourceVersion} \ 7 + -compatibility_version 1 \ 8 + - -install_name /usr/lib/libc++abi.dylib \ 9 + + -install_name $out/lib/libc++abi.dylib \ 10 + -lSystem" 11 + - if [ -f "${SDKROOT}/usr/local/lib/libCrashReporterClient.a" ] 12 + - then 13 + - LDSHARED_FLAGS+=" -lCrashReporterClient" 14 + - fi 15 + ;; 16 + *-*-mingw*) 17 + # FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt
+23 -13
pkgs/development/libraries/libc++abi/default.nix
··· 1 - { stdenv, fetchurl, libcxx, libunwind }: 1 + { lib, stdenv, fetchurl, libcxx, coreutils, gnused }: 2 2 3 3 let rev = "199626"; in 4 4 ··· 10 10 sha256 = "09wr6qwgmdzbmgfkdzfhph9giy0zd6fp3s017fcfy4g0prjn5s4c"; 11 11 }; 12 12 13 - NIX_CFLAGS_LINK = "-L${libunwind}/lib -lunwind"; 13 + patches = [ ./no-stdc++.patch ./darwin.patch ]; 14 + 15 + buildInputs = [ coreutils ]; 14 16 15 17 postUnpack = '' 16 18 unpackFile ${libcxx.src} 17 - export NIX_CFLAGS_COMPILE="-I${libunwind}/include -I$PWD/include -I$(readlink -f libcxx-*)/include" 18 - ''; 19 - 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 19 + '' + lib.optionalString stdenv.isDarwin '' 20 + export TRIPLE=x86_64-apple-darwin 21 + # Hack: NIX_CFLAGS_COMPILE doesn't work here because clang++ isn't 22 + # wrapped at this point. 23 + export CXX="clang++ -D_LIBCXX_DYNAMIC_FALLBACK=1" 26 24 ''; 27 25 28 - patchPhase = "sed -e s,-lstdc++,, -i lib/buildit"; 26 + installPhase = if stdenv.isDarwin 27 + then '' 28 + install -d -m 755 $out/include $out/lib 29 + install -m 644 lib/libc++abi.dylib $out/lib 30 + install -m 644 include/cxxabi.h $out/include 31 + '' 32 + else '' 33 + install -d -m 755 $out/include $out/lib 34 + install -m 644 lib/libc++abi.so.1.0 $out/lib 35 + install -m 644 include/cxxabi.h $out/include 36 + ln -s libc++abi.so.1.0 $out/lib/libc++abi.so 37 + ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 38 + ''; 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 }
+12
pkgs/development/libraries/libc++abi/no-stdc++.patch
··· 1 + diff -ru -x '*~' libcxxabi-orig/lib/buildit libcxxabi/lib/buildit 2 + --- libcxxabi-orig/lib/buildit 2014-09-18 16:54:14.000000000 +0200 3 + +++ libcxxabi/lib/buildit 2014-09-24 13:22:27.000000000 +0200 4 + @@ -70,7 +66,7 @@ 5 + SOEXT=so 6 + LDSHARED_FLAGS="-o libc++abi.so.1.0 \ 7 + -shared -nodefaultlibs -Wl,-soname,libc++abi.so.1 \ 8 + - -lpthread -lrt -lc -lstdc++" 9 + + -lpthread -lrt -lc" 10 + ;; 11 + esac 12 +
+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 configureFlags = [ "--enable-widec" ];
+3 -2
pkgs/development/libraries/libffi/default.nix
··· 16 16 "--with-gcc-arch=generic" # no detection of -march= or -mtune= 17 17 ] ++ stdenv.lib.optional (stdenv.needsPax) "--enable-pax_emutramp"; 18 18 19 - doCheck = stdenv.isLinux; # until we solve dejagnu problems on darwin and expect on BSD 19 + #doCheck = stdenv.isLinux; # until we solve dejagnu problems on darwin and expect on BSD 20 + doCheck = false; 20 21 21 22 dontStrip = stdenv ? cross; # Don't run the native `strip' when cross-compiling. 22 23 23 24 postInstall = 24 25 # Install headers in the right place. 25 - '' ln -s${if stdenv.isFreeBSD then "" else "r"}v "$out/lib/"libffi*/include "$out/include" 26 + '' ln -s${if stdenv.isBSD then "" else "r"}v "$out/lib/"libffi*/include "$out/include" 26 27 ''; 27 28 28 29 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 &&
+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
+1 -1
pkgs/development/libraries/v8/default.nix
··· 63 63 64 64 meta = with stdenv.lib; { 65 65 description = "Google's open source JavaScript engine"; 66 - platforms = with platforms; linux ++ darwin; 66 + platforms = with platforms; linux; 67 67 license = licenses.bsd3; 68 68 }; 69 69 }
+2
pkgs/development/tools/misc/ccache/default.nix
··· 1 1 {stdenv, fetchurl, runCommand, gcc, zlib}: 2 2 3 + assert stdenv.isLinux; 4 + 3 5 let 4 6 ccache = 5 7 stdenv.mkDerivation {
+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;
+2 -2
pkgs/games/spring/default.nix
··· 32 32 33 33 postInstall = '' 34 34 wrapProgram "$out/bin/spring" \ 35 - --prefix LD_LIBRARY_PATH : "${stdenv.gcc.gcc}/lib64:${stdenv.gcc.gcc}/lib::${systemd}/lib" 35 + --prefix LD_LIBRARY_PATH : "${stdenv.gcc.gcc}/lib::${systemd}/lib" 36 36 ''; 37 37 38 38 meta = with stdenv.lib; { ··· 40 40 description = "A powerful real-time strategy (RTS) game engine"; 41 41 license = licenses.gpl2; 42 42 maintainers = [ maintainers.phreedom maintainers.qknight maintainers.iElectric ]; 43 - platforms = platforms.mesaPlatforms; 43 + platforms = platforms.linux; 44 44 }; 45 45 }
+1 -1
pkgs/servers/http/nginx/default.nix
··· 112 112 ++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio"; 113 113 114 114 115 - additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations"; 115 + additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations -Wno-error=conditional-uninitialized"; 116 116 117 117 preConfigure = '' 118 118 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
+12 -13
pkgs/stdenv/adapters.nix
··· 285 285 }; 286 286 287 287 288 - /* Modify a stdenv so that it uses the Gold linker. FIXME: should 289 - use -fuse-ld=gold instead, but then the ld-wrapper won't be 290 - invoked. */ 291 - useGoldLinker = stdenv: 292 - let 293 - binutils = stdenv.gcc.binutils; 294 - binutils' = pkgs.runCommand "${binutils.name}-gold" { } 295 - '' 296 - mkdir -p $out/bin 297 - ln -s ${binutils}/bin/* $out/bin/ 298 - ln -sfn ${binutils}/bin/ld.gold $out/bin/ld 299 - ''; # */ 300 - in overrideGCC stdenv (stdenv.gcc.override { binutils = binutils'; }); 288 + /* Modify a stdenv so that it uses the Gold linker. */ 289 + useGoldLinker = stdenv: stdenv // 290 + { mkDerivation = args: stdenv.mkDerivation (args // { 291 + dontStrip = true; 292 + NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_COMPILE or "") + " -fuse-ld=gold"; 293 + }); 294 + }; 301 295 296 + dropCxx = drv: drv.override { 297 + stdenv = if pkgs.stdenv.isDarwin 298 + then pkgs.allStdenvs.stdenvDarwinNaked 299 + else pkgs.stdenv; 300 + }; 302 301 }
+49
pkgs/stdenv/darwin/default.nix
··· 1 + { stdenv, pkgs, config 2 + , haveLibCxx ? true 3 + , useClang33 ? true }: 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.9 18 + export SDKROOT=$(/usr/bin/xcrun --sdk macosx10.9 --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/gcc-wrapper { 28 + nativeTools = false; 29 + nativeLibc = true; 30 + inherit stdenv; 31 + extraPackages = stdenv.lib.optional haveLibCxx pkgs.libcxx; 32 + binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}; 33 + gcc = if useClang33 then pkgs.clang_33.gcc else pkgs.clang.gcc; 34 + coreutils = pkgs.coreutils; 35 + shell = pkgs.bash + "/bin/sh"; 36 + }; 37 + 38 + shell = pkgs.bash + "/bin/sh"; 39 + 40 + fetchurlBoot = stdenv.fetchurlBoot; 41 + 42 + overrides = pkgs_: { 43 + inherit gcc; 44 + inherit (gcc) binutils; 45 + inherit (pkgs) 46 + gzip bzip2 xz bash coreutils diffutils findutils gawk 47 + gnumake gnused gnutar gnugrep gnupatch perl libcxx libcxxabi; 48 + }; 49 + }
+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
··· 164 164 isBSD = system == "i686-freebsd" 165 165 || system == "x86_64-freebsd" 166 166 || system == "i686-openbsd" 167 - || system == "x86_64-openbsd"; 167 + || system == "x86_64-openbsd" 168 + || system == "x86_64-darwin"; 168 169 isi686 = system == "i686-linux" 169 170 || system == "i686-gnu" 170 171 || system == "i686-freebsd"
-9
pkgs/stdenv/native/default.nix
··· 35 35 alias sed=gsed 36 36 export MAKE=gmake 37 37 shopt -s expand_aliases 38 - 39 - # Filter out stupid GCC warnings (in gcc-wrapper). 40 - export NIX_GCC_NEEDS_GREP=1 41 38 ''; 42 39 43 40 prehookOpenBSD = '' ··· 52 49 53 50 export MAKE=gmake 54 51 shopt -s expand_aliases 55 - 56 - # Filter out stupid GCC warnings (in gcc-wrapper). 57 - export NIX_GCC_NEEDS_GREP=1 58 52 ''; 59 53 60 54 prehookNetBSD = '' ··· 65 59 alias tar=gtar 66 60 export MAKE=gmake 67 61 shopt -s expand_aliases 68 - 69 - # Filter out stupid GCC warnings (in gcc-wrapper). 70 - export NIX_GCC_NEEDS_GREP=1 71 62 ''; 72 63 73 64 prehookCygwin = ''
+1 -16
pkgs/stdenv/nix/default.nix
··· 7 7 '' 8 8 export NIX_ENFORCE_PURITY=1 9 9 export NIX_IGNORE_LD_THROUGH_GCC=1 10 - '' + lib.optionalString stdenv.isDarwin '' 11 - export NIX_ENFORCE_PURITY= 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 10 ''; 22 11 23 12 initialPath = (import ../common-path.nix) {pkgs = pkgs;}; ··· 29 18 nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr"; 30 19 nativeLibc = true; 31 20 inherit stdenv; 32 - binutils = 33 - if stdenv.isDarwin then 34 - import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;} 35 - else 36 - pkgs.binutils; 21 + binutils = pkgs.binutils; 37 22 gcc = pkgs.gcc.gcc; 38 23 coreutils = pkgs.coreutils; 39 24 shell = pkgs.bash + "/bin/sh";
+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 sha256 = "1arvjfzw6p310zbgv629w5hkyslrj44imf3r3s2r4ry2jfcks221"; 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 }
+1 -1
pkgs/tools/networking/strongswan/default.nix
··· 19 19 description = "OpenSource IPsec-based VPN Solution"; 20 20 homepage = https://www.strongswan.org; 21 21 license = stdenv.lib.licenses.gpl2Plus; 22 - inherit (stdenv.gcc.clang.meta) platforms; 22 + inherit (stdenv.gcc.gcc.meta) platforms; 23 23 }; 24 24 }
+3
pkgs/tools/package-management/nix/default.nix
··· 66 66 enableParallelBuilding = true; 67 67 68 68 meta = { 69 + # due to builder args bug; see 70 + # https://github.com/NixOS/nix/commit/b224ac15201c57b40ea855f5a98b1bd166c1c7f6 71 + broken = stdenv.isDarwin; 69 72 description = "Powerful package manager that makes package management reliable and reproducible"; 70 73 longDescription = '' 71 74 Nix is a powerful package manager for Linux and other Unix systems that
+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
··· 20 20 21 21 patchPhase = '' 22 22 find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i 23 + patch gl/stdint_.h < ${./clang.patch} 23 24 ''; 24 25 25 26 configureFlags =
+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
+5 -2
pkgs/tools/text/sgml/opensp/default.nix
··· 1 - {stdenv, fetchurl, xmlto, docbook_xml_dtd_412, libxslt, docbook_xsl}: 1 + { lib, stdenv, fetchurl, xmlto, docbook_xml_dtd_412, libxslt, docbook_xsl }: 2 2 3 3 stdenv.mkDerivation { 4 4 name = "opensp-1.5.2"; ··· 13 13 docsrc/*.xml 14 14 ''; 15 15 16 + configureFlags = lib.optional stdenv.isDarwin [ 17 + "--with-libintl-prefix=/usr" 18 + "--with-libiconv-prefix=/usr" 19 + ]; 16 20 17 21 setupHook = ./setup-hook.sh; 18 22 ··· 21 25 sed -i -e 's/href="#idm.*"//g' $out/share/doc/OpenSP/releasenotes.html 22 26 sed -i -e 's/name="idm.*"//g' $out/share/doc/OpenSP/releasenotes.html 23 27 ''; 24 - 25 28 26 29 buildInputs = [ xmlto docbook_xml_dtd_412 libxslt docbook_xsl ]; 27 30
+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
+31 -56
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 ··· 1923 1921 1924 1922 openssh_with_kerberos = pkgs.appendToName "with-kerberos" (openssh.override { withKerberos = true; }); 1925 1923 1926 - opensp = callPackage ../tools/text/sgml/opensp { }; 1924 + opensp = callPackage ../tools/text/sgml/opensp { 1925 + stdenv = if stdenv.isDarwin 1926 + then allStdenvs.stdenvDarwinNaked 1927 + else stdenv; 1928 + }; 1927 1929 1928 1930 spCompat = callPackage ../tools/text/sgml/opensp/compat.nix { }; 1929 1931 ··· 2853 2855 2854 2856 ccl = builderDefsPackage ../development/compilers/ccl {}; 2855 2857 2856 - clang = wrapClang llvmPackages.clang; 2858 + clang = wrapGCC llvmPackages.clang; 2857 2859 2858 - clang_34 = wrapClang llvmPackages_34.clang; 2859 - clang_33 = wrapClang (clangUnwrapped llvm_33 ../development/compilers/llvm/3.3/clang.nix); 2860 + clang_34 = wrapGCC llvmPackages_34.clang; 2861 + clang_33 = wrapGCC (clangUnwrapped llvm_33 ../development/compilers/llvm/3.3/clang.nix); 2860 2862 2861 2863 clangAnalyzer = callPackage ../development/tools/analysis/clang-analyzer { 2862 2864 clang = clang_34; ··· 2864 2866 }; 2865 2867 2866 2868 clangUnwrapped = llvm: pkg: callPackage pkg { 2867 - stdenv = if stdenv.isDarwin then stdenvApple else stdenv; 2868 - inherit llvm; 2869 + inherit stdenv llvm; 2869 2870 }; 2870 2871 2871 2872 clangSelf = clangWrapSelf llvmPackagesSelf.clang; 2872 2873 2873 - clangWrapSelf = build: (import ../build-support/clang-wrapper) { 2874 - clang = build; 2874 + clangWrapSelf = build: (import ../build-support/gcc-wrapper) { 2875 + gcc = build; 2875 2876 stdenv = clangStdenv; 2876 2877 libc = glibc; 2877 2878 binutils = binutils; 2878 - shell = bash; 2879 - inherit libcxx coreutils zlib; 2879 + inherit coreutils zlib; 2880 + extraPackages = [ libcxx ]; 2880 2881 nativeTools = false; 2881 2882 nativeLibc = false; 2882 2883 }; 2883 2884 2884 2885 #Use this instead of stdenv to build with clang 2885 - clangStdenv = lowPrio (stdenvAdapters.overrideGCC stdenv clang); 2886 + clangStdenv = if stdenv.isDarwin then stdenv else lowPrio (stdenvAdapters.overrideGCC stdenv clang); 2886 2887 libcxxStdenv = stdenvAdapters.overrideGCC stdenv (clangWrapSelf llvmPackages.clang); 2887 2888 2888 2889 clean = callPackage ../development/compilers/clean { }; ··· 2918 2919 2919 2920 gcc = gcc48; 2920 2921 gcc_multi = gcc48_multi; 2922 + 2923 + gccApple = throw "gccApple is no longer supported"; 2921 2924 2922 2925 gcc33 = wrapGCC (import ../development/compilers/gcc/3.3 { 2923 2926 inherit fetchurl stdenv noSysDirs; ··· 3088 3091 then gnu.libpthreadCross 3089 3092 else null; 3090 3093 })); 3091 - 3092 - gccApple = 3093 - assert stdenv.isDarwin; 3094 - wrapGCC (makeOverridable (import ../development/compilers/gcc/4.2-apple64) { 3095 - inherit fetchurl noSysDirs; 3096 - profiledCompiler = true; 3097 - # Since it fails to build with GCC 4.6, build it with the "native" 3098 - # Apple-GCC. 3099 - stdenv = allStdenvs.stdenvNative; 3100 - }); 3101 3094 3102 3095 gfortran = gfortran48; 3103 3096 ··· 3419 3412 llvm_34 = llvmPackages_34.llvm; 3420 3413 llvm_33 = llvm_v ../development/compilers/llvm/3.3/llvm.nix; 3421 3414 3422 - llvm_v = path: callPackage path { 3423 - stdenv = if stdenv.isDarwin then stdenvApple else stdenv; 3424 - }; 3415 + llvm_v = path: callPackage path { }; 3425 3416 3426 - llvmPackages = if !stdenv.isDarwin then llvmPackages_34 else llvmPackages_34 // { 3427 - # until someone solves build problems with _34 3428 - llvm = llvm_33; 3429 - clang = clang_33; 3430 - }; 3417 + llvmPackages = llvmPackages_34; 3431 3418 3432 3419 llvmPackages_34 = recurseIntoAttrs (import ../development/compilers/llvm/3.4 { 3433 3420 inherit stdenv newScope fetchurl; ··· 3810 3797 win32hello = callPackage ../development/compilers/visual-c++/test { }; 3811 3798 3812 3799 wrapGCCWith = gccWrapper: glibc: baseGCC: gccWrapper { 3813 - nativeTools = stdenv ? gcc && stdenv.gcc.nativeTools; 3814 - nativeLibc = stdenv ? gcc && stdenv.gcc.nativeLibc; 3815 - nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else ""; 3816 - gcc = baseGCC; 3817 - libc = glibc; 3818 - shell = bash; 3819 - inherit stdenv binutils coreutils zlib; 3820 - }; 3821 - 3822 - wrapClangWith = clangWrapper: glibc: baseClang: clangWrapper { 3823 3800 nativeTools = stdenv.gcc.nativeTools or false; 3824 3801 nativeLibc = stdenv.gcc.nativeLibc or false; 3825 3802 nativePrefix = stdenv.gcc.nativePrefix or ""; 3826 - clang = baseClang; 3803 + gcc = baseGCC; 3827 3804 libc = glibc; 3828 - shell = bash; 3829 - binutils = stdenv.gcc.binutils; 3830 - inherit stdenv coreutils zlib; 3805 + inherit stdenv binutils coreutils zlib; 3831 3806 }; 3832 3807 3833 - wrapClang = wrapClangWith (makeOverridable (import ../build-support/clang-wrapper)) glibc; 3834 - 3835 3808 wrapGCC = wrapGCCWith (makeOverridable (import ../build-support/gcc-wrapper)) glibc; 3836 3809 3837 3810 wrapGCCCross = ··· 4260 4233 bam = callPackage ../development/tools/build-managers/bam {}; 4261 4234 4262 4235 binutils = if stdenv.isDarwin 4263 - then stdenv.gcc.binutils 4236 + then import ../build-support/native-darwin-cctools-wrapper {inherit stdenv;} 4264 4237 else callPackage ../development/tools/misc/binutils { 4265 4238 inherit noSysDirs; 4266 4239 }; ··· 4405 4378 wrapGCC (distcc.links extraConfig)) {}; 4406 4379 distccStdenv = lowPrio (overrideGCC stdenv distccWrapper); 4407 4380 4408 - distccMasquerade = callPackage ../development/tools/misc/distcc/masq.nix { 4409 - gccRaw = gcc.gcc; 4410 - binutils = binutils; 4411 - }; 4381 + distccMasquerade = if stdenv.isDarwin 4382 + then null 4383 + else callPackage ../development/tools/misc/distcc/masq.nix { 4384 + gccRaw = gcc.gcc; 4385 + binutils = binutils; 4386 + }; 4412 4387 4413 4388 docutils = builderDefsPackage (import ../development/tools/documentation/docutils) { 4414 4389 inherit python pil makeWrapper; ··· 4909 4884 4910 4885 coredumper = callPackage ../development/libraries/coredumper { }; 4911 4886 4912 - ctl = callPackage ../development/libraries/ctl { }; 4887 + ctl = dropCxx (callPackage ../development/libraries/ctl { }); 4913 4888 4914 4889 cpp-netlib = callPackage ../development/libraries/cpp-netlib { }; 4915 4890 ··· 5440 5415 5441 5416 ilixi = callPackage ../development/libraries/ilixi { }; 5442 5417 5443 - ilmbase = callPackage ../development/libraries/ilmbase { }; 5418 + ilmbase = dropCxx (callPackage ../development/libraries/ilmbase { }); 5444 5419 5445 5420 imlib = callPackage ../development/libraries/imlib { 5446 5421 libpng = libpng12; ··· 5622 5597 5623 5598 libdc1394avt = callPackage ../development/libraries/libdc1394avt { }; 5624 5599 5625 - libdevil = callPackage ../development/libraries/libdevil { }; 5600 + libdevil = dropCxx (callPackage ../development/libraries/libdevil { }); 5626 5601 5627 5602 libdiscid = callPackage ../development/libraries/libdiscid { }; 5628 5603 ··· 6388 6363 # this ctl version is needed by openexr_viewers 6389 6364 openexr_ctl = callPackage ../development/libraries/openexr_ctl { }; 6390 6365 6391 - openexr = callPackage ../development/libraries/openexr { }; 6366 + openexr = dropCxx (callPackage ../development/libraries/openexr { }); 6392 6367 6393 6368 openldap = callPackage ../development/libraries/openldap { 6394 6369 stdenv = if stdenv.isDarwin
+3 -1
pkgs/top-level/haskell-defaults.nix
··· 214 214 gmp = pkgs.gmp4; 215 215 }); 216 216 217 + ghc783Binary = lowPrio (callPackage ../development/compilers/ghc/7.8.3-binary.nix {}); 218 + 217 219 ghc6101BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6101Binary; 218 220 ghc6121BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6121Binary; 219 221 ··· 234 236 235 237 packages_ghc783 = 236 238 packages { ghcPath = ../development/compilers/ghc/7.8.3.nix; 237 - ghcBinary = ghc742Binary; 239 + ghcBinary = if stdenv.isDarwin then ghc783Binary else ghc742Binary; 238 240 prefFun = ghc783Prefs; 239 241 }; 240 242