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

Conflicts:
	pkgs/applications/editors/vim/macvim.nix
This commit is contained in:
Eelco Dolstra 2014-11-04 14:30:43 +01:00
commit 7495c61d49
93 changed files with 1019 additions and 1035 deletions

View File

@ -3,12 +3,12 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "vim-${version}"; name = "vim-${version}";
version = "7.4.335"; version = "7.4.410";
src = fetchhg { src = fetchhg {
url = "https://vim.googlecode.com/hg/"; url = "https://vim.googlecode.com/hg/";
rev = "v7-4-335"; rev = "v7-4-410";
sha256 = "0qnpzfcbi6fhz82pj68l4vrnigca1akq2ksrxz6krwlfhns6jhhj"; sha256 = "145llhj6gq2bh9b7p8xkxc388krrximq80b87f3cn4w4d4k9fhqp";
}; };
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -38,16 +38,14 @@ stdenv.mkDerivation rec {
${if pythonBindings || perlBindings then "--with-swig=${swig}" else "--without-swig"} ${if pythonBindings || perlBindings then "--with-swig=${swig}" else "--without-swig"}
${if javahlBindings then "--enable-javahl --with-jdk=${jdk}" else ""} ${if javahlBindings then "--enable-javahl --with-jdk=${jdk}" else ""}
${if stdenv.isDarwin then "--enable-keychain" else "--disable-keychain"} ${if stdenv.isDarwin then "--enable-keychain" else "--disable-keychain"}
${if saslSupport then "--enable-sasl --with-sasl=${sasl}" else "--disable-sasl"} ${if saslSupport then "--with-sasl=${sasl}" else "--without-sasl"}
${if httpSupport then "--enable-serf --with-serf=${serf}" else "--disable-serf"} ${if httpSupport then "--with-serf=${serf}" else "--without-serf"}
--with-zlib=${zlib} --with-zlib=${zlib}
--with-sqlite=${sqlite} --with-sqlite=${sqlite}
''; '';
preBuild = '' preBuild = ''
makeFlagsArray=(APACHE_LIBEXECDIR=$out/modules) makeFlagsArray=(APACHE_LIBEXECDIR=$out/modules)
'' + stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace configure --replace "-no-cpp-precomp" ""
''; '';
postInstall = '' postInstall = ''
@ -73,10 +71,6 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
# Hack to build on Mac OS X. The system header files use C99-style
# comments, but Subversion passes -std=c90.
NIX_CFLAGS_COMPILE = "-std=c99";
meta = { meta = {
description = "A version control system intended to be a compelling replacement for CVS in the open source community"; description = "A version control system intended to be a compelling replacement for CVS in the open source community";
homepage = http://subversion.apache.org/; homepage = http://subversion.apache.org/;

View File

@ -218,6 +218,10 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
configureFlags+=" --ghc-option=-optl=-Wl,-headerpad_max_install_names" configureFlags+=" --ghc-option=-optl=-Wl,-headerpad_max_install_names"
''} ''}
${optionalString self.stdenv.isDarwin ''
configureFlags+=" --with-gcc=clang"
''}
echo "configure flags: $extraConfigureFlags $configureFlags" echo "configure flags: $extraConfigureFlags $configureFlags"
./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \ ./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \
--libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \ --libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \
@ -240,6 +244,7 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
export GHC_PACKAGE_PATH=$(${ghc.GHCPackages}) export GHC_PACKAGE_PATH=$(${ghc.GHCPackages})
test -n "$noHaddock" || ./Setup haddock --html --hoogle \ test -n "$noHaddock" || ./Setup haddock --html --hoogle \
--ghc-options=-optP-P \
${optionalString self.hyperlinkSource "--hyperlink-source"} ${optionalString self.hyperlinkSource "--hyperlink-source"}
eval "$postBuild" eval "$postBuild"

View File

@ -1,24 +0,0 @@
# `-B@out@/bin' forces clang to use ld-wrapper.sh when calling ld.
export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE"
if test -e @out@/nix-support/libc-cflags; then
export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE"
fi
if test -e @out@/nix-support/clang-cflags; then
export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/clang-cflags) $NIX_CFLAGS_COMPILE"
fi
if test -e @out@/nix-support/libc-ldflags; then
export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)"
fi
if test -e @out@/nix-support/clang-ldflags; then
export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/clang-ldflags)"
fi
if test -e @out@/nix-support/libc-ldflags-before; then
export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE"
fi
export NIX_GCC_WRAPPER_FLAGS_SET=1

View File

@ -1,137 +0,0 @@
source $stdenv/setup
mkdir -p $out/bin
mkdir -p $out/nix-support
if test -z "$nativeLibc"; then
dynamicLinker="$libc/lib/$dynamicLinker"
echo $dynamicLinker > $out/nix-support/dynamic-linker
if test -e $libc/lib/32/ld-linux.so.2; then
echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32
fi
# The "-B$libc/lib/" flag is a quick hack to force clang to link
# against the crt1.o from our own glibc, rather than the one in
# /usr/lib. (This is only an issue when using an `impure'
# compiler/linker, i.e., one that searches /usr/lib and so on.)
echo "-B$libc/lib/ -idirafter $libc/include" > $out/nix-support/libc-cflags
echo "-L$libc/lib" > $out/nix-support/libc-ldflags
# The dynamic linker is passed in `ldflagsBefore' to allow
# explicit overrides of the dynamic linker by callers to clang/ld
# (the *last* value counts, so ours should come first).
echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before
fi
if test -n "$nativeTools"; then
clangPath="$nativePrefix/bin"
ldPath="$nativePrefix/bin"
else
basePath=`echo $gcc/lib/*/*/*`
# Need libgcc until the llvm compiler-rt library is complete
clangLDFlags="$clangLDFlags -L$basePath"
if test -e "$gcc/lib64"; then
clangLDFlags="$clangLDFlags -L$gcc/lib64"
else
clangLDFlags="$clangLDFlags -L$gcc/lib"
fi
clangLDFlags="$clangLDFlags -L$clang/lib"
echo "$clangLDFlags" > $out/nix-support/clang-ldflags
# Need files like crtbegin.o from gcc
# It's unclear if these will ever be provided by an LLVM project
clangCFlags="$clangCFlags -B$basePath"
clangCFlags="$clangCFlags -isystem$clang/lib/clang/$clangVersion/include"
echo "$clangCFlags" > $out/nix-support/clang-cflags
clangPath="$clang/bin"
ldPath="$binutils/bin"
fi
doSubstitute() {
local src=$1
local dst=$2
local uselibcxx=
local uselibcxxabi=
if test -n "$libcxx" && echo $dst | fgrep ++; then uselibcxx=$libcxx; fi
if test -n "$libcxxabi" && echo $dst | fgrep ++; then uselibcxxabi=$libcxxabi; fi
# Can't use substitute() here, because replace may not have been
# built yet (in the bootstrap).
sed \
-e "s^@out@^$out^g" \
-e "s^@shell@^$shell^g" \
-e "s^@libcxx@^$uselibcxx^g" \
-e "s^@libcxxabi@^$uselibcxxabi^g" \
-e "s^@clang@^$clang^g" \
-e "s^@clangProg@^$clangProg^g" \
-e "s^@binutils@^$binutils^g" \
-e "s^@coreutils@^$coreutils^g" \
-e "s^@libc@^$libc^g" \
-e "s^@ld@^$ldPath/ld^g" \
< "$src" > "$dst"
}
# Make wrapper scripts around clang and clang++. Also make symlinks
# cc and c++
mkClangWrapper() {
local dst=$1
local src=$2
if ! test -f "$src"; then
echo "$src does not exist (skipping)"
return 1
fi
clangProg="$src"
doSubstitute "$clangWrapper" "$dst"
chmod +x "$dst"
}
if mkClangWrapper $out/bin/clang $clangPath/clang
then
ln -sv clang $out/bin/cc
fi
if mkClangWrapper $out/bin/clang++ $clangPath/clang++
then
ln -sv clang++ $out/bin/c++
fi
# Create a symlink to as (the assembler). This is useful when a
# clang-wrapper is installed in a user environment, as it ensures that
# the right assembler is called.
ln -s $ldPath/as $out/bin/as
# Make a wrapper around the linker.
doSubstitute "$ldWrapper" "$out/bin/ld"
chmod +x "$out/bin/ld"
# Emit a setup hook. Also store the path to the original Clang and
# libc.
test -n "$clang" && echo $clang > $out/nix-support/orig-clang
test -n "$libc" && echo $libc > $out/nix-support/orig-libc
doSubstitute "$addFlags" "$out/nix-support/add-flags.sh"
doSubstitute "$setupHook" "$out/nix-support/setup-hook"
cp -p $utils $out/nix-support/utils.sh
# Propagate the wrapped clang so that if you install the wrapper, you get
# llvm tools, the manpages, etc. as well (including for binutils
# and Glibc).
if test -z "$nativeTools"; then
echo $clang $binutils $libc > $out/nix-support/propagated-user-env-packages
fi

View File

@ -1,150 +0,0 @@
#! @shell@ -e
if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then
source "$NIX_GCC_WRAPPER_START_HOOK"
fi
if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then
source @out@/nix-support/add-flags.sh
fi
source @out@/nix-support/utils.sh
# Figure out if linker flags should be passed. Clang prints annoying
# warnings when they are not needed. (does it really? Copied from gcc-wrapper)
dontLink=0
getVersion=0
nonFlagArgs=0
for i in "$@"; do
if test "$i" = "-c"; then
dontLink=1
elif test "$i" = "-S"; then
dontLink=1
elif test "$i" = "-E"; then
dontLink=1
elif test "$i" = "-E"; then
dontLink=1
elif test "$i" = "-M"; then
dontLink=1
elif test "$i" = "-MM"; then
dontLink=1
elif test "$i" = "-x"; then
# At least for the cases c-header or c++-header we should set dontLink.
# I expect no one use -x other than making precompiled headers.
dontLink=1
elif test "${i:0:1}" != "-"; then
nonFlagArgs=1
elif test "$i" = "-m32"; then
if test -e @out@/nix-support/dynamic-linker-m32; then
NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)"
fi
fi
done
# If we pass a flag like -Wl, then clang will call the linker unless it
# can figure out that it has to do something else (e.g., because of a
# "-c" flag). So if no non-flag arguments are given, don't pass any
# linker flags. This catches cases like "clang" (should just print
# "clang: no input files") and "clang -v" (should print the version).
if test "$nonFlagArgs" = "0"; then
dontLink=1
fi
# Optionally filter out paths not refering to the store.
params=("$@")
if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
rest=()
n=0
while test $n -lt ${#params[*]}; do
p=${params[n]}
p2=${params[$((n+1))]}
if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then
skip $p
elif test "$p" = "-L" && badPath "$p2"; then
n=$((n + 1)); skip $p2
elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then
skip $p
elif test "$p" = "-I" && badPath "$p2"; then
n=$((n + 1)); skip $p2
elif test "$p" = "-isystem" && badPath "$p2"; then
n=$((n + 1)); skip $p2
else
rest=("${rest[@]}" "$p")
fi
n=$((n + 1))
done
params=("${rest[@]}")
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE --sysroot=/var/empty"
fi
if test -n "@libcxx@"; then
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem@libcxx@/include/c++/v1 -stdlib=libc++"
NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L@libcxx@/lib -stdlib=libc++ -L@libcxxabi@/lib -lc++abi"
fi
# Add the flags for the C compiler proper.
extraAfter=($NIX_CFLAGS_COMPILE)
extraBefore=()
if test "$dontLink" != "1"; then
# Add the flags that should only be passed to the compiler when
# linking.
extraAfter=(${extraAfter[@]} $NIX_CFLAGS_LINK)
# Add the flags that should be passed to the linker (and prevent
# `ld-wrapper' from adding NIX_LDFLAGS again).
for i in $NIX_LDFLAGS_BEFORE; do
extraBefore=(${extraBefore[@]} "-Wl,$i")
done
for i in $NIX_LDFLAGS; do
if test "${i:0:3}" = "-L/"; then
extraAfter=(${extraAfter[@]} "$i")
else
extraAfter=(${extraAfter[@]} "-Wl,$i")
fi
done
export NIX_LDFLAGS_SET=1
fi
# As a very special hack, if the arguments are just `-v', then don't
# add anything. This is to prevent `clang -v' (which normally prints
# out the version number and returns exit code 0) from printing out
# `No input files specified' and returning exit code 1.
if test "$*" = "-v"; then
extraAfter=()
extraBefore=()
fi
# Optionally print debug info.
if test "$NIX_DEBUG" = "1"; then
echo "original flags to @clangProg@:" >&2
for i in "${params[@]}"; do
echo " $i" >&2
done
echo "extraBefore flags to @clangProg@:" >&2
for i in ${extraBefore[@]}; do
echo " $i" >&2
done
echo "extraAfter flags to @clangProg@:" >&2
for i in ${extraAfter[@]}; do
echo " $i" >&2
done
fi
if test -n "$NIX_CLANG_WRAPPER_EXEC_HOOK"; then
source "$NIX_CLANG_WRAPPER_EXEC_HOOK"
fi
# Call the real `clang'. Filter out warnings from stderr about unused
# `-B' flags, since they confuse some programs. Deep bash magic to
# apply grep to stderr (by swapping stdin/stderr twice).
if test -z "$NIX_CLANG_NEEDS_GREP"; then
@clangProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
else
(@clangProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \
| (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3-
exit $?
fi

View File

@ -1,89 +0,0 @@
# The Nix `clang' stdenv.mkDerivation is not directly usable, since it doesn't
# know where the C library and standard header files are. Therefore
# the compiler produced by that package cannot be installed directly
# in a user environment and used from the command line. This
# stdenv.mkDerivation provides a wrapper that sets up the right environment
# variables so that the compiler and the linker just "work".
{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
, clang ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
, zlib ? null, libcxx ? null
}:
assert nativeTools -> nativePrefix != "";
assert !nativeTools -> clang != null && binutils != null && coreutils != null;
assert !nativeLibc -> libc != null;
let
clangVersion = (builtins.parseDrvName clang.name).version;
clangName = (builtins.parseDrvName clang.name).name;
in
stdenv.mkDerivation {
name =
(if name != "" then name else clangName + "-wrapper") +
(if clang != null && clangVersion != "" then "-" + clangVersion else "");
builder = ./builder.sh;
setupHook = ./setup-hook.sh;
clangWrapper = ./clang-wrapper.sh;
ldWrapper = ../gcc-wrapper/ld-wrapper.sh;
utils = ../gcc-wrapper/utils.sh;
addFlags = ./add-flags;
inherit nativeTools nativeLibc nativePrefix clang clangVersion libcxx;
libcxxabi = libcxx.abi or null;
gcc = clang.gcc;
libc = if nativeLibc then null else libc;
binutils = if nativeTools then null else binutils;
# The wrapper scripts use 'cat', so we may need coreutils
coreutils = if nativeTools then null else coreutils;
langC = true;
langCC = true;
shell = if shell == "" then stdenv.shell else
if builtins.isAttrs shell then (shell + shell.shellPath)
else shell;
crossAttrs = {
shell = shell.crossDrv + shell.crossDrv.shellPath;
libc = libc.crossDrv;
coreutils = coreutils.crossDrv;
binutils = binutils.crossDrv;
clang = clang.crossDrv;
#
# This is not the best way to do this. I think the reference should be
# the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
# do this sufficient if/else.
dynamicLinker =
(if stdenv.cross.arch == "arm" then "ld-linux.so.3" else
if stdenv.cross.arch == "mips" then "ld.so.1" else
if stdenv.lib.hasSuffix "pc-gnu" stdenv.cross.config then "ld.so.1" else
abort "don't know the name of the dynamic linker for this platform");
};
meta =
let clang_ = if clang != null then clang else {}; in
(if clang_ ? meta then removeAttrs clang.meta ["priority"] else {}) //
{ description =
stdenv.lib.attrByPath ["meta" "description"] "System C compiler" clang_
+ " (wrapper script)";
};
# The dynamic linker has different names on different Linux platforms.
dynamicLinker =
if !nativeLibc then
(if stdenv.system == "i686-linux" then "ld-linux.so.2" else
if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
if stdenv.isArm then "ld-linux.so.3" else
if stdenv.system == "powerpc-linux" then "ld.so.1" else
if stdenv.system == "mips64el-linux" then "ld.so.1" else
abort "don't know the name of the dynamic linker for this platform")
else "";
preferLocalBuild = true;
}

View File

@ -1,38 +0,0 @@
export NIX_GCC=@out@
addCVars () {
if test -d $1/include; then
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include"
fi
if test -d $1/lib64; then
export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64"
fi
if test -d $1/lib; then
export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib"
fi
}
envHooks+=(addCVars)
# Note: these come *after* $out in the PATH (see setup.sh).
if test -n "@clang@"; then
addToSearchPath PATH @clang@/bin
fi
if test -n "@binutils@"; then
addToSearchPath PATH @binutils@/bin
fi
if test -n "@libc@"; then
addToSearchPath PATH @libc@/bin
fi
if test -n "@coreutils@"; then
addToSearchPath PATH @coreutils@/bin
fi
: ${CXX:=clang++}
export CXX

View File

@ -114,13 +114,4 @@ fi
# We want gcc to call the wrapper linker, not that of binutils. # We want gcc to call the wrapper linker, not that of binutils.
export PATH="@ldPath@:$PATH" export PATH="@ldPath@:$PATH"
# Call the real `gcc'. Filter out warnings from stderr about unused exec @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
# `-B' flags, since they confuse some programs. Deep bash magic to
# apply grep to stderr (by swapping stdin/stderr twice).
if test -z "$NIX_GCC_NEEDS_GREP"; then
@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
else
(@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \
| (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3-
exit $?
fi

View File

@ -1,27 +1,27 @@
# `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld. # `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld.
export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE" export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE"
if test -e @out@/nix-support/libc-cflags; then if [ -e @out@/nix-support/libc-cflags ]; then
export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE" export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE"
fi fi
if test -e @out@/nix-support/gcc-cflags; then if [ -e @out@/nix-support/gcc-cflags ]; then
export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE" export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE"
fi fi
if test -e @out@/nix-support/gnat-cflags; then if [ -e @out@/nix-support/gnat-cflags ]; then
export NIX_GNATFLAGS_COMPILE="$(cat @out@/nix-support/gnat-cflags) $NIX_GNATFLAGS_COMPILE" export NIX_GNATFLAGS_COMPILE="$(cat @out@/nix-support/gnat-cflags) $NIX_GNATFLAGS_COMPILE"
fi fi
if test -e @out@/nix-support/libc-ldflags; then if [ -e @out@/nix-support/libc-ldflags ]; then
export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)" export NIX_LDFLAGS+=" $(cat @out@/nix-support/libc-ldflags)"
fi fi
if test -e @out@/nix-support/gcc-ldflags; then if [ -e @out@/nix-support/gcc-ldflags ]; then
export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/gcc-ldflags)" export NIX_LDFLAGS+=" $(cat @out@/nix-support/gcc-ldflags)"
fi fi
if test -e @out@/nix-support/libc-ldflags-before; then if [ -e @out@/nix-support/libc-ldflags-before ]; then
export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE" export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE"
fi fi

View File

@ -1,214 +0,0 @@
source $stdenv/setup
mkdir -p $out/bin
mkdir -p $out/nix-support
if test -z "$nativeLibc"; then
dynamicLinker="$libc/lib/$dynamicLinker"
echo $dynamicLinker > $out/nix-support/dynamic-linker
if test -e $libc/lib/32/ld-linux.so.2; then
echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32
fi
# The "-B$libc/lib/" flag is a quick hack to force gcc to link
# against the crt1.o from our own glibc, rather than the one in
# /usr/lib. (This is only an issue when using an `impure'
# compiler/linker, i.e., one that searches /usr/lib and so on.)
#
# Unfortunately, setting -B appears to override the default search
# path. Thus, the gcc-specific "../includes-fixed" directory is
# now longer searched and glibc's <limits.h> header fails to
# compile, because it uses "#include_next <limits.h>" to find the
# limits.h file in ../includes-fixed. To remedy the problem,
# another -idirafter is necessary to add that directory again.
echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
echo "-L$libc/lib" > $out/nix-support/libc-ldflags
# The dynamic linker is passed in `ldflagsBefore' to allow
# explicit overrides of the dynamic linker by callers to gcc/ld
# (the *last* value counts, so ours should come first).
echo "-dynamic-linker" $dynamicLinker > $out/nix-support/libc-ldflags-before
fi
if test -n "$nativeTools"; then
gccPath="$nativePrefix/bin"
ldPath="$nativePrefix/bin"
else
if test -e "$gcc/lib64"; then
gccLDFlags="$gccLDFlags -L$gcc/lib64"
fi
gccLDFlags="$gccLDFlags -L$gcc/lib"
if [ -n "$langVhdl" ]; then
gccLDFlags="$gccLDFlags -L$zlib/lib"
fi
echo "$gccLDFlags" > $out/nix-support/gcc-ldflags
# GCC shows $gcc/lib in `gcc -print-search-dirs', but not
# $gcc/lib64 (even though it does actually search there...)..
# This confuses libtool. So add it to the compiler tool search
# path explicitly.
if test -e "$gcc/lib64"; then
gccCFlags="$gccCFlags -B$gcc/lib64"
fi
# Find the gcc libraries path (may work only without multilib)
if [ -n "$langAda" ]; then
basePath=`echo $gcc/lib/*/*/*`
gccCFlags="$gccCFlags -B$basePath -I$basePath/adainclude"
gnatCFlags="-aI$basePath/adainclude -aO$basePath/adalib"
echo "$gnatCFlags" > $out/nix-support/gnat-cflags
fi
echo "$gccCFlags" > $out/nix-support/gcc-cflags
gccPath="$gcc/bin"
# On Illumos/Solaris we might prefer native ld
if test -n "$nativePrefix"; then
ldPath="$nativePrefix/bin"
else
ldPath="$binutils/bin"
fi;
fi
doSubstitute() {
local src=$1
local dst=$2
local ld="$ldPath/ld"
if $ld -V 2>&1 |grep Solaris; then
# Use Solaris specific linker wrapper
ld="$out/bin/ld-solaris"
fi
# Can't use substitute() here, because replace may not have been
# built yet (in the bootstrap).
sed \
-e "s^@out@^$out^g" \
-e "s^@shell@^$shell^g" \
-e "s^@gcc@^$gcc^g" \
-e "s^@gccProg@^$gccProg^g" \
-e "s^@gnatProg@^$gnatProg^g" \
-e "s^@gnatlinkProg@^$gnatlinkProg^g" \
-e "s^@binutils@^$binutils^g" \
-e "s^@coreutils@^$coreutils^g" \
-e "s^@libc@^$libc^g" \
-e "s^@ld@^$ld^g" \
< "$src" > "$dst"
}
# Make wrapper scripts around gcc, g++, and gfortran. Also make symlinks
# cc, c++, and f77.
mkGccWrapper() {
local dst=$1
local src=$2
if ! test -f "$src"; then
echo "$src does not exist (skipping)"
return 1
fi
gccProg="$src"
doSubstitute "$gccWrapper" "$dst"
chmod +x "$dst"
}
mkGnatWrapper() {
local dst=$1
local src=$2
if ! test -f "$src"; then
echo "$src does not exist (skipping)"
return 1
fi
gnatProg="$src"
doSubstitute "$gnatWrapper" "$dst"
chmod +x "$dst"
}
mkGnatLinkWrapper() {
local dst=$1
local src=$2
if ! test -f "$src"; then
echo "$src does not exist (skipping)"
return 1
fi
gnatlinkProg="$src"
doSubstitute "$gnatlinkWrapper" "$dst"
chmod +x "$dst"
}
if mkGccWrapper $out/bin/gcc $gccPath/gcc
then
ln -sv gcc $out/bin/cc
fi
if mkGccWrapper $out/bin/g++ $gccPath/g++
then
ln -sv g++ $out/bin/c++
fi
mkGccWrapper $out/bin/cpp $gccPath/cpp || true
if mkGccWrapper $out/bin/gfortran $gccPath/gfortran
then
ln -sv gfortran $out/bin/g77
ln -sv gfortran $out/bin/f77
fi
mkGccWrapper $out/bin/gcj $gccPath/gcj || true
mkGccWrapper $out/bin/gccgo $gccPath/gccgo || true
mkGccWrapper $out/bin/gnatgcc $gccPath/gnatgcc || true
mkGnatWrapper $out/bin/gnatmake $gccPath/gnatmake || true
mkGnatWrapper $out/bin/gnatbind $gccPath/gnatbind || true
mkGnatLinkWrapper $out/bin/gnatlink $gccPath/gnatlink || true
if [ -f $gccPath/ghdl ]; then
ln -sf $gccPath/ghdl $out/bin/ghdl
fi
# Create a symlink to as (the assembler). This is useful when a
# gcc-wrapper is installed in a user environment, as it ensures that
# the right assembler is called.
ln -s $ldPath/as $out/bin/as
# Make a wrapper around the linker.
doSubstitute "$ldWrapper" "$out/bin/ld"
chmod +x "$out/bin/ld"
# Copy solaris ld wrapper if needed
if $ldPath/ld -V 2>&1 |grep Solaris; then
# Use Solaris specific linker wrapper
sed -e "s^@ld@^$ldPath/ld^g" < "$ldSolarisWrapper" > "$out/bin/ld-solaris"
chmod +x "$out/bin/ld-solaris"
fi
# Emit a setup hook. Also store the path to the original GCC and
# Glibc.
test -n "$gcc" && echo $gcc > $out/nix-support/orig-gcc
test -n "$libc" && echo $libc > $out/nix-support/orig-libc
doSubstitute "$addFlags" "$out/nix-support/add-flags.sh"
doSubstitute "$setupHook" "$out/nix-support/setup-hook"
cp -p $utils $out/nix-support/utils.sh
# Propagate the wrapped gcc so that if you install the wrapper, you get
# tools like gcov, the manpages, etc. as well (including for binutils
# and Glibc).
if test -z "$nativeTools"; then
echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages
fi

View File

@ -1,28 +1,29 @@
# The Nix `gcc' stdenv.mkDerivation is not directly usable, since it doesn't # The Nixpkgs GCC is not directly usable, since it doesn't know where
# know where the C library and standard header files are. Therefore # the C library and standard header files are. Therefore the compiler
# the compiler produced by that package cannot be installed directly # produced by that package cannot be installed directly in a user
# in a user environment and used from the command line. This # environment and used from the command line. So we use a wrapper
# stdenv.mkDerivation provides a wrapper that sets up the right environment # script that sets up the right environment variables so that the
# variables so that the compiler and the linker just "work". # compiler and the linker just "work".
{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? "" { name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? "" , gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell
, zlib ? null , zlib ? null, extraPackages ? []
}: }:
with stdenv.lib;
assert nativeTools -> nativePrefix != ""; assert nativeTools -> nativePrefix != "";
assert !nativeTools -> gcc != null && binutils != null && coreutils != null; assert !nativeTools -> gcc != null && binutils != null && coreutils != null;
assert !nativeLibc -> libc != null; assert !nativeLibc -> libc != null;
# For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper # For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper.
assert (gcc != null && gcc ? langVhdl && gcc.langVhdl) -> zlib != null; assert gcc.langVhdl or false -> zlib != null;
let let
gccVersion = (builtins.parseDrvName gcc.name).version; gccVersion = (builtins.parseDrvName gcc.name).version;
gccName = (builtins.parseDrvName gcc.name).name; gccName = (builtins.parseDrvName gcc.name).name;
langGo = if nativeTools then false else gcc ? langGo && gcc.langGo;
in in
stdenv.mkDerivation { stdenv.mkDerivation {
@ -30,31 +31,198 @@ stdenv.mkDerivation {
(if name != "" then name else gccName + "-wrapper") + (if name != "" then name else gccName + "-wrapper") +
(if gcc != null && gccVersion != "" then "-" + gccVersion else ""); (if gcc != null && gccVersion != "" then "-" + gccVersion else "");
builder = ./builder.sh; preferLocalBuild = true;
setupHook = ./setup-hook.sh;
gccWrapper = ./gcc-wrapper.sh;
gnatWrapper = ./gnat-wrapper.sh;
gnatlinkWrapper = ./gnatlink-wrapper.sh;
ldWrapper = ./ld-wrapper.sh;
ldSolarisWrapper = ./ld-solaris-wrapper.sh;
utils = ./utils.sh;
addFlags = ./add-flags;
inherit nativeTools nativeLibc nativePrefix gcc; inherit gcc shell;
libc = if nativeLibc then null else libc; libc = if nativeLibc then null else libc;
binutils = if nativeTools then null else binutils; binutils = if nativeTools then null else binutils;
# The wrapper scripts use 'cat', so we may need coreutils # The wrapper scripts use 'cat', so we may need coreutils.
coreutils = if nativeTools then null else coreutils; coreutils = if nativeTools then null else coreutils;
langC = if nativeTools then true else gcc.langC; passthru = { inherit nativeTools nativeLibc nativePrefix; };
langCC = if nativeTools then true else gcc.langCC;
langFortran = if nativeTools then false else gcc ? langFortran; buildCommand =
langAda = if nativeTools then false else gcc ? langAda && gcc.langAda; ''
langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl; mkdir -p $out/bin $out/nix-support
zlib = if gcc != null && gcc ? langVhdl then zlib else null;
shell = if shell == "" then stdenv.shell else wrap() {
if builtins.isAttrs shell then (shell + shell.shellPath) local dst="$1"
else shell; local wrapper="$2"
export prog="$3"
substituteAll "$wrapper" "$out/bin/$dst"
chmod +x "$out/bin/$dst"
}
''
+ optionalString (!nativeLibc) ''
dynamicLinker="$libc/lib/$dynamicLinker"
echo $dynamicLinker > $out/nix-support/dynamic-linker
if [ -e $libc/lib/32/ld-linux.so.2 ]; then
echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32
fi
# The "-B$libc/lib/" flag is a quick hack to force gcc to link
# against the crt1.o from our own glibc, rather than the one in
# /usr/lib. (This is only an issue when using an `impure'
# compiler/linker, i.e., one that searches /usr/lib and so on.)
#
# Unfortunately, setting -B appears to override the default search
# path. Thus, the gcc-specific "../includes-fixed" directory is
# now longer searched and glibc's <limits.h> header fails to
# compile, because it uses "#include_next <limits.h>" to find the
# limits.h file in ../includes-fixed. To remedy the problem,
# another -idirafter is necessary to add that directory again.
echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
echo "-L$libc/lib" > $out/nix-support/libc-ldflags
# The dynamic linker is passed in `ldflagsBefore' to allow
# explicit overrides of the dynamic linker by callers to gcc/ld
# (the *last* value counts, so ours should come first).
echo "-dynamic-linker" $dynamicLinker > $out/nix-support/libc-ldflags-before
echo $libc > $out/nix-support/orig-libc
''
+ (if nativeTools then ''
gccPath="${nativePrefix}/bin"
ldPath="${nativePrefix}/bin"
'' else ''
echo $gcc > $out/nix-support/orig-gcc
# GCC shows $gcc/lib in `gcc -print-search-dirs', but not
# $gcc/lib64 (even though it does actually search there...)..
# This confuses libtool. So add it to the compiler tool search
# path explicitly.
if [ -e "$gcc/lib64" -a ! -L "$gcc/lib64" ]; then
gccLDFlags+=" -L$gcc/lib64"
gccCFlags+=" -B$gcc/lib64"
fi
gccLDFlags+=" -L$gcc/lib"
${optionalString gcc.langVhdl or false ''
gccLDFlags+=" -L${zlib}/lib"
''}
# Find the gcc libraries path (may work only without multilib).
${optionalString gcc.langAda or false ''
basePath=`echo $gcc/lib/*/*/*`
gccCFlags+=" -B$basePath -I$basePath/adainclude"
gnatCFlags="-aI$basePath/adainclude -aO$basePath/adalib"
echo "$gnatCFlags" > $out/nix-support/gnat-cflags
''}
echo "$gccLDFlags" > $out/nix-support/gcc-ldflags
echo "$gccCFlags" > $out/nix-support/gcc-cflags
gccPath="$gcc/bin"
ldPath="$binutils/bin"
# Propagate the wrapped gcc so that if you install the wrapper,
# you get tools like gcov, the manpages, etc. as well (including
# for binutils and Glibc).
echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages
echo ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs
''
+ optionalString (stdenv.isSunOS && nativePrefix != "") ''
# Solaris needs an additional ld wrapper.
ldPath="${nativePrefix}/bin"
ld="$out/bin/ld-solaris"
wrap ld-solaris ${./ld-solaris-wrapper.sh}
'')
+ ''
# Create a symlink to as (the assembler). This is useful when a
# gcc-wrapper is installed in a user environment, as it ensures that
# the right assembler is called.
if [ -e $ldPath/as ]; then
ln -s $ldPath/as $out/bin/as
fi
wrap ld ${./ld-wrapper.sh} ''${ld:-$ldPath/ld}
if [ -e $binutils/bin/ld.gold ]; then
wrap ld.gold ${./ld-wrapper.sh} $binutils/bin/ld.gold
fi
if [ -e $binutils/bin/ld.bfd ]; then
wrap ld.bfd ${./ld-wrapper.sh} $binutils/bin/ld.bfd
fi
if [ -e $gccPath/gcc ]; then
wrap gcc ${./gcc-wrapper.sh} $gccPath/gcc
ln -s gcc $out/bin/cc
elif [ -e $gccPath/clang ]; then
wrap clang ${./gcc-wrapper.sh} $gccPath/clang
ln -s clang $out/bin/cc
fi
if [ -e $gccPath/g++ ]; then
wrap g++ ${./gcc-wrapper.sh} $gccPath/g++
ln -s g++ $out/bin/c++
elif [ -e $gccPath/clang++ ]; then
wrap clang++ ${./gcc-wrapper.sh} $gccPath/clang++
ln -s clang++ $out/bin/c++
fi
if [ -e $gccPath/cpp ]; then
wrap cpp ${./gcc-wrapper.sh} $gccPath/cpp
fi
''
+ optionalString gcc.langFortran or false ''
wrap gfortran ${./gcc-wrapper.sh} $gccPath/gfortran
ln -sv gfortran $out/bin/g77
ln -sv gfortran $out/bin/f77
''
+ optionalString gcc.langJava or false ''
wrap gcj ${./gcc-wrapper.sh} $gccPath/gcj
''
+ optionalString gcc.langGo or false ''
wrap gccgo ${./gcc-wrapper.sh} $gccPath/gccgo
''
+ optionalString gcc.langAda or false ''
wrap gnatgcc ${./gcc-wrapper.sh} $gccPath/gnatgcc
wrap gnatmake ${./gnat-wrapper.sh} $gccPath/gnatmake
wrap gnatbind ${./gnat-wrapper.sh} $gccPath/gnatbind
wrap gnatlink ${./gnatlink-wrapper.sh} $gccPath/gnatlink
''
+ optionalString gcc.langVhdl or false ''
ln -s $gccPath/ghdl $out/bin/ghdl
''
+ ''
substituteAll ${./setup-hook.sh} $out/nix-support/setup-hook
substituteAll ${./add-flags} $out/nix-support/add-flags.sh
cp -p ${./utils.sh} $out/nix-support/utils.sh
if [ -e $out/bin/clang ]; then
echo 'export CC; : ''${CC:=clang}' >> $out/nix-support/setup-hook
fi
if [ -e $out/bin/clang++ ]; then
echo 'export CXX; : ''${CXX:=clang++}' >> $out/nix-support/setup-hook
fi
'';
# The dynamic linker has different names on different Linux platforms.
dynamicLinker =
if !nativeLibc then
(if stdenv.system == "i686-linux" then "ld-linux.so.2" else
if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
# ARM with a wildcard, which can be "" or "-armhf".
if stdenv.isArm then "ld-linux*.so.3" else
if stdenv.system == "powerpc-linux" then "ld.so.1" else
if stdenv.system == "mips64el-linux" then "ld.so.1" else
abort "Don't know the name of the dynamic linker for this platform.")
else "";
crossAttrs = { crossAttrs = {
shell = shell.crossDrv + shell.crossDrv.shellPath; shell = shell.crossDrv + shell.crossDrv.shellPath;
@ -73,8 +241,6 @@ stdenv.mkDerivation {
abort "don't know the name of the dynamic linker for this platform"); abort "don't know the name of the dynamic linker for this platform");
}; };
preferLocalBuild = true;
meta = meta =
let gcc_ = if gcc != null then gcc else {}; in let gcc_ = if gcc != null then gcc else {}; in
(if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) // (if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) //
@ -82,16 +248,4 @@ stdenv.mkDerivation {
stdenv.lib.attrByPath ["meta" "description"] "System C compiler" gcc_ stdenv.lib.attrByPath ["meta" "description"] "System C compiler" gcc_
+ " (wrapper script)"; + " (wrapper script)";
}; };
# The dynamic linker has different names on different Linux platforms.
dynamicLinker =
if !nativeLibc then
(if stdenv.system == "i686-linux" then "ld-linux.so.2" else
if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
# ARM with a wildcard, which can be "" or "-armhf".
if stdenv.isArm then "ld-linux*.so.3" else
if stdenv.system == "powerpc-linux" then "ld.so.1" else
if stdenv.system == "mips64el-linux" then "ld.so.1" else
abort "don't know the name of the dynamic linker for this platform")
else "";
} }

View File

@ -1,10 +1,10 @@
#! @shell@ -e #! @shell@ -e
if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then if [ -n "$NIX_GCC_WRAPPER_START_HOOK" ]; then
source "$NIX_GCC_WRAPPER_START_HOOK" source "$NIX_GCC_WRAPPER_START_HOOK"
fi fi
if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then if [ -z "$NIX_GCC_WRAPPER_FLAGS_SET" ]; then
source @out@/nix-support/add-flags.sh source @out@/nix-support/add-flags.sh
fi fi
@ -18,26 +18,26 @@ getVersion=0
nonFlagArgs=0 nonFlagArgs=0
for i in "$@"; do for i in "$@"; do
if test "$i" = "-c"; then if [ "$i" = -c ]; then
dontLink=1 dontLink=1
elif test "$i" = "-S"; then elif [ "$i" = -S ]; then
dontLink=1 dontLink=1
elif test "$i" = "-E"; then elif [ "$i" = -E ]; then
dontLink=1 dontLink=1
elif test "$i" = "-E"; then elif [ "$i" = -E ]; then
dontLink=1 dontLink=1
elif test "$i" = "-M"; then elif [ "$i" = -M ]; then
dontLink=1 dontLink=1
elif test "$i" = "-MM"; then elif [ "$i" = -MM ]; then
dontLink=1 dontLink=1
elif test "$i" = "-x"; then elif [ "$i" = -x ]; then
# At least for the cases c-header or c++-header we should set dontLink. # At least for the cases c-header or c++-header we should set dontLink.
# I expect no one use -x other than making precompiled headers. # I expect no one use -x other than making precompiled headers.
dontLink=1 dontLink=1
elif test "${i:0:1}" != "-"; then elif [ "${i:0:1}" != - ]; then
nonFlagArgs=1 nonFlagArgs=1
elif test "$i" = "-m32"; then elif [ "$i" = -m32 ]; then
if test -e @out@/nix-support/dynamic-linker-m32; then if [ -e @out@/nix-support/dynamic-linker-m32 ]; then
NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)"
fi fi
fi fi
@ -48,28 +48,28 @@ done
# "-c" flag). So if no non-flag arguments are given, don't pass any # "-c" flag). So if no non-flag arguments are given, don't pass any
# linker flags. This catches cases like "gcc" (should just print # linker flags. This catches cases like "gcc" (should just print
# "gcc: no input files") and "gcc -v" (should print the version). # "gcc: no input files") and "gcc -v" (should print the version).
if test "$nonFlagArgs" = "0"; then if [ "$nonFlagArgs" = 0 ]; then
dontLink=1 dontLink=1
fi fi
# Optionally filter out paths not refering to the store. # Optionally filter out paths not refering to the store.
params=("$@") params=("$@")
if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then
rest=() rest=()
n=0 n=0
while test $n -lt ${#params[*]}; do while [ $n -lt ${#params[*]} ]; do
p=${params[n]} p=${params[n]}
p2=${params[$((n+1))]} p2=${params[$((n+1))]}
if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then
skip $p skip $p
elif test "$p" = "-L" && badPath "$p2"; then elif [ "$p" = -L ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then elif [ "${p:0:3}" = -I/ ] && badPath "${p:2}"; then
skip $p skip $p
elif test "$p" = "-I" && badPath "$p2"; then elif [ "$p" = -I ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
elif test "$p" = "-isystem" && badPath "$p2"; then elif [ "$p" = -isystem ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
else else
rest=("${rest[@]}" "$p") rest=("${rest[@]}" "$p")
@ -86,14 +86,14 @@ extraBefore=()
# When enforcing purity, pretend gcc can't find the current date and # When enforcing purity, pretend gcc can't find the current date and
# time # time
if test "$NIX_ENFORCE_PURITY" = "1"; then if [ "$NIX_ENFORCE_PURITY" = 1 ]; then
extraAfter+=('-D__DATE__="Jan 01 1970"' extraAfter+=('-D__DATE__="Jan 01 1970"'
'-D__TIME__="00:00:01"' '-D__TIME__="00:00:01"'
-Wno-builtin-macro-redefined) -Wno-builtin-macro-redefined)
fi fi
if test "$dontLink" != "1"; then if [ "$dontLink" != 1 ]; then
# Add the flags that should only be passed to the compiler when # Add the flags that should only be passed to the compiler when
# linking. # linking.
@ -105,11 +105,11 @@ if test "$dontLink" != "1"; then
extraBefore=(${extraBefore[@]} "-Wl,$i") extraBefore=(${extraBefore[@]} "-Wl,$i")
done done
for i in $NIX_LDFLAGS; do for i in $NIX_LDFLAGS; do
if test "${i:0:3}" = "-L/"; then if [ "${i:0:3}" = -L/ ]; then
extraAfter+=("$i") extraAfter+=("$i")
else else
extraAfter+=("-Wl,$i") extraAfter+=("-Wl,$i")
fi fi
done done
export NIX_LDFLAGS_SET=1 export NIX_LDFLAGS_SET=1
fi fi
@ -118,39 +118,29 @@ fi
# add anything. This is to prevent `gcc -v' (which normally prints # add anything. This is to prevent `gcc -v' (which normally prints
# out the version number and returns exit code 0) from printing out # out the version number and returns exit code 0) from printing out
# `No input files specified' and returning exit code 1. # `No input files specified' and returning exit code 1.
if test "$*" = "-v"; then if [ "$*" = -v ]; then
extraAfter=() extraAfter=()
extraBefore=() extraBefore=()
fi fi
# Optionally print debug info. # Optionally print debug info.
if test "$NIX_DEBUG" = "1"; then if [ -n "$NIX_DEBUG" ]; then
echo "original flags to @gccProg@:" >&2 echo "original flags to @prog@:" >&2
for i in "${params[@]}"; do for i in "${params[@]}"; do
echo " $i" >&2 echo " $i" >&2
done done
echo "extraBefore flags to @gccProg@:" >&2 echo "extraBefore flags to @prog@:" >&2
for i in ${extraBefore[@]}; do for i in ${extraBefore[@]}; do
echo " $i" >&2 echo " $i" >&2
done done
echo "extraAfter flags to @gccProg@:" >&2 echo "extraAfter flags to @prog@:" >&2
for i in ${extraAfter[@]}; do for i in ${extraAfter[@]}; do
echo " $i" >&2 echo " $i" >&2
done done
fi fi
if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then if [ -n "$NIX_GCC_WRAPPER_EXEC_HOOK" ]; then
source "$NIX_GCC_WRAPPER_EXEC_HOOK" source "$NIX_GCC_WRAPPER_EXEC_HOOK"
fi fi
exec @prog@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}"
# Call the real `gcc'. Filter out warnings from stderr about unused
# `-B' flags, since they confuse some programs. Deep bash magic to
# apply grep to stderr (by swapping stdin/stderr twice).
if test -z "$NIX_GCC_NEEDS_GREP"; then
@gccProg@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}"
else
(@gccProg@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}" 3>&2 2>&1 1>&3- \
| (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3-
exit $?
fi

View File

@ -1,10 +1,10 @@
#! @shell@ -e #! @shell@ -e
if test -n "$NIX_GNAT_WRAPPER_START_HOOK"; then if [ -n "$NIX_GNAT_WRAPPER_START_HOOK" ]; then
source "$NIX_GNAT_WRAPPER_START_HOOK" source "$NIX_GNAT_WRAPPER_START_HOOK"
fi fi
if test -z "$NIX_GNAT_WRAPPER_FLAGS_SET"; then if [ -z "$NIX_GNAT_WRAPPER_FLAGS_SET" ]; then
source @out@/nix-support/add-flags.sh source @out@/nix-support/add-flags.sh
fi fi
@ -18,14 +18,14 @@ getVersion=0
nonFlagArgs=0 nonFlagArgs=0
for i in "$@"; do for i in "$@"; do
if test "$i" = "-c"; then if [ "$i" = -c ]; then
dontLink=1 dontLink=1
elif test "$i" = "-M"; then elif [ "$i" = -M ]; then
dontLink=1 dontLink=1
elif test "${i:0:1}" != "-"; then elif [ "${i:0:1}" != - ]; then
nonFlagArgs=1 nonFlagArgs=1
elif test "$i" = "-m32"; then elif [ "$i" = -m32 ]; then
if test -e @out@/nix-support/dynamic-linker-m32; then if [ -e @out@/nix-support/dynamic-linker-m32 ]; then
NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)"
fi fi
fi fi
@ -36,26 +36,26 @@ done
# "-c" flag). So if no non-flag arguments are given, don't pass any # "-c" flag). So if no non-flag arguments are given, don't pass any
# linker flags. This catches cases like "gcc" (should just print # linker flags. This catches cases like "gcc" (should just print
# "gcc: no input files") and "gcc -v" (should print the version). # "gcc: no input files") and "gcc -v" (should print the version).
if test "$nonFlagArgs" = "0"; then if [ "$nonFlagArgs" = 0 ]; then
dontLink=1 dontLink=1
fi fi
# Optionally filter out paths not refering to the store. # Optionally filter out paths not refering to the store.
params=("$@") params=("$@")
if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then
rest=() rest=()
n=0 n=0
while test $n -lt ${#params[*]}; do while [ $n -lt ${#params[*]} ]; do
p=${params[n]} p=${params[n]}
p2=${params[$((n+1))]} p2=${params[$((n+1))]}
if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then
skip $p skip $p
elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then elif [ "${p:0:3}" = -I/ ] && badPath "${p:2}"; then
skip $p skip $p
elif test "${p:0:4}" = "-aI/" && badPath "${p:3}"; then elif [ "${p:0:4}" = -aI/ ] && badPath "${p:3}"; then
skip $p skip $p
elif test "${p:0:4}" = "-aO/" && badPath "${p:3}"; then elif [ "${p:0:4}" = -aO/ ] && badPath "${p:3}"; then
skip $p skip $p
else else
rest=("${rest[@]}" "$p") rest=("${rest[@]}" "$p")
@ -81,33 +81,23 @@ fi
#done #done
# Optionally print debug info. # Optionally print debug info.
if test "$NIX_DEBUG" = "1"; then if [ -n "$NIX_DEBUG" ]; then
echo "original flags to @gnatProg@:" >&2 echo "original flags to @prog@:" >&2
for i in "${params[@]}"; do for i in "${params[@]}"; do
echo " $i" >&2 echo " $i" >&2
done done
echo "extraBefore flags to @gnatProg@:" >&2 echo "extraBefore flags to @prog@:" >&2
for i in ${extraBefore[@]}; do for i in ${extraBefore[@]}; do
echo " $i" >&2 echo " $i" >&2
done done
echo "extraAfter flags to @gnatProg@:" >&2 echo "extraAfter flags to @prog@:" >&2
for i in ${extraAfter[@]}; do for i in ${extraAfter[@]}; do
echo " $i" >&2 echo " $i" >&2
done done
fi fi
if test -n "$NIX_GNAT_WRAPPER_EXEC_HOOK"; then if [ -n "$NIX_GNAT_WRAPPER_EXEC_HOOK" ]; then
source "$NIX_GNAT_WRAPPER_EXEC_HOOK" source "$NIX_GNAT_WRAPPER_EXEC_HOOK"
fi fi
exec @prog@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
# Call the real `gcc'. Filter out warnings from stderr about unused
# `-B' flags, since they confuse some programs. Deep bash magic to
# apply grep to stderr (by swapping stdin/stderr twice).
if test -z "$NIX_GNAT_NEEDS_GREP"; then
@gnatProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
else
(@gnatProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \
| (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3-
exit $?
fi

View File

@ -11,33 +11,23 @@ extraBefore=()
#done #done
# Optionally print debug info. # Optionally print debug info.
if test "$NIX_DEBUG" = "1"; then if [ -n "$NIX_DEBUG" ]; then
echo "original flags to @gnatlinkProg@:" >&2 echo "original flags to @prog@:" >&2
for i in "$@"; do for i in "$@"; do
echo " $i" >&2 echo " $i" >&2
done done
echo "extraBefore flags to @gnatlinkProg@:" >&2 echo "extraBefore flags to @prog@:" >&2
for i in ${extraBefore[@]}; do for i in ${extraBefore[@]}; do
echo " $i" >&2 echo " $i" >&2
done done
echo "extraAfter flags to @gnatlinkProg@:" >&2 echo "extraAfter flags to @prog@:" >&2
for i in ${extraAfter[@]}; do for i in ${extraAfter[@]}; do
echo " $i" >&2 echo " $i" >&2
done done
fi fi
if test -n "$NIX_GNAT_WRAPPER_EXEC_HOOK"; then if [ -n "$NIX_GNAT_WRAPPER_EXEC_HOOK" ]; then
source "$NIX_GNAT_WRAPPER_EXEC_HOOK" source "$NIX_GNAT_WRAPPER_EXEC_HOOK"
fi fi
exec @prog@ ${extraBefore[@]} "$@" ${extraAfter[@]}
# Call the real `gcc'. Filter out warnings from stderr about unused
# `-B' flags, since they confuse some programs. Deep bash magic to
# apply grep to stderr (by swapping stdin/stderr twice).
if test -z "$NIX_GNAT_NEEDS_GREP"; then
@gnatlinkProg@ ${extraBefore[@]} "$@" ${extraAfter[@]}
else
(@gnatlinkProg@ ${extraBefore[@]} "$@" ${extraAfter[@]} 3>&2 2>&1 1>&3- \
| (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3-
exit $?
fi

View File

@ -6,7 +6,7 @@ set -u
# I've also tried adding -z direct and -z lazyload, but it gave too many problems with C++ exceptions :'( # I've also tried adding -z direct and -z lazyload, but it gave too many problems with C++ exceptions :'(
# Also made sure libgcc would not be lazy-loaded, as suggested here: https://www.illumos.org/issues/2534#note-3 # Also made sure libgcc would not be lazy-loaded, as suggested here: https://www.illumos.org/issues/2534#note-3
# but still no success. # but still no success.
cmd="@ld@ -z ignore" cmd="@prog@ -z ignore"
args=("$@"); args=("$@");

View File

@ -1,10 +1,10 @@
#! @shell@ -e #! @shell@ -e
if test -n "$NIX_LD_WRAPPER_START_HOOK"; then if [ -n "$NIX_LD_WRAPPER_START_HOOK" ]; then
source "$NIX_LD_WRAPPER_START_HOOK" source "$NIX_LD_WRAPPER_START_HOOK"
fi fi
if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then if [ -z "$NIX_GCC_WRAPPER_FLAGS_SET" ]; then
source @out@/nix-support/add-flags.sh source @out@/nix-support/add-flags.sh
fi fi
@ -13,26 +13,26 @@ source @out@/nix-support/utils.sh
# Optionally filter out paths not refering to the store. # Optionally filter out paths not refering to the store.
params=("$@") params=("$@")
if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \ if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" \
-a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \); then -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \) ]; then
rest=() rest=()
n=0 n=0
while test $n -lt ${#params[*]}; do while [ $n -lt ${#params[*]} ]; do
p=${params[n]} p=${params[n]}
p2=${params[$((n+1))]} p2=${params[$((n+1))]}
if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then
skip $p skip $p
elif test "$p" = "-L" && badPath "$p2"; then elif [ "$p" = -L ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
elif test "$p" = "-rpath" && badPath "$p2"; then elif [ "$p" = -rpath ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
elif test "$p" = "-dynamic-linker" && badPath "$p2"; then elif [ "$p" = -dynamic-linker ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
elif test "${p:0:1}" = "/" && badPath "$p"; then elif [ "${p:0:1}" = / ] && badPath "$p"; then
# We cannot skip this; barf. # We cannot skip this; barf.
echo "impure path \`$p' used in link" >&2 echo "impure path \`$p' used in link" >&2
exit 1 exit 1
elif test "${p:0:9}" = "--sysroot"; then elif [ "${p:0:9}" = --sysroot ]; then
# Our ld is not built with sysroot support (Can we fix that?) # Our ld is not built with sysroot support (Can we fix that?)
: :
else else
@ -47,7 +47,7 @@ fi
extra=() extra=()
extraBefore=() extraBefore=()
if test -z "$NIX_LDFLAGS_SET"; then if [ -z "$NIX_LDFLAGS_SET" ]; then
extra+=($NIX_LDFLAGS) extra+=($NIX_LDFLAGS)
extraBefore+=($NIX_LDFLAGS_BEFORE) extraBefore+=($NIX_LDFLAGS_BEFORE)
fi fi
@ -56,12 +56,12 @@ extra+=($NIX_LDFLAGS_AFTER)
# Add all used dynamic libraries to the rpath. # Add all used dynamic libraries to the rpath.
if test "$NIX_DONT_SET_RPATH" != "1"; then if [ "$NIX_DONT_SET_RPATH" != 1 ]; then
libPath="" libPath=""
addToLibPath() { addToLibPath() {
local path="$1" local path="$1"
if test "${path:0:1}" != "/"; then return 0; fi if [ "${path:0:1}" != / ]; then return 0; fi
case "$path" in case "$path" in
*..*|*./*|*/.*|*//*) *..*|*./*|*/.*|*//*)
local path2 local path2
@ -80,7 +80,7 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then
# If the path is not in the store, don't add it to the rpath. # If the path is not in the store, don't add it to the rpath.
# This typically happens for libraries in /tmp that are later # This typically happens for libraries in /tmp that are later
# copied to $out/lib. If not, we're screwed. # copied to $out/lib. If not, we're screwed.
if test "${1:0:${#NIX_STORE}}" != "$NIX_STORE"; then return 0; fi if [ "${1:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then return 0; fi
case $rpath in case $rpath in
*\ $1\ *) return 0 ;; *\ $1\ *) return 0 ;;
esac esac
@ -97,20 +97,20 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then
# First, find all -L... switches. # First, find all -L... switches.
allParams=("${params[@]}" ${extra[@]}) allParams=("${params[@]}" ${extra[@]})
n=0 n=0
while test $n -lt ${#allParams[*]}; do while [ $n -lt ${#allParams[*]} ]; do
p=${allParams[n]} p=${allParams[n]}
p2=${allParams[$((n+1))]} p2=${allParams[$((n+1))]}
if test "${p:0:3}" = "-L/"; then if [ "${p:0:3}" = -L/ ]; then
addToLibPath ${p:2} addToLibPath ${p:2}
elif test "$p" = "-L"; then elif [ "$p" = -L ]; then
addToLibPath ${p2} addToLibPath ${p2}
n=$((n + 1)) n=$((n + 1))
elif test "$p" = "-l"; then elif [ "$p" = -l ]; then
addToLibs ${p2} addToLibs ${p2}
n=$((n + 1)) n=$((n + 1))
elif test "${p:0:2}" = "-l"; then elif [ "${p:0:2}" = -l ]; then
addToLibs ${p:2} addToLibs ${p:2}
elif test "$p" = "-dynamic-linker"; then elif [ "$p" = -dynamic-linker ]; then
# Ignore the dynamic linker argument, or it # Ignore the dynamic linker argument, or it
# will get into the next 'elif'. We don't want # will get into the next 'elif'. We don't want
# the dynamic linker path rpath to go always first. # the dynamic linker path rpath to go always first.
@ -132,7 +132,7 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then
for i in $libPath; do for i in $libPath; do
for j in $libs; do for j in $libs; do
if test -f "$i/lib$j.so"; then if [ -f "$i/lib$j.so" ]; then
addToRPath $i addToRPath $i
break break
fi fi
@ -148,19 +148,19 @@ fi
# Optionally print debug info. # Optionally print debug info.
if test "$NIX_DEBUG" = "1"; then if [ -n "$NIX_DEBUG" ]; then
echo "original flags to @ld@:" >&2 echo "original flags to @prog@:" >&2
for i in "${params[@]}"; do for i in "${params[@]}"; do
echo " $i" >&2 echo " $i" >&2
done done
echo "extra flags to @ld@:" >&2 echo "extra flags to @prog@:" >&2
for i in ${extra[@]}; do for i in ${extra[@]}; do
echo " $i" >&2 echo " $i" >&2
done done
fi fi
if test -n "$NIX_LD_WRAPPER_EXEC_HOOK"; then if [ -n "$NIX_LD_WRAPPER_EXEC_HOOK" ]; then
source "$NIX_LD_WRAPPER_EXEC_HOOK" source "$NIX_LD_WRAPPER_EXEC_HOOK"
fi fi
exec @ld@ ${extraBefore[@]} "${params[@]}" ${extra[@]} exec @prog@ ${extraBefore[@]} "${params[@]}" ${extra[@]}

View File

@ -1,16 +1,16 @@
export NIX_GCC=@out@ export NIX_GCC=@out@
addCVars () { addCVars () {
if test -d $1/include; then if [ -d $1/include ]; then
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include" export NIX_CFLAGS_COMPILE+=" -isystem $1/include"
fi fi
if test -d $1/lib64; then if [ -d $1/lib64 -a ! -L $1/lib64 ]; then
export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64" export NIX_LDFLAGS+=" -L$1/lib64"
fi fi
if test -d $1/lib; then if [ -d $1/lib ]; then
export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib" export NIX_LDFLAGS+=" -L$1/lib"
fi fi
} }
@ -18,18 +18,18 @@ envHooks+=(addCVars)
# Note: these come *after* $out in the PATH (see setup.sh). # Note: these come *after* $out in the PATH (see setup.sh).
if test -n "@gcc@"; then if [ -n "@gcc@" ]; then
addToSearchPath PATH @gcc@/bin addToSearchPath PATH @gcc@/bin
fi fi
if test -n "@binutils@"; then if [ -n "@binutils@" ]; then
addToSearchPath PATH @binutils@/bin addToSearchPath PATH @binutils@/bin
fi fi
if test -n "@libc@"; then if [ -n "@libc@" ]; then
addToSearchPath PATH @libc@/bin addToSearchPath PATH @libc@/bin
fi fi
if test -n "@coreutils@"; then if [ -n "@coreutils@" ]; then
addToSearchPath PATH @coreutils@/bin addToSearchPath PATH @coreutils@/bin
fi fi

View File

@ -1,5 +1,5 @@
skip () { skip () {
if test "$NIX_DEBUG" = "1"; then if [ -n "$NIX_DEBUG" ]; then
echo "skipping impure path $1" >&2 echo "skipping impure path $1" >&2
fi fi
} }
@ -12,7 +12,7 @@ badPath() {
# Relative paths are okay (since they're presumably relative to # Relative paths are okay (since they're presumably relative to
# the temporary build directory). # the temporary build directory).
if test "${p:0:1}" != "/"; then return 1; fi if [ "${p:0:1}" != / ]; then return 1; fi
# Otherwise, the path should refer to the store or some temporary # Otherwise, the path should refer to the store or some temporary
# directory (including the build directory). # directory (including the build directory).

View File

@ -10,6 +10,8 @@
# their absolute path (using "install_name_tool -id"). It also # their absolute path (using "install_name_tool -id"). It also
# rewrites references in other dylibs to absolute paths. # rewrites references in other dylibs to absolute paths.
postFixupHooks+=('fixDarwinDylibNamesIn $prefix')
fixDarwinDylibNames() { fixDarwinDylibNames() {
local flags=() local flags=()
local old_id local old_id
@ -29,7 +31,3 @@ fixDarwinDylibNamesIn() {
local dir="$1" local dir="$1"
fixDarwinDylibNames $(find "$dir" -name "*.dylib") fixDarwinDylibNames $(find "$dir" -name "*.dylib")
} }
postFixup() {
fixDarwinDylibNamesIn "$prefix"
}

View File

@ -4,6 +4,7 @@
, gmp ? null, mpfr ? null, bison ? null, flex ? null , gmp ? null, mpfr ? null, bison ? null, flex ? null
}: }:
assert false;
assert stdenv.isDarwin; assert stdenv.isDarwin;
assert langF77 -> gmp != null; assert langF77 -> gmp != null;

View File

@ -62,7 +62,8 @@ stdenv.mkDerivation rec {
'' else ""); '' else "");
configurePhase = '' configurePhase = ''
./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include \
--with-clang
''; '';
# Stripping combined with patchelf breaks the executables (they die # Stripping combined with patchelf breaks the executables (they die

View File

@ -0,0 +1,93 @@
{stdenv, fetchurl, perl, ncurses, gmp}:
stdenv.mkDerivation rec {
version = "7.8.3";
name = "ghc-${version}-binary";
src =
if stdenv.system == "i686-linux" then
fetchurl {
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi";
}
else if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns";
}
else if stdenv.system == "i686-darwin" then
fetchurl {
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0";
}
else if stdenv.system == "x86_64-darwin" then
fetchurl {
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
sha256 = "1ja0cq5xyjcvjpvjmm4nzhkpmwfs2kjlldbc48lxcs9rmqi7rnay";
}
else throw "cannot bootstrap GHC on this platform";
buildInputs = [perl];
postUnpack =
# Strip is harmful, see also below. It's important that this happens
# first. The GHC Cabal build system makes use of strip by default and
# has hardcoded paths to /usr/bin/strip in many places. We replace
# those below, making them point to our dummy script.
''
mkdir "$TMP/bin"
for i in strip; do
echo '#! ${stdenv.shell}' > "$TMP/bin/$i"
chmod +x "$TMP/bin/$i"
done
PATH="$TMP/bin:$PATH"
'' +
# We have to patch the GMP paths for the integer-gmp package.
''
find . -name integer-gmp.buildinfo \
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp}/lib@" {} \;
'' +
# On Linux, use patchelf to modify the executables so that they can
# find editline/gmp.
(if stdenv.isLinux then ''
find . -type f -perm +100 \
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath "${ncurses}/lib:${gmp}/lib" {} \;
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
for prog in ld ar gcc strip ranlib; do
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
done
'' else "");
configurePhase = ''
./configure --prefix=$out --with-gmp-libraries=${gmp}/lib \
--with-gmp-includes=${gmp}/include
'';
# Stripping combined with patchelf breaks the executables (they die
# with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
dontStrip = true;
# No building is necessary, but calling make without flags ironically
# calls install-strip ...
buildPhase = "true";
postInstall =
''
# Sanity check, can ghc create executables?
cd $TMP
mkdir test-ghc; cd test-ghc
cat > main.hs << EOF
module Main where
main = putStrLn "yes"
EOF
$out/bin/ghc --make main.hs
echo compilation ok
[ $(./main) == "yes" ]
'';
meta.license = stdenv.lib.licenses.bsd3;
meta.platforms = ["x86_64-linux" "i686-linux" "i686-darwin" "x86_64-darwin"];
}

View File

@ -26,8 +26,6 @@ stdenv.mkDerivation rec {
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
''; '';
configureFlags = "--with-gcc=${stdenv.gcc}/bin/gcc";
# required, because otherwise all symbols from HSffi.o are stripped, and # required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort # that in turn causes GHCi to abort
stripDebugFlags = [ "-S" "--keep-file-symbols" ]; stripDebugFlags = [ "-S" "--keep-file-symbols" ];

View File

@ -1,5 +1,9 @@
{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src }: { stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src }:
# be sure not to rebuild clang on darwin; some packages request it specifically
# we need to fix those
assert stdenv.isDarwin -> stdenv.gcc.nativeTools;
stdenv.mkDerivation { stdenv.mkDerivation {
name = "clang-${version}"; name = "clang-${version}";

View File

@ -27,7 +27,10 @@ in stdenv.mkDerivation rec {
mv compiler-rt-* $sourceRoot/projects/compiler-rt mv compiler-rt-* $sourceRoot/projects/compiler-rt
''; '';
buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind; buildInputs =
[ perl groff cmake libxml2 libffi ]
++ stdenv.lib.optional (!stdenv.isDarwin) python /*
++ stdenv.lib.optional stdenv.isLinux valgrind */;
propagatedBuildInputs = [ ncurses zlib ]; propagatedBuildInputs = [ ncurses zlib ];
@ -65,6 +68,5 @@ in stdenv.mkDerivation rec {
license = stdenv.lib.licenses.bsd3; license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ shlevy lovek323 raskin viric ]; maintainers = with stdenv.lib.maintainers; [ shlevy lovek323 raskin viric ];
platforms = stdenv.lib.platforms.all; platforms = stdenv.lib.platforms.all;
broken = stdenv.isDarwin;
}; };
} }

View File

@ -26,6 +26,8 @@ stdenv.mkDerivation rec {
sha256 = "b1ca708994180236917ae79e17606da5bd334ca6acd6873a550027e1c0ec874a"; sha256 = "b1ca708994180236917ae79e17606da5bd334ca6acd6873a550027e1c0ec874a";
}; };
patches = [ ./fix-clang-build-on-osx.diff ];
prefixKey = "-prefix "; prefixKey = "-prefix ";
configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" x11lib configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" x11lib
"-x11include" x11inc ]; "-x11include" x11inc ];

View File

@ -0,0 +1,20 @@
diff --git a/configure b/configure
index d45e88f..25d872b 100755
--- a/configure
+++ b/configure
@@ -322,7 +322,14 @@ case "$bytecc,$target" in
bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC"
mathlib="";;
*,*-*-darwin*)
- bytecccompopts="-fno-defer-pop $gcc_warnings"
+ # On recent version of OSX, gcc is a symlink to clang
+ if $bytecc --version | grep -q clang; then
+ # -fno-defer-pop is not supported by clang, and make recent
+ # versions of clang to fail
+ bytecccompopts="$gcc_warnings"
+ else
+ bytecccompopts="-fno-defer-pop $gcc_warnings"
+ fi
mathlib=""
mkexe="$mkexe -Wl,-no_compact_unwind"
# Tell gcc that we can use 32-bit code addresses for threaded code

View File

@ -0,0 +1,14 @@
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index 889bca7..15d39b0 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -74,7 +74,8 @@
in <inttypes.h> would reinclude us, skipping our contents because
_@GUARD_PREFIX@_STDINT_H is defined.
The include_next requires a split double-inclusion guard. */
-# @INCLUDE_NEXT@ @NEXT_STDINT_H@
+# include <inttypes.h>
+// # @INCLUDE_NEXT@ @NEXT_STDINT_H@
#endif
#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H

View File

@ -7,11 +7,11 @@
else stdenv.mkDerivation) else stdenv.mkDerivation)
(rec { (rec {
name = "guile-2.0.9"; name = "guile-2.0.11";
src = fetchurl { src = fetchurl {
url = "mirror://gnu/guile/${name}.tar.xz"; url = "mirror://gnu/guile/${name}.tar.xz";
sha256 = "0nw9y8vjyz4r61v06p9msks5lm58pd91irmzg4k487vmv743h2pp"; sha256 = "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f";
}; };
nativeBuildInputs = [ makeWrapper gawk pkgconfig ]; nativeBuildInputs = [ makeWrapper gawk pkgconfig ];
@ -29,7 +29,7 @@
enableParallelBuilding = true; enableParallelBuilding = true;
patches = [ ./disable-gc-sensitive-tests.patch ./eai_system.patch ] ++ patches = [ ./disable-gc-sensitive-tests.patch ./eai_system.patch ./clang.patch ] ++
(stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch); (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch);
# Explicitly link against libgcc_s, to work around the infamous # Explicitly link against libgcc_s, to work around the infamous

View File

@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
configurePhase = configurePhase =
if stdenv.isDarwin if stdenv.isDarwin
then '' then ''
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDFLAGS="" ) makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDFLAGS="" CC="$CC" )
installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.5.1.5.dylib" INSTALL_DATA='cp -d' ) installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.5.1.5.dylib" INSTALL_DATA='cp -d' )
'' else '' '' else ''
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC" LDFLAGS="-fPIC" ) makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC" LDFLAGS="-fPIC" )

View File

@ -31,7 +31,6 @@ stdenv.mkDerivation rec {
# Miniperl needs -lm. perl needs -lrt. # Miniperl needs -lm. perl needs -lrt.
configureFlags = configureFlags =
[ "-de" [ "-de"
"-Dcc=gcc"
"-Uinstallusrbinperl" "-Uinstallusrbinperl"
"-Dinstallstyle=lib/perl5" "-Dinstallstyle=lib/perl5"
"-Duseshrplib" "-Duseshrplib"

View File

@ -86,6 +86,8 @@ stdenv.mkDerivation rec {
installFlags = stdenv.lib.optionalString docSupport "install-doc"; installFlags = stdenv.lib.optionalString docSupport "install-doc";
CFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.7";
postInstall = '' postInstall = ''
# Bundler tries to create this directory # Bundler tries to create this directory
mkdir -pv $out/${passthru.gemPath} mkdir -pv $out/${passthru.gemPath}

View File

@ -2,6 +2,7 @@
, sslSupport ? true, openssl , sslSupport ? true, openssl
, bdbSupport ? false, db , bdbSupport ? false, db
, ldapSupport ? true, openldap , ldapSupport ? true, openldap
, libiconvOrNull
}: }:
assert sslSupport -> openssl != null; assert sslSupport -> openssl != null;
@ -28,7 +29,7 @@ stdenv.mkDerivation rec {
${stdenv.lib.optionalString ldapSupport "--with-ldap"} ${stdenv.lib.optionalString ldapSupport "--with-ldap"}
''; '';
propagatedBuildInputs = [ makeWrapper apr expat ] propagatedBuildInputs = [ makeWrapper apr expat libiconvOrNull ]
++ optional sslSupport openssl ++ optional sslSupport openssl
++ optional bdbSupport db ++ optional bdbSupport db
++ optional ldapSupport openldap; ++ optional ldapSupport openldap;

View File

@ -0,0 +1,18 @@
--- interfaces/cc/aspell.h 2013-10-13 20:29:33.000000000 +0200
+++ interfaces/cc/aspell.h 2013-10-13 20:30:01.000000000 +0200
@@ -237,6 +237,7 @@
/******************************** errors ********************************/
+#ifndef __cplusplus
extern const struct AspellErrorInfo * const aerror_other;
extern const struct AspellErrorInfo * const aerror_operation_not_supported;
extern const struct AspellErrorInfo * const aerror_cant_copy;
@@ -322,6 +323,7 @@
extern const struct AspellErrorInfo * const aerror_bad_magic;
extern const struct AspellErrorInfo * const aerror_expression;
extern const struct AspellErrorInfo * const aerror_invalid_expression;
+#endif
/******************************* speller *******************************/

View File

@ -8,6 +8,10 @@ stdenv.mkDerivation rec {
sha256 = "1qgn5psfyhbrnap275xjfrzppf5a83fb67gpql0kfqv37al869gm"; sha256 = "1qgn5psfyhbrnap275xjfrzppf5a83fb67gpql0kfqv37al869gm";
}; };
patchPhase = ''
patch interfaces/cc/aspell.h < ${./clang.patch}
'';
buildInputs = [ perl ]; buildInputs = [ perl ];
doCheck = true; doCheck = true;

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames { stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames
, toolset ? null , toolset ? if stdenv.isDarwin then "clang" else null
, enableRelease ? true , enableRelease ? true
, enableDebug ? false , enableDebug ? false
, enableSingleThreaded ? false , enableSingleThreaded ? false
@ -57,6 +57,8 @@ let res = stdenv.mkDerivation {
sha256 = "0lkv5dzssbl5fmh2nkaszi8x9qbj80pr4acf9i26sj3rvlih1w7z"; sha256 = "0lkv5dzssbl5fmh2nkaszi8x9qbj80pr4acf9i26sj3rvlih1w7z";
}; };
patches = stdenv.lib.optional (toolset == "clang") [ ./boost-155-clang.patch ];
enableParallelBuilding = true; enableParallelBuilding = true;
buildInputs = buildInputs =
@ -66,7 +68,7 @@ let res = stdenv.mkDerivation {
configureScript = "./bootstrap.sh"; configureScript = "./bootstrap.sh";
configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python" + withToolset; configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python" + withToolset;
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}"; 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";
# normal install does not install bjam, this is a separate step # normal install does not install bjam, this is a separate step
installPhase = '' installPhase = ''

View File

@ -0,0 +1,90 @@
diff --git a/boost/atomic/detail/cas128strong.hpp b/boost/atomic/detail/cas128strong.hpp
index 906c13e..dcb4d7d 100644
--- a/boost/atomic/detail/cas128strong.hpp
+++ b/boost/atomic/detail/cas128strong.hpp
@@ -196,15 +196,17 @@ class base_atomic<T, void, 16, Sign>
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
+ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
{
+ memset(&v_, 0, sizeof(v_));
memcpy(&v_, &v, sizeof(value_type));
}
void
store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
- storage_type value_s = 0;
+ storage_type value_s;
+ memset(&value_s, 0, sizeof(value_s));
memcpy(&value_s, &value, sizeof(value_type));
platform_fence_before_store(order);
platform_store128(value_s, &v_);
@@ -247,7 +249,9 @@ class base_atomic<T, void, 16, Sign>
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
- storage_type expected_s = 0, desired_s = 0;
+ storage_type expected_s, desired_s;
+ memset(&expected_s, 0, sizeof(expected_s));
+ memset(&desired_s, 0, sizeof(desired_s));
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
diff --git a/boost/atomic/detail/gcc-atomic.hpp b/boost/atomic/detail/gcc-atomic.hpp
index a130590..4af99a1 100644
--- a/boost/atomic/detail/gcc-atomic.hpp
+++ b/boost/atomic/detail/gcc-atomic.hpp
@@ -958,14 +958,16 @@ class base_atomic<T, void, 16, Sign>
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
+ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
{
+ memset(&v_, 0, sizeof(v_));
memcpy(&v_, &v, sizeof(value_type));
}
void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
- storage_type tmp = 0;
+ storage_type tmp;
+ memset(&tmp, 0, sizeof(tmp));
memcpy(&tmp, &v, sizeof(value_type));
__atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order));
}
@@ -980,7 +982,8 @@ class base_atomic<T, void, 16, Sign>
value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
- storage_type tmp = 0;
+ storage_type tmp;
+ memset(&tmp, 0, sizeof(tmp));
memcpy(&tmp, &v, sizeof(value_type));
tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order));
value_type res;
@@ -994,7 +997,9 @@ class base_atomic<T, void, 16, Sign>
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
- storage_type expected_s = 0, desired_s = 0;
+ storage_type expected_s, desired_s;
+ memset(&expected_s, 0, sizeof(expected_s));
+ memset(&desired_s, 0, sizeof(desired_s));
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false,
@@ -1010,7 +1015,9 @@ class base_atomic<T, void, 16, Sign>
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
- storage_type expected_s = 0, desired_s = 0;
+ storage_type expected_s, desired_s;
+ memset(&expected_s, 0, sizeof(expected_s));
+ memset(&desired_s, 0, sizeof(desired_s));
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true,

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, openssl, db, gettext, pam }: { lib, stdenv, fetchurl, openssl, db, gettext, pam, fixDarwinDylibNames }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "cyrus-sasl-2.1.26"; name = "cyrus-sasl-2.1.26";
@ -8,7 +8,10 @@ stdenv.mkDerivation rec {
sha256 = "1hvvbcsg21nlncbgs0cgn3iwlnb3vannzwsp6rwvnn9ba4v53g4g"; sha256 = "1hvvbcsg21nlncbgs0cgn3iwlnb3vannzwsp6rwvnn9ba4v53g4g";
}; };
buildInputs = [ openssl db gettext ] ++ stdenv.lib.optional stdenv.isLinux pam; buildInputs =
[ openssl db gettext ]
++ lib.optional stdenv.isLinux pam
++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
patches = [ ./missing-size_t.patch ]; # https://bugzilla.redhat.com/show_bug.cgi?id=906519 patches = [ ./missing-size_t.patch ]; # https://bugzilla.redhat.com/show_bug.cgi?id=906519
patchFlags = "-p0"; patchFlags = "-p0";
@ -22,7 +25,7 @@ stdenv.mkDerivation rec {
) )
''; '';
installFlags = if stdenv.isDarwin then [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ] else null; installFlags = lib.optional stdenv.isDarwin [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ];
meta = { meta = {
homepage = "http://cyrusimap.web.cmu.edu/"; homepage = "http://cyrusimap.web.cmu.edu/";

View File

@ -18,6 +18,10 @@ stdenv.mkDerivation rec {
patches = extraPatches; patches = extraPatches;
patchPhase = ''
patch src/dbinc/atomic.h < ${./osx.patch}
'';
configureFlags = [ configureFlags = [
(if cxxSupport then "--enable-cxx" else "--disable-cxx") (if cxxSupport then "--enable-cxx" else "--disable-cxx")
(if compat185 then "--enable-compat185" else "--disable-compat185") (if compat185 then "--enable-compat185" else "--disable-compat185")

View File

@ -0,0 +1,20 @@
--- src/dbinc/atomic.h 2013-03-12 14:07:22.000000000 -0400
+++ src/dbinc/atomic.h.change 2013-03-12 14:06:35.000000000 -0400
@@ -144,7 +144,7 @@
#define atomic_inc(env, p) __atomic_inc(p)
#define atomic_dec(env, p) __atomic_dec(p)
#define atomic_compare_exchange(env, p, o, n) \
- __atomic_compare_exchange((p), (o), (n))
+ __atomic_compare_exchange_db((p), (o), (n))
static inline int __atomic_inc(db_atomic_t *p)
{
int temp;
@@ -176,7 +176,7 @@
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
* which configure could be changed to use.
*/
-static inline int __atomic_compare_exchange(
+static inline int __atomic_compare_exchange_db(
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
{
atomic_value_t was;

View File

@ -16,10 +16,13 @@ stdenv.mkDerivation (rec {
# Build a "fat binary", with routines for several sub-architectures # Build a "fat binary", with routines for several sub-architectures
# (x86), except on Solaris where some tests crash with "Memory fault". # (x86), except on Solaris where some tests crash with "Memory fault".
# See <http://hydra.nixos.org/build/2760931>, for instance. # See <http://hydra.nixos.org/build/2760931>, for instance.
#
# no darwin because gmp uses ASM that clang doesn't like
optional (!stdenv.isSunOS) "--enable-fat" optional (!stdenv.isSunOS) "--enable-fat"
++ (if cxx then [ "--enable-cxx" ] ++ (if cxx then [ "--enable-cxx" ]
else [ "--disable-cxx" ]) else [ "--disable-cxx" ])
++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions" ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
++ optional stdenv.isDarwin "ABI=64"
++ optional stdenv.is64bit "--with-pic" ++ optional stdenv.is64bit "--with-pic"
; ;

View File

@ -0,0 +1,30 @@
diff -ru -x '*~' libcxx-3.4.2.src-orig/lib/CMakeLists.txt libcxx-3.4.2.src/lib/CMakeLists.txt
--- libcxx-3.4.2.src-orig/lib/CMakeLists.txt 2013-11-15 18:18:57.000000000 +0100
+++ libcxx-3.4.2.src/lib/CMakeLists.txt 2014-09-24 14:04:01.000000000 +0200
@@ -56,7 +56,7 @@
"-compatibility_version 1"
"-current_version ${LIBCXX_VERSION}"
"-install_name /usr/lib/libc++.1.dylib"
- "-Wl,-reexport_library,/usr/lib/libc++abi.dylib"
+ "-Wl,-reexport_library,${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
"/usr/lib/libSystem.B.dylib")
else()
@@ -64,14 +64,14 @@
list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7)
if (OSX_HAS_ARMV7)
set(OSX_RE_EXPORT_LINE
- "${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"
+ "${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp")
else()
set(OSX_RE_EXPORT_LINE
- "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib")
+ "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib")
endif()
else()
- set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
+ 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")
endif()
list(APPEND link_flags

View File

@ -1,9 +1,8 @@
{ stdenv, fetchurl, cmake, libcxxabi, python }: { lib, stdenv, fetchurl, cmake, libcxxabi, fixDarwinDylibNames }:
let let version = "3.4.2"; in
version = "3.4.2";
in stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libc++-${version}"; name = "libc++-${version}";
src = fetchurl { src = fetchurl {
@ -11,21 +10,32 @@ in stdenv.mkDerivation rec {
sha256 = "0z3jdvgcq995khkpis5c5vaxhbmvbqjlalbhn09k6pgb5zp46rc2"; sha256 = "0z3jdvgcq995khkpis5c5vaxhbmvbqjlalbhn09k6pgb5zp46rc2";
}; };
buildInputs = [ cmake libcxxabi python ]; patches = [ ./darwin.patch ];
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
"-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${libcxxabi}/include"
"-DLIBCXX_CXX_ABI=libcxxabi" ]; cmakeFlags =
[ "-DCMAKE_BUILD_TYPE=Release"
"-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${libcxxabi}/include"
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
"-DLIBCXX_LIBCPPABI_VERSION=2"
"-DLIBCXX_CXX_ABI=libcxxabi"
];
enableParallelBuilding = true; enableParallelBuilding = true;
passthru.abi = libcxxabi; inherit libcxxabi;
# Remove a Makefile that causes many retained dependencies.
postInstall = "rm $out/include/c++/v1/Makefile";
setupHook = ./setup-hook.sh;
meta = { meta = {
homepage = http://libcxx.llvm.org/; homepage = http://libcxx.llvm.org/;
description = "A new implementation of the C++ standard library, targeting C++11"; description = "A new implementation of the C++ standard library, targeting C++11";
license = "BSD"; license = "BSD";
maintainers = [ stdenv.lib.maintainers.shlevy ]; maintainers = [ stdenv.lib.maintainers.shlevy ];
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.unix;
}; };
} }

View File

@ -0,0 +1,2 @@
export NIX_CFLAGS_COMPILE+=" -isystem @out@/include/c++/v1 -stdlib=libc++"
export NIX_CFLAGS_LINK+=" -stdlib=libc++ -Wl,-rpath,@libcxxabi@/lib"

View File

@ -0,0 +1,17 @@
diff -ru -x '*~' libcxxabi-orig/lib/buildit libcxxabi/lib/buildit
--- libcxxabi-orig/lib/buildit 2014-09-18 16:54:14.000000000 +0200
+++ libcxxabi/lib/buildit 2014-09-24 13:22:27.000000000 +0200
@@ -51,12 +51,8 @@
-dynamiclib -nodefaultlibs \
-current_version ${RC_ProjectSourceVersion} \
-compatibility_version 1 \
- -install_name /usr/lib/libc++abi.dylib \
+ -install_name $out/lib/libc++abi.dylib \
-lSystem"
- if [ -f "${SDKROOT}/usr/local/lib/libCrashReporterClient.a" ]
- then
- LDSHARED_FLAGS+=" -lCrashReporterClient"
- fi
;;
*-*-mingw*)
# FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, libcxx, libunwind }: { lib, stdenv, fetchurl, libcxx, coreutils, gnused }:
let rev = "199626"; in let rev = "199626"; in
@ -10,22 +10,32 @@ stdenv.mkDerivation {
sha256 = "09wr6qwgmdzbmgfkdzfhph9giy0zd6fp3s017fcfy4g0prjn5s4c"; sha256 = "09wr6qwgmdzbmgfkdzfhph9giy0zd6fp3s017fcfy4g0prjn5s4c";
}; };
NIX_CFLAGS_LINK = "-L${libunwind}/lib -lunwind"; patches = [ ./no-stdc++.patch ./darwin.patch ];
buildInputs = [ coreutils ];
postUnpack = '' postUnpack = ''
unpackFile ${libcxx.src} unpackFile ${libcxx.src}
export NIX_CFLAGS_COMPILE="-I${libunwind}/include -I$PWD/include -I$(readlink -f libcxx-*)/include" '' + lib.optionalString stdenv.isDarwin ''
export TRIPLE=x86_64-apple-darwin
# Hack: NIX_CFLAGS_COMPILE doesn't work here because clang++ isn't
# wrapped at this point.
export CXX="clang++ -D_LIBCXX_DYNAMIC_FALLBACK=1"
''; '';
installPhase = '' installPhase = if stdenv.isDarwin
install -d -m 755 $out/include $out/lib then ''
install -m 644 lib/libc++abi.so.1.0 $out/lib install -d -m 755 $out/include $out/lib
install -m 644 include/cxxabi.h $out/include install -m 644 lib/libc++abi.dylib $out/lib
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so install -m 644 include/cxxabi.h $out/include
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 ''
''; else ''
install -d -m 755 $out/include $out/lib
patchPhase = "sed -e s,-lstdc++,, -i lib/buildit"; install -m 644 lib/libc++abi.so.1.0 $out/lib
install -m 644 include/cxxabi.h $out/include
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
'';
buildPhase = "(cd lib; ./buildit)"; buildPhase = "(cd lib; ./buildit)";
@ -34,6 +44,6 @@ stdenv.mkDerivation {
description = "A new implementation of low level support for a standard C++ library"; description = "A new implementation of low level support for a standard C++ library";
license = "BSD"; license = "BSD";
maintainers = [ stdenv.lib.maintainers.shlevy ]; maintainers = [ stdenv.lib.maintainers.shlevy ];
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.unix;
}; };
} }

View File

@ -0,0 +1,12 @@
diff -ru -x '*~' libcxxabi-orig/lib/buildit libcxxabi/lib/buildit
--- libcxxabi-orig/lib/buildit 2014-09-18 16:54:14.000000000 +0200
+++ libcxxabi/lib/buildit 2014-09-24 13:22:27.000000000 +0200
@@ -70,7 +66,7 @@
SOEXT=so
LDSHARED_FLAGS="-o libc++abi.so.1.0 \
-shared -nodefaultlibs -Wl,-soname,libc++abi.so.1 \
- -lpthread -lrt -lc -lstdc++"
+ -lpthread -lrt -lc"
;;
esac

View File

@ -16,6 +16,15 @@ stdenv.mkDerivation rec {
configureFlags = [ "--enable-ILU" "--enable-ILUT" ]; configureFlags = [ "--enable-ILU" "--enable-ILUT" ];
preConfigure = ''
sed -i 's, -std=gnu99,,g' configure
sed -i 's,malloc.h,stdlib.h,g' src-ILU/ilur/ilur.c
'';
postConfigure = ''
sed -i '/RESTRICT_KEYWORD/d' include/IL/config.h
'';
patches = patches =
[ ( fetchurl { [ ( fetchurl {
url = http://patch-tracker.debian.org/patch/series/dl/devil/1.7.8-6.1/03_CVE-2009-3994.diff; url = http://patch-tracker.debian.org/patch/series/dl/devil/1.7.8-6.1/03_CVE-2009-3994.diff;

View File

@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
NROFF = "${groff}/bin/nroff"; NROFF = "${groff}/bin/nroff";
postInstall = '' postInstall = ''
sed -i s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc sed -i ${stdenv.lib.optionalString (stdenv.isDarwin && stdenv.gcc.nativeTools) "''"} s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc
''; '';
configureFlags = [ "--enable-widec" ]; configureFlags = [ "--enable-widec" ];

View File

@ -16,13 +16,14 @@ stdenv.mkDerivation rec {
"--with-gcc-arch=generic" # no detection of -march= or -mtune= "--with-gcc-arch=generic" # no detection of -march= or -mtune=
] ++ stdenv.lib.optional (stdenv.needsPax) "--enable-pax_emutramp"; ] ++ stdenv.lib.optional (stdenv.needsPax) "--enable-pax_emutramp";
doCheck = stdenv.isLinux; # until we solve dejagnu problems on darwin and expect on BSD #doCheck = stdenv.isLinux; # until we solve dejagnu problems on darwin and expect on BSD
doCheck = false;
dontStrip = stdenv ? cross; # Don't run the native `strip' when cross-compiling. dontStrip = stdenv ? cross; # Don't run the native `strip' when cross-compiling.
postInstall = postInstall =
# Install headers in the right place. # Install headers in the right place.
'' ln -s${if stdenv.isFreeBSD then "" else "r"}v "$out/lib/"libffi*/include "$out/include" '' ln -s${if stdenv.isBSD then "" else "r"}v "$out/lib/"libffi*/include "$out/include"
''; '';
meta = { meta = {

View File

@ -10,6 +10,8 @@ stdenv.mkDerivation (rec {
propagatedBuildInputs = [ libgpgerror ]; propagatedBuildInputs = [ libgpgerror ];
configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-asm";
doCheck = stdenv.system != "i686-linux"; # "basic" test fails after stdenv+glibc-2.18 doCheck = stdenv.system != "i686-linux"; # "basic" test fails after stdenv+glibc-2.18
# For some reason the tests don't find `libgpg-error.so'. # For some reason the tests don't find `libgpg-error.so'.

View File

@ -0,0 +1,14 @@
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index 997e406..e0827f5 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -53,7 +53,8 @@
in <inttypes.h> would reinclude us, skipping our contents because
_GL_STDINT_H is defined.
The include_next requires a split double-inclusion guard. */
-# @INCLUDE_NEXT@ @NEXT_STDINT_H@
+# include <inttypes.h>
+// # @INCLUDE_NEXT@ @NEXT_STDINT_H@
#endif
#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H

View File

@ -8,6 +8,8 @@ stdenv.mkDerivation (rec {
sha256 = "18q620269xzpw39dwvr9zpilnl2dkw5z5kz3mxaadnpv4k3kw3b1"; sha256 = "18q620269xzpw39dwvr9zpilnl2dkw5z5kz3mxaadnpv4k3kw3b1";
}; };
patches = stdenv.lib.optional stdenv.isDarwin [ ./clang.patch ];
propagatedBuildInputs = propagatedBuildInputs =
stdenv.lib.optional ((! (stdenv ? glibc)) stdenv.lib.optional ((! (stdenv ? glibc))
|| (stdenv ? cross && || (stdenv ? cross &&

View File

@ -1,4 +1,4 @@
{ stdenv, stdenvAdapters, gccApple, fetchurl, pkgconfig, intltool, flex, bison { stdenv, stdenvAdapters, fetchurl, pkgconfig, intltool, flex, bison
, python, libxml2Python, file, expat, makedepend, xorg, llvm, libffi, libvdpau , python, libxml2Python, file, expat, makedepend, xorg, llvm, libffi, libvdpau
, enableTextureFloats ? false # Texture floats are patented, see docs/patents.txt , enableTextureFloats ? false # Texture floats are patented, see docs/patents.txt
, enableExtraFeatures ? false # not maintained , enableExtraFeatures ? false # not maintained

View File

@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
buildInputs = [ gmp mpfr ]; buildInputs = [ gmp mpfr ];
CFLAGS = "-I${gmp}/include";
doCheck = true; doCheck = true;
meta = { meta = {

View File

@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
buildInputs = [ gmp ]; buildInputs = [ gmp ];
CFLAGS = "-I${gmp}/include";
configureFlags = configureFlags =
/* Work around a FreeBSD bug that otherwise leads to segfaults in the test suite: /* Work around a FreeBSD bug that otherwise leads to segfaults in the test suite:
http://hydra.bordeaux.inria.fr/build/34862 http://hydra.bordeaux.inria.fr/build/34862

View File

@ -0,0 +1,42 @@
diff -ruNp ncurses-5.8.orig/c++/cursesf.h ncurses-5.8/c++/cursesf.h
--- ncurses-5.8.orig/c++/cursesf.h 2005-08-13 21:08:24.000000000 +0300
+++ ncurses-5.8/c++/cursesf.h 2011-04-03 18:29:29.000000000 +0300
@@ -681,7 +681,7 @@ public:
const T* p_UserData = STATIC_CAST(T*)(0),
bool with_frame=FALSE,
bool autoDelete_Fields=FALSE)
- : NCursesForm (Fields, with_frame, autoDelete_Fields) {
+ : NCursesForm (&Fields, with_frame, autoDelete_Fields) {
if (form)
set_user (const_cast<void *>(p_UserData));
};
@@ -694,7 +694,7 @@ public:
const T* p_UserData = STATIC_CAST(T*)(0),
bool with_frame=FALSE,
bool autoDelete_Fields=FALSE)
- : NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
+ : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x,
with_frame, autoDelete_Fields) {
if (form)
set_user (const_cast<void *>(p_UserData));
diff -ruNp ncurses-5.8.orig/c++/cursesm.h ncurses-5.8/c++/cursesm.h
--- ncurses-5.8.orig/c++/cursesm.h 2005-08-13 21:10:36.000000000 +0300
+++ ncurses-5.8/c++/cursesm.h 2011-04-03 18:31:42.000000000 +0300
@@ -639,7 +639,7 @@ public:
const T* p_UserData = STATIC_CAST(T*)(0),
bool with_frame=FALSE,
bool autoDelete_Items=FALSE)
- : NCursesMenu (Items, with_frame, autoDelete_Items) {
+ : NCursesMenu (&Items, with_frame, autoDelete_Items) {
if (menu)
set_user (const_cast<void *>(p_UserData));
};
@@ -651,7 +651,7 @@ public:
int begin_x = 0,
const T* p_UserData = STATIC_CAST(T*)(0),
bool with_frame=FALSE)
- : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
+ : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) {
if (menu)
set_user (const_cast<void *>(p_UserData));
};

View File

@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh"; sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
}; };
patches = [ ./patch-ac ]; patches = [ ./patch-ac ./clang.patch ];
configureFlags = '' configureFlags = ''
--with-shared --without-debug --enable-pc-files --enable-symlinks --with-shared --without-debug --enable-pc-files --enable-symlinks
@ -35,8 +35,6 @@ stdenv.mkDerivation rec {
export configureFlags="$configureFlags --includedir=$out/include" export configureFlags="$configureFlags --includedir=$out/include"
export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig" export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig"
mkdir -p "$PKG_CONFIG_LIBDIR" mkdir -p "$PKG_CONFIG_LIBDIR"
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace configure --replace -no-cpp-precomp ""
''; '';
selfNativeBuildInput = true; selfNativeBuildInput = true;

View File

@ -78,8 +78,6 @@ stdenv.mkDerivation rec {
-translationdir $out/share/${name}/translations -translationdir $out/share/${name}/translations
" "
'' + optionalString stdenv.isDarwin '' '' + optionalString stdenv.isDarwin ''
export CXX=clang++
export CC=clang
sed -i 's/QMAKE_CC = gcc/QMAKE_CC = clang/' mkspecs/common/g++-base.conf sed -i 's/QMAKE_CC = gcc/QMAKE_CC = clang/' mkspecs/common/g++-base.conf
sed -i 's/QMAKE_CXX = g++/QMAKE_CXX = clang++/' mkspecs/common/g++-base.conf sed -i 's/QMAKE_CXX = g++/QMAKE_CXX = clang++/' mkspecs/common/g++-base.conf
''; '';

View File

@ -14,6 +14,7 @@ stdenv.mkDerivation (rec {
patches = patches =
[ ./link-against-ncurses.patch [ ./link-against-ncurses.patch
./no-arch_only.patch ./no-arch_only.patch
./clang.patch
] ]
++ ++
(let (let

View File

@ -0,0 +1,13 @@
diff --git a/support/shobj-conf b/support/shobj-conf
index 5a63e80..4b2a741 100644
--- support/shobj-conf
+++ support/shobj-conf
@@ -189,7 +189,7 @@ darwin*|macosx*)
darwin[789]*|darwin10*) SHOBJ_LDFLAGS=''
SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
;;
- *) SHOBJ_LDFLAGS='-dynamic'
+ *) SHOBJ_LDFLAGS='-dynamiclib'
SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
;;
esac

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, krb5, pkgconfig }: { stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, krb5, pkgconfig, gnused }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "serf-1.3.7"; name = "serf-1.3.7";
@ -11,16 +11,20 @@ stdenv.mkDerivation rec {
buildInputs = [ apr scons openssl aprutil zlib krb5 pkgconfig ]; buildInputs = [ apr scons openssl aprutil zlib krb5 pkgconfig ];
configurePhase = '' configurePhase = ''
sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"PATH":os.environ["PATH"]})' -i SConstruct ${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"PATH":os.environ["PATH"]})' -i SConstruct
sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_CFLAGS_COMPILE":os.environ["NIX_CFLAGS_COMPILE"]})' -i SConstruct ${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_CFLAGS_COMPILE":os.environ["NIX_CFLAGS_COMPILE"]})' -i SConstruct
sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_LDFLAGS":os.environ["NIX_LDFLAGS"]})' -i SConstruct ${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_LDFLAGS":os.environ["NIX_LDFLAGS"]})' -i SConstruct
''; '';
buildPhase = '' buildPhase = ''
scons PREFIX="$out" OPENSSL="${openssl}" ZLIB="${zlib}" APR="$(echo "${apr}"/bin/*-config)" \ scons PREFIX="$out" OPENSSL="${openssl}" ZLIB="${zlib}" APR="$(echo "${apr}"/bin/*-config)" \
APU="$(echo "${aprutil}"/bin/*-config)" GSSAPI="${krb5}" CC="${stdenv.gcc}/bin/gcc" APU="$(echo "${aprutil}"/bin/*-config)" GSSAPI="${krb5}" CC="${
if stdenv.isDarwin then "clang" else "${stdenv.gcc}/bin/gcc"
}"
''; '';
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-L/usr/lib";
installPhase = '' installPhase = ''
scons install scons install
''; '';

View File

@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Google's open source JavaScript engine"; description = "Google's open source JavaScript engine";
platforms = with platforms; linux ++ darwin; platforms = with platforms; linux;
license = licenses.bsd3; license = licenses.bsd3;
}; };
} }

View File

@ -1,5 +1,7 @@
{stdenv, fetchurl, runCommand, gcc, zlib}: {stdenv, fetchurl, runCommand, gcc, zlib}:
assert stdenv.isLinux;
let let
ccache = ccache =
stdenv.mkDerivation { stdenv.mkDerivation {

View File

@ -3,6 +3,10 @@
stdenv.mkDerivation { stdenv.mkDerivation {
name = "distcc-masq-${gccRaw.name}"; name = "distcc-masq-${gccRaw.name}";
meta = {
platforms = stdenv.lib.platforms.linux;
};
phases = [ "installPhase" ]; phases = [ "installPhase" ];
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin

View File

@ -31,6 +31,7 @@ stdenv.mkDerivation rec {
configurePhase = '' configurePhase = ''
sed -i "makefile" -"es|PREFIX[[:blank:]]*=.*$|PREFIX = $out|g" sed -i "makefile" -"es|PREFIX[[:blank:]]*=.*$|PREFIX = $out|g"
sed -i "makefile" -"es|gcc|$CC|g"
''; '';
doCheck = true; doCheck = true;

View File

@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
postInstall = '' postInstall = ''
wrapProgram "$out/bin/spring" \ wrapProgram "$out/bin/spring" \
--prefix LD_LIBRARY_PATH : "${stdenv.gcc.gcc}/lib64:${stdenv.gcc.gcc}/lib::${systemd}/lib" --prefix LD_LIBRARY_PATH : "${stdenv.gcc.gcc}/lib::${systemd}/lib"
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
@ -40,6 +40,6 @@ stdenv.mkDerivation rec {
description = "A powerful real-time strategy (RTS) game engine"; description = "A powerful real-time strategy (RTS) game engine";
license = licenses.gpl2; license = licenses.gpl2;
maintainers = [ maintainers.phreedom maintainers.qknight maintainers.iElectric ]; maintainers = [ maintainers.phreedom maintainers.qknight maintainers.iElectric ];
platforms = platforms.mesaPlatforms; platforms = platforms.linux;
}; };
} }

View File

@ -112,7 +112,7 @@ stdenv.mkDerivation rec {
++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio"; ++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio";
additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations"; additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations -Wno-error=conditional-uninitialized";
preConfigure = '' preConfigure = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags" export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags"

View File

@ -69,12 +69,15 @@ in
}; };
libX11 = attrs: attrs // { libX11 = attrs: attrs // {
preConfigure = setMalloc0ReturnsNullCrossCompiling; preConfigure = setMalloc0ReturnsNullCrossCompiling + ''
sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure
'';
postInstall = postInstall =
'' ''
# Remove useless DocBook XML files. # Remove useless DocBook XML files.
rm -rf $out/share/doc rm -rf $out/share/doc
''; '';
CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -";
}; };
libXfont = attrs: attrs // { libXfont = attrs: attrs // {
@ -99,8 +102,11 @@ in
# Note: most of these are in Requires.private, so maybe builder.sh # Note: most of these are in Requires.private, so maybe builder.sh
# should propagate them automatically. # should propagate them automatically.
libXt = attrs: attrs // { libXt = attrs: attrs // {
preConfigure = setMalloc0ReturnsNullCrossCompiling; preConfigure = setMalloc0ReturnsNullCrossCompiling + ''
sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure
'';
propagatedBuildInputs = [ xorg.libSM ]; propagatedBuildInputs = [ xorg.libSM ];
CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -";
}; };
# See https://bugs.freedesktop.org/show_bug.cgi?id=47792 # See https://bugs.freedesktop.org/show_bug.cgi?id=47792

View File

@ -285,18 +285,17 @@ rec {
}; };
/* Modify a stdenv so that it uses the Gold linker. FIXME: should /* Modify a stdenv so that it uses the Gold linker. */
use -fuse-ld=gold instead, but then the ld-wrapper won't be useGoldLinker = stdenv: stdenv //
invoked. */ { mkDerivation = args: stdenv.mkDerivation (args // {
useGoldLinker = stdenv: dontStrip = true;
let NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_COMPILE or "") + " -fuse-ld=gold";
binutils = stdenv.gcc.binutils; });
binutils' = pkgs.runCommand "${binutils.name}-gold" { } };
''
mkdir -p $out/bin
ln -s ${binutils}/bin/* $out/bin/
ln -sfn ${binutils}/bin/ld.gold $out/bin/ld
''; # */
in overrideGCC stdenv (stdenv.gcc.override { binutils = binutils'; });
dropCxx = drv: drv.override {
stdenv = if pkgs.stdenv.isDarwin
then pkgs.allStdenvs.stdenvDarwinNaked
else pkgs.stdenv;
};
} }

View File

@ -0,0 +1,49 @@
{ stdenv, pkgs, config
, haveLibCxx ? true
, useClang33 ? true }:
import ../generic rec {
inherit config;
preHook =
''
export NIX_ENFORCE_PURITY=
export NIX_IGNORE_LD_THROUGH_GCC=1
export NIX_DONT_SET_RPATH=1
export NIX_NO_SELF_RPATH=1
dontFixLibtool=1
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
xargsFlags=" "
export MACOSX_DEPLOYMENT_TARGET=10.9
export SDKROOT=$(/usr/bin/xcrun --sdk macosx10.9 --show-sdk-path 2> /dev/null || true)
export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT/usr/include -F$SDKROOT/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations"
export NIX_LDFLAGS_AFTER+=" -L$SDKROOT/usr/lib"
'';
initialPath = (import ../common-path.nix) {pkgs = pkgs;};
system = stdenv.system;
gcc = import ../../build-support/gcc-wrapper {
nativeTools = false;
nativeLibc = true;
inherit stdenv;
extraPackages = stdenv.lib.optional haveLibCxx pkgs.libcxx;
binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;};
gcc = if useClang33 then pkgs.clang_33.gcc else pkgs.clang.gcc;
coreutils = pkgs.coreutils;
shell = pkgs.bash + "/bin/sh";
};
shell = pkgs.bash + "/bin/sh";
fetchurlBoot = stdenv.fetchurlBoot;
overrides = pkgs_: {
inherit gcc;
inherit (gcc) binutils;
inherit (pkgs)
gzip bzip2 xz bash coreutils diffutils findutils gawk
gnumake gnused gnutar gnugrep gnupatch perl libcxx libcxxabi;
};
}

View File

@ -33,6 +33,26 @@ rec {
pkgs = stdenvNativePkgs; pkgs = stdenvNativePkgs;
}; };
stdenvDarwin = import ./darwin {
inherit config;
stdenv = stdenvNative;
pkgs = stdenvNativePkgs;
};
stdenvDarwinNaked = import ./darwin {
inherit config;
stdenv = stdenvNative;
pkgs = stdenvNativePkgs;
haveLibCxx = false;
};
stdenvDarwin33 = import ./darwin {
inherit config;
stdenv = stdenvNative;
pkgs = stdenvNativePkgs;
useClang33 = true;
};
# Linux standard environment. # Linux standard environment.
stdenvLinux = (import ./linux { inherit system allPackages platform config lib; }).stdenvLinux; stdenvLinux = (import ./linux { inherit system allPackages platform config lib; }).stdenvLinux;
@ -47,7 +67,7 @@ rec {
if system == "armv7l-linux" then stdenvLinux else if system == "armv7l-linux" then stdenvLinux else
if system == "mips64el-linux" then stdenvLinux else if system == "mips64el-linux" then stdenvLinux else
if system == "powerpc-linux" then /* stdenvLinux */ stdenvNative else if system == "powerpc-linux" then /* stdenvLinux */ stdenvNative else
if system == "x86_64-darwin" then stdenvNix else if system == "x86_64-darwin" then stdenvDarwin else
if system == "x86_64-solaris" then stdenvNix else if system == "x86_64-solaris" then stdenvNix else
stdenvNative; stdenvNative;
} }

View File

@ -164,7 +164,8 @@ let
isBSD = system == "i686-freebsd" isBSD = system == "i686-freebsd"
|| system == "x86_64-freebsd" || system == "x86_64-freebsd"
|| system == "i686-openbsd" || system == "i686-openbsd"
|| system == "x86_64-openbsd"; || system == "x86_64-openbsd"
|| system == "x86_64-darwin";
isi686 = system == "i686-linux" isi686 = system == "i686-linux"
|| system == "i686-gnu" || system == "i686-gnu"
|| system == "i686-freebsd" || system == "i686-freebsd"

View File

@ -35,9 +35,6 @@ rec {
alias sed=gsed alias sed=gsed
export MAKE=gmake export MAKE=gmake
shopt -s expand_aliases shopt -s expand_aliases
# Filter out stupid GCC warnings (in gcc-wrapper).
export NIX_GCC_NEEDS_GREP=1
''; '';
prehookOpenBSD = '' prehookOpenBSD = ''
@ -52,9 +49,6 @@ rec {
export MAKE=gmake export MAKE=gmake
shopt -s expand_aliases shopt -s expand_aliases
# Filter out stupid GCC warnings (in gcc-wrapper).
export NIX_GCC_NEEDS_GREP=1
''; '';
prehookNetBSD = '' prehookNetBSD = ''
@ -65,9 +59,6 @@ rec {
alias tar=gtar alias tar=gtar
export MAKE=gmake export MAKE=gmake
shopt -s expand_aliases shopt -s expand_aliases
# Filter out stupid GCC warnings (in gcc-wrapper).
export NIX_GCC_NEEDS_GREP=1
''; '';
prehookCygwin = '' prehookCygwin = ''

View File

@ -7,17 +7,6 @@ import ../generic rec {
'' ''
export NIX_ENFORCE_PURITY=1 export NIX_ENFORCE_PURITY=1
export NIX_IGNORE_LD_THROUGH_GCC=1 export NIX_IGNORE_LD_THROUGH_GCC=1
'' + lib.optionalString stdenv.isDarwin ''
export NIX_ENFORCE_PURITY=
export NIX_DONT_SET_RPATH=1
export NIX_NO_SELF_RPATH=1
dontFixLibtool=1
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
xargsFlags=" "
export MACOSX_DEPLOYMENT_TARGET=10.6
export SDKROOT=$(/usr/bin/xcrun --show-sdk-path 2> /dev/null || true)
export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT/usr/include -F$SDKROOT/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations"
export NIX_LDFLAGS_AFTER+=" -L$SDKROOT/usr/lib"
''; '';
initialPath = (import ../common-path.nix) {pkgs = pkgs;}; initialPath = (import ../common-path.nix) {pkgs = pkgs;};
@ -29,11 +18,7 @@ import ../generic rec {
nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr"; nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr";
nativeLibc = true; nativeLibc = true;
inherit stdenv; inherit stdenv;
binutils = binutils = pkgs.binutils;
if stdenv.isDarwin then
import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}
else
pkgs.binutils;
gcc = pkgs.gcc.gcc; gcc = pkgs.gcc.gcc;
coreutils = pkgs.coreutils; coreutils = pkgs.coreutils;
shell = pkgs.bash + "/bin/sh"; shell = pkgs.bash + "/bin/sh";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, gettext }: { stdenv, fetchurl, gettext, coreutils }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "sharutils-4.11.1"; name = "sharutils-4.11.1";
@ -12,11 +12,11 @@ stdenv.mkDerivation rec {
'' ''
# Fix for building on Glibc 2.16. Won't be needed once the # Fix for building on Glibc 2.16. Won't be needed once the
# gnulib in sharutils is updated. # gnulib in sharutils is updated.
sed -i '/gets is a security hole/d' lib/stdio.in.h sed -i ${stdenv.lib.optionalString (stdenv.isBSD && stdenv.gcc.nativeTools) "''"} '/gets is a security hole/d' lib/stdio.in.h
''; '';
# GNU Gettext is needed on non-GNU platforms. # GNU Gettext is needed on non-GNU platforms.
buildInputs = [ gettext ]; buildInputs = [ gettext coreutils ];
doCheck = true; doCheck = true;

View File

@ -26,6 +26,8 @@ stdenv.mkDerivation {
sharedLibrary = sharedLibrary =
!stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic; !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic;
patchPhase = stdenv.lib.optionalString stdenv.isDarwin "substituteInPlace Makefile --replace 'CC=gcc' 'CC=clang'";
preConfigure = "substituteInPlace Makefile --replace '$(PREFIX)/man' '$(PREFIX)/share/man'"; preConfigure = "substituteInPlace Makefile --replace '$(PREFIX)/man' '$(PREFIX)/share/man'";
makeFlags = if linkStatic then "LDFLAGS=-static" else ""; makeFlags = if linkStatic then "LDFLAGS=-static" else "";

View File

@ -7,4 +7,7 @@ stdenv.mkDerivation {
url = http://tarballs.nixos.org/getopt-1.1.4.tar.gz; url = http://tarballs.nixos.org/getopt-1.1.4.tar.gz;
sha256 = "1arvjfzw6p310zbgv629w5hkyslrj44imf3r3s2r4ry2jfcks221"; sha256 = "1arvjfzw6p310zbgv629w5hkyslrj44imf3r3s2r4ry2jfcks221";
}; };
preBuild = ''
export buildFlags=CC="$CC" # for darwin
'';
} }

View File

@ -16,6 +16,6 @@ stdenv.mkDerivation rec {
license = [ "GPLv2+" ]; license = [ "GPLv2+" ];
maintainers = with stdenv.lib.maintainers; [ the-kenny viric ]; maintainers = with stdenv.lib.maintainers; [ the-kenny viric ];
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.unix;
}; };
} }

View File

@ -19,6 +19,6 @@ stdenv.mkDerivation rec {
description = "OpenSource IPsec-based VPN Solution"; description = "OpenSource IPsec-based VPN Solution";
homepage = https://www.strongswan.org; homepage = https://www.strongswan.org;
license = stdenv.lib.licenses.gpl2Plus; license = stdenv.lib.licenses.gpl2Plus;
inherit (stdenv.gcc.clang.meta) platforms; inherit (stdenv.gcc.gcc.meta) platforms;
}; };
} }

View File

@ -66,6 +66,9 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
meta = { meta = {
# due to builder args bug; see
# https://github.com/NixOS/nix/commit/b224ac15201c57b40ea855f5a98b1bd166c1c7f6
broken = stdenv.isDarwin;
description = "Powerful package manager that makes package management reliable and reproducible"; description = "Powerful package manager that makes package management reliable and reproducible";
longDescription = '' longDescription = ''
Nix is a powerful package manager for Linux and other Unix systems that Nix is a powerful package manager for Linux and other Unix systems that

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, perl, curl, bzip2, sqlite, openssl ? null { stdenv, fetchurl, perl, curl, bzip2, sqlite, openssl ? null
, pkgconfig, boehmgc, perlPackages , pkgconfig, boehmgc, perlPackages, bash
, storeDir ? "/nix/store" , storeDir ? "/nix/store"
, stateDir ? "/nix/var" , stateDir ? "/nix/var"
}: }:
@ -24,6 +24,7 @@ stdenv.mkDerivation rec {
postUnpack = postUnpack =
'' export CPATH="${bzip2}/include" '' export CPATH="${bzip2}/include"
export LIBRARY_PATH="${bzip2}/lib" export LIBRARY_PATH="${bzip2}/lib"
export CXXFLAGS="-O3 -Wno-error=reserved-user-defined-literal"
''; '';
configureFlags = configureFlags =
@ -34,7 +35,7 @@ stdenv.mkDerivation rec {
--with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix} --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}
--disable-init-state --disable-init-state
--enable-gc --enable-gc
CFLAGS=-O3 CXXFLAGS=-O3 CFLAGS=-O3
''; '';
makeFlags = "profiledir=$(out)/etc/profile.d"; makeFlags = "profiledir=$(out)/etc/profile.d";

View File

@ -0,0 +1,13 @@
diff --git a/gl/stdint_.h b/gl/stdint_.h
index bc27595..303e81a 100644
--- a/gl/stdint_.h
+++ b/gl/stdint_.h
@@ -62,7 +62,7 @@
int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
<inttypes.h> also defines intptr_t and uintptr_t. */
# define _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
-# include <inttypes.h>
+// # include <inttypes.h>
# undef _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
#elif @HAVE_SYS_INTTYPES_H@
/* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and

View File

@ -20,6 +20,7 @@ stdenv.mkDerivation rec {
patchPhase = '' patchPhase = ''
find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i
patch gl/stdint_.h < ${./clang.patch}
''; '';
configureFlags = configureFlags =

View File

@ -37,6 +37,7 @@ stdenv.mkDerivation {
prefix=$out prefix=$out
MANDIR=$out/share/man/man1 MANDIR=$out/share/man/man1
${systemFlags} ${systemFlags}
CC="$CC"
) )
''; '';

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, xmlto, docbook_xml_dtd_412, libxslt, docbook_xsl}: { lib, stdenv, fetchurl, xmlto, docbook_xml_dtd_412, libxslt, docbook_xsl }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "opensp-1.5.2"; name = "opensp-1.5.2";
@ -13,6 +13,10 @@ stdenv.mkDerivation {
docsrc/*.xml docsrc/*.xml
''; '';
configureFlags = lib.optional stdenv.isDarwin [
"--with-libintl-prefix=/usr"
"--with-libiconv-prefix=/usr"
];
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
@ -22,7 +26,6 @@ stdenv.mkDerivation {
sed -i -e 's/name="idm.*"//g' $out/share/doc/OpenSP/releasenotes.html sed -i -e 's/name="idm.*"//g' $out/share/doc/OpenSP/releasenotes.html
''; '';
buildInputs = [ xmlto docbook_xml_dtd_412 libxslt docbook_xsl ]; buildInputs = [ xmlto docbook_xml_dtd_412 libxslt docbook_xsl ];
meta = { meta = {

View File

@ -0,0 +1,13 @@
diff --git a/texk/ps2pkm/type1.c b/texk/ps2pkm/type1.c
index 027bf1f..4dcbad0 100644
--- a/texk/ps2pkm/type1.c
+++ b/texk/ps2pkm/type1.c
@@ -800,7 +800,7 @@ static void PSFakePush(Num)
static DOUBLE PSFakePop ()
{
if (PSFakeTop >= 0) return(PSFakeStack[PSFakeTop--]);
- else Error0("PSFakePop : Stack empty\n");
+ else { CC; IfTrace0(TRUE, "PSFakePop : Stack empty\n"); errflag = TRUE; return 0; }
/*NOTREACHED*/
}

View File

@ -20,7 +20,7 @@ stdenv.mkDerivation {
sed -i 57d texk/kpathsea/c-std.h sed -i 57d texk/kpathsea/c-std.h
''; '';
patches = [ ./environment.patch ./getline.patch ]; patches = [ ./environment.patch ./getline.patch ./clang.patch ];
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;

View File

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
cd src cd src
for f in tex4ht t4ht htcmd ; do for f in tex4ht t4ht htcmd ; do
# -DENVFILE="$out/share/texmf-nix/tex4ht/base/unix/tex4ht.env" # -DENVFILE="$out/share/texmf-nix/tex4ht/base/unix/tex4ht.env"
gcc -o $f $f.c -I${tetex}/include -L${tetex}/lib -DHAVE_DIRENT_H -DHAVE_DIRENT_H -DKPATHSEA -lkpathsea $CC -o $f $f.c -I${tetex}/include -L${tetex}/lib -DHAVE_DIRENT_H -DHAVE_DIRENT_H -DKPATHSEA -lkpathsea
done done
cd - cd -
''; '';

View File

@ -22,7 +22,6 @@ rec {
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
doMainBuild = fullDepEntry ( stdenv.lib.optionalString stdenv.isDarwin '' doMainBuild = fullDepEntry ( stdenv.lib.optionalString stdenv.isDarwin ''
export MACOSX_DEPLOYMENT_TARGET=10.9
export DYLD_LIBRARY_PATH="${poppler}/lib" export DYLD_LIBRARY_PATH="${poppler}/lib"
'' + '' '' + ''
mkdir -p $out mkdir -p $out

View File

@ -231,8 +231,6 @@ let
else else
defaultStdenv; defaultStdenv;
stdenvApple = stdenvAdapters.overrideGCC allStdenvs.stdenvNative gccApple;
forceNativeDrv = drv : if crossSystem == null then drv else forceNativeDrv = drv : if crossSystem == null then drv else
(drv // { crossDrv = drv.nativeDrv; }); (drv // { crossDrv = drv.nativeDrv; });
@ -1923,7 +1921,11 @@ let
openssh_with_kerberos = pkgs.appendToName "with-kerberos" (openssh.override { withKerberos = true; }); openssh_with_kerberos = pkgs.appendToName "with-kerberos" (openssh.override { withKerberos = true; });
opensp = callPackage ../tools/text/sgml/opensp { }; opensp = callPackage ../tools/text/sgml/opensp {
stdenv = if stdenv.isDarwin
then allStdenvs.stdenvDarwinNaked
else stdenv;
};
spCompat = callPackage ../tools/text/sgml/opensp/compat.nix { }; spCompat = callPackage ../tools/text/sgml/opensp/compat.nix { };
@ -2853,10 +2855,10 @@ let
ccl = builderDefsPackage ../development/compilers/ccl {}; ccl = builderDefsPackage ../development/compilers/ccl {};
clang = wrapClang llvmPackages.clang; clang = wrapGCC llvmPackages.clang;
clang_34 = wrapClang llvmPackages_34.clang; clang_34 = wrapGCC llvmPackages_34.clang;
clang_33 = wrapClang (clangUnwrapped llvm_33 ../development/compilers/llvm/3.3/clang.nix); clang_33 = wrapGCC (clangUnwrapped llvm_33 ../development/compilers/llvm/3.3/clang.nix);
clangAnalyzer = callPackage ../development/tools/analysis/clang-analyzer { clangAnalyzer = callPackage ../development/tools/analysis/clang-analyzer {
clang = clang_34; clang = clang_34;
@ -2864,25 +2866,24 @@ let
}; };
clangUnwrapped = llvm: pkg: callPackage pkg { clangUnwrapped = llvm: pkg: callPackage pkg {
stdenv = if stdenv.isDarwin then stdenvApple else stdenv; inherit stdenv llvm;
inherit llvm;
}; };
clangSelf = clangWrapSelf llvmPackagesSelf.clang; clangSelf = clangWrapSelf llvmPackagesSelf.clang;
clangWrapSelf = build: (import ../build-support/clang-wrapper) { clangWrapSelf = build: (import ../build-support/gcc-wrapper) {
clang = build; gcc = build;
stdenv = clangStdenv; stdenv = clangStdenv;
libc = glibc; libc = glibc;
binutils = binutils; binutils = binutils;
shell = bash; inherit coreutils zlib;
inherit libcxx coreutils zlib; extraPackages = [ libcxx ];
nativeTools = false; nativeTools = false;
nativeLibc = false; nativeLibc = false;
}; };
#Use this instead of stdenv to build with clang #Use this instead of stdenv to build with clang
clangStdenv = lowPrio (stdenvAdapters.overrideGCC stdenv clang); clangStdenv = if stdenv.isDarwin then stdenv else lowPrio (stdenvAdapters.overrideGCC stdenv clang);
libcxxStdenv = stdenvAdapters.overrideGCC stdenv (clangWrapSelf llvmPackages.clang); libcxxStdenv = stdenvAdapters.overrideGCC stdenv (clangWrapSelf llvmPackages.clang);
clean = callPackage ../development/compilers/clean { }; clean = callPackage ../development/compilers/clean { };
@ -2919,6 +2920,8 @@ let
gcc = gcc48; gcc = gcc48;
gcc_multi = gcc48_multi; gcc_multi = gcc48_multi;
gccApple = throw "gccApple is no longer supported";
gcc33 = wrapGCC (import ../development/compilers/gcc/3.3 { gcc33 = wrapGCC (import ../development/compilers/gcc/3.3 {
inherit fetchurl stdenv noSysDirs; inherit fetchurl stdenv noSysDirs;
}); });
@ -3089,16 +3092,6 @@ let
else null; else null;
})); }));
gccApple =
assert stdenv.isDarwin;
wrapGCC (makeOverridable (import ../development/compilers/gcc/4.2-apple64) {
inherit fetchurl noSysDirs;
profiledCompiler = true;
# Since it fails to build with GCC 4.6, build it with the "native"
# Apple-GCC.
stdenv = allStdenvs.stdenvNative;
});
gfortran = gfortran48; gfortran = gfortran48;
gfortran48 = wrapGCC (gcc48.gcc.override { gfortran48 = wrapGCC (gcc48.gcc.override {
@ -3419,15 +3412,9 @@ let
llvm_34 = llvmPackages_34.llvm; llvm_34 = llvmPackages_34.llvm;
llvm_33 = llvm_v ../development/compilers/llvm/3.3/llvm.nix; llvm_33 = llvm_v ../development/compilers/llvm/3.3/llvm.nix;
llvm_v = path: callPackage path { llvm_v = path: callPackage path { };
stdenv = if stdenv.isDarwin then stdenvApple else stdenv;
};
llvmPackages = if !stdenv.isDarwin then llvmPackages_34 else llvmPackages_34 // { llvmPackages = llvmPackages_34;
# until someone solves build problems with _34
llvm = llvm_33;
clang = clang_33;
};
llvmPackages_34 = recurseIntoAttrs (import ../development/compilers/llvm/3.4 { llvmPackages_34 = recurseIntoAttrs (import ../development/compilers/llvm/3.4 {
inherit stdenv newScope fetchurl; inherit stdenv newScope fetchurl;
@ -3810,28 +3797,14 @@ let
win32hello = callPackage ../development/compilers/visual-c++/test { }; win32hello = callPackage ../development/compilers/visual-c++/test { };
wrapGCCWith = gccWrapper: glibc: baseGCC: gccWrapper { wrapGCCWith = gccWrapper: glibc: baseGCC: gccWrapper {
nativeTools = stdenv ? gcc && stdenv.gcc.nativeTools;
nativeLibc = stdenv ? gcc && stdenv.gcc.nativeLibc;
nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else "";
gcc = baseGCC;
libc = glibc;
shell = bash;
inherit stdenv binutils coreutils zlib;
};
wrapClangWith = clangWrapper: glibc: baseClang: clangWrapper {
nativeTools = stdenv.gcc.nativeTools or false; nativeTools = stdenv.gcc.nativeTools or false;
nativeLibc = stdenv.gcc.nativeLibc or false; nativeLibc = stdenv.gcc.nativeLibc or false;
nativePrefix = stdenv.gcc.nativePrefix or ""; nativePrefix = stdenv.gcc.nativePrefix or "";
clang = baseClang; gcc = baseGCC;
libc = glibc; libc = glibc;
shell = bash; inherit stdenv binutils coreutils zlib;
binutils = stdenv.gcc.binutils;
inherit stdenv coreutils zlib;
}; };
wrapClang = wrapClangWith (makeOverridable (import ../build-support/clang-wrapper)) glibc;
wrapGCC = wrapGCCWith (makeOverridable (import ../build-support/gcc-wrapper)) glibc; wrapGCC = wrapGCCWith (makeOverridable (import ../build-support/gcc-wrapper)) glibc;
wrapGCCCross = wrapGCCCross =
@ -4260,7 +4233,7 @@ let
bam = callPackage ../development/tools/build-managers/bam {}; bam = callPackage ../development/tools/build-managers/bam {};
binutils = if stdenv.isDarwin binutils = if stdenv.isDarwin
then stdenv.gcc.binutils then import ../build-support/native-darwin-cctools-wrapper {inherit stdenv;}
else callPackage ../development/tools/misc/binutils { else callPackage ../development/tools/misc/binutils {
inherit noSysDirs; inherit noSysDirs;
}; };
@ -4405,10 +4378,12 @@ let
wrapGCC (distcc.links extraConfig)) {}; wrapGCC (distcc.links extraConfig)) {};
distccStdenv = lowPrio (overrideGCC stdenv distccWrapper); distccStdenv = lowPrio (overrideGCC stdenv distccWrapper);
distccMasquerade = callPackage ../development/tools/misc/distcc/masq.nix { distccMasquerade = if stdenv.isDarwin
gccRaw = gcc.gcc; then null
binutils = binutils; else callPackage ../development/tools/misc/distcc/masq.nix {
}; gccRaw = gcc.gcc;
binutils = binutils;
};
docutils = builderDefsPackage (import ../development/tools/documentation/docutils) { docutils = builderDefsPackage (import ../development/tools/documentation/docutils) {
inherit python pil makeWrapper; inherit python pil makeWrapper;
@ -4909,7 +4884,7 @@ let
coredumper = callPackage ../development/libraries/coredumper { }; coredumper = callPackage ../development/libraries/coredumper { };
ctl = callPackage ../development/libraries/ctl { }; ctl = dropCxx (callPackage ../development/libraries/ctl { });
cpp-netlib = callPackage ../development/libraries/cpp-netlib { }; cpp-netlib = callPackage ../development/libraries/cpp-netlib { };
@ -5440,7 +5415,7 @@ let
ilixi = callPackage ../development/libraries/ilixi { }; ilixi = callPackage ../development/libraries/ilixi { };
ilmbase = callPackage ../development/libraries/ilmbase { }; ilmbase = dropCxx (callPackage ../development/libraries/ilmbase { });
imlib = callPackage ../development/libraries/imlib { imlib = callPackage ../development/libraries/imlib {
libpng = libpng12; libpng = libpng12;
@ -5622,7 +5597,7 @@ let
libdc1394avt = callPackage ../development/libraries/libdc1394avt { }; libdc1394avt = callPackage ../development/libraries/libdc1394avt { };
libdevil = callPackage ../development/libraries/libdevil { }; libdevil = dropCxx (callPackage ../development/libraries/libdevil { });
libdiscid = callPackage ../development/libraries/libdiscid { }; libdiscid = callPackage ../development/libraries/libdiscid { };
@ -6388,7 +6363,7 @@ let
# this ctl version is needed by openexr_viewers # this ctl version is needed by openexr_viewers
openexr_ctl = callPackage ../development/libraries/openexr_ctl { }; openexr_ctl = callPackage ../development/libraries/openexr_ctl { };
openexr = callPackage ../development/libraries/openexr { }; openexr = dropCxx (callPackage ../development/libraries/openexr { });
openldap = callPackage ../development/libraries/openldap { openldap = callPackage ../development/libraries/openldap {
stdenv = if stdenv.isDarwin stdenv = if stdenv.isDarwin

View File

@ -214,6 +214,8 @@
gmp = pkgs.gmp4; gmp = pkgs.gmp4;
}); });
ghc783Binary = lowPrio (callPackage ../development/compilers/ghc/7.8.3-binary.nix {});
ghc6101BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6101Binary; ghc6101BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6101Binary;
ghc6121BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6121Binary; ghc6121BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6121Binary;
@ -234,7 +236,7 @@
packages_ghc783 = packages_ghc783 =
packages { ghcPath = ../development/compilers/ghc/7.8.3.nix; packages { ghcPath = ../development/compilers/ghc/7.8.3.nix;
ghcBinary = ghc742Binary; ghcBinary = if stdenv.isDarwin then ghc783Binary else ghc742Binary;
prefFun = ghc783Prefs; prefFun = ghc783Prefs;
}; };