diff options
Diffstat (limited to 'pkgs/development')
103 files changed, 910 insertions, 408 deletions
diff --git a/pkgs/development/compilers/gcc-arm-embedded/default.nix b/pkgs/development/compilers/gcc-arm-embedded/default.nix index b6f6ac51ba2..1d192fbbc56 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation { for f in $(find $out); do if [ -f "$f" ] && patchelf "$f" 2> /dev/null; then - patchelf --set-interpreter ${glibc}/lib/ld-linux.so.2 \ + patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 \ --set-rpath $out/lib:${gcc}/lib:${ncurses}/lib \ "$f" || true fi diff --git a/pkgs/development/compilers/gcc/4.6/builder.sh b/pkgs/development/compilers/gcc/4.6/builder.sh index af2e97b1e4e..af36ec33b70 100644 --- a/pkgs/development/compilers/gcc/4.6/builder.sh +++ b/pkgs/development/compilers/gcc/4.6/builder.sh @@ -8,9 +8,10 @@ mkdir $NIX_FIXINC_DUMMY if test "$staticCompiler" = "1"; then EXTRA_LDFLAGS="-static" else - EXTRA_LDFLAGS="" + EXTRA_LDFLAGS="-Wl,-rpath,$lib/lib" fi + # GCC interprets empty paths as ".", which we don't want. if test -z "$CPATH"; then unset CPATH; fi if test -z "$LIBRARY_PATH"; then unset LIBRARY_PATH; fi @@ -29,7 +30,7 @@ if test "$noSysDirs" = "1"; then # Use *real* header files, otherwise a limits.h is generated # that does not include Glibc's limits.h (notably missing # SSIZE_MAX, which breaks the build). - export NIX_FIXINC_DUMMY=$(cat $NIX_CC/nix-support/orig-libc)/include + export NIX_FIXINC_DUMMY=$libc_dev/include # The path to the Glibc binaries such as `crti.o'. glibc_libdir="$(cat $NIX_CC/nix-support/orig-libc)/lib" @@ -50,10 +51,10 @@ if test "$noSysDirs" = "1"; then # bootstrap compiler are optimized and (optionally) contain # debugging information (info "(gccinstall) Building"). if test -n "$dontStrip"; then - extraFlags="-O2 -g $extraFlags" + extraFlags="-O2 -g $extraFlags" else - # Don't pass `-g' at all; this saves space while building. - extraFlags="-O2 $extraFlags" + # Don't pass `-g' at all; this saves space while building. + extraFlags="-O2 $extraFlags" fi EXTRA_FLAGS="$extraFlags" @@ -170,9 +171,8 @@ preConfigure() { # Patch the configure script so it finds glibc headers. It's # important for example in order not to get libssp built, # because its functionality is in glibc already. - glibc_headers="$(cat $NIX_CC/nix-support/orig-libc)/include" sed -i \ - -e "s,glibc_header_dir=/usr/include,glibc_header_dir=$glibc_headers", \ + -e "s,glibc_header_dir=/usr/include,glibc_header_dir=$libc_dev/include", \ gcc/configure fi @@ -206,6 +206,14 @@ preInstall() { postInstall() { + # Move runtime libraries to $lib. + mkdir -p $lib/lib + ln -s lib $lib/lib64 + mv -v $out/lib/lib*.so $out/lib/lib*.so.*[0-9] $out/lib/*.la $lib/lib/ + for i in $lib/lib/*.la; do + substituteInPlace $i --replace $out $lib + done + # Remove precompiled headers for now. They are very big and # probably not very useful yet. find $out/include -name "*.gch" -exec rm -rf {} \; -prune @@ -217,6 +225,7 @@ postInstall() { # More dependencies with the previous gcc or some libs (gccbug stores the build command line) rm -rf $out/bin/gccbug + # Take out the bootstrap-tools from the rpath, as it's not needed at all having $out for i in $out/libexec/gcc/*/*/*; do if PREV_RPATH=`patchelf --print-rpath $i`; then @@ -225,7 +234,7 @@ postInstall() { done # Get rid of some "fixed" header files - rm -rf $out/lib/gcc/*/*/include/root + rm -rfv $out/lib/gcc/*/*/include-fixed/{root,linux} # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks. for i in $out/bin/*-gcc*; do diff --git a/pkgs/development/compilers/gcc/4.6/default.nix b/pkgs/development/compilers/gcc/4.6/default.nix index b3caad11b71..bc968d1f66e 100644 --- a/pkgs/development/compilers/gcc/4.6/default.nix +++ b/pkgs/development/compilers/gcc/4.6/default.nix @@ -170,7 +170,7 @@ let version = "4.6.4"; "-stage-final"; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else ""; - bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips; + bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips; in @@ -182,13 +182,19 @@ stdenv.mkDerivation ({ builder = ./builder.sh; - src = (import ./sources.nix) { + srcs = (import ./sources.nix) { inherit fetchurl optional version; inherit langC langCC langFortran langJava langAda langGo; }; + outputs = [ "out" "lib" ]; + + setOutputFlags = false; + inherit patches enableMultilib; + libc_dev = stdenv.cc.libc_dev; + postPatch = if (stdenv.isGNU || (libcCross != null # e.g., building `gcc.crossDrv' diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index ff1d388b6e2..83fbbef3fb7 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -197,7 +197,7 @@ let version = "4.8.5"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else ""; - bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips; + bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips; in @@ -218,6 +218,12 @@ stdenv.mkDerivation ({ inherit patches; + outputs = [ "out" "lib" "doc" ]; + setOutputFlags = false; + NIX_NO_SELF_RPATH = true; + + libc_dev = stdenv.cc.libc_dev; + postPatch = if (stdenv.isGNU || (libcCross != null # e.g., building `gcc.crossDrv' @@ -359,7 +365,7 @@ stdenv.mkDerivation ({ ) } ${if (stdenv ? glibc && cross == null) - then " --with-native-system-header-dir=${stdenv.glibc}/include" + then " --with-native-system-header-dir=${stdenv.glibc.dev}/include" else ""} ${if langAda then " --enable-libada" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""} diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 13154ddd27a..8b2fda05095 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -358,7 +358,7 @@ stdenv.mkDerivation ({ ) } ${if (stdenv ? glibc && cross == null) - then " --with-native-system-header-dir=${stdenv.glibc}/include" + then " --with-native-system-header-dir=${stdenv.glibc.dev}/include" else ""} ${if langAda then " --enable-libada" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""} diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index dd77c67a023..8cf04ce1c35 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -8,9 +8,10 @@ mkdir $NIX_FIXINC_DUMMY if test "$staticCompiler" = "1"; then EXTRA_LDFLAGS="-static" else - EXTRA_LDFLAGS="" + EXTRA_LDFLAGS="-Wl,-rpath,$lib/lib" fi + # GCC interprets empty paths as ".", which we don't want. if test -z "$CPATH"; then unset CPATH; fi if test -z "$LIBRARY_PATH"; then unset LIBRARY_PATH; fi @@ -29,7 +30,7 @@ if test "$noSysDirs" = "1"; then # Use *real* header files, otherwise a limits.h is generated # that does not include Glibc's limits.h (notably missing # SSIZE_MAX, which breaks the build). - export NIX_FIXINC_DUMMY=$(cat $NIX_CC/nix-support/orig-libc)/include + export NIX_FIXINC_DUMMY=$libc_dev/include # The path to the Glibc binaries such as `crti.o'. glibc_libdir="$(cat $NIX_CC/nix-support/orig-libc)/lib" @@ -171,9 +172,8 @@ preConfigure() { # Patch the configure script so it finds glibc headers. It's # important for example in order not to get libssp built, # because its functionality is in glibc already. - glibc_headers="$(cat $NIX_CC/nix-support/orig-libc)/include" sed -i \ - -e "s,glibc_header_dir=/usr/include,glibc_header_dir=$glibc_headers", \ + -e "s,glibc_header_dir=/usr/include,glibc_header_dir=$libc_dev/include", \ gcc/configure fi @@ -210,6 +210,14 @@ preInstall() { postInstall() { + # Move runtime libraries to $lib. + mkdir -p $lib/lib + ln -s lib $lib/lib64 + mv -v $out/lib/lib*.so $out/lib/lib*.so.*[0-9] $out/lib/*.la $lib/lib/ + for i in $lib/lib/*.la; do + substituteInPlace $i --replace $out $lib + done + # Remove precompiled headers for now. They are very big and # probably not very useful yet. find $out/include -name "*.gch" -exec rm -rf {} \; -prune @@ -221,15 +229,23 @@ postInstall() { # More dependencies with the previous gcc or some libs (gccbug stores the build command line) rm -rf $out/bin/gccbug + # Take out the bootstrap-tools from the rpath, as it's not needed at all having $out - for i in $out/libexec/gcc/*/*/*; do - if PREV_RPATH=`patchelf --print-rpath $i`; then - patchelf --set-rpath `echo $PREV_RPATH | sed 's,:[^:]*bootstrap-tools/lib,,'` $i - fi + for i in "$out"/libexec/gcc/*/*/*; do + PREV_RPATH=`patchelf --print-rpath "$i"` + NEW_RPATH=`echo "$PREV_RPATH" | sed 's,:[^:]*bootstrap-tools/lib,,g'` + patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK + done + + # For some reason the libs retain RPATH to $out + for i in "$lib"/lib/{libtsan.so.0.0.0,libasan.so.0.0.0}; do + PREV_RPATH=`patchelf --print-rpath "$i"` + NEW_RPATH=`echo "$PREV_RPATH" | sed "s,:${out}[^:]*,,g"` + patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK done # Get rid of some "fixed" header files - rm -rf $out/lib/gcc/*/*/include/root + rm -rfv $out/lib/gcc/*/*/include-fixed/{root,linux} # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks. for i in $out/bin/*-gcc*; do diff --git a/pkgs/development/compilers/go/1.1.nix b/pkgs/development/compilers/go/1.1.nix new file mode 100644 index 00000000000..0c6d4126414 --- /dev/null +++ b/pkgs/development/compilers/go/1.1.nix @@ -0,0 +1,101 @@ +{ stdenv, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc +, removeGodocExternals ? false }: + +let + loader386 = "${glibc.out}/lib/ld-linux.so.2"; + loaderAmd64 = "${glibc.out}/lib/ld-linux-x86-64.so.2"; + loaderArm = "${glibc.out}/lib/ld-linux.so.3"; +in + +stdenv.mkDerivation { + name = "go-1.1.2"; + + src = fetchurl { + url = http://go.googlecode.com/files/go1.1.2.src.tar.gz; + sha256 = "0w7bchhb4b053az3wjp6z342rs9lp9nxf4w2mnfd1b89d6sb7izz"; + }; + + buildInputs = [ bison glibc bash makeWrapper ]; + + NIX_CFLAGS_COMPILE = "-Wno-error=cpp"; + + # I'm not sure what go wants from its 'src', but the go installation manual + # describes an installation keeping the src. + preUnpack = '' + mkdir -p $out/share + cd $out/share + ''; + + prePatch = '' + cd .. + if [ ! -d go ]; then + mv * go + fi + cd go + + patchShebangs ./ # replace /bin/bash + # !!! substituteInPlace does not seems to be effective. + sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c + sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c + sed -i 's,/lib64/ld-linux-x86-64.so.3,${loaderArm},' src/cmd/5l/asm.c + sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go + sed -i 's,/etc/protocols,${iana_etc}/etc/protocols,' src/pkg/net/lookup_unix.go + + #sed -i -e 's,/bin/cat,${coreutils}/bin/cat,' \ + # -e 's,/bin/echo,${coreutils}/bin/echo,' \ + # src/pkg/exec/exec_test.go + + # Disabling the 'os/http/net' tests (they want files not available in + # chroot builds) + rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go} + # The os test wants to read files in an existing path. Just it don't be /usr/bin. + sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go + sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go + # Disable the hostname test + sed -i '/TestHostname/areturn' src/pkg/os/os_test.go + # ParseInLocation fails the test + sed -i '/TestParseInSydney/areturn' src/pkg/time/time_test.go + '' + stdenv.lib.optionalString removeGodocExternals '' + sed -i -e '/googleapi/d' -e '/javascript">$/,+6d' lib/godoc/godoc.html + ''; + + patches = [ ./cacert.patch ]; + + GOOS = "linux"; + GOARCH = if stdenv.system == "i686-linux" then "386" + else if stdenv.system == "x86_64-linux" then "amd64" + else if stdenv.system == "armv5tel-linux" then "arm" + else throw "Unsupported system"; + GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5"; + + installPhase = '' + mkdir -p "$out/bin" + export GOROOT="$(pwd)/" + export GOBIN="$out/bin" + export PATH="$GOBIN:$PATH" + cd ./src + ./all.bash + cd - + + # Wrap the tools to define the location of the + # libraries. + for a in go gofmt godoc; do + wrapProgram "$out/bin/$a" \ + --set "GOROOT" $out/share/go \ + ${if stdenv.system == "armv5tel-linux" then "--set GOARM $GOARM" else ""} + done + + # Copy the emacs configuration for Go files. + mkdir -p "$out/share/emacs/site-lisp" + cp ./misc/emacs/* $out/share/emacs/site-lisp/ + ''; + + meta = { + branch = "1.1"; + homepage = http://golang.org/; + description = "The Go Programming language"; + license = "BSD"; + maintainers = with stdenv.lib.maintainers; [ pierron viric ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/development/compilers/go/1.2.nix b/pkgs/development/compilers/go/1.2.nix new file mode 100644 index 00000000000..0454ea96d89 --- /dev/null +++ b/pkgs/development/compilers/go/1.2.nix @@ -0,0 +1,91 @@ +{ stdenv, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc }: + +let + loader386 = "${glibc.out}/lib/ld-linux.so.2"; + loaderAmd64 = "${glibc.out}/lib/ld-linux-x86-64.so.2"; + loaderArm = "${glibc.out}/lib/ld-linux.so.3"; +in + +stdenv.mkDerivation { + name = "go-1.2.2"; + + src = fetchurl { + url = https://storage.googleapis.com/golang/go1.2.2.src.tar.gz; + sha1 = "3ce0ac4db434fc1546fec074841ff40dc48c1167"; + }; + + buildInputs = [ bison glibc bash makeWrapper ]; + + NIX_CFLAGS_COMPILE = "-Wno-error=cpp"; + + # I'm not sure what go wants from its 'src', but the go installation manual + # describes an installation keeping the src. + preUnpack = '' + mkdir -p $out/share + cd $out/share + ''; + + prePatch = '' + cd .. + if [ ! -d go ]; then + mv * go + fi + cd go + + patchShebangs ./ # replace /bin/bash + # !!! substituteInPlace does not seems to be effective. + sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c + sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c + sed -i 's,/lib64/ld-linux-x86-64.so.3,${loaderArm},' src/cmd/5l/asm.c + sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go + sed -i 's,/etc/protocols,${iana_etc}/etc/protocols,' src/pkg/net/lookup_unix.go + + #sed -i -e 's,/bin/cat,${coreutils}/bin/cat,' \ + # -e 's,/bin/echo,${coreutils}/bin/echo,' \ + # src/pkg/exec/exec_test.go + + # Disabling the 'os/http/net' tests (they want files not available in + # chroot builds) + rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go} + # The os test wants to read files in an existing path. Just it don't be /usr/bin. + sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go + sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go + # Disable the hostname test + sed -i '/TestHostname/areturn' src/pkg/os/os_test.go + # ParseInLocation fails the test + sed -i '/TestParseInSydney/areturn' src/pkg/time/time_test.go + ''; + + patches = [ ./cacert-1.2.patch ]; + + GOOS = "linux"; + GOARCH = if stdenv.system == "i686-linux" then "386" + else if stdenv.system == "x86_64-linux" then "amd64" + else if stdenv.system == "armv5tel-linux" then "arm" + else throw "Unsupported system"; + GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5"; + GO386 = 387; # from Arch: don't assume sse2 on i686 + + installPhase = '' + mkdir -p "$out/bin" + export GOROOT="$(pwd)/" + export GOBIN="$out/bin" + export PATH="$GOBIN:$PATH" + cd ./src + ./all.bash + cd - + + # Copy the emacs configuration for Go files. + mkdir -p "$out/share/emacs/site-lisp" + cp ./misc/emacs/* $out/share/emacs/site-lisp/ + ''; + + meta = { + branch = "1.2"; + homepage = http://golang.org/; + description = "The Go Programming language"; + license = "BSD"; + maintainers = with stdenv.lib.maintainers; [ pierron viric ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/development/compilers/go/1.3.nix b/pkgs/development/compilers/go/1.3.nix new file mode 100644 index 00000000000..a9a3c10584b --- /dev/null +++ b/pkgs/development/compilers/go/1.3.nix @@ -0,0 +1,113 @@ +{ stdenv, lib, fetchurl, fetchhg, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc, perl }: + +let + loader386 = "${glibc.out}/lib/ld-linux.so.2"; + loaderAmd64 = "${glibc.out}/lib/ld-linux-x86-64.so.2"; + loaderArm = "${glibc.out}/lib/ld-linux.so.3"; + srcs = { + golang = fetchurl { + url = https://storage.googleapis.com/golang/go1.3.3.src.tar.gz; + sha1 = "b54b7deb7b7afe9f5d9a3f5dd830c7dede35393a"; + }; + tools = fetchhg { + url = https://code.google.com/p/go.tools/; + rev = "e1c276c4e679"; + sha256 = "0x62njflwkd99i2ixbksg6mjppl1wfg86f0g3swn350l1h0xzp76"; + }; + }; +in + +stdenv.mkDerivation { + name = "go-1.3.3"; + + src = srcs.golang; + + # perl is used for testing go vet + buildInputs = [ bison bash makeWrapper perl ] ++ lib.optionals stdenv.isLinux [ glibc ] ; + + # I'm not sure what go wants from its 'src', but the go installation manual + # describes an installation keeping the src. + preUnpack = '' + mkdir -p $out/share + cd $out/share + ''; + postUnpack = '' + mkdir -p $out/share/go/src/pkg/code.google.com/p/ + cp -rv --no-preserve=mode,ownership ${srcs.tools} $out/share/go/src/pkg/code.google.com/p/go.tools + ''; + + prePatch = '' + # Ensure that the source directory is named go + cd .. + if [ ! -d go ]; then + mv * go + fi + cd go + patchShebangs ./ # replace /bin/bash + + # Disabling the 'os/http/net' tests (they want files not available in + # chroot builds) + rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go} + # !!! substituteInPlace does not seems to be effective. + # The os test wants to read files in an existing path. Just don't let it be /usr/bin. + sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go + sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go + # Disable the unix socket test + sed -i '/TestShutdownUnix/areturn' src/pkg/net/net_test.go + # Disable the hostname test + sed -i '/TestHostname/areturn' src/pkg/os/os_test.go + sed -i 's,/etc/protocols,${iana_etc}/etc/protocols,' src/pkg/net/lookup_unix.go + # ParseInLocation fails the test + sed -i '/TestParseInSydney/areturn' src/pkg/time/format_test.go + '' + lib.optionalString stdenv.isLinux '' + sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go + sed -i 's,/lib/ld-linux.so.3,${loaderArm},' src/cmd/5l/asm.c + sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c + sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c + ''; + + patches = [ ./cacert-1.2.patch ]; + + GOOS = if stdenv.isDarwin then "darwin" else "linux"; + GOARCH = if stdenv.isDarwin then "amd64" + else if stdenv.system == "i686-linux" then "386" + else if stdenv.system == "x86_64-linux" then "amd64" + else if stdenv.system == "armv5tel-linux" then "arm" + else throw "Unsupported system"; + GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5"; + GO386 = 387; # from Arch: don't assume sse2 on i686 + CGO_ENABLED = if stdenv.isDarwin then 0 else 1; + + installPhase = '' + export CC=cc + mkdir -p "$out/bin" + unset GOPATH + export GOROOT="$(pwd)/" + export GOBIN="$out/bin" + export PATH="$GOBIN:$PATH" + cd ./src + ./all.bash + cd - + + # Build extra tooling + # TODO: Fix godoc tests + TOOL_ROOT=code.google.com/p/go.tools/cmd + go install -v $TOOL_ROOT/cover $TOOL_ROOT/vet $TOOL_ROOT/godoc + go test -v $TOOL_ROOT/cover $TOOL_ROOT/vet # $TOOL_ROOT/godoc + + # Copy the emacs configuration for Go files. + mkdir -p "$out/share/emacs/site-lisp" + cp ./misc/emacs/* $out/share/emacs/site-lisp/ + ''; + + setupHook = ./setup-hook.sh; + + meta = { + branch = "1.3"; + homepage = http://golang.org/; + description = "The Go Programming language"; + license = "BSD"; + maintainers = with stdenv.lib.maintainers; [ cstrahan ]; + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; + }; +} diff --git a/pkgs/development/compilers/go/1.4.nix b/pkgs/development/compilers/go/1.4.nix index 413320d2d45..ad995042864 100644 --- a/pkgs/development/compilers/go/1.4.nix +++ b/pkgs/development/compilers/go/1.4.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go # Find the loader dynamically - LOADER="$(find ${libc}/lib -name ld-linux\* | head -n 1)" + LOADER="$(find ${libc.out or libc}/lib -name ld-linux\* | head -n 1)" # Replace references to the loader find src/cmd -name asm.c -exec sed -i "s,/lib/ld-linux.*\.so\.[0-9],$LOADER," {} \; diff --git a/pkgs/development/compilers/go/default.nix b/pkgs/development/compilers/go/default.nix new file mode 100644 index 00000000000..c684d7d5ee5 --- /dev/null +++ b/pkgs/development/compilers/go/default.nix @@ -0,0 +1,95 @@ +{ stdenv, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata}: + +let + loader386 = "${glibc.out}/lib/ld-linux.so.2"; + loaderAmd64 = "${glibc.out}/lib/ld-linux-x86-64.so.2"; + loaderArm = "${glibc.out}/lib/ld-linux.so.3"; +in + +stdenv.mkDerivation { + name = "go-1.0.3"; + + src = fetchurl { + url = http://go.googlecode.com/files/go1.0.3.src.tar.gz; + sha256 = "1pz31az3icwqfqfy3avms05jnqr0qrbrx9yqsclkdwbjs4rkbfkz"; + }; + + buildInputs = [ bison glibc bash makeWrapper ]; + + # I'm not sure what go wants from its 'src', but the go installation manual + # describes an installation keeping the src. + preUnpack = '' + mkdir -p $out/share + cd $out/share + ''; + + prePatch = '' + cd .. + if [ ! -d go ]; then + mv * go + fi + cd go + + patchShebangs ./ # replace /bin/bash + # !!! substituteInPlace does not seems to be effective. + sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c + sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c + sed -i 's,/lib64/ld-linux-x86-64.so.3,${loaderArm},' src/cmd/5l/asm.c + sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go + + #sed -i -e 's,/bin/cat,${coreutils}/bin/cat,' \ + # -e 's,/bin/echo,${coreutils}/bin/echo,' \ + # src/pkg/exec/exec_test.go + + # Disabling the 'os/http/net' tests (they want files not available in + # chroot builds) + rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go} + # The os test wants to read files in an existing path. Just it don't be /usr/bin. + sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go + sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go + # Disable the hostname test + sed -i '/TestHostname/areturn' src/pkg/os/os_test.go + ''; + + patches = [ ./cacert.patch ./1_0-opt-error.patch ./1_0-gcc-bug.patch ]; + + GOOS = "linux"; + GOARCH = if stdenv.system == "i686-linux" then "386" + else if stdenv.system == "x86_64-linux" then "amd64" + else if stdenv.system == "armv5tel-linux" then "arm" + else throw "Unsupported system"; + GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5"; + + NIX_CFLAGS_COMPILE = "-Wno-error=cpp"; + + installPhase = '' + mkdir -p "$out/bin" + export GOROOT="$(pwd)/" + export GOBIN="$out/bin" + export PATH="$GOBIN:$PATH" + cd ./src + ./all.bash + cd - + + # Wrap the tools to define the location of the + # libraries. + for a in go gofmt godoc; do + wrapProgram "$out/bin/$a" \ + --set "GOROOT" $out/share/go \ + ${if stdenv.system == "armv5tel-linux" then "--set GOARM $GOARM" else ""} + done + + # Copy the emacs configuration for Go files. + mkdir -p "$out/share/emacs/site-lisp" + cp ./misc/emacs/* $out/share/emacs/site-lisp/ + ''; + + meta = { + branch = "1.0"; + homepage = http://golang.org/; + description = "The Go Programming language"; + license = "BSD"; + maintainers = with stdenv.lib.maintainers; [ pierron viric ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/development/compilers/mlton/default.nix b/pkgs/development/compilers/mlton/default.nix index 381941acc20..9ff76207738 100644 --- a/pkgs/development/compilers/mlton/default.nix +++ b/pkgs/development/compilers/mlton/default.nix @@ -6,8 +6,8 @@ let usr_prefix = if stdenv.isDarwin then "usr/local" else "usr"; dynamic_linker = - if stdenv.isx86_64 then "${stdenv.glibc}/lib/ld-linux-x86-64.so.2" - else "${stdenv.glibc}/lib/ld-linux.so.2"; + if stdenv.isx86_64 then "${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2" + else "${stdenv.glibc.out}/lib/ld-linux.so.2"; in stdenv.mkDerivation rec { diff --git a/pkgs/development/compilers/nvidia-cg-toolkit/default.nix b/pkgs/development/compilers/nvidia-cg-toolkit/default.nix index 9c6d07c4681..ab71090b358 100644 --- a/pkgs/development/compilers/nvidia-cg-toolkit/default.nix +++ b/pkgs/development/compilers/nvidia-cg-toolkit/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { installPhase = '' for b in cgc cgfxcat cginfo do - patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux*.so.? "bin/$b" + patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux*.so.? "bin/$b" done # FIXME: cgfxcat and cginfo need more patchelf mkdir -p "$out/bin/" diff --git a/pkgs/development/compilers/openjdk/bootstrap.nix b/pkgs/development/compilers/openjdk/bootstrap.nix index a9ca7673dfe..48a22638813 100644 --- a/pkgs/development/compilers/openjdk/bootstrap.nix +++ b/pkgs/development/compilers/openjdk/bootstrap.nix @@ -40,13 +40,13 @@ let LIBDIRS="$(find $out -name \*.so\* -exec dirname {} \; | sort | uniq | tr '\n' ':')" for i in $out/bin/*; do - patchelf --set-interpreter ${glibc}/lib/ld-linux*.so.2 $i || true - patchelf --set-rpath "${glibc}/lib:$LIBDIRS" $i || true + patchelf --set-interpreter ${glibc.out}/lib/ld-linux*.so.2 $i || true + patchelf --set-rpath "${glibc.out}/lib:$LIBDIRS" $i || true done find $out -name \*.so\* | while read lib; do - patchelf --set-interpreter ${glibc}/lib/ld-linux*.so.2 $lib || true - patchelf --set-rpath "${glibc}/lib:${stdenv.cc.cc}/lib:$LIBDIRS" $lib || true + patchelf --set-interpreter ${glibc.out}/lib/ld-linux*.so.2 $lib || true + patchelf --set-rpath "${glibc.out}/lib:${stdenv.cc.cc.lib}/lib:$LIBDIRS" $lib || true done # Temporarily, while NixOS's OpenJDK bootstrap tarball doesn't have PaX markings: diff --git a/pkgs/development/compilers/path64/default.nix b/pkgs/development/compilers/path64/default.nix index d6112dcdfc4..694bdc8990f 100644 --- a/pkgs/development/compilers/path64/default.nix +++ b/pkgs/development/compilers/path64/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { patchPhase = '' sed -i s,/usr/bin/ld,$(type -P ld), src/driver/phases.c - sed -i s,/lib64/ld-linux-x86-64.so.2,${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2, src/include/main_defs.h.in + sed -i s,/lib64/ld-linux-x86-64.so.2,${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2, src/include/main_defs.h.in ''; cmakeFlags = '' @@ -22,7 +22,7 @@ stdenv.mkDerivation { -DPATH64_ENABLE_PSCRUNTIME=OFF -DPATH64_ENABLE_PROFILING=OFF -DPATH64_ENABLE_TARGETS=x8664 -DCMAKE_BUILD_TYPE=Debug -DPATH64_ENABLE_FORTRAN=OFF - -DPSC_CRT_PATH=${stdenv.cc.libc}/lib + -DPSC_CRT_PATH=${stdenv.cc.libc.out}/lib ''; makeFlags = "-j4"; diff --git a/pkgs/development/compilers/rustc/generic.nix b/pkgs/development/compilers/rustc/generic.nix deleted file mode 100644 index 2dc91cb5ec4..00000000000 --- a/pkgs/development/compilers/rustc/generic.nix +++ /dev/null @@ -1,168 +0,0 @@ -{ stdenv, fetchurl, fetchgit, fetchzip, file, python2, tzdata, procps -, llvmPackages_37, jemalloc, ncurses - -, shortVersion, isRelease -, srcSha, srcRev ? "" -, snapshotHashLinux686, snapshotHashLinux64 -, snapshotHashDarwin686, snapshotHashDarwin64 -, snapshotDate, snapshotRev -, configureFlags ? [] - -, patches -}: - -assert !stdenv.isFreeBSD; - -/* Rust's build process has a few quirks : - -- The Rust compiler is written is Rust, so it requires a bootstrap - compiler, which is downloaded during the build. To make the build - pure, we download it ourself before and put it where it is - expected. Once the language is stable (1.0) , we might want to - switch it to use nix's packaged rust compiler. This might not be possible - as the compiler is highly coupled to the bootstrap. - -NOTE : some derivation depend on rust. When updating this, please make -sure those derivations still compile. (racer, for example). - -*/ - -assert (if isRelease then srcRev == "" else srcRev != ""); - -let version = if isRelease then - "${shortVersion}" - else - "${shortVersion}-g${builtins.substring 0 7 srcRev}"; - - name = "rustc-${version}"; - - platform = if stdenv.system == "i686-linux" - then "linux-i386" - else if stdenv.system == "x86_64-linux" - then "linux-x86_64" - else if stdenv.system == "i686-darwin" - then "macos-i386" - else if stdenv.system == "x86_64-darwin" - then "macos-x86_64" - else abort "no snapshot to bootstrap for this platform (missing platform url suffix)"; - - target = if stdenv.system == "i686-linux" - then "i686-unknown-linux-gnu" - else if stdenv.system == "x86_64-linux" - then "x86_64-unknown-linux-gnu" - else if stdenv.system == "i686-darwin" - then "i686-apple-darwin" - else if stdenv.system == "x86_64-darwin" - then "x86_64-apple-darwin" - else abort "no snapshot to bootstrap for this platform (missing target triple)"; - - meta = with stdenv.lib; { - homepage = http://www.rust-lang.org/; - description = "A safe, concurrent, practical language"; - maintainers = with maintainers; [ madjar cstrahan wizeman globin havvy wkennington ]; - license = [ licenses.mit licenses.asl20 ]; - platforms = platforms.linux; - }; - - snapshotHash = if stdenv.system == "i686-linux" - then snapshotHashLinux686 - else if stdenv.system == "x86_64-linux" - then snapshotHashLinux64 - else if stdenv.system == "i686-darwin" - then snapshotHashDarwin686 - else if stdenv.system == "x86_64-darwin" - then snapshotHashDarwin64 - else abort "no snapshot for platform ${stdenv.system}"; - snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshotHash}.tar.bz2"; -in - -stdenv.mkDerivation { - inherit name; - inherit version; - inherit meta; - - __impureHostDeps = [ "/usr/lib/libedit.3.dylib" ]; - - src = if isRelease then - fetchzip { - url = "http://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"; - sha256 = srcSha; - } - else - fetchgit { - url = https://github.com/rust-lang/rust; - rev = srcRev; - sha256 = srcSha; - }; - - # We need rust to build rust. If we don't provide it, configure will try to download it. - snapshot = stdenv.mkDerivation { - name = "rust-stage0"; - src = fetchurl { - url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}"; - sha1 = snapshotHash; - }; - dontStrip = true; - installPhase = '' - mkdir -p "$out" - cp -r bin "$out/bin" - '' + stdenv.lib.optionalString stdenv.isLinux '' - patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \ - --set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/" \ - "$out/bin/rustc" - ''; - }; - - configureFlags = configureFlags - ++ [ "--enable-local-rust" "--local-rust-root=$snapshot" "--enable-rpath" ] - ++ [ "--llvm-root=${llvmPackages_37.llvm}" ] #"--jemalloc-root=${jemalloc}/lib" ] - ++ [ "--default-linker=${stdenv.cc}/bin/cc" "--default-ar=${stdenv.cc.binutils}/bin/ar" ] - ++ stdenv.lib.optional (stdenv.cc.cc ? isClang) "--enable-clang"; - - inherit patches; - - postPatch = '' - substituteInPlace src/rust-installer/gen-install-script.sh \ - --replace /bin/echo "$(type -P echo)" - substituteInPlace src/rust-installer/gen-installer.sh \ - --replace /bin/echo "$(type -P echo)" - - # Workaround for NixOS/nixpkgs#8676 - substituteInPlace mk/rustllvm.mk \ - --replace "\$\$(subst /,//," "\$\$(subst /,/," - - # Fix dynamic linking against llvm - sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py - - # Fix the configure script to not require curl as we won't use it - sed -i configure \ - -e '/probe_need CFG_CURLORWGET/d' - - # Fix the use of jemalloc prefixes which our jemalloc doesn't have - # TODO: reenable if we can figure out how to get our jemalloc to work - #[ -f src/liballoc_jemalloc/lib.rs ] && sed -i 's,je_,,g' src/liballoc_jemalloc/lib.rs - #[ -f src/liballoc/heap.rs ] && sed -i 's,je_,,g' src/liballoc/heap.rs # Remove for 1.4.0+ - - # Useful debugging parameter - #export VERBOSE=1 - ''; - - preConfigure = '' - # Needed flags as the upstream configure script has a broken prefix substitution - configureFlagsArray+=("--datadir=$out/share") - configureFlagsArray+=("--infodir=$out/share/info") - ''; - - # Procps is needed for one of the test cases - nativeBuildInputs = [ file python2 ] - ++ stdenv.lib.optionals stdenv.isLinux [ procps ]; - buildInputs = [ llvmPackages_37.llvm ncurses ]; - - enableParallelBuilding = true; - - outputs = [ "out" "doc" ]; - - preCheck = "export TZDIR=${tzdata}/share/zoneinfo"; - - doCheck = true; -} diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index c9378451d1f..9da1ef0dd9a 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -19,9 +19,9 @@ stdenv.mkDerivation rec { preConfigure = '' configureFlagsArray+=("--elfinterp=$(cat $NIX_CC/nix-support/dynamic-linker)") - configureFlagsArray+=("--crtprefix=${stdenv.glibc}/lib") - configureFlagsArray+=("--sysincludepaths=${stdenv.glibc}/include:{B}/include") - configureFlagsArray+=("--libpaths=${stdenv.glibc}/lib") + configureFlagsArray+=("--crtprefix=${stdenv.glibc.out}/lib") + configureFlagsArray+=("--sysincludepaths=${stdenv.glibc.dev}/include:{B}/include") + configureFlagsArray+=("--libpaths=${stdenv.glibc.out}/lib") ''; doCheck = true; diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix index 8e148f1189c..0d4a5ef2d6a 100644 --- a/pkgs/development/interpreters/luajit/default.nix +++ b/pkgs/development/interpreters/luajit/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { '' + stdenv.lib.optionalString (stdenv.cc.libc != null) '' substituteInPlace Makefile \ - --replace ldconfig ${stdenv.cc.libc}/sbin/ldconfig + --replace ldconfig ${stdenv.cc.libc.bin}/bin/ldconfig ''; configurePhase = false; diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix index 568025edfd4..989d24950b9 100644 --- a/pkgs/development/interpreters/perl/5.16/default.nix +++ b/pkgs/development/interpreters/perl/5.16/default.nix @@ -14,6 +14,11 @@ stdenv.mkDerivation rec { sha256 = "1dpd9lhc4723wmsn4dsn4m320qlqgyw28bvcbhnfqp2nl3f0ikv9"; }; + # TODO: Add a "dev" output containing the header files. + outputs = [ "out" "man" ]; + + setOutputFlags = false; + patches = [ # Do not look in /usr etc. for dependencies. ./no-sys-dirs.patch @@ -45,8 +50,8 @@ stdenv.mkDerivation rec { "-Uinstallusrbinperl" "-Dinstallstyle=lib/perl5" "-Duseshrplib" - "-Dlocincpth=${libc}/include" - "-Dloclibpth=${libc}/lib" + "-Dlocincpth=${libc.dev or libc}/include" + "-Dloclibpth=${libc.out or libc}/lib" ] ++ lib.optional enableThreading "-Dusethreads"; @@ -58,7 +63,7 @@ stdenv.mkDerivation rec { preConfigure = '' - configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3" + configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$man/share/man/man1 -Dman3dir=$man/share/man/man3" ${lib.optionalString stdenv.isArm '' configureFlagsArray=(-Dldflags="-lm -lrt") @@ -77,6 +82,17 @@ stdenv.mkDerivation rec { substituteInPlace dist/Cwd/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'" ''; + postInstall = + '' + # Remove dependency between "out" and "man" outputs. + rm $out/lib/perl5/*/*/.packlist + + # Remove dependencies on glibc.dev and coreutils. + substituteInPlace $out/lib/perl5/*/*/Config_heavy.pl \ + --replace ${stdenv.glibc.dev or "/blabla"} /no-such-path \ + --replace $man /no-such-path + ''; # */ + setupHook = ./setup-hook.sh; passthru.libPrefix = "lib/perl5/site_perl"; diff --git a/pkgs/development/interpreters/perl/5.20/default.nix b/pkgs/development/interpreters/perl/5.20/default.nix index 141484814ea..bcf22654969 100644 --- a/pkgs/development/interpreters/perl/5.20/default.nix +++ b/pkgs/development/interpreters/perl/5.20/default.nix @@ -28,8 +28,11 @@ stdenv.mkDerivation rec { sha256 = "17cvplgpxbm1hshxlkra2fldn4da1iap1lsnb04hdm8ply93k95i"; }; + # TODO: Add a "dev" output containing the header files. outputs = [ "out" "man" ]; + setOutputFlags = false; + patches = [ # Do not look in /usr etc. for dependencies. ./no-sys-dirs.patch @@ -61,8 +64,8 @@ stdenv.mkDerivation rec { "-Uinstallusrbinperl" "-Dinstallstyle=lib/perl5" "-Duseshrplib" - "-Dlocincpth=${libc}/include" - "-Dloclibpth=${libc}/lib" + "-Dlocincpth=${libc.dev or libc}/include" + "-Dloclibpth=${libc.out or libc}/lib" ] ++ optional enableThreading "-Dusethreads"; diff --git a/pkgs/development/interpreters/perl/5.22/default.nix b/pkgs/development/interpreters/perl/5.22/default.nix index e0be8610fb7..2cf6981c763 100644 --- a/pkgs/development/interpreters/perl/5.22/default.nix +++ b/pkgs/development/interpreters/perl/5.22/default.nix @@ -28,8 +28,11 @@ stdenv.mkDerivation rec { sha256 = "0g5bl8sdpzx9gx2g5jq3py4bj07z2ylk7s1qn0fvsss2yl3hhs8c"; }; + # TODO: Add a "dev" output containing the header files. outputs = [ "out" "man" ]; + setOutputFlags = false; + patches = [ # Do not look in /usr etc. for dependencies. ./no-sys-dirs.patch @@ -48,8 +51,8 @@ stdenv.mkDerivation rec { "-Uinstallusrbinperl" "-Dinstallstyle=lib/perl5" "-Duseshrplib" - "-Dlocincpth=${libc}/include" - "-Dloclibpth=${libc}/lib" + "-Dlocincpth=${libc.dev or libc}/include" + "-Dloclibpth=${libc.out or libc}/lib" ] ++ optional enableThreading "-Dusethreads"; diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix index 32974778168..96b44ddc17f 100644 --- a/pkgs/development/interpreters/python/2.6/default.nix +++ b/pkgs/development/interpreters/python/2.6/default.nix @@ -52,6 +52,10 @@ let [ bzip2 openssl ]++ optionals includeModules [ db openssl ncurses gdbm readline xlibsWrapper tcl tk sqlite ] ++ optional zlibSupport zlib; + mkPaths = paths: { + C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p.dev or p}/include") paths); + LIBRARY_PATH = concatStringsSep ":" (map (p: "${p.lib or (p.out or p)}/lib") paths); + }; # Build the basic Python interpreter without modules that have # external dependencies. @@ -62,8 +66,7 @@ let inherit majorVersion version src patches buildInputs preConfigure configureFlags; - C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); - LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); + inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH; NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"; @@ -83,9 +86,9 @@ let ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb${majorVersion} mv $out/share/man/man1/{python.1,python2.6.1} ln -s $out/share/man/man1/{python2.6.1,python.1} - + paxmark E $out/bin/python${majorVersion} - + ${ optionalString includeModules "$out/bin/python ./setup.py build_ext"} ''; @@ -139,8 +142,7 @@ let buildInputs = [ python ] ++ deps; - C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); - LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); + inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH; buildPhase = '' diff --git a/pkgs/development/interpreters/python/2.7/default.nix b/pkgs/development/interpreters/python/2.7/default.nix index 6f951bc2837..a756bfde373 100644 --- a/pkgs/development/interpreters/python/2.7/default.nix +++ b/pkgs/development/interpreters/python/2.7/default.nix @@ -101,6 +101,11 @@ let # <mach-o/dyld.h> which is in our pure bootstrapTools, but not in the system headers. ++ optionals (stdenv.isDarwin && !stdenv.cc.nativeLibc) [ CF configd ]; + mkPaths = paths: { + C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p.dev or p}/include") paths); + LIBRARY_PATH = concatStringsSep ":" (map (p: "${p.lib or (p.out or p)}/lib") paths); + }; + # Build the basic Python interpreter without modules that have # external dependencies. python = stdenv.mkDerivation { @@ -111,8 +116,7 @@ let configureFlags; LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; - C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); - LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); + inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH; NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"; DETERMINISTIC_BUILD = 1; @@ -138,6 +142,8 @@ let paxmark E $out/bin/python${majorVersion} ${ optionalString includeModules "$out/bin/python ./setup.py build_ext"} + + rm "$out"/lib/python*/plat-linux2/regen # refers to glibc.dev ''; passthru = rec { @@ -186,8 +192,7 @@ let buildInputs = [ python ] ++ deps; - C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); - LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); + inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH; # non-python gdbm has a libintl dependency on i686-cygwin, not on x86_64-cygwin buildPhase = (if (stdenv.system == "i686-cygwin" && moduleName == "gdbm") then '' diff --git a/pkgs/development/libraries/acl/default.nix b/pkgs/development/libraries/acl/default.nix index d37d8926fbd..4055708907b 100644 --- a/pkgs/development/libraries/acl/default.nix +++ b/pkgs/development/libraries/acl/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "08qd9s3wfhv0ajswsylnfwr5h0d7j9d4rgip855nrh400nxp940p"; }; + outputs = [ "dev" "out" "bin" "doc" ]; + nativeBuildInputs = [ gettext ]; buildInputs = [ attr ]; diff --git a/pkgs/development/libraries/apr-util/default.nix b/pkgs/development/libraries/apr-util/default.nix index c35520f22fd..a1d63274ddf 100644 --- a/pkgs/development/libraries/apr-util/default.nix +++ b/pkgs/development/libraries/apr-util/default.nix @@ -22,12 +22,14 @@ stdenv.mkDerivation rec { configureFlags = '' --with-apr=${apr} --with-expat=${expat} ${optionalString (!stdenv.isCygwin) "--with-crypto"} - ${stdenv.lib.optionalString sslSupport "--with-openssl=${openssl}"} + ${stdenv.lib.optionalString sslSupport "--with-openssl"} ${stdenv.lib.optionalString bdbSupport "--with-berkeley-db=${db}"} ${stdenv.lib.optionalString ldapSupport "--with-ldap"}${ optionalString stdenv.isCygwin "--without-pgsql --without-sqlite2 --without-sqlite3 --without-freetds --without-berkeley-db --without-crypto"} ''; + buildInputs = stdenv.lib.optional sslSupport openssl; + propagatedBuildInputs = [ makeWrapper apr expat libiconv ] ++ optional sslSupport openssl ++ optional bdbSupport db diff --git a/pkgs/development/libraries/apr/default.nix b/pkgs/development/libraries/apr/default.nix index 08fd1fe4d5f..74994223e0f 100644 --- a/pkgs/development/libraries/apr/default.nix +++ b/pkgs/development/libraries/apr/default.nix @@ -10,6 +10,13 @@ stdenv.mkDerivation rec { patches = stdenv.lib.optionals stdenv.isDarwin [ ./is-this-a-compiler-bug.patch ]; + outputs = [ "dev" "out" ]; + + preConfigure = + '' + configureFlagsArray+=("--with-installbuilddir=$dev/share/build") + ''; + configureFlags = # Including the Windows headers breaks unistd.h. # Based on ftp://sourceware.org/pub/cygwin/release/libapr1/libapr1-1.3.8-2-src.tar.bz2 @@ -17,6 +24,13 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + postInstall = + '' + mkdir $dev/bin $dev/lib + mv $out/bin/apr-1-config $dev/bin + mv $out/lib/pkgconfig $dev/lib + ''; + meta = { homepage = http://apr.apache.org/; description = "The Apache Portable Runtime library"; diff --git a/pkgs/development/libraries/atk/default.nix b/pkgs/development/libraries/atk/default.nix index dcb90aa16cd..fbfb5765996 100644 --- a/pkgs/development/libraries/atk/default.nix +++ b/pkgs/development/libraries/atk/default.nix @@ -12,6 +12,10 @@ stdenv.mkDerivation rec { sha256 = "ce6c48d77bf951083029d5a396dd552d836fff3c1715d3a7022e917e46d0c92b"; }; + enableParallelBuilding = true; + + outputs = [ "dev" "out" "doc" ]; + buildInputs = libintlOrEmpty; nativeBuildInputs = [ pkgconfig perl ]; @@ -20,8 +24,6 @@ stdenv.mkDerivation rec { #doCheck = true; # no checks in there (2.10.0) - postInstall = "rm -rf $out/share/gtk-doc"; - meta = { description = "Accessibility toolkit"; diff --git a/pkgs/development/libraries/attr/default.nix b/pkgs/development/libraries/attr/default.nix index 8d87e2ee50d..e4e9142b632 100644 --- a/pkgs/development/libraries/attr/default.nix +++ b/pkgs/development/libraries/attr/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "0nd8y0m6awc9ahv0ciiwf8gy54c8d3j51pw9xg7f7cn579jjyxr5"; }; + outputs = [ "dev" "out" "bin" "doc" ]; + nativeBuildInputs = [ gettext ]; configureFlags = "MAKE=make MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ECHO=echo SED=sed AWK=gawk"; diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index 158f4b227dd..4839bedd8bb 100644 --- a/pkgs/development/libraries/boehm-gc/default.nix +++ b/pkgs/development/libraries/boehm-gc/default.nix @@ -7,9 +7,10 @@ stdenv.mkDerivation rec { url = http://www.hboehm.info/gc/gc_source/gc-7.2f.tar.gz; sha256 = "119x7p1cqw40mpwj80xfq879l9m1dkc7vbc1f3bz3kvkf8bf6p16"; }; - patches = if stdenv.isCygwin then [ ./cygwin.patch ] else null; + outputs = [ "dev" "out" "doc" ]; + configureFlags = [ "--enable-cplusplus" ] ++ lib.optional enableLargeConfig "--enable-large-config"; @@ -19,6 +20,12 @@ stdenv.mkDerivation rec { # Don't run the native `strip' when cross-compiling. dontStrip = stdenv ? cross; + postInstall = + '' + mkdir -p $out/share/doc + mv $out/share/gc $out/share/doc/gc + ''; + meta = { description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++"; diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix index cd98c0a312b..677652a733b 100644 --- a/pkgs/development/libraries/boost/generic.nix +++ b/pkgs/development/libraries/boost/generic.nix @@ -159,6 +159,7 @@ stdenv.mkDerivation { postFixup = fixup; outputs = [ "out" "dev" "lib" ]; + setOutputFlags = false; crossAttrs = rec { buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ]; diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix index e2d6b25e137..18a9a7aa051 100644 --- a/pkgs/development/libraries/cairo/default.nix +++ b/pkgs/development/libraries/cairo/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { sha1 = "c8da68aa66ca0855b5d0ff552766d3e8679e1d24"; }; + outputs = [ "dev" "out" "bin" "doc" ]; + nativeBuildInputs = [ pkgconfig libiconv ] ++ libintlOrEmpty; propagatedBuildInputs = @@ -53,12 +55,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - # The default `--disable-gtk-doc' is ignored. - postInstall = "rm -rf $out/share/gtk-doc" - + stdenv.lib.optionalString stdenv.isDarwin ('' - #newline - '' + glib.flattenInclude - ); + postInstall = stdenv.lib.optionalString stdenv.isDarwin glib.flattenInclude; meta = with stdenv.lib; { description = "A 2D graphics library with support for multiple output devices"; diff --git a/pkgs/development/libraries/fftw/default.nix b/pkgs/development/libraries/fftw/default.nix index 2bcc1cd69a7..aa383b0c73a 100644 --- a/pkgs/development/libraries/fftw/default.nix +++ b/pkgs/development/libraries/fftw/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { sha256 = "10h9mzjxnwlsjziah4lri85scc05rlajz39nqf3mbh4vja8dw34g"; }; + buildInputs = [ (stdenv.cc.cc.lib or null) ]; + configureFlags = [ "--enable-shared" "--disable-static" "--enable-threads" diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix index e9e393075b3..dccde33efcf 100644 --- a/pkgs/development/libraries/freetype/default.nix +++ b/pkgs/development/libraries/freetype/default.nix @@ -31,12 +31,16 @@ stdenv.mkDerivation rec { (fetch_bohoomil "04-infinality-2.5.4-2014.12.07.patch" "1gph7z9s2221gy5dxn01v3lga0m9yib8yqsaqj5km74bqx1vlalh") ]; + outputs = [ "dev" "out" ]; + propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype # dependence on harfbuzz is looser than the reverse dependence buildInputs = [ pkgconfig which ] # FreeType requires GNU Make, which is not part of stdenv on FreeBSD. ++ optional (!stdenv.isLinux) gnumake; + configureFlags = "--disable-static --bindir=$(dev)/bin"; + # from Gentoo, see https://bugzilla.redhat.com/show_bug.cgi?id=506840 NIX_CFLAGS_COMPILE = "-fno-strict-aliasing"; # The asm for armel is written with the 'asm' keyword. @@ -47,8 +51,8 @@ stdenv.mkDerivation rec { doCheck = true; # compat hacks - postInstall = glib.flattenInclude + '' - ln -s . "$out"/include/freetype + postFixup = glib.flattenInclude + '' + ln -s . "$dev"/include/freetype ''; crossAttrs = { diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix index 0971df78e66..626fb2627b3 100644 --- a/pkgs/development/libraries/gdk-pixbuf/default.nix +++ b/pkgs/development/libraries/gdk-pixbuf/default.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation rec { sha256 = "0rqvj5gcs2zfyyg9llm289b0xkj4mrhzxfjpjja0wx1m6vn5axjk"; }; + outputs = [ "dev" "out" "bin" "doc" ]; + setupHook = ./setup-hook.sh; + enableParallelBuilding = true; + # !!! We might want to factor out the gdk-pixbuf-xlib subpackage. buildInputs = [ libX11 libintlOrEmpty ]; @@ -29,7 +33,11 @@ stdenv.mkDerivation rec { # The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB). inherit (doCheck); - postInstall = "rm -rf $out/share/gtk-doc"; + # propagate the bin output + postPhases = "postPostFixup"; + postPostFixup = '' + echo -n " $bin" >> "$dev"/nix-support/propagated-*build-inputs + ''; meta = { description = "A library for image loading and manipulation"; diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 874c767046b..b32b126cfe8 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation (rec { sed -i -e "s/\(am_libgettextlib_la_OBJECTS = \)error.lo/\\1/" gettext-tools/gnulib-lib/Makefile.in ''; - buildInputs = [ xz ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv; + buildInputs = [ xz xz.bin ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 137fe943637..ae64f1f68e0 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -53,18 +53,21 @@ stdenv.mkDerivation rec { patches = optional stdenv.isDarwin ./darwin-compilation.patch ++ optional doCheck ./skip-timer-test.patch; + outputs = [ "dev" "out" "doc" ]; + outputBin = "dev"; + setupHook = ./setup-hook.sh; - buildInputs = [ libelf ] + buildInputs = [ libelf setupHook/*get the gtk-doc hook*/ ] ++ optionals doCheck [ tzdata libxml2 desktop_file_utils shared_mime_info ]; nativeBuildInputs = [ pkgconfig gettext perl python ]; - propagatedBuildInputs = [ pcre zlib libffi libiconv ] + propagatedBuildInputs = [ zlib libffi libiconv /*pcre*/ ] ++ libintlOrEmpty; - configureFlags = - optional stdenv.isDarwin "--disable-compile-warnings" + configureFlags = [ ] # [ "--with-pcre=system" ] # internal pcre only adds <200kB + ++ optional stdenv.isDarwin "--disable-compile-warnings" ++ optional stdenv.isSunOS "--disable-modular-tests"; NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl" @@ -78,6 +81,11 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; DETERMINISTIC_BUILD = 1; + postInstall = '' + _moveToOutput "share/glib-2.0" "$dev" + substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$dev" + ''; + inherit doCheck; preCheck = optionalString doCheck '' export LD_LIBRARY_PATH="$NIX_BUILD_TOP/${name}/glib/.libs:$LD_LIBRARY_PATH" @@ -99,8 +107,6 @@ stdenv.mkDerivation rec { sed -e '/g_subprocess_launcher_set_environ (launcher, envp);/a g_subprocess_launcher_setenv (launcher, "PATH", g_getenv("PATH"), TRUE);' -i gio/tests/gsubprocess.c ''; - postInstall = ''rm -rvf $out/share/gtk-doc''; - passthru = { gioModuleDir = "lib/gio/modules"; inherit flattenInclude; diff --git a/pkgs/development/libraries/glib/setup-hook.sh b/pkgs/development/libraries/glib/setup-hook.sh index ca7e326bd02..5ead702f006 100644 --- a/pkgs/development/libraries/glib/setup-hook.sh +++ b/pkgs/development/libraries/glib/setup-hook.sh @@ -20,4 +20,19 @@ glibPreFixupPhase() { addToSearchPath GSETTINGS_SCHEMAS_PATH "$out/share/gsettings-schemas/$name" } -preFixupPhases="$preFixupPhases glibPreFixupPhase" +preFixupPhases+=(glibPreFixupPhase) + + +preFixupHooks+=(_multioutGtkDocs) + +# Move documentation to the desired outputs. +_multioutGtkDocs() { + if [ "$outputs" = "out" ]; then return; fi; + _moveToOutput share/gtk-doc "${!outputDoc}" + + # Remove empty share directory. + if [ -d "$out/share" ]; then + rmdir "$out/share" 2> /dev/null || true + fi +} + diff --git a/pkgs/development/libraries/glibc/builder.sh b/pkgs/development/libraries/glibc/builder.sh index 2836063e3bf..46f47d9b99c 100644 --- a/pkgs/development/libraries/glibc/builder.sh +++ b/pkgs/development/libraries/glibc/builder.sh @@ -12,8 +12,10 @@ postConfigure() { export NIX_DONT_SET_RPATH=1 unset CFLAGS -} + # Apparently --bindir is not respected. + makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin") +} postInstall() { if test -n "$installLocales"; then @@ -27,7 +29,7 @@ postInstall() { if test -z "$hurdHeaders"; then # Include the Linux kernel headers in Glibc, except the `scsi' # subdirectory, which Glibc provides itself. - (cd $out/include && \ + (cd $dev/include && \ ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .) fi @@ -48,6 +50,17 @@ postInstall() { # Get rid of more unnecessary stuff. rm -rf $out/var $out/sbin/sln + + # Put libraries for static linking in a separate output. Note + # that libc_nonshared.a and libpthread_nonshared.a are required + # for dynamically-linked applications. + mkdir -p $static/lib + mv $out/lib/*.a $static/lib + mv $static/lib/lib*_nonshared.a $out/lib + + # Work around a Nix bug: hard links across outputs cause a build failure. + cp $bin/bin/getconf $bin/bin/getconf_ + mv $bin/bin/getconf_ $bin/bin/getconf } genericBuild diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index cf356ccefbe..03881a41aa5 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -124,7 +124,10 @@ stdenv.mkDerivation ({ installFlags = [ "sysconfdir=$(out)/etc" ]; - buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ] + outputs = [ "dev" "out" "bin" "static" ]; + + buildInputs = [ ] + ++ stdenv.lib.optionals (cross != null) [ gccCross ] ++ stdenv.lib.optional (mig != null) mig ++ stdenv.lib.optionals withGd [ gd libpng ]; diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index 08eaf555e02..26d2bda2aeb 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -97,7 +97,7 @@ in # To avoid a dependency on the build system 'bash'. preFixup = '' - rm $out/bin/{ldd,tzselect,catchsegv,xtrace} + rm $bin/bin/{ldd,tzselect,catchsegv,xtrace} ''; } else {})) diff --git a/pkgs/development/libraries/glibc/locales.nix b/pkgs/development/libraries/glibc/locales.nix index cbf7af22cac..0cf074323fb 100644 --- a/pkgs/development/libraries/glibc/locales.nix +++ b/pkgs/development/libraries/glibc/locales.nix @@ -18,6 +18,8 @@ build null { builder = ./locales-builder.sh; + outputs = [ "out" ]; + # Awful hack: `localedef' doesn't allow the path to `locale-archive' # to be overriden, but you *can* specify a prefix, i.e. it will use # <prefix>/<path-to-glibc>/lib/locale/locale-archive. So we use @@ -25,7 +27,7 @@ build null { # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive. buildPhase = '' - mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale" + mkdir -p $TMPDIR/"${stdenv.cc.libc.out}/lib/locale" # Hack to allow building of the locales (needed since glibc-2.12) sed -i -e 's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef --prefix='$TMPDIR',' ../glibc-2*/localedata/Makefile diff --git a/pkgs/development/libraries/gmime/default.nix b/pkgs/development/libraries/gmime/default.nix index 6564fc51186..93bad0059b7 100644 --- a/pkgs/development/libraries/gmime/default.nix +++ b/pkgs/development/libraries/gmime/default.nix @@ -8,9 +8,13 @@ stdenv.mkDerivation rec { sha256 = "0rfzbgsh8ira5p76kdghygl5i3fvmmx4wbw5rp7f8ajc4vxp18g0"; }; + outputs = [ "dev" "out" "doc" ]; + nativeBuildInputs = [ pkgconfig ]; propagatedBuildInputs = [ glib zlib libgpgerror ]; + enableParallelBuilding = true; + meta = { homepage = http://spruce.sourceforge.net/gmime/; description = "A C/C++ library for manipulating MIME messages"; diff --git a/pkgs/development/libraries/gmp/5.1.x.nix b/pkgs/development/libraries/gmp/5.1.x.nix index 7b393067ff5..0768df60a79 100644 --- a/pkgs/development/libraries/gmp/5.1.x.nix +++ b/pkgs/development/libraries/gmp/5.1.x.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { sha256 = "0q5i39pxrasgn9qdxzpfbwhh11ph80p57x6hf48m74261d97j83m"; }; + outputs = [ "out" "info" ]; + nativeBuildInputs = [ m4 ]; patches = if stdenv.isDarwin then [ ./need-size-t.patch ] else null; diff --git a/pkgs/development/libraries/gnutls/generic.nix b/pkgs/development/libraries/gnutls/generic.nix index 0c2e3429159..d2bdc3fd281 100644 --- a/pkgs/development/libraries/gnutls/generic.nix +++ b/pkgs/development/libraries/gnutls/generic.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation { # Fixup broken libtool and pkgconfig files preFixup = lib.optionalString (!stdenv.isDarwin) '' sed ${lib.optionalString tpmSupport "-e 's,-ltspi,-L${trousers}/lib -ltspi,'"} \ - -e 's,-lz,-L${zlib}/lib -lz,' \ + -e 's,-lz,-L${zlib.out}/lib -lz,' \ -e 's,-lgmp,-L${gmp}/lib -lgmp,' \ -i $out/lib/libgnutls.la $out/lib/pkgconfig/gnutls.pc ''; diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix index f429e1dc6c3..226fbd2835b 100644 --- a/pkgs/development/libraries/gobject-introspection/default.nix +++ b/pkgs/development/libraries/gobject-introspection/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { sha256 = "6658bd3c2b8813eb3e2511ee153238d09ace9d309e4574af27443d87423e4233"; }; + outputs = [ "dev" "out" "doc" ]; + buildInputs = [ flex bison pkgconfig python ] ++ libintlOrEmpty ++ stdenv.lib.optional stdenv.isDarwin otool; @@ -29,8 +31,6 @@ stdenv.mkDerivation rec { sed 's|/usr/bin/env ||' -i tools/g-ir-tool-template.in ''; - postInstall = "rm -rf $out/share/gtk-doc"; - setupHook = ./setup-hook.sh; patches = [ ./absolute_shlib_path.patch ]; diff --git a/pkgs/development/libraries/gtk+/2.x.nix b/pkgs/development/libraries/gtk+/2.x.nix index e821e693b0c..c04a1e0b4cc 100644 --- a/pkgs/development/libraries/gtk+/2.x.nix +++ b/pkgs/development/libraries/gtk+/2.x.nix @@ -15,11 +15,16 @@ stdenv.mkDerivation rec { sha256 = "0mj6xn40py9r9lvzg633fal81xfwfm89d9mvz7jk4lmwk0g49imj"; }; + outputs = [ "dev" "out" "doc" ]; + outputBin = "dev"; + enableParallelBuilding = true; NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (libintlOrEmpty != []) "-lintl"; - nativeBuildInputs = [ perl pkgconfig gettext ]; + setupHook = ./setup-hook.sh; + + nativeBuildInputs = [ setupHook perl pkgconfig gettext ]; propagatedBuildInputs = with xorg; with stdenv.lib; [ glib cairo pango gdk_pixbuf atk ] @@ -35,7 +40,9 @@ stdenv.mkDerivation rec { then "--disable-glibtest --disable-introspection --disable-visibility" else "--with-xinput=yes"; - postInstall = "rm -rf $out/share/gtk-doc"; + postInstall = '' + _moveToOutput share/gtk-2.0/demo "$doc" + ''; passthru = { gtkExeEnvPostBuild = '' diff --git a/pkgs/development/libraries/gtk+/setup-hook.sh b/pkgs/development/libraries/gtk+/setup-hook.sh new file mode 100644 index 00000000000..c2b0ab502db --- /dev/null +++ b/pkgs/development/libraries/gtk+/setup-hook.sh @@ -0,0 +1,10 @@ +fixupOutputHooks+=(_gtk2CleanComments) + +# Clean comments that link to generator of the file +_gtk2CleanComments() { + local f="$prefix/lib/gtk-2.0/2.10.0/immodules.cache" + if [ -f "$f" ]; then + sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f" + fi +} + diff --git a/pkgs/development/libraries/hunspell/default.nix b/pkgs/development/libraries/hunspell/default.nix index 98f6511f391..0d0ff38fb47 100644 --- a/pkgs/development/libraries/hunspell/default.nix +++ b/pkgs/development/libraries/hunspell/default.nix @@ -8,8 +8,10 @@ stdenv.mkDerivation rec { sha256 = "0v14ff9s37vkh45diaddndcrj0hmn67arh8xh8k79q9c1vgc1cm7"; }; - propagatedBuildInputs = [ ncurses readline ]; - configureFlags = "--with-ui --with-readline"; + outputs = [ "dev" "out" "bin" "man" ]; + + buildInputs = [ ncurses readline ]; + configureFlags = [ "--with-ui" "--with-readline" ]; meta = with stdenv.lib; { homepage = http://hunspell.sourceforge.net; diff --git a/pkgs/development/libraries/jasper/default.nix b/pkgs/development/libraries/jasper/default.nix index 2fa9cf7dbf9..82d86d46fad 100644 --- a/pkgs/development/libraries/jasper/default.nix +++ b/pkgs/development/libraries/jasper/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, unzip, xorg, libjpeg }: +{ stdenv, fetchurl, unzip, libjpeg }: stdenv.mkDerivation rec { name = "jasper-1.900.1"; @@ -17,11 +17,16 @@ stdenv.mkDerivation rec { ./jasper-CVE-2014-9029.diff ]; - nativeBuildInputs = [unzip]; + # outputs TODO: why reconf + nativeBuildInputs = [ unzip autoreconfHook ]; propagatedBuildInputs = [ libjpeg ]; configureFlags = "--enable-shared"; - + + outputs = [ "dev" "out" "man" "bin" ]; + + enableParallelBuilding = true; + meta = { homepage = https://www.ece.uvic.ca/~frodo/jasper/; description = "JPEG2000 Library"; diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix index 23b1402e3e7..8ca8695def8 100644 --- a/pkgs/development/libraries/libav/default.nix +++ b/pkgs/development/libraries/libav/default.nix @@ -10,7 +10,7 @@ , vaapiSupport ? false, libva ? null # ToDo: it has huge closure , vdpauSupport ? true, libvdpau ? null , freetypeSupport ? true, freetype ? null # it's small and almost everywhere -, SDL # only for avplay in $tools, adds nontrivial closure to it +, SDL # only for avplay in $bin, adds nontrivial closure to it , enableGPL ? true # ToDo: some additional default stuff may need GPL , enableUnfree ? faacSupport }: @@ -77,12 +77,12 @@ let enableParallelBuilding = true; - outputs = [ "out" "tools" ]; + outputs = [ "dev" "out" "bin" ]; #TODO: re-check # move avplay to get rid of the SDL dependency in the main output postInstall = '' - mkdir -p "$tools/bin" - mv "$out/bin/avplay" "$tools/bin" + mkdir -p "$bin/bin" + mv "$out/bin/avplay" "$bin/bin" ''; doInstallCheck = false; # fails randomly diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix index 533512e9b68..4db67e73b8b 100644 --- a/pkgs/development/libraries/libdrm/default.nix +++ b/pkgs/development/libraries/libdrm/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "71960ac8bde7d710992b1bc8879935e8300a870c36bd06f22412d0447e3d96c4"; }; + outputs = [ "dev" "out" ]; + nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libpthreadstubs libpciaccess ] ++ stdenv.lib.optional stdenv.isLinux udev; diff --git a/pkgs/development/libraries/libelf/default.nix b/pkgs/development/libraries/libelf/default.nix index 4a34ac6bdec..686b444e430 100644 --- a/pkgs/development/libraries/libelf/default.nix +++ b/pkgs/development/libraries/libelf/default.nix @@ -1,6 +1,6 @@ { fetchurl, stdenv, gettext, glibc }: -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { name = "libelf-0.8.13"; src = fetchurl { @@ -15,6 +15,11 @@ stdenv.mkDerivation (rec { nativeBuildInputs = [ glibc ]; }; + # Libelf's custom NLS macros fail to determine the catalog file extension on + # Darwin, so disable NLS for now. + # FIXME: Eventually make Gettext a build input on all platforms. + configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-nls"; + meta = { description = "ELF object file access library"; @@ -26,12 +31,3 @@ stdenv.mkDerivation (rec { maintainers = [ ]; }; } - -// - -# Libelf's custom NLS macros fail to determine the catalog file extension on -# Darwin, so disable NLS for now. -# FIXME: Eventually make Gettext a build input on all platforms. -(if stdenv.isDarwin - then { configureFlags = [ "--disable-nls" ]; } - else { })) diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix index 824b909f1d9..cc7d1f75bb1 100644 --- a/pkgs/development/libraries/libffi/default.nix +++ b/pkgs/development/libraries/libffi/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { patches = if stdenv.isCygwin then [ ./3.2.1-cygwin.patch ] else null; + outputs = [ "dev" "out" "doc" ]; + configureFlags = [ "--with-gcc-arch=generic" # no detection of -march= or -mtune= "--enable-pax_emutramp" @@ -17,9 +19,15 @@ stdenv.mkDerivation rec { dontStrip = stdenv ? cross; # Don't run the native `strip' when cross-compiling. - # Install headers in the right place. + # Install headers and libs in the right places. postInstall = '' - ln -s${if (stdenv.isFreeBSD || stdenv.isOpenBSD || stdenv.isDarwin) then "" else "r"}v "$out/lib/"libffi*/include "$out/include" + mv "$out"/lib64/* "$out/lib" + rmdir "$out/lib64" + ln -s lib "$out/lib64" + + mkdir -p "$dev/" + mv "$out/lib/${name}/include" "$dev/include" + rmdir "$out/lib/${name}" ''; meta = { diff --git a/pkgs/development/libraries/libjpeg-turbo/default.nix b/pkgs/development/libraries/libjpeg-turbo/default.nix index 3660a652e79..79cf45a8005 100644 --- a/pkgs/development/libraries/libjpeg-turbo/default.nix +++ b/pkgs/development/libraries/libjpeg-turbo/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, nasm }: +{ stdenv, fetchurl, nasm, autoreconfHook }: stdenv.mkDerivation rec { name = "libjpeg-turbo-1.4.2"; @@ -8,7 +8,11 @@ stdenv.mkDerivation rec { sha256 = "0gi349hp1x7mb98s4mf66sb2xay2kjjxj9ihrriw0yiy0k9va6sj"; }; - buildInputs = [ nasm ]; + outputs = [ "dev" "out" "doc" "bin" ]; + + buildInputs = [ autoreconfHook nasm ]; + + enableParallelBuilding = true; doCheck = true; checkTarget = "test"; diff --git a/pkgs/development/libraries/libjpeg/default.nix b/pkgs/development/libraries/libjpeg/default.nix index bf2ebb27f37..025be200959 100644 --- a/pkgs/development/libraries/libjpeg/default.nix +++ b/pkgs/development/libraries/libjpeg/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation { configureFlags = optional static "--enable-static --disable-shared"; + outputs = [ "dev" "out" "man" "bin" ]; + meta = { homepage = http://www.ijg.org/; description = "A library that implements the JPEG image file format"; diff --git a/pkgs/development/libraries/libogg/default.nix b/pkgs/development/libraries/libogg/default.nix index 4e017840472..2e19c1a588f 100644 --- a/pkgs/development/libraries/libogg/default.nix +++ b/pkgs/development/libraries/libogg/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "doc" ]; meta = with stdenv.lib; { + + outputs = [ "dev" "doc" "out" ]; homepage = http://xiph.org/ogg/; license = licenses.bsd3; maintainers = [ maintainers.emery ]; diff --git a/pkgs/development/libraries/libopensc-dnie/default.nix b/pkgs/development/libraries/libopensc-dnie/default.nix index f2855dd2a92..242c4473cf2 100644 --- a/pkgs/development/libraries/libopensc-dnie/default.nix +++ b/pkgs/development/libraries/libopensc-dnie/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { ar x opensc-dnie* tar xf data.tar.gz - RPATH=${glib}/lib:${opensc}/lib:${openssl}/lib:${openct}/lib:${libtool}/lib:${pcsclite}/lib:${stdenv.cc.libc}/lib:${zlib}/lib + RPATH=${glib}/lib:${opensc}/lib:${openssl}/lib:${openct}/lib:${libtool}/lib:${pcsclite}/lib:${stdenv.cc.libc.out}/lib:${zlib}/lib for a in "usr/lib/"*.so*; do if ! test -L $a; then diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix index 53777a0c56f..67be2ec8611 100644 --- a/pkgs/development/libraries/libpng/default.nix +++ b/pkgs/development/libraries/libpng/default.nix @@ -18,13 +18,18 @@ in stdenv.mkDerivation rec { url = "mirror://sourceforge/libpng/libpng-${version}.tar.xz"; inherit sha256; }; - postPatch = whenPatched "gunzip < ${patch_src} | patch -Np1"; + outputs = [ "dev" "out" "man" ]; + propagatedBuildInputs = [ zlib ]; + preConfigure = "export bin=$dev"; + doCheck = true; + postInstall = ''mv "$out/bin" "$dev/bin"''; + passthru = { inherit zlib; }; meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/libraw/default.nix b/pkgs/development/libraries/libraw/default.nix index 3d564fc00f8..928b251b3af 100644 --- a/pkgs/development/libraries/libraw/default.nix +++ b/pkgs/development/libraries/libraw/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "043kckxjqanw8dl3m9f6kvsf0l20ywxmgxd1xb0slj6m8l4w4hz6"; }; - buildInputs = [ lcms2 jasper ] ; + buildInputs = [ lcms2 jasper (stdenv.cc.cc.lib or null) ] ; nativeBuildInputs = [ pkgconfig ]; diff --git a/pkgs/development/libraries/libsamplerate/default.nix b/pkgs/development/libraries/libsamplerate/default.nix index 481d82c0c9a..f0ff549c716 100644 --- a/pkgs/development/libraries/libsamplerate/default.nix +++ b/pkgs/development/libraries/libsamplerate/default.nix @@ -1,6 +1,4 @@ -{ stdenv, fetchurl, pkgconfig -, fftw, libsndfile -}: +{ stdenv, fetchurl, pkgconfig, libsndfile }: stdenv.mkDerivation rec { name = "libsamplerate-0.1.8"; @@ -11,12 +9,14 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ fftw libsndfile ]; + buildInputs = [ libsndfile ]; # maybe interesting configure flags: #--disable-fftw disable usage of FFTW #--disable-cpu-clip disable tricky cpu specific clipper + outputs = [ "dev" "bin" "out" ]; + postConfigure = stdenv.lib.optionalString stdenv.isDarwin '' # need headers from the Carbon.framework in /System/Library/Frameworks to diff --git a/pkgs/development/libraries/libsndfile/default.nix b/pkgs/development/libraries/libsndfile/default.nix index 1fac43fa2a9..b9aa9522564 100644 --- a/pkgs/development/libraries/libsndfile/default.nix +++ b/pkgs/development/libraries/libsndfile/default.nix @@ -10,6 +10,10 @@ stdenv.mkDerivation rec { buildInputs = [ pkgconfig flac libogg libvorbis ]; + enableParallelBuilding = true; + + outputs = [ "dev" "out" "bin" "doc" ]; + # need headers from the Carbon.framework in /System/Library/Frameworks to # compile this on darwin -- not sure how to handle preConfigure = stdenv.lib.optionalString stdenv.isDarwin diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix index 2c559d221ab..1de75f72e6e 100644 --- a/pkgs/development/libraries/libtiff/default.nix +++ b/pkgs/development/libraries/libtiff/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "doc" "man" ]; + outputs = [ "dev" "out" "bin" "doc" ]; + nativeBuildInputs = [ pkgconfig ]; propagatedBuildInputs = [ zlib libjpeg xz ]; #TODO: opengl support (bogus configure detection) diff --git a/pkgs/development/libraries/libusb/default.nix b/pkgs/development/libraries/libusb/default.nix index 7aec64d596f..b1872779b70 100644 --- a/pkgs/development/libraries/libusb/default.nix +++ b/pkgs/development/libraries/libusb/default.nix @@ -3,6 +3,9 @@ stdenv.mkDerivation { name = "libusb-compat-0.1.5"; + outputs = [ "dev" "out" ]; # get rid of propagating systemd closure + outputBin = "dev"; + nativeBuildInputs = [ pkgconfig ]; propagatedBuildInputs = [ libusb1 ]; diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix index 75d6bdb4cc6..e488b7b8eec 100644 --- a/pkgs/development/libraries/libusb1/default.nix +++ b/pkgs/development/libraries/libusb1/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "0h38p9rxfpg9vkrbyb120i1diq57qcln82h5fr7hvy82c20jql3c"; }; + outputs = [ "dev" "out" ]; # get rid of propagating systemd closure + buildInputs = [ pkgconfig ]; propagatedBuildInputs = stdenv.lib.optional stdenv.isLinux udev ++ diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix index e946f27791b..f2d6a089119 100644 --- a/pkgs/development/libraries/libvirt/default.nix +++ b/pkgs/development/libraries/libvirt/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { ]; preConfigure = '' - PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${udev}/sbin:${dnsmasq}/bin:$PATH + PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${udev.out}/sbin:${dnsmasq}/bin:$PATH patchShebangs . # fixes /usr/bin/python references ''; diff --git a/pkgs/development/libraries/libvorbis/default.nix b/pkgs/development/libraries/libvorbis/default.nix index d58607ea298..f1715805141 100644 --- a/pkgs/development/libraries/libvorbis/default.nix +++ b/pkgs/development/libraries/libvorbis/default.nix @@ -8,7 +8,8 @@ stdenv.mkDerivation rec { sha256 = "1lg1n3a6r41492r7in0fpvzc7909mc5ir9z0gd3qh2pz4yalmyal"; }; - outputs = [ "out" "doc" ]; + outputs = [ "dev" "out" "doc" ]; + nativeBuildInputs = [ pkgconfig ]; propagatedBuildInputs = [ libogg ]; diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 90db53ae7eb..eadcb6c61f9 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -1,6 +1,5 @@ -{ stdenv, fetchurl, fetchpatch, pkgconfig, intltool, flex, bison, autoreconfHook, substituteAll -, python, libxml2Python, file, expat, makedepend, pythonPackages -, libdrm, xorg, wayland, udev, llvmPackages, libffi, libomxil-bellagio +{ stdenv, fetchurl, fetchpatch, pkgconfig, intltool, autoreconfHook, substituteAll +, file, expat, libdrm, xorg, wayland, udev, llvmPackages, libffi, libomxil-bellagio , libvdpau, libelf, libva , grsecEnabled , enableTextureFloats ? false # Texture floats are patented, see docs/patents.txt @@ -21,12 +20,13 @@ else - libOSMesa is in $osmesa (~4 MB) */ +with { inherit (stdenv.lib) optional optionalString; }; + let version = "10.6.8"; # this is the default search path for DRI drivers - driverLink = "/run/opengl-driver" + stdenv.lib.optionalString stdenv.isi686 "-32"; + driverLink = "/run/opengl-driver" + optionalString stdenv.isi686 "-32"; in -with { inherit (stdenv.lib) optional optionals optionalString; }; stdenv.mkDerivation { name = "mesa-noglu-${version}"; @@ -48,7 +48,7 @@ stdenv.mkDerivation { ] ++ optional stdenv.isLinux (substituteAll { src = ./dlopen-absolute-paths.diff; - inherit udev; + inherit (udev) libudev; }); postPatch = '' @@ -56,7 +56,7 @@ stdenv.mkDerivation { --replace _EGL_DRIVER_SEARCH_DIR '"${driverLink}"' ''; - outputs = ["out" "drivers" "osmesa"]; + outputs = [ "dev" "out" "drivers" "osmesa" ]; configureFlags = [ "--sysconfdir=/etc" @@ -97,13 +97,13 @@ stdenv.mkDerivation { ] ++ optional enableTextureFloats "--enable-texture-float" ++ optional grsecEnabled "--enable-glx-rts"; # slight performance degradation, enable only for grsec - nativeBuildInputs = [ pkgconfig python makedepend file flex bison pythonPackages.Mako ]; + nativeBuildInputs = [ pkgconfig file ]; propagatedBuildInputs = with xorg; [ libXdamage libXxf86vm ] - ++ optionals stdenv.isLinux [ libdrm ]; + ++ optional stdenv.isLinux libdrm; buildInputs = with xorg; [ - autoreconfHook intltool expat libxml2Python llvmPackages.llvm + autoreconfHook intltool expat llvmPackages.llvm glproto dri2proto dri3proto presentproto libX11 libXext libxcb libXt libXfixes libxshmfence libffi wayland libvdpau libelf libXvMC /* libomxil-bellagio libva */ @@ -125,8 +125,13 @@ stdenv.mkDerivation { $out/lib/libXvMC* \ $out/lib/d3d \ $out/lib/vdpau \ + $out/lib/{bellagio,d3d} \ $out/lib/libxatracker* + mv -t "$drivers/lib/dri/" \ + "$out"/lib/dri/* + rmdir "$out/lib/dri" + mkdir -p {$osmesa,$drivers}/lib/pkgconfig mv -t $osmesa/lib/ \ $out/lib/libOSMesa* @@ -141,29 +146,34 @@ stdenv.mkDerivation { sed "/^libdir=/s,$out,$osmesa," -i \ $osmesa/lib/libOSMesa*.la - '' + /* work around bug #529, but maybe $drivers should also be patchelf-ed */ '' - find $drivers/ $osmesa/ -type f -executable -print0 | xargs -0 strip -S || true + '' + /* set the default search path for DRI drivers; used e.g. by X server */ '' + substituteInPlace "$out/lib/pkgconfig/dri.pc" --replace '$(drivers)' "${driverLink}" + '' + /* move vdpau drivers to $drivers/lib, so they are found */ '' + mv "$drivers"/lib/vdpau/* "$drivers"/lib/ && rmdir "$drivers"/lib/vdpau + ''; + #ToDo: @vcunat isn't sure if drirc will be found when in $out/etc/, but it doesn't seem important ATM */ - '' + /* add RPATH so the drivers can find the moved libgallium and libdricore9 */ '' + postFixup = + # add RPATH so the drivers can find the moved libgallium and libdricore9 + # moved here to avoid problems with stripping patchelfed files + '' for lib in $drivers/lib/*.so* $drivers/lib/*/*.so*; do if [[ ! -L "$lib" ]]; then patchelf --set-rpath "$(patchelf --print-rpath $lib):$drivers/lib" "$lib" fi done - '' + /* set the default search path for DRI drivers; used e.g. by X server */ '' - substituteInPlace "$out/lib/pkgconfig/dri.pc" --replace '$(drivers)' "${driverLink}" - '' + /* move vdpau drivers to $drivers/lib, so they are found */ '' - mv "$drivers"/lib/vdpau/* "$drivers"/lib/ && rmdir "$drivers"/lib/vdpau ''; - #ToDo: @vcunat isn't sure if drirc will be found when in $out/etc/, but it doesn't seem important ATM + # ToDo + /* check $out doesn't depend on llvm */ '' + # builder failures are ignored for some reason + # grep -qv '${llvmPackages.llvm}' -R "$out" passthru = { inherit libdrm version driverLink; }; - meta = { + meta = with stdenv.lib; { description = "An open source implementation of OpenGL"; homepage = http://www.mesa3d.org/; - license = "bsd"; - platforms = stdenv.lib.platforms.mesaPlatforms; - maintainers = with stdenv.lib.maintainers; [ eduarrrd simons vcunat ]; + license = licenses.mit; # X11 variant, in most files + platforms = platforms.mesaPlatforms; + maintainers = with maintainers; [ eduarrrd simons vcunat ]; }; } diff --git a/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff b/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff index a4bb6a72b13..9a522657223 100644 --- a/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff +++ b/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff @@ -16,7 +16,7 @@ index 4fdf3c2..69ea22d 100644 do { for (version = 1; version >= 0; version--) { - snprintf(name, sizeof(name), "libudev.so.%d", version); -+ snprintf(name, sizeof(name), "@udev@/lib/libudev.so.%d", version); ++ snprintf(name, sizeof(name), "@libudev@/lib/libudev.so.%d", version); udev_handle = dlopen(name, flags); if (udev_handle) return udev_handle; diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix index e1809d544d1..c17b762cab2 100644 --- a/pkgs/development/libraries/mpfr/default.nix +++ b/pkgs/development/libraries/mpfr/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { patches = [ ./upstream.patch ]; + outputs = [ "dev" "out" "doc" ]; + # mpfr.h requires gmp.h propagatedBuildInputs = [ gmp ]; diff --git a/pkgs/development/libraries/nss_wrapper/default.nix b/pkgs/development/libraries/nss_wrapper/default.nix index 278834190bb..a81d95e6b98 100644 --- a/pkgs/development/libraries/nss_wrapper/default.nix +++ b/pkgs/development/libraries/nss_wrapper/default.nix @@ -8,7 +8,8 @@ stdenv.mkDerivation rec { sha256 = "0bysdijvi9n0jk74iklbfhbp0kvv81a727lcfd5q03q2hkzjfm18"; }; - buildInputs = [ cmake pkgconfig ]; + buildInputs = [ cmake pkgconfig (stdenv.cc.libc.out or null) ]; + # outputs TODO: missing glibc.out might become a general problem meta = with stdenv.lib; { description = "A wrapper for the user, group and hosts NSS API"; diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index ca3e7999f9b..3ed9ca9e847 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -18,11 +18,12 @@ stdenv.mkDerivation rec { sha1 = "9d1977cc89242cd11471269ece2ed4650947c046"; }; - outputs = [ "out" "man" ]; - patches = optional stdenv.isCygwin ./1.0.1-cygwin64.patch ++ optional (stdenv.isDarwin || (stdenv ? cross && stdenv.cross.libc == "libSystem")) ./darwin-arch.patch; + outputs = [ "dev" "out" "man" "bin" ]; + setOutputFlags = false; + nativeBuildInputs = [ perl ]; buildInputs = stdenv.lib.optional withCryptodev cryptodevHeaders; @@ -42,9 +43,6 @@ stdenv.mkDerivation rec { "-DUSE_CRYPTODEV_DIGESTS" ]; - makeFlags = [ - "MANDIR=$(out)/share/man" - ]; # Parallel building is broken in OpenSSL. enableParallelBuilding = false; @@ -56,6 +54,18 @@ stdenv.mkDerivation rec { rm "$out/lib/"*.a fi + mkdir -p $bin + mv $out/bin $bin/ + + rm -rf $out/etc/ssl/misc + + mkdir $dev + mv $out/include $dev/ + + # OpenSSL installs readonly files, which otherwise we can't strip. + # FIXME: Can remove this after the next stdenv merge. + chmod -R +w $out + # remove dependency on Perl at runtime rm -r $out/etc/ssl/misc $out/bin/c_rehash ''; diff --git a/pkgs/development/libraries/pango/default.nix b/pkgs/development/libraries/pango/default.nix index e7106b9877e..01c76489ba5 100644 --- a/pkgs/development/libraries/pango/default.nix +++ b/pkgs/development/libraries/pango/default.nix @@ -14,10 +14,10 @@ stdenv.mkDerivation rec { sha256 = "0v12gi7f01iq3z852pclpnmkbcksbvpcmiazmklkx1dd9fbpakhx"; }; - buildInputs = with stdenv.lib; [ gobjectIntrospection ] - ++ optional stdenv.isDarwin fontconfig; - nativeBuildInputs = [ pkgconfig ]; + outputs = [ "dev" "out" "bin" "doc" ]; + buildInputs = [ gobjectIntrospection ]; + nativeBuildInputs = [ pkgconfig ]; propagatedBuildInputs = [ xlibsWrapper glib cairo libpng fontconfig freetype harfbuzz ] ++ libintlOrEmpty; enableParallelBuilding = true; @@ -29,8 +29,6 @@ stdenv.mkDerivation rec { # .../bin/sh: line 5: 14823 Abort trap: 6 srcdir=. PANGO_RC_FILE=./pangorc ${dir}$tst # FAIL: testiter - postInstall = "rm -rf $out/share/gtk-doc"; - meta = with stdenv.lib; { description = "A library for laying out and rendering of text, with an emphasis on internationalization"; diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index 3370e910565..cc655579289 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { ./cve-2015-5073.patch ]; - outputs = [ "out" "doc" "man" ]; + outputs = [ "dev" "out" "bin" "doc" "man" ]; configureFlags = '' --enable-jit @@ -33,6 +33,12 @@ stdenv.mkDerivation rec { buildInputs = [ windows.mingw_w64_pthreads.crossDrv ]; }; + postInstall = + '' + mkdir $dev/bin + mv $bin/bin/pcre-config $dev/bin/ + ''; + meta = { homepage = "http://www.pcre.org/"; description = "A library for Perl Compatible Regular Expressions"; diff --git a/pkgs/development/libraries/scmccid/default.nix b/pkgs/development/libraries/scmccid/default.nix index 7dcde2a09a8..f9845d60b49 100644 --- a/pkgs/development/libraries/scmccid/default.nix +++ b/pkgs/development/libraries/scmccid/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { buildInputs = [ patchelf ]; installPhase = '' - RPATH=${libusb}/lib:${stdenv.cc.libc}/lib + RPATH=${libusb}/lib:${stdenv.cc.libc.out}/lib for a in proprietary/*/Contents/Linux/*.so*; do if ! test -L $a; then diff --git a/pkgs/development/libraries/socket_wrapper/default.nix b/pkgs/development/libraries/socket_wrapper/default.nix index 46faf9b67ea..df0cc1db34b 100644 --- a/pkgs/development/libraries/socket_wrapper/default.nix +++ b/pkgs/development/libraries/socket_wrapper/default.nix @@ -9,6 +9,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake pkgconfig ]; + buildInputs = [ (stdenv.cc.libc.out or null) ]; meta = with stdenv.lib; { description = "a library passing all socket communications through unix sockets"; diff --git a/pkgs/development/libraries/speex/default.nix b/pkgs/development/libraries/speex/default.nix index 9a1c00e63b9..8e3cf899e40 100644 --- a/pkgs/development/libraries/speex/default.nix +++ b/pkgs/development/libraries/speex/default.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { name = "speex-1.2rc2"; - + src = fetchurl { url = "http://downloads.us.xiph.org/releases/speex/${name}.tar.gz"; sha256 = "14g8ph39inkrif749lzjm089g7kwk0hymq1a3i9ch5gz8xr7r8na"; @@ -11,7 +11,9 @@ stdenv.mkDerivation rec { postPatch = '' sed -i '/AC_CONFIG_MACRO_DIR/i PKG_PROG_PKG_CONFIG' configure.ac ''; - + + outputs = [ "dev" "out" "doc" ]; + nativeBuildInputs = [ autoreconfHook pkgconfig ]; buildInputs = [ fftw speexdsp ]; diff --git a/pkgs/development/libraries/uid_wrapper/default.nix b/pkgs/development/libraries/uid_wrapper/default.nix index 0ec6342c39e..49bc088d8c5 100644 --- a/pkgs/development/libraries/uid_wrapper/default.nix +++ b/pkgs/development/libraries/uid_wrapper/default.nix @@ -9,6 +9,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake pkgconfig ]; + buildInputs = [ (stdenv.cc.libc.out or null) ]; meta = with stdenv.lib; { description = "a wrapper for the user, group and hosts NSS API"; diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index 93474d14344..2d3b10974f7 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -2,7 +2,7 @@ let version = "1.2.8"; in -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { name = "zlib-${version}"; src = fetchurl { @@ -20,15 +20,30 @@ stdenv.mkDerivation (rec { --replace 'ARFLAGS="-o"' 'ARFLAGS="-r"' ''; - configureFlags = if static then "" else "--shared"; + outputs = [ "dev" "out" "static" "man" ]; + setOutputFlags = false; + preConfigure = '' if test -n "$crossConfig"; then export CC=$crossConfig-gcc - configureFlags=${if static then "" else "--shared"} fi ''; + configureFlags = stdenv.lib.optional (!static) "--shared"; + + postInstall = '' + _moveToOutput lib/libz.a "$static" + '' + # jww (2015-01-06): Sometimes this library install as a .so, even on + # Darwin; others time it installs as a .dylib. I haven't yet figured out + # what causes this difference. + + stdenv.lib.optionalString stdenv.isDarwin '' + for file in $out/lib/*.so* $out/lib/*.dylib* ; do + install_name_tool -id "$file" $file + done + ''; + # As zlib takes part in the stdenv building, we don't want references # to the bootstrap-tools libgcc (as uses to happen on arm/mips) NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.isDarwin) "-static-libgcc"; @@ -57,13 +72,5 @@ stdenv.mkDerivation (rec { license = licenses.zlib; platforms = platforms.all; }; -} // (if stdenv.isDarwin then { - postInstall = '' - # jww (2015-01-06): Sometimes this library install as a .so, even on - # Darwin; others time it installs as a .dylib. I haven't yet figured out - # what causes this difference. - for file in $out/lib/*.so* $out/lib/*.dylib* ; do - install_name_tool -id "$file" $file - done - ''; -} else {})) +} + diff --git a/pkgs/development/mobile/androidenv/androidndk.nix b/pkgs/development/mobile/androidenv/androidndk.nix index cc1c2810524..03d7cae1a9d 100644 --- a/pkgs/development/mobile/androidenv/androidndk.nix +++ b/pkgs/development/mobile/androidenv/androidndk.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { find $out \( \ \( -type f -a -name "*.so*" \) -o \ \( -type f -a -perm -0100 \) \ - \) -exec patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-*so.? \ + \) -exec patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-*so.? \ --set-rpath ${zlib}/lib:${ncurses}/lib {} \; # fix ineffective PROGDIR / MYNDKDIR determination for i in ndk-build ndk-gdb ndk-gdb-py diff --git a/pkgs/development/mobile/androidenv/androidndk_r8e.nix b/pkgs/development/mobile/androidenv/androidndk_r8e.nix index 90994ae708e..d3f66c918ec 100644 --- a/pkgs/development/mobile/androidenv/androidndk_r8e.nix +++ b/pkgs/development/mobile/androidenv/androidndk_r8e.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { find $out \( \ \( -type f -a -name "*.so*" \) -o \ \( -type f -a -perm -0100 \) \ - \) -exec patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-*so.? \ + \) -exec patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-*so.? \ --set-rpath ${zlib}/lib:${ncurses}/lib {} \; # fix ineffective PROGDIR / MYNDKDIR determination for i in ndk-build ndk-gdb ndk-gdb-py diff --git a/pkgs/development/mobile/androidenv/androidsdk.nix b/pkgs/development/mobile/androidenv/androidsdk.nix index 52b146b87f4..afedfe54e94 100644 --- a/pkgs/development/mobile/androidenv/androidsdk.nix +++ b/pkgs/development/mobile/androidenv/androidsdk.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { for i in emulator emulator-arm emulator-mips emulator-x86 mksdcard do - patchelf --set-interpreter ${stdenv_32bit.cc.libc}/lib/ld-linux.so.2 $i + patchelf --set-interpreter ${stdenv_32bit.cc.libc.out}/lib/ld-linux.so.2 $i patchelf --set-rpath ${stdenv_32bit.cc.cc}/lib $i done @@ -48,7 +48,7 @@ stdenv.mkDerivation rec { for i in emulator64-arm emulator64-mips emulator64-x86 do - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $i + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 $i patchelf --set-rpath ${stdenv.cc.cc}/lib64 $i done ''} @@ -85,7 +85,7 @@ stdenv.mkDerivation rec { # The monitor requires some more patching cd lib/monitor-x86 - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 monitor + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux.so.2 monitor patchelf --set-rpath ${libX11}/lib:${libXext}/lib:${libXrender}/lib:${freetype}/lib:${fontconfig}/lib libcairo-swt.so wrapProgram `pwd`/monitor \ @@ -98,7 +98,7 @@ stdenv.mkDerivation rec { # The monitor requires some more patching cd lib/monitor-x86_64 - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 monitor + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 monitor patchelf --set-rpath ${libX11}/lib:${libXext}/lib:${libXrender}/lib:${freetype}/lib:${fontconfig}/lib libcairo-swt.so wrapProgram `pwd`/monitor \ diff --git a/pkgs/development/mobile/androidenv/build-tools.nix b/pkgs/development/mobile/androidenv/build-tools.nix index 3a7df3ce1af..1136466f14b 100644 --- a/pkgs/development/mobile/androidenv/build-tools.nix +++ b/pkgs/development/mobile/androidenv/build-tools.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { # Patch the interpreter for i in aapt aidl dexdump llvm-rs-cc do - patchelf --set-interpreter ${stdenv_32bit.cc.libc}/lib/ld-linux.so.2 $i + patchelf --set-interpreter ${stdenv_32bit.cc.libc.out}/lib/ld-linux.so.2 $i done # These binaries need to find libstdc++ and libgcc_s @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { # These binaries also need zlib in addition to libstdc++ for i in zipalign do - patchelf --set-interpreter ${stdenv_32bit.cc.libc}/lib/ld-linux.so.2 $i + patchelf --set-interpreter ${stdenv_32bit.cc.libc.out}/lib/ld-linux.so.2 $i patchelf --set-rpath ${stdenv_32bit.cc.cc}/lib:${zlib_32bit}/lib $i done diff --git a/pkgs/development/mobile/androidenv/platform-tools.nix b/pkgs/development/mobile/androidenv/platform-tools.nix index 1be54adaaed..820d31fd5df 100644 --- a/pkgs/development/mobile/androidenv/platform-tools.nix +++ b/pkgs/development/mobile/androidenv/platform-tools.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation { '' for i in adb fastboot do - patchelf --set-interpreter ${stdenv_32bit.cc.libc}/lib/ld-linux.so.2 $i + patchelf --set-interpreter ${stdenv_32bit.cc.libc.out}/lib/ld-linux.so.2 $i patchelf --set-rpath ${stdenv_32bit.cc.cc}/lib $i done ''} diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.1.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.1.nix index 60cab19ecbd..0437edad63f 100644 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.1.nix +++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.1.nix @@ -45,11 +45,11 @@ stdenv.mkDerivation { ${if stdenv.system == "i686-linux" then '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 titanium_prep.linux32 + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux.so.2 titanium_prep.linux32 '' else if stdenv.system == "x86_64-linux" then '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64 + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64 '' else ""} diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.2.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.2.nix index 47414e205a0..37ecf62706d 100644 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.2.nix +++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.2.nix @@ -44,11 +44,11 @@ stdenv.mkDerivation { ${if stdenv.system == "i686-linux" then '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 titanium_prep.linux32 + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux.so.2 titanium_prep.linux32 '' else if stdenv.system == "x86_64-linux" then '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64 + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64 '' else ""} diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.3.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.3.nix index 59a405f61fa..b5f1c6c5312 100644 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.3.nix +++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.3.nix @@ -44,11 +44,11 @@ stdenv.mkDerivation { ${if stdenv.system == "i686-linux" then '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 titanium_prep.linux32 + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux.so.2 titanium_prep.linux32 '' else if stdenv.system == "x86_64-linux" then '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64 + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64 '' else ""} diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.4.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.4.nix index 041ba0d4a6c..a927a74729a 100644 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.4.nix +++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.4.nix @@ -44,11 +44,11 @@ stdenv.mkDerivation { ${if stdenv.system == "i686-linux" then '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 titanium_prep.linux32 + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux.so.2 titanium_prep.linux32 '' else if stdenv.system == "x86_64-linux" then '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64 + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64 '' else ""} diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.5.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.5.nix index f9c5ce8812f..3fa119dda65 100644 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.5.nix +++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.5.nix @@ -44,11 +44,11 @@ stdenv.mkDerivation { ${if stdenv.system == "i686-linux" then '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 titanium_prep.linux32 + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux.so.2 titanium_prep.linux32 '' else if stdenv.system == "x86_64-linux" then '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64 + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64 '' else ""} diff --git a/pkgs/development/perl-modules/generic/builder.sh b/pkgs/development/perl-modules/generic/builder.sh index 7c51bf1b591..d657a6ccc98 100644 --- a/pkgs/development/perl-modules/generic/builder.sh +++ b/pkgs/development/perl-modules/generic/builder.sh @@ -28,6 +28,13 @@ preConfigure() { perl Makefile.PL PREFIX=$out INSTALLDIRS=site $makeMakerFlags } +preFixup() { + if [ -n "$man" ]; then + mkdir -p $man/share + if [ -d $out/man ]; then mv $out/man $man/share/; fi + fi +} + postFixup() { # If a user installs a Perl package, she probably also wants its # dependencies in the user environment (since Perl modules don't diff --git a/pkgs/development/perl-modules/generic/default.nix b/pkgs/development/perl-modules/generic/default.nix index 6cd4134cc9c..bf41f4d3945 100644 --- a/pkgs/development/perl-modules/generic/default.nix +++ b/pkgs/development/perl-modules/generic/default.nix @@ -1,13 +1,15 @@ perl: -{ buildInputs ? [], ... } @ attrs: +{ buildInputs ? [], name, ... } @ attrs: perl.stdenv.mkDerivation ( { + outputs = [ "out" "man" ]; + doCheck = true; - + checkTarget = "test"; - + # Prevent CPAN downloads. PERL_AUTOINSTALL = "--skipdeps"; @@ -23,7 +25,7 @@ perl.stdenv.mkDerivation ( attrs // { - name = "perl-" + attrs.name; + name = "perl-" + name; builder = ./builder.sh; buildInputs = buildInputs ++ [ perl ]; } diff --git a/pkgs/development/tools/build-managers/cargo/snapshot.nix b/pkgs/development/tools/build-managers/cargo/snapshot.nix index f24bcc2d9ab..58e284f2965 100644 --- a/pkgs/development/tools/build-managers/cargo/snapshot.nix +++ b/pkgs/development/tools/build-managers/cargo/snapshot.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation { ${postInstall} '' + (if stdenv.isLinux then '' - patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \ + patchelf --interpreter "${stdenv.glibc.out}/lib/${stdenv.cc.dynamicLinker}" \ --set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/:${zlib}/lib" \ "$out/bin/cargo" '' else ""); diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix index 5ddbefe0884..8ac21940904 100644 --- a/pkgs/development/tools/build-managers/cmake/default.nix +++ b/pkgs/development/tools/build-managers/cmake/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl +{ stdenv, fetchurl, pkgconfig , bzip2, curl, expat, libarchive, xz, zlib , useNcurses ? false, ncurses, useQt4 ? false, qt4 , wantPS ? false, ps ? null @@ -25,8 +25,6 @@ stdenv.mkDerivation rec { sha256 = "08pwy9ip9cgwgynhn5vrjw8drw29gijy1rmziq22n65zds6ifnp7"; }; - enableParallelBuilding = true; - patches = # Don't search in non-Nix locations such as /usr, but do search in # Nixpkgs' Glibc. @@ -38,18 +36,28 @@ stdenv.mkDerivation rec { sha256 = "16acmdr27adma7gs9rs0dxdiqppm15vl3vv3agy7y8s94wyh4ybv"; }) ++ stdenv.lib.optional stdenv.isCygwin ./3.2.2-cygwin.patch; + outputs = [ "out" "doc" ]; + setOutputFlags = false; + + setupHook = ./setup-hook.sh; + buildInputs = - [ bzip2 curl expat libarchive xz zlib ] + [ setupHook pkgconfig bzip2 curl expat libarchive xz zlib ] ++ optional useNcurses ncurses ++ optional useQt4 qt4; propagatedBuildInputs = optional wantPS ps; - CMAKE_PREFIX_PATH = stdenv.lib.concatStringsSep ":" buildInputs; - + preConfigure = with stdenv; optionalString (stdenv ? glibc) + '' + fixCmakeFiles . + substituteInPlace Modules/Platform/UnixPaths.cmake \ + --subst-var-by glibc_bin ${glibc.bin or glibc} \ + --subst-var-by glibc_dev ${glibc.dev or glibc} \ + --subst-var-by glibc_lib ${glibc.out or glibc} + ''; configureFlags = [ "--docdir=/share/doc/${name}" - "--mandir=/share/man" "--no-system-jsoncpp" ] ++ optional (!stdenv.isCygwin) "--system-libs" @@ -57,22 +65,18 @@ stdenv.mkDerivation rec { ++ ["--"] ++ optional (!useNcurses) "-DBUILD_CursesDialog=OFF"; - setupHook = ./setup-hook.sh; - dontUseCmakeConfigure = true; - preConfigure = optionalString (stdenv ? glibc) - '' - source $setupHook - fixCmakeFiles . - substituteInPlace Modules/Platform/UnixPaths.cmake \ - --subst-var-by glibc ${stdenv.glibc} - ''; + enableParallelBuilding = true; + + preInstall = ''mkdir "$doc" ''; + + postInstall = ''_moveToOutput "share/cmake-*/Help" "$doc" ''; - meta = { + meta = with stdenv.lib; { homepage = http://www.cmake.org/; description = "Cross-Platform Makefile Generator"; - platforms = if useQt4 then qt4.meta.platforms else stdenv.lib.platforms.all; - maintainers = with stdenv.lib.maintainers; [ urkud mornfall ttuegel ]; + platforms = if useQt4 then qt4.meta.platforms else platforms.all; + maintainers = with maintainers; [ urkud mornfall ttuegel ]; }; } diff --git a/pkgs/development/tools/build-managers/cmake/search-path-3.2.patch b/pkgs/development/tools/build-managers/cmake/search-path-3.2.patch index b0447e70607..0a2d4ad43ab 100644 --- a/pkgs/development/tools/build-managers/cmake/search-path-3.2.patch +++ b/pkgs/development/tools/build-managers/cmake/search-path-3.2.patch @@ -53,21 +53,21 @@ index 20ee1d1..39834e6 100644 - -list(APPEND CMAKE_SYSTEM_PROGRAM_PATH - /usr/pkg/bin -+ "@glibc@" ++ "@glibc_bin@" ) list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64 -+ "@glibc@/lib" ++ "@glibc_lib@/lib" ) list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES - /usr/include -+ "@glibc@/include" ++ "@glibc_dev@/include" ) list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES - /usr/include -+ "@glibc@/include" ++ "@glibc_dev@/include" ) # Enable use of lib64 search path variants by default. diff --git a/pkgs/development/tools/build-managers/gnumake/4.1/default.nix b/pkgs/development/tools/build-managers/gnumake/4.1/default.nix index 9ac20107018..de6f96ce99f 100644 --- a/pkgs/development/tools/build-managers/gnumake/4.1/default.nix +++ b/pkgs/development/tools/build-managers/gnumake/4.1/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation { ./no-tty-name.patch ]; + outputs = [ "out" "doc" ]; + meta = { homepage = http://www.gnu.org/software/make/; description = "A tool to control the generation of non-source files from sources"; diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 61824eb607b..ccdb52238de 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -34,6 +34,8 @@ stdenv.mkDerivation rec { ./pt-pax-flags-20121023.patch ]; + outputs = [ "dev" "out" "info" ]; + nativeBuildInputs = optional gold bison; buildInputs = [ zlib ]; @@ -67,6 +69,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + postFixup = "ln -s $out/bin $dev/bin"; # tools needed for development + meta = { description = "Tools for manipulating binaries (linker, assembler, etc.)"; diff --git a/pkgs/development/tools/misc/libtool/libtool2.nix b/pkgs/development/tools/misc/libtool/libtool2.nix index 5d27b469680..27ec2772e09 100644 --- a/pkgs/development/tools/misc/libtool/libtool2.nix +++ b/pkgs/development/tools/misc/libtool/libtool2.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "1qq61k6lp1fp75xs398yzi6wvbx232l7xbyn3p13cnh27mflvgg3"; }; + outputs = [ "out" "lib" ]; + propagatedNativeBuildInputs = [ m4 ]; nativeBuildInputs = [ perl help2man ]; @@ -43,4 +45,3 @@ stdenv.mkDerivation rec { maintainers = [ ]; }; } - diff --git a/pkgs/development/tools/misc/patchelf/default.nix b/pkgs/development/tools/misc/patchelf/default.nix index 5aa81e46bed..b3121ac7944 100644 --- a/pkgs/development/tools/misc/patchelf/default.nix +++ b/pkgs/development/tools/misc/patchelf/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { setupHook = [ ./setup-hook.sh ]; + #doCheck = true; # problems when loading libc.so.6 + meta = { homepage = http://nixos.org/patchelf.html; license = "GPL"; diff --git a/pkgs/development/tools/misc/pkgconfig/default.nix b/pkgs/development/tools/misc/pkgconfig/default.nix index 6eea0a6d5d6..0d5e2d275aa 100644 --- a/pkgs/development/tools/misc/pkgconfig/default.nix +++ b/pkgs/development/tools/misc/pkgconfig/default.nix @@ -1,24 +1,30 @@ -{stdenv, fetchurl, automake, libiconv, vanilla ? false}: +{stdenv, fetchurl, automake, libiconv, vanilla ? false }: -stdenv.mkDerivation (rec { +let + inherit (stdenv.lib) optional; +in +stdenv.mkDerivation rec { name = "pkg-config-0.29"; - + setupHook = ./setup-hook.sh; - + src = fetchurl { url = "http://pkgconfig.freedesktop.org/releases/${name}.tar.gz"; sha256 = "0sq09a39wj4cxf8l2jvkq067g08ywfma4v6nhprnf351s82pfl68"; }; + # Process Requires.private properly, see + # http://bugs.freedesktop.org/show_bug.cgi?id=4738. + patches = optional (!vanilla) ./requires-private.patch; - buildInputs = stdenv.lib.optional (stdenv.isCygwin || stdenv.isDarwin) libiconv; + preConfigure = stdenv.lib.optionalString (stdenv.system == "mips64el-linux") + ''cp -v ${automake}/share/automake*/config.{sub,guess} .''; + + buildInputs = optional (stdenv.isCygwin || stdenv.isDarwin) libiconv; configureFlags = [ "--with-internal-glib" ]; - patches = (if vanilla then [] else [ - # Process Requires.private properly, see - # http://bugs.freedesktop.org/show_bug.cgi?id=4738. - ./requires-private.patch - ]) ++ stdenv.lib.optional stdenv.isCygwin ./2.36.3-not-win32.patch; + postInstall = ''rm "$out"/bin/*-pkg-config''; # clean the duplicate file + patches = optional stdenv.isCygwin ./2.36.3-not-win32.patch; meta = { description = "A tool that allows packages to find out information about other packages"; @@ -26,9 +32,5 @@ stdenv.mkDerivation (rec { platforms = stdenv.lib.platforms.all; }; -} // (if stdenv.system == "mips64el-linux" then - { - preConfigure = '' - cp -v ${automake}/share/automake*/config.{sub,guess} . - ''; - } else {})) +} + diff --git a/pkgs/development/tools/misc/texinfo/5.2.nix b/pkgs/development/tools/misc/texinfo/5.2.nix index c43ebcd2de2..a9edccbd200 100644 --- a/pkgs/development/tools/misc/texinfo/5.2.nix +++ b/pkgs/development/tools/misc/texinfo/5.2.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ncurses, perl, xz, interactive ? false }: +{ stdenv, fetchurl, xz, ncurses, perl, interactive ? false }: stdenv.mkDerivation rec { name = "texinfo-5.2"; @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"; }; - buildInputs = [ perl xz ] + buildInputs = [ perl xz.bin ] ++ stdenv.lib.optional interactive ncurses; preInstall = '' diff --git a/pkgs/development/tools/node-webkit/nw11.nix b/pkgs/development/tools/node-webkit/nw11.nix index ed3b99aad00..b1e848acb4b 100644 --- a/pkgs/development/tools/node-webkit/nw11.nix +++ b/pkgs/development/tools/node-webkit/nw11.nix @@ -35,7 +35,7 @@ in stdenv.mkDerivation rec { patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nw patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nwsnapshot - ln -s ${udev}/lib/libudev.so $out/share/node-webkit/libudev.so.0 + ln -s ${udev.libudev}/lib/libudev.so $out/share/node-webkit/libudev.so.0 patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nw patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nwsnapshot diff --git a/pkgs/development/tools/node-webkit/nw9.nix b/pkgs/development/tools/node-webkit/nw9.nix index 213b94102b0..f33914ec7be 100644 --- a/pkgs/development/tools/node-webkit/nw9.nix +++ b/pkgs/development/tools/node-webkit/nw9.nix @@ -33,7 +33,7 @@ in stdenv.mkDerivation rec { patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nw patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nwsnapshot - ln -s ${udev}/lib/libudev.so $out/share/node-webkit/libudev.so.0 + ln -s ${udev.libudev}/lib/libudev.so $out/share/node-webkit/libudev.so.0 patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nw patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nwsnapshot diff --git a/pkgs/development/tools/selenium/chromedriver/default.nix b/pkgs/development/tools/selenium/chromedriver/default.nix index 8d9db34446d..8f2e44ce8a6 100644 --- a/pkgs/development/tools/selenium/chromedriver/default.nix +++ b/pkgs/development/tools/selenium/chromedriver/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin mv chromedriver $out/bin - patchelf --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 $out/bin/chromedriver + patchelf --set-interpreter ${glibc.out}/lib/ld-linux-x86-64.so.2 $out/bin/chromedriver wrapProgram "$out/bin/chromedriver" \ --prefix LD_LIBRARY_PATH : "$(cat ${stdenv.cc}/nix-support/orig-cc)/lib64:${cairo}/lib:${fontconfig}/lib:${freetype}/lib:${gdk_pixbuf}/lib:${glib}/lib:${gtk}/lib:${libX11}/lib:${nspr}/lib:${nss}/lib:${pango}/lib:${libXrender}/lib:${gconf}/lib:${libXext}/lib:${libXi}/lib:\$LD_LIBRARY_PATH" ''; diff --git a/pkgs/development/web/nodejs/default.nix b/pkgs/development/web/nodejs/default.nix index 440ed7aca92..8337a092acb 100644 --- a/pkgs/development/web/nodejs/default.nix +++ b/pkgs/development/web/nodejs/default.nix @@ -42,9 +42,10 @@ in stdenv.mkDerivation { patches = stdenv.lib.optional stdenv.isDarwin ./no-xcode.patch; - buildInputs = [ python which http-parser zlib libuv openssl python ] - ++ (optional stdenv.isLinux utillinux) - ++ optionals stdenv.isDarwin [ pkgconfig openssl libtool ]; + buildInputs = [ python http-parser zlib libuv openssl python ] + ++ (optional stdenv.isLinux utillinux); + nativeBuildInputs = [ pkgconfig ] + ++ optional stdenv.isDarwin libtool; setupHook = ./setup-hook.sh; enableParallelBuilding = true; |