diff options
Diffstat (limited to 'pkgs/development')
60 files changed, 489 insertions, 238 deletions
diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 4a4cfce5cc47..ae723a145313 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -239,8 +239,8 @@ stdenv.mkDerivation ({ (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS + EXTRA_FLAGS_FOR_TARGET + EXTRA_LDFLAGS_FOR_TARGET ; passthru = { diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index b35b69e87e1e..6a2c506b1bf3 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -264,8 +264,8 @@ stdenv.mkDerivation ({ (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS + EXTRA_FLAGS_FOR_TARGET + EXTRA_LDFLAGS_FOR_TARGET ; passthru = { diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index f7fbe1ec554b..0a35ed023c6f 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -276,8 +276,8 @@ stdenv.mkDerivation ({ (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS + EXTRA_FLAGS_FOR_TARGET + EXTRA_LDFLAGS_FOR_TARGET ; passthru = { diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 173ca128ee0b..f3b15eac55d2 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -292,8 +292,8 @@ stdenv.mkDerivation ({ (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS + EXTRA_FLAGS_FOR_TARGET + EXTRA_LDFLAGS_FOR_TARGET ; passthru = { diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 9153268a12b3..89933c22edd4 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -247,8 +247,8 @@ stdenv.mkDerivation ({ (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS + EXTRA_FLAGS_FOR_TARGET + EXTRA_LDFLAGS_FOR_TARGET ; passthru = { diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index e3091a062be8..5a6e20c0f412 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -234,8 +234,8 @@ stdenv.mkDerivation ({ (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS + EXTRA_FLAGS_FOR_TARGET + EXTRA_LDFLAGS_FOR_TARGET ; passthru = { diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index fadfdfa47a89..978ad75a3d26 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -242,8 +242,8 @@ stdenv.mkDerivation ({ (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic langD libcCross threadsCross; }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS + EXTRA_FLAGS_FOR_TARGET + EXTRA_LDFLAGS_FOR_TARGET ; passthru = { diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index b806f5a6e503..4b14cdb94cdd 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -25,12 +25,12 @@ echo "\$LIBRARY_PATH is \`${LIBRARY_PATH-}'" if test "$noSysDirs" = "1"; then declare \ - EXTRA_BUILD_FLAGS EXTRA_FLAGS EXTRA_TARGET_FLAGS \ - EXTRA_BUILD_LDFLAGS EXTRA_TARGET_LDFLAGS + EXTRA_FLAGS_FOR_BUILD EXTRA_FLAGS EXTRA_FLAGS_FOR_TARGET \ + EXTRA_LDFLAGS_FOR_BUILD EXTRA_LDFLAGS_FOR_TARGET # Extract flags from Bintools Wrappers - for pre in 'BUILD_' ''; do - curBintools="NIX_${pre}BINTOOLS" + for post in '_FOR_BUILD' ''; do + curBintools="NIX_BINTOOLS${post}" declare -a extraLDFlags=() if [[ -e "${!curBintools}/nix-support/orig-libc" ]]; then @@ -48,14 +48,14 @@ if test "$noSysDirs" = "1"; then extraLDFlags=("-L$libc_libdir" "-rpath" "$libc_libdir" "${extraLDFlags[@]}") for i in "${extraLDFlags[@]}"; do - declare EXTRA_${pre}LDFLAGS+=" -Wl,$i" + declare EXTRA_LDFLAGS${post}+=" -Wl,$i" done done # Extract flags from CC Wrappers - for pre in 'BUILD_' ''; do - curCC="NIX_${pre}CC" - curFIXINC="NIX_${pre}FIXINC_DUMMY" + for post in '_FOR_BUILD' ''; do + curCC="NIX_CC${post}" + curFIXINC="NIX_FIXINC_DUMMY${post}" declare -a extraFlags=() if [[ -e "${!curCC}/nix-support/orig-libc" ]]; then @@ -69,11 +69,11 @@ if test "$noSysDirs" = "1"; then # Use *real* header files, otherwise a limits.h is generated that # does not include Libc's limits.h (notably missing SSIZE_MAX, # which breaks the build). - declare NIX_${pre}FIXINC_DUMMY="$libc_devdir/include" + declare NIX_FIXINC_DUMMY${post}="$libc_devdir/include" else # Hack: support impure environments. extraFlags=("-isystem" "/usr/include") - declare NIX_${pre}FIXINC_DUMMY=/usr/include + declare NIX_FIXINC_DUMMY${post}=/usr/include fi extraFlags=("-I${!curFIXINC}" "${extraFlags[@]}") @@ -89,13 +89,13 @@ if test "$noSysDirs" = "1"; then extraFlags=("-O2" "${extraFlags[@]}") fi - declare EXTRA_${pre}FLAGS="${extraFlags[*]}" + declare EXTRA_FLAGS${post}="${extraFlags[*]}" done if test -z "${targetConfig-}"; then # host = target, so the flags are the same - EXTRA_TARGET_FLAGS="$EXTRA_FLAGS" - EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS" + EXTRA_FLAGS_FOR_TARGET="$EXTRA_FLAGS" + EXTRA_LDFLAGS_FOR_TARGET="$EXTRA_LDFLAGS" fi # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find @@ -103,31 +103,31 @@ if test "$noSysDirs" = "1"; then # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx # for the startfiles. makeFlagsArray+=( - "BUILD_SYSTEM_HEADER_DIR=$NIX_BUILD_FIXINC_DUMMY" - "SYSTEM_HEADER_DIR=$NIX_BUILD_FIXINC_DUMMY" + "BUILD_SYSTEM_HEADER_DIR=$NIX_FIXINC_DUMMY_FOR_BUILD" + "SYSTEM_HEADER_DIR=$NIX_FIXINC_DUMMY_FOR_BUILD" "NATIVE_SYSTEM_HEADER_DIR=$NIX_FIXINC_DUMMY" - "LDFLAGS_FOR_BUILD=$EXTRA_BUILD_LDFLAGS" + "LDFLAGS_FOR_BUILD=$EXTRA_LDFLAGS_FOR_BUILD" #"LDFLAGS=$EXTRA_LDFLAGS" - "LDFLAGS_FOR_TARGET=$EXTRA_TARGET_LDFLAGS" + "LDFLAGS_FOR_TARGET=$EXTRA_LDFLAGS_FOR_TARGET" - "CFLAGS_FOR_BUILD=$EXTRA_BUILD_FLAGS $EXTRA_BUILD_LDFLAGS" - "CXXFLAGS_FOR_BUILD=$EXTRA_BUILD_FLAGS $EXTRA_BUILD_LDFLAGS" - "FLAGS_FOR_BUILD=$EXTRA_BUILD_FLAGS $EXTRA_BUILD_LDFLAGS" + "CFLAGS_FOR_BUILD=$EXTRA_FLAGS_FOR_BUILD $EXTRA_LDFLAGS_FOR_BUILD" + "CXXFLAGS_FOR_BUILD=$EXTRA_FLAGS_FOR_BUILD $EXTRA_LDFLAGS_FOR_BUILD" + "FLAGS_FOR_BUILD=$EXTRA_FLAGS_FOR_BUILD $EXTRA_LDFLAGS_FOR_BUILD" # It seems there is a bug in GCC 5 #"CFLAGS=$EXTRA_FLAGS $EXTRA_LDFLAGS" #"CXXFLAGS=$EXTRA_FLAGS $EXTRA_LDFLAGS" - "CFLAGS_FOR_TARGET=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" - "CXXFLAGS_FOR_TARGET=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" - "FLAGS_FOR_TARGET=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" + "CFLAGS_FOR_TARGET=$EXTRA_FLAGS_FOR_TARGET $EXTRA_LDFLAGS_FOR_TARGET" + "CXXFLAGS_FOR_TARGET=$EXTRA_FLAGS_FOR_TARGET $EXTRA_LDFLAGS_FOR_TARGET" + "FLAGS_FOR_TARGET=$EXTRA_FLAGS_FOR_TARGET $EXTRA_LDFLAGS_FOR_TARGET" ) if test -z "${targetConfig-}"; then makeFlagsArray+=( "BOOT_CFLAGS=$EXTRA_FLAGS $EXTRA_LDFLAGS" - "BOOT_LDFLAGS=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" + "BOOT_LDFLAGS=$EXTRA_FLAGS_FOR_TARGET $EXTRA_LDFLAGS_FOR_TARGET" ) fi diff --git a/pkgs/development/compilers/gcc/common/extra-target-flags.nix b/pkgs/development/compilers/gcc/common/extra-target-flags.nix index f1696f182c04..bfac25b59654 100644 --- a/pkgs/development/compilers/gcc/common/extra-target-flags.nix +++ b/pkgs/development/compilers/gcc/common/extra-target-flags.nix @@ -5,7 +5,7 @@ let in { - EXTRA_TARGET_FLAGS = let + EXTRA_FLAGS_FOR_TARGET = let mkFlags = dep: langD: lib.optionals (targetPlatform != hostPlatform && dep != null && !langD) ([ "-idirafter ${lib.getDev dep}${dep.incdir or "/include"}" ] ++ stdenv.lib.optionals (! crossStageStatic) [ @@ -15,7 +15,7 @@ in ++ lib.optionals (!crossStageStatic) (mkFlags threadsCross langD) ; - EXTRA_TARGET_LDFLAGS = let + EXTRA_LDFLAGS_FOR_TARGET = let mkFlags = dep: lib.optionals (targetPlatform != hostPlatform && dep != null) ([ "-Wl,-L${lib.getLib dep}${dep.libdir or "/lib"}" ] ++ (if crossStageStatic then [ diff --git a/pkgs/development/compilers/gcc/libstdc++-hook.sh b/pkgs/development/compilers/gcc/libstdc++-hook.sh index 60c610a8e7a8..f5b4123b64d9 100644 --- a/pkgs/development/compilers/gcc/libstdc++-hook.sh +++ b/pkgs/development/compilers/gcc/libstdc++-hook.sh @@ -1,4 +1,4 @@ # See pkgs/build-support/setup-hooks/role.bash getHostRole -export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem $(echo -n @gcc@/include/c++/*) -isystem $(echo -n @gcc@/include/c++/*)/@targetConfig@" +export NIX_CXXSTDLIB_COMPILE${role_post}+=" -isystem $(echo -n @gcc@/include/c++/*) -isystem $(echo -n @gcc@/include/c++/*)/@targetConfig@" diff --git a/pkgs/development/compilers/go/1.14.nix b/pkgs/development/compilers/go/1.14.nix index 9ee5b6fa6242..9aaf85c598fc 100644 --- a/pkgs/development/compilers/go/1.14.nix +++ b/pkgs/development/compilers/go/1.14.nix @@ -30,11 +30,11 @@ in stdenv.mkDerivation rec { pname = "go"; - version = "1.14.2"; + version = "1.14.3"; src = fetchurl { url = "https://dl.google.com/go/go${version}.src.tar.gz"; - sha256 = "0z3zxsnhmsxplnwfw1l9gr6jgglwp50sr3p5njknv9i6jzk89plq"; + sha256 = "0mmgf74snprdiajgh99jjliwjl5im71qcgm5qrxpnyfisiw3f0lk"; }; # perl is used for testing go vet @@ -229,8 +229,6 @@ stdenv.mkDerivation rec { runHook postInstall ''; - setupHook = ./setup-hook.sh; - disallowedReferences = [ goBootstrap ]; meta = with stdenv.lib; { diff --git a/pkgs/development/compilers/go/1.4.nix b/pkgs/development/compilers/go/1.4.nix index fc3fb0ad0e5a..af125d60ed0a 100644 --- a/pkgs/development/compilers/go/1.4.nix +++ b/pkgs/development/compilers/go/1.4.nix @@ -151,8 +151,6 @@ stdenv.mkDerivation rec { ./all.bash ''; - setupHook = ./setup-hook.sh; - meta = with stdenv.lib; { branch = "1.4"; homepage = "http://golang.org/"; diff --git a/pkgs/development/compilers/go/setup-hook.sh b/pkgs/development/compilers/go/setup-hook.sh deleted file mode 100644 index 7dce15eeb102..000000000000 --- a/pkgs/development/compilers/go/setup-hook.sh +++ /dev/null @@ -1,5 +0,0 @@ -addToGoPath() { - addToSearchPath GOPATH $1/share/go -} - -addEnvHooks "$targetOffset" addToGoPath diff --git a/pkgs/development/compilers/graalvm/default.nix b/pkgs/development/compilers/graalvm/default.nix index 244ee4c010ea..337e0f735ebe 100644 --- a/pkgs/development/compilers/graalvm/default.nix +++ b/pkgs/development/compilers/graalvm/default.nix @@ -462,7 +462,7 @@ in rec { export CC="gcc" export CPP="gcc -E" export NIX_CXXSTDLIB_LINK="" - export NIX_TARGET_CXXSTDLIB_LINK="" + export NIX_CXXSTDLIB_LINK_FOR_TARGET="" export OPENSSL_PREFIX=$(realpath openssl) # this fixes error: impure path 'LibFFIHeaderDirectives' used in link export NIX_ENFORCE_PURITY=0 diff --git a/pkgs/development/compilers/llvm/10/compiler-rt.nix b/pkgs/development/compilers/llvm/10/compiler-rt.nix index 68f64ef42560..00c4f0677ebc 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/10/compiler-rt.nix @@ -57,7 +57,7 @@ stdenv.mkDerivation rec { # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by # a flag and turn the flag off during the stdenv build. - postPatch = '' + postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) '' substituteInPlace cmake/builtin-config-ix.cmake \ --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' '' + stdenv.lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/compilers/llvm/10/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/10/libc++/setup-hook.sh index 6611259165ae..3a274aecc23d 100644 --- a/pkgs/development/compilers/llvm/10/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/10/libc++/setup-hook.sh @@ -2,5 +2,5 @@ getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_CXXSTDLIB_COMPILE${role_post}+=" -isystem @out@/include/c++/v1" +export NIX_CXXSTDLIB_LINK${role_post}=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh index 6611259165ae..3a274aecc23d 100644 --- a/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh @@ -2,5 +2,5 @@ getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_CXXSTDLIB_COMPILE${role_post}+=" -isystem @out@/include/c++/v1" +export NIX_CXXSTDLIB_LINK${role_post}=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/6/compiler-rt.nix b/pkgs/development/compilers/llvm/6/compiler-rt.nix index 5ae8bb01f050..13abf6d95611 100644 --- a/pkgs/development/compilers/llvm/6/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/6/compiler-rt.nix @@ -55,7 +55,7 @@ stdenv.mkDerivation { # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by # a flag and turn the flag off during the stdenv build. - postPatch = '' + postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) '' substituteInPlace cmake/builtin-config-ix.cmake \ --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' '' + stdenv.lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh index 6611259165ae..3a274aecc23d 100644 --- a/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh @@ -2,5 +2,5 @@ getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_CXXSTDLIB_COMPILE${role_post}+=" -isystem @out@/include/c++/v1" +export NIX_CXXSTDLIB_LINK${role_post}=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/7/compiler-rt.nix b/pkgs/development/compilers/llvm/7/compiler-rt.nix index e9853c58ca57..84ca6af3b36d 100644 --- a/pkgs/development/compilers/llvm/7/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/7/compiler-rt.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation { # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by # a flag and turn the flag off during the stdenv build. - postPatch = '' + postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) '' substituteInPlace cmake/builtin-config-ix.cmake \ --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' '' + stdenv.lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/compilers/llvm/7/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/7/libc++/setup-hook.sh index 6611259165ae..3a274aecc23d 100644 --- a/pkgs/development/compilers/llvm/7/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/7/libc++/setup-hook.sh @@ -2,5 +2,5 @@ getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_CXXSTDLIB_COMPILE${role_post}+=" -isystem @out@/include/c++/v1" +export NIX_CXXSTDLIB_LINK${role_post}=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/8/compiler-rt.nix b/pkgs/development/compilers/llvm/8/compiler-rt.nix index 1f58cb98e3d3..15e55800dc8e 100644 --- a/pkgs/development/compilers/llvm/8/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/8/compiler-rt.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation { # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by # a flag and turn the flag off during the stdenv build. - postPatch = '' + postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) '' substituteInPlace cmake/builtin-config-ix.cmake \ --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' '' + stdenv.lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/compilers/llvm/8/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/8/libc++/setup-hook.sh index 6611259165ae..3a274aecc23d 100644 --- a/pkgs/development/compilers/llvm/8/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/8/libc++/setup-hook.sh @@ -2,5 +2,5 @@ getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_CXXSTDLIB_COMPILE${role_post}+=" -isystem @out@/include/c++/v1" +export NIX_CXXSTDLIB_LINK${role_post}=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/9/compiler-rt.nix b/pkgs/development/compilers/llvm/9/compiler-rt.nix index 3b92264ad692..0183754a2fd4 100644 --- a/pkgs/development/compilers/llvm/9/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/9/compiler-rt.nix @@ -55,7 +55,7 @@ stdenv.mkDerivation rec { # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by # a flag and turn the flag off during the stdenv build. - postPatch = '' + postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) '' substituteInPlace cmake/builtin-config-ix.cmake \ --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' '' + stdenv.lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/compilers/llvm/9/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/9/libc++/setup-hook.sh index 6611259165ae..3a274aecc23d 100644 --- a/pkgs/development/compilers/llvm/9/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/9/libc++/setup-hook.sh @@ -2,5 +2,5 @@ getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_CXXSTDLIB_COMPILE${role_post}+=" -isystem @out@/include/c++/v1" +export NIX_CXXSTDLIB_LINK${role_post}=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/idris-modules/idris-wrapper.nix b/pkgs/development/idris-modules/idris-wrapper.nix index 4e1d2f9c82eb..68a1a0f267ad 100644 --- a/pkgs/development/idris-modules/idris-wrapper.nix +++ b/pkgs/development/idris-modules/idris-wrapper.nix @@ -7,7 +7,7 @@ symlinkJoin { postBuild = '' wrapProgram $out/bin/idris \ --run 'export IDRIS_CC=''${IDRIS_CC:-${stdenv.cc}/bin/cc}' \ - --set NIX_CC_WRAPPER_${stdenv.cc.infixSalt}_TARGET_HOST 1 \ + --set 'NIX_CC_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}' 1 \ --prefix NIX_CFLAGS_COMPILE " " "-I${lib.getDev gmp}/include" \ --prefix NIX_CFLAGS_LINK " " "-L${lib.getLib gmp}/lib" ''; diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 2def54de12d1..a3ba72a27b27 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -107,10 +107,10 @@ in { sourceVersion = { major = "3"; minor = "8"; - patch = "2"; + patch = "3"; suffix = ""; }; - sha256 = "1ps5v323cp5czfshqjmbsqw7nvrdpcbk06f62jbzaqik4gfffii6"; + sha256 = "0r2qg4pdvv52ld5dd95fl6lzzsxxxhbsxmymwcphh6624g3mxayz"; inherit (darwin) configd; inherit passthruFun; }; diff --git a/pkgs/development/interpreters/python/sitecustomize.py b/pkgs/development/interpreters/python/sitecustomize.py index 72ce951328f1..d79a4696d8ea 100644 --- a/pkgs/development/interpreters/python/sitecustomize.py +++ b/pkgs/development/interpreters/python/sitecustomize.py @@ -21,9 +21,11 @@ paths = os.environ.pop('NIX_PYTHONPATH', None) if paths: functools.reduce(lambda k, p: site.addsitedir(p, k), paths.split(':'), site._init_pathinfo()) -# Check whether we are in a venv. -# Note Python 2 does not support base_prefix so we assume we are not in a venv. -in_venv = sys.version_info.major == 3 and sys.prefix != sys.base_prefix +# Check whether we are in a venv or virtualenv. +# For Python 3 we check whether our `base_prefix` is different from our current `prefix`. +# For Python 2 we check whether the non-standard `real_prefix` is set. +# https://stackoverflow.com/questions/1871549/determine-if-python-is-running-inside-virtualenv +in_venv = (sys.version_info.major == 3 and sys.prefix != sys.base_prefix) or (sys.version_info.major == 2 and hasattr(sys, "real_prefix")) if not in_venv: executable = os.environ.pop('NIX_PYTHONEXECUTABLE', None) @@ -32,8 +34,6 @@ if not in_venv: if 'PYTHONEXECUTABLE' not in os.environ and executable is not None: sys.executable = executable if prefix is not None: - # Because we cannot check with Python 2 whether we are in a venv, - # creating a venv from a Nix env won't work as well with Python 2. - # Also, note that sysconfig does not like it when sys.prefix is set to None + # Sysconfig does not like it when sys.prefix is set to None sys.prefix = sys.exec_prefix = prefix site.PREFIXES.insert(0, prefix) diff --git a/pkgs/development/interpreters/python/tests.nix b/pkgs/development/interpreters/python/tests.nix index 6c4a6ae8e21c..03a3b9537090 100644 --- a/pkgs/development/interpreters/python/tests.nix +++ b/pkgs/development/interpreters/python/tests.nix @@ -19,10 +19,8 @@ let is_nixenv = "False"; is_virtualenv = "False"; }; - } // lib.optionalAttrs (python.isPy3k && !python.isPyPy) { + } // lib.optionalAttrs (!python.isPyPy) { # Use virtualenv from a Nix env. - # Does not function with Python 2 - # ValueError: source and destination is the same /nix/store/38kz3j1a87cq5y59k5w7k9yk4cqgc5b2-python-2.7.18/lib/python2.7/os.py nixenv-virtualenv = rec { env = runCommand "${python.name}-virtualenv" {} '' ${pythonVirtualEnv.interpreter} -m virtualenv $out @@ -39,7 +37,7 @@ let interpreter = env.interpreter; is_venv = "False"; is_nixenv = "True"; - is_virtualenv = "True"; + is_virtualenv = "False"; }; } // lib.optionalAttrs (python.isPy3k && (!python.isPyPy)) rec { # Venv built using plain Python @@ -52,7 +50,7 @@ let interpreter = "${env}/bin/${python.executable}"; is_venv = "True"; is_nixenv = "False"; - is_virtualenv = "True"; + is_virtualenv = "False"; }; } // lib.optionalAttrs (python.pythonAtLeast "3.8") { @@ -66,7 +64,7 @@ let interpreter = "${env}/bin/${pythonEnv.executable}"; is_venv = "True"; is_nixenv = "True"; - is_virtualenv = "True"; + is_virtualenv = "False"; }; }; diff --git a/pkgs/development/interpreters/python/tests/test_python.py b/pkgs/development/interpreters/python/tests/test_python.py index 41a7e687d263..0fc4b8a9e91c 100644 --- a/pkgs/development/interpreters/python/tests/test_python.py +++ b/pkgs/development/interpreters/python/tests/test_python.py @@ -43,6 +43,10 @@ class TestCasePython(unittest.TestCase): else: self.assertEqual(sys.prefix, sys.base_prefix) + @unittest.skipIf(sys.version_info.major==3, "sys.real_prefix is only set by virtualenv in case of Python 2.") + def test_real_prefix(self): + self.assertTrue(hasattr(sys, "real_prefix") == IS_VIRTUALENV) + def test_python_version(self): self.assertTrue(platform.python_version().startswith(PYTHON_VERSION)) diff --git a/pkgs/development/libraries/audio/lilv/default.nix b/pkgs/development/libraries/audio/lilv/default.nix index 831cd8c2054f..124828b0ff5f 100644 --- a/pkgs/development/libraries/audio/lilv/default.nix +++ b/pkgs/development/libraries/audio/lilv/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "lilv"; - version = "0.24.6"; + version = "0.24.8"; src = fetchurl { url = "https://download.drobilla.net/${pname}-${version}.tar.bz2"; - sha256 = "1p3hafsxgs5d4za7n66lf5nz74qssfqpmk520cm7iq2njvvlqm2z"; + sha256 = "0063i5zgf3d3accwmyx651hw0wh5ik7kji2hvfkcdbl1qia3dp6a"; }; patches = [ ./lilv-pkgconfig.patch ]; diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index f56447668ea6..5b98884c1fc5 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -163,7 +163,6 @@ stdenv.mkDerivation rec { ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-prefix=${stdenv.cc.targetPrefix}" "--enable-cross-compile" - "--pkg-config=pkg-config" # Override ffmpeg's ./configure assumption that pkg-config is prefixed by the architecture. (e.g. aarch64-unknown-linux-gnu-pkg-config) ] ++ optional stdenv.cc.isClang "--cc=clang"); depsBuildBuild = [ buildPackages.stdenv.cc ]; @@ -174,7 +173,7 @@ stdenv.mkDerivation rec { libvorbis lzma soxr x264 x265 xvidcore zlib libopus speex nv-codec-headers ] ++ optionals openglSupport [ libGL libGLU ] ++ optional libmfxSupport intel-media-sdk - ++ optional vpxSupport libaom + ++ optional libaomSupport libaom ++ optional vpxSupport libvpx ++ optionals (!isDarwin && !isAarch32) [ libpulseaudio ] # Need to be fixed on Darwin and ARM ++ optional ((isLinux || isFreeBSD) && !isAarch32) libva @@ -199,9 +198,10 @@ stdenv.mkDerivation rec { --replace "includedir=$out" "includedir=''${!outputInclude}" done '' + optionalString stdenv.isLinux '' - # Set RUNPATH so that libnvcuvid in /run/opengl-driver(-32)/lib can be found. + # Set RUNPATH so that libnvcuvid and libcuda in /run/opengl-driver(-32)/lib can be found. # See the explanation in addOpenGLRunpath. - addOpenGLRunpath $out/lib/libavcodec.so* + addOpenGLRunpath $out/lib/libavcodec.so + addOpenGLRunpath $out/lib/libavutil.so ''; installFlags = [ "install-man" ]; diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix index 82fbbc967efc..08b8f70b2d9a 100644 --- a/pkgs/development/libraries/gdk-pixbuf/default.nix +++ b/pkgs/development/libraries/gdk-pixbuf/default.nix @@ -1,23 +1,43 @@ -{ stdenv, fetchurl, nixosTests, fixDarwinDylibNames, meson, ninja, pkgconfig, gettext, python3, libxml2, libxslt, docbook_xsl -, docbook_xml_dtd_43, gtk-doc, glib, libtiff, libjpeg, libpng, libX11, gnome3 -, gobject-introspection, doCheck ? false, makeWrapper +{ stdenv +, fetchurl +, nixosTests +, fixDarwinDylibNames +, meson +, ninja +, pkg-config +, gettext +, python3 +, libxml2 +, libxslt +, docbook-xsl-nons +, docbook_xml_dtd_43 +, gtk-doc +, glib +, libtiff +, libjpeg +, libpng +, gnome3 +, gobject-introspection +, doCheck ? false +, makeWrapper , fetchpatch }: -let +stdenv.mkDerivation rec { pname = "gdk-pixbuf"; version = "2.40.0"; -in stdenv.mkDerivation rec { - name = "${pname}-${version}"; + + outputs = [ "out" "dev" "man" "devdoc" "installedTests" ]; src = fetchurl { - url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz"; + url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "1rnlx9yfw970maxi2x6niaxmih5la11q1ilr7gzshz2kk585k0hm"; }; patches = [ # Move installed tests to a separate output ./installed-tests-path.patch + # Temporary until the fix is released. (fetchpatch { name = "tests-circular-table.patch"; @@ -26,24 +46,34 @@ in stdenv.mkDerivation rec { }) ]; - outputs = [ "out" "dev" "man" "devdoc" "installedTests" ]; - - setupHook = ./setup-hook.sh; - - # !!! We might want to factor out the gdk-pixbuf-xlib subpackage. - buildInputs = [ libX11 ]; - nativeBuildInputs = [ - meson ninja pkgconfig gettext python3 libxml2 libxslt docbook_xsl docbook_xml_dtd_43 - gtk-doc gobject-introspection makeWrapper glib - ] - ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; + meson + ninja + pkg-config + gettext + python3 + libxml2 + libxslt + docbook-xsl-nons + docbook_xml_dtd_43 + gtk-doc + gobject-introspection + makeWrapper + glib + ] ++ stdenv.lib.optional stdenv.isDarwin [ + fixDarwinDylibNames + ]; - propagatedBuildInputs = [ glib libtiff libjpeg libpng ]; + propagatedBuildInputs = [ + glib + libtiff + libjpeg + libpng + ]; mesonFlags = [ "-Ddocs=true" - "-Dx11=true" + "-Dx11=false" # use gdk-pixbuf-xlib "-Dgir=${if gobject-introspection != null then "true" else "false"}" "-Dgio_sniffing=false" ]; @@ -87,6 +117,8 @@ in stdenv.mkDerivation rec { # The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB). inherit doCheck; + setupHook = ./setup-hook.sh; + passthru = { updateScript = gnome3.updateScript { packageName = pname; @@ -102,8 +134,8 @@ in stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "A library for image loading and manipulation"; - homepage = "http://library.gnome.org/devel/gdk-pixbuf/"; - maintainers = [ maintainers.eelco ]; + homepage = "https://gitlab.gnome.org/GNOME/gdk-pixbuf"; + maintainers = [ maintainers.eelco ] ++ teams.gnome.members; license = licenses.lgpl21; platforms = platforms.unix; }; diff --git a/pkgs/development/libraries/gdk-pixbuf/xlib.nix b/pkgs/development/libraries/gdk-pixbuf/xlib.nix new file mode 100644 index 000000000000..e5f1718f0751 --- /dev/null +++ b/pkgs/development/libraries/gdk-pixbuf/xlib.nix @@ -0,0 +1,55 @@ +{ stdenv +, fetchFromGitLab +, meson +, ninja +, pkg-config +, docbook-xsl-nons +, docbook_xml_dtd_43 +, gtk-doc +, gdk-pixbuf +, libX11 +}: + +stdenv.mkDerivation rec { + pname = "gdk-pixbuf-xlib"; + version = "2019-10-19-unstable"; + + outputs = [ "out" "dev" "devdoc" ]; + + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "Archive"; + repo = "gdk-pixbuf-xlib"; + rev = "dc22ea36f69755007c66877284596df270532cc1"; + sha256 = "XhBQ4wano+MtGaqF6JNKoWgYQN6eBW+b8ZCGEBGt8IM="; + }; + + nativeBuildInputs = [ + meson + ninja + pkg-config + docbook-xsl-nons + docbook_xml_dtd_43 + gtk-doc + ]; + + buildInputs = [ + libX11 + ]; + + propagatedBuildInputs = [ + gdk-pixbuf + ]; + + mesonFlags = [ + "-Dgtk_doc=true" + ]; + + meta = with stdenv.lib; { + description = "Deprecated API for integrating GdkPixbuf with Xlib data types"; + homepage = "https://gitlab.gnome.org/Archive/gdk-pixbuf-xlib"; + maintainers = teams.gnome.members; + license = licenses.lgpl21Plus; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/libraries/gettext/gettext-setup-hook.sh b/pkgs/development/libraries/gettext/gettext-setup-hook.sh index 69020146f84d..5cc9655a89bc 100644 --- a/pkgs/development/libraries/gettext/gettext-setup-hook.sh +++ b/pkgs/development/libraries/gettext/gettext-setup-hook.sh @@ -13,5 +13,5 @@ addEnvHooks "$hostOffset" gettextDataDirsHook if [ -n "@gettextNeedsLdflags@" -a -z "${dontAddExtraLibs-}" ]; then # See pkgs/build-support/setup-hooks/role.bash getHostRole - export NIX_${role_pre}LDFLAGS+=" -lintl" + export NIX_LDFLAGS${role_post}+=" -lintl" fi diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index d74bd0c4067a..47e372cf9a36 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -48,11 +48,11 @@ in stdenv.mkDerivation rec { pname = "glib"; - version = "2.64.1"; + version = "2.64.3"; src = fetchurl { url = "mirror://gnome/sources/glib/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "1ixvjmsrj45xq9bq3chhj98jhgcsqa08v627mjx6sjxlph1pd5hp"; + sha256 = "08pbgiv5m3rica4ydvwvpq5mrxbyswx7l1jzjc2ch52xjabvr77y"; }; patches = optionals stdenv.isDarwin [ diff --git a/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch b/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch index 6e56d3fab411..775c29855301 100644 --- a/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch +++ b/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch @@ -140,3 +140,46 @@ def extract_libtool(la_file): +--- a/tests/scanner/test_shlibs.py ++++ b/tests/scanner/test_shlibs.py +@@ -7,6 +7,30 @@ from giscanner.shlibs import resolve_from_ldd_output, sanitize_shlib_path + + class TestLddParser(unittest.TestCase): + ++ def test_resolve_from_ldd_output_nix(self): ++ output = '''\ ++ libglib-2.0.so.0 => @nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libglib-2.0.so.0 (0x00007f0ee1b28000) ++ libgobject-2.0.so.0 => @nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgobject-2.0.so.0 (0x00007f0ee18cf000) ++ libgio-2.0.so.0 => @nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgio-2.0.so.0 (0x00007f0ee1502000) ++ libxml2.so.2 => @nixStoreDir@/72mxkk74cv266snkjpz1kwl1i2rg8rpc-libxml2-2.9.8/lib/libxml2.so.2 (0x00007f0ee119c000) ++ libsqlite3.so.0 => @nixStoreDir@/ck5ay23hsmlc67pg3m34kzd1k2hhvww0-sqlite-3.24.0/lib/libsqlite3.so.0 (0x00007f0ee0e98000) ++ libpsl.so.5 => @nixStoreDir@/qn3l2gn7m76f318676wflrs2z6d4rrkj-libpsl-0.20.2-list-2017-02-03/lib/libpsl.so.5 (0x00007f0ee0c88000) ++ libc.so.6 => @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib/libc.so.6 (0x00007f0ee08d4000) ++ libpcre.so.1 => @nixStoreDir@/hxbq8lpc53qsf1bc0dfcsm47wmcxzjvh-pcre-8.42/lib/libpcre.so.1 (0x00007f0ee0662000) ++ @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f0ee20ff000) ++ libblkid.so.1 => @nixStoreDir@/q0kgnq21j0l2yd77gdlld371246cwghh-util-linux-2.32.1/lib/libblkid.so.1 (0x00007f0edd0cd000) ++ libuuid.so.1 => @nixStoreDir@/q0kgnq21j0l2yd77gdlld371246cwghh-util-linux-2.32.1/lib/libuuid.so.1 (0x00007f0edcec5000) ++ librt.so.1 => @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib/librt.so.1 (0x00007f0edccbd000) ++ libstdc++.so.6 => @nixStoreDir@/3v5r7fkrbkw2qajadvjbf6p6qriz9p1i-gcc-7.3.0-lib/lib/libstdc++.so.6 (0x00007f0edc936000) ++ libgcc_s.so.1 => @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib/libgcc_s.so.1 (0x00007f0edc720000) ++ ''' ++ libraries = ['glib-2.0', 'gio-2.0'] ++ ++ self.assertEqual( ++ ['@nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libglib-2.0.so.0', ++ '@nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgio-2.0.so.0'], ++ resolve_from_ldd_output(libraries, output)) ++ + def test_resolve_from_ldd_output(self): + output = '''\ + libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fbe12d68000) +@@ -40,7 +64,8 @@ class TestLddParser(unittest.TestCase): + + self.assertEqual( + sanitize_shlib_path('/foo/bar'), +- '/foo/bar' if sys.platform == 'darwin' else 'bar') ++ # NixOS always want the absolute path ++ '/foo/bar') + + def test_unresolved_library(self): + output = '' diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix index 0d514c3fd7d8..03b0d1767d9f 100644 --- a/pkgs/development/libraries/gobject-introspection/default.nix +++ b/pkgs/development/libraries/gobject-introspection/default.nix @@ -1,61 +1,97 @@ -{ stdenv, fetchurl, glib, flex, bison, meson, ninja, pkgconfig, libffi, python3 -, libintl, cctools, cairo, gnome3, glibcLocales -, substituteAll, nixStoreDir ? builtins.storeDir +{ stdenv +, fetchurl +, glib +, flex +, bison +, meson +, ninja +, gtk-doc +, docbook-xsl-nons +, docbook_xml_dtd_43 +, docbook_xml_dtd_45 +, pkg-config +, libffi +, python3 +, cctools +, cairo +, gnome3 +, substituteAll +, nixStoreDir ? builtins.storeDir , x11Support ? true }: + # now that gobject-introspection creates large .gir files (eg gtk3 case) # it may be worth thinking about using multiple derivation outputs # In that case its about 6MB which could be separated -with stdenv.lib; stdenv.mkDerivation rec { pname = "gobject-introspection"; version = "1.64.1"; + # outputs TODO: share/gobject-introspection-1.0/tests is needed during build + # by pygobject3 (and maybe others), but it's only searched in $out + outputs = [ "out" "dev" "devdoc" "man" ]; + outputBin = "dev"; + src = fetchurl { url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "19vz7vp10h0zj3f491yk72dp89bix6rgkzxg4qcm4d6151ksxgl0"; }; - outputs = [ "out" "dev" "man" ]; - outputBin = "dev"; + patches = [ + # Make g-ir-scanner put absolute path to GIR files it generates + # so that programs can just dlopen them without having to muck + # with LD_LIBRARY_PATH environment variable. + (substituteAll { + src = ./absolute_shlib_path.patch; + inherit nixStoreDir; + }) + ] ++ stdenv.lib.optionals x11Support [ + # Hardcode the cairo shared library path in the Cairo gir shipped with this package. + # https://github.com/NixOS/nixpkgs/issues/34080 + (substituteAll { + src = ./absolute_gir_path.patch; + cairoLib = "${stdenv.lib.getLib cairo}/lib"; + }) + ]; - LC_ALL = "en_US.UTF-8"; # for tests + nativeBuildInputs = [ + meson + ninja + pkg-config + flex + bison + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_43 # FIXME: remove in next release + docbook_xml_dtd_45 + python3 + setupHook # move .gir files + ]; - nativeBuildInputs = [ meson ninja pkgconfig libintl glibcLocales ]; - buildInputs = [ flex bison python3 setupHook/*move .gir*/ ] - ++ stdenv.lib.optional stdenv.isDarwin cctools; - propagatedBuildInputs = [ libffi glib ]; + buildInputs = [ + python3 + ]; + + checkInputs = stdenv.lib.optionals stdenv.isDarwin [ + cctools # for otool + ]; + + propagatedBuildInputs = [ + libffi + glib + ]; mesonFlags = [ "--datadir=${placeholder "dev"}/share" "-Ddoctool=disabled" "-Dcairo=disabled" + "-Dgtk_doc=true" ]; - # outputs TODO: share/gobject-introspection-1.0/tests is needed during build - # by pygobject3 (and maybe others), but it's only searched in $out - - setupHook = ./setup-hook.sh; - - patches = [ - (substituteAll { - src = ./test_shlibs.patch; - inherit nixStoreDir; - }) - (substituteAll { - src = ./absolute_shlib_path.patch; - inherit nixStoreDir; - }) - ] ++ stdenv.lib.optional x11Support # https://github.com/NixOS/nixpkgs/issues/34080 - (substituteAll { - src = ./absolute_gir_path.patch; - cairoLib = "${getLib cairo}/lib"; - }); - doCheck = !stdenv.isAarch64; - preBuild = '' + preCheck = '' # Our gobject-introspection patches make the shared library paths absolute # in the GIR files. When running tests, the library is not yet installed, # though, so we need to replace the absolute path with a local one during build. @@ -64,10 +100,12 @@ stdenv.mkDerivation rec { ln -s $PWD/tests/scanner/libregress-1.0${stdenv.targetPlatform.extensions.sharedLibrary} $out/lib/libregress-1.0${stdenv.targetPlatform.extensions.sharedLibrary} ''; - preInstall = '' + postCheck = '' rm $out/lib/libregress-1.0${stdenv.targetPlatform.extensions.sharedLibrary} ''; + setupHook = ./setup-hook.sh; + passthru = { updateScript = gnome3.updateScript { packageName = pname; @@ -76,9 +114,9 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "A middleware layer between C libraries and language bindings"; - homepage = "http://live.gnome.org/GObjectIntrospection"; - maintainers = with maintainers; [ lovek323 lethalman ]; - platforms = platforms.unix; + homepage = "https://gi.readthedocs.io/"; + maintainers = teams.gnome.members ++ (with maintainers; [ lovek323 ]); + platforms = platforms.unix; license = with licenses; [ gpl2 lgpl2 ]; longDescription = '' diff --git a/pkgs/development/libraries/gobject-introspection/test_shlibs.patch b/pkgs/development/libraries/gobject-introspection/test_shlibs.patch deleted file mode 100644 index 65b5a1a13b91..000000000000 --- a/pkgs/development/libraries/gobject-introspection/test_shlibs.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- a/tests/scanner/test_shlibs.py -+++ b/tests/scanner/test_shlibs.py -@@ -7,6 +7,30 @@ from giscanner.shlibs import resolve_from_ldd_output, sanitize_shlib_path - - class TestLddParser(unittest.TestCase): - -+ def test_resolve_from_ldd_output_nix(self): -+ output = '''\ -+ libglib-2.0.so.0 => @nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libglib-2.0.so.0 (0x00007f0ee1b28000) -+ libgobject-2.0.so.0 => @nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgobject-2.0.so.0 (0x00007f0ee18cf000) -+ libgio-2.0.so.0 => @nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgio-2.0.so.0 (0x00007f0ee1502000) -+ libxml2.so.2 => @nixStoreDir@/72mxkk74cv266snkjpz1kwl1i2rg8rpc-libxml2-2.9.8/lib/libxml2.so.2 (0x00007f0ee119c000) -+ libsqlite3.so.0 => @nixStoreDir@/ck5ay23hsmlc67pg3m34kzd1k2hhvww0-sqlite-3.24.0/lib/libsqlite3.so.0 (0x00007f0ee0e98000) -+ libpsl.so.5 => @nixStoreDir@/qn3l2gn7m76f318676wflrs2z6d4rrkj-libpsl-0.20.2-list-2017-02-03/lib/libpsl.so.5 (0x00007f0ee0c88000) -+ libc.so.6 => @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib/libc.so.6 (0x00007f0ee08d4000) -+ libpcre.so.1 => @nixStoreDir@/hxbq8lpc53qsf1bc0dfcsm47wmcxzjvh-pcre-8.42/lib/libpcre.so.1 (0x00007f0ee0662000) -+ @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f0ee20ff000) -+ libblkid.so.1 => @nixStoreDir@/q0kgnq21j0l2yd77gdlld371246cwghh-util-linux-2.32.1/lib/libblkid.so.1 (0x00007f0edd0cd000) -+ libuuid.so.1 => @nixStoreDir@/q0kgnq21j0l2yd77gdlld371246cwghh-util-linux-2.32.1/lib/libuuid.so.1 (0x00007f0edcec5000) -+ librt.so.1 => @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib/librt.so.1 (0x00007f0edccbd000) -+ libstdc++.so.6 => @nixStoreDir@/3v5r7fkrbkw2qajadvjbf6p6qriz9p1i-gcc-7.3.0-lib/lib/libstdc++.so.6 (0x00007f0edc936000) -+ libgcc_s.so.1 => @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib/libgcc_s.so.1 (0x00007f0edc720000) -+ ''' -+ libraries = ['glib-2.0', 'gio-2.0'] -+ -+ self.assertEqual( -+ ['@nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libglib-2.0.so.0', -+ '@nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgio-2.0.so.0'], -+ resolve_from_ldd_output(libraries, output)) -+ - def test_resolve_from_ldd_output(self): - output = '''\ - libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fbe12d68000) -@@ -40,7 +64,8 @@ class TestLddParser(unittest.TestCase): - - self.assertEqual( - sanitize_shlib_path('/foo/bar'), -- '/foo/bar' if sys.platform == 'darwin' else 'bar') -+ # NixOS always want the absolute path -+ '/foo/bar') - - def test_unresolved_library(self): - output = '' diff --git a/pkgs/development/libraries/gtkd/default.nix b/pkgs/development/libraries/gtkd/default.nix index a03dc51f00c5..5cef820db149 100644 --- a/pkgs/development/libraries/gtkd/default.nix +++ b/pkgs/development/libraries/gtkd/default.nix @@ -117,7 +117,7 @@ in stdenv.mkDerivation rec { makeFlags = [ "prefix=${placeholder "out"}" - "PKG_CONFIG=${pkgconfig}/bin/pkg-config" + "PKG_CONFIG=${pkgconfig}/bin/${pkgconfig.targetPrefix}pkg-config" ]; # The .pc files does not declare an `includedir=`, so the multiple diff --git a/pkgs/development/libraries/jansson/default.nix b/pkgs/development/libraries/jansson/default.nix index c1653ea5d1be..7ecf7579a307 100644 --- a/pkgs/development/libraries/jansson/default.nix +++ b/pkgs/development/libraries/jansson/default.nix @@ -1,11 +1,11 @@ {stdenv, fetchurl}: stdenv.mkDerivation rec { - name = "jansson-2.12"; + name = "jansson-2.13.1"; src = fetchurl { url = "http://www.digip.org/jansson/releases/${name}.tar.gz"; - sha256 = "1jfj4xq3rdgnkxval1x2gqwhaam34qdxbplsj5fsrvs8a1vfr3az"; + sha256 = "0ks7gbs0j8p4dmmi2sq129mxy5gfg0z6220i1jk020mi2zd7gwzl"; }; meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/libaom/default.nix b/pkgs/development/libraries/libaom/default.nix index 04b1c810c085..2c67e6ac1588 100644 --- a/pkgs/development/libraries/libaom/default.nix +++ b/pkgs/development/libraries/libaom/default.nix @@ -2,14 +2,16 @@ stdenv.mkDerivation rec { pname = "libaom"; - version = "1.0.0-errata1"; + version = "2.0.0"; src = fetchgit { url = "https://aomedia.googlesource.com/aom"; rev = "v${version}"; - sha256 = "090phh4jl9z6m2pwpfpwcjh6iyw0byngb2n112qxkg6a3gsaa62f"; + sha256 = "1616xjhj6770ykn82ml741h8hx44v507iky3s9h7a5lnk9d4cxzy"; }; + patches = [ ./outputs.patch ]; + nativeBuildInputs = [ yasm perl cmake pkgconfig python3 ]; @@ -24,10 +26,30 @@ stdenv.mkDerivation rec { export PATH=$NIX_BUILD_TOP:$PATH ''; + # Configuration options: + # https://aomedia.googlesource.com/aom/+/refs/heads/master/build/cmake/aom_config_defaults.cmake + + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DENABLE_TESTS=OFF" + ]; + + postFixup = '' + moveToOutput lib/libaom.a "$static" + ''; + + outputs = [ "out" "bin" "dev" "static" ]; + meta = with stdenv.lib; { - description = "AV1 Bitstream and Decoding Library"; + description = "Alliance for Open Media AV1 codec library"; + longDescription = '' + Libaom is the reference implementation of the AV1 codec from the Alliance + for Open Media. It contains an AV1 library as well as applications like + an encoder (aomenc) and a decoder (aomdec). + ''; homepage = "https://aomedia.org/av1-features/get-started/"; - maintainers = with maintainers; [ kiloreux ]; + changelog = "https://aomedia.googlesource.com/aom/+/refs/tags/v${version}/CHANGELOG"; + maintainers = with maintainers; [ primeos kiloreux ]; platforms = platforms.all; license = licenses.bsd2; }; diff --git a/pkgs/development/libraries/libaom/outputs.patch b/pkgs/development/libraries/libaom/outputs.patch new file mode 100644 index 000000000000..7c0ff397dfee --- /dev/null +++ b/pkgs/development/libraries/libaom/outputs.patch @@ -0,0 +1,45 @@ +--- a/build/cmake/aom_install.cmake ++++ b/build/cmake/aom_install.cmake +@@ -45,2 +45,2 @@ macro(setup_aom_install_targets) +- -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} +- -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} ++ -DCMAKE_INSTALL_FULL_INCLUDEDIR=${CMAKE_INSTALL_FULL_INCLUDEDIR} ++ -DCMAKE_INSTALL_FULL_LIBDIR=${CMAKE_INSTALL_FULL_LIBDIR} +@@ -82,14 +82,14 @@ macro(setup_aom_install_targets) + install( + FILES ${AOM_INSTALL_INCS} +- DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/aom") ++ DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/aom") + install( + FILES "${AOM_PKG_CONFIG_FILE}" +- DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig") ++ DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") + install(TARGETS ${AOM_INSTALL_LIBS} DESTINATION +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") ++ "${CMAKE_INSTALL_FULL_LIBDIR}") + + if(ENABLE_EXAMPLES) + install(TARGETS ${AOM_INSTALL_BINS} DESTINATION +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") ++ "${CMAKE_INSTALL_FULL_BINDIR}") + endif() + endif() +--- a/build/cmake/pkg_config.cmake ++++ b/build/cmake/pkg_config.cmake +@@ -14,2 +14,2 @@ +- "CMAKE_INSTALL_BINDIR" "CMAKE_INSTALL_INCLUDEDIR" +- "CMAKE_INSTALL_LIBDIR" "CMAKE_PROJECT_NAME" ++ "CMAKE_INSTALL_BINDIR" "CMAKE_INSTALL_FULL_INCLUDEDIR" ++ "CMAKE_INSTALL_FULL_LIBDIR" "CMAKE_PROJECT_NAME" +@@ -38,4 +38,4 @@ endif() +-set(prefix "${CMAKE_INSTALL_PREFIX}") +-set(bindir "${CMAKE_INSTALL_BINDIR}") +-set(includedir "${CMAKE_INSTALL_INCLUDEDIR}") +-set(libdir "${CMAKE_INSTALL_LIBDIR}") ++get_filename_component(prefix "${CMAKE_INSTALL_FULL_INCLUDEDIR}" DIRECTORY) ++get_filename_component(exec_prefix "${CMAKE_INSTALL_FULL_LIBDIR}" DIRECTORY) ++get_filename_component(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}" NAME) ++get_filename_component(libdir "${CMAKE_INSTALL_FULL_LIBDIR}" NAME) +@@ -46 +46 @@ file(APPEND "${pkgconfig_file}" "prefix=${prefix}\n") +-file(APPEND "${pkgconfig_file}" "exec_prefix=\${prefix}\n") ++file(APPEND "${pkgconfig_file}" "exec_prefix=${exec_prefix}\n") diff --git a/pkgs/development/libraries/libbytesize/default.nix b/pkgs/development/libraries/libbytesize/default.nix index 5e293c163a9b..ec14b2a6091e 100644 --- a/pkgs/development/libraries/libbytesize/default.nix +++ b/pkgs/development/libraries/libbytesize/default.nix @@ -4,7 +4,7 @@ }: let - version = "2.2"; + version = "2.3"; in stdenv.mkDerivation rec { pname = "libbytesize"; inherit version; @@ -13,7 +13,7 @@ in stdenv.mkDerivation rec { owner = "storaged-project"; repo = "libbytesize"; rev = version; - sha256 = "0n4gmn68ypsk3gcw6akcghlgk3aj3wskwg3mlg93cw5y3a33nbhm"; + sha256 = "1nrlmn63k0ix1yzn8v4lni5n5b4c0b6w9f33p1ig113ymmdvcc0h"; }; outputs = [ "out" "dev" "devdoc" ]; diff --git a/pkgs/development/libraries/libiconv/setup-hook.sh b/pkgs/development/libraries/libiconv/setup-hook.sh index 120cf06c61b5..3d9656ffe5d6 100644 --- a/pkgs/development/libraries/libiconv/setup-hook.sh +++ b/pkgs/development/libraries/libiconv/setup-hook.sh @@ -4,5 +4,5 @@ # See pkgs/build-support/setup-hooks/role.bash if [ -z "${dontAddExtraLibs-}" ]; then getHostRole - export NIX_${role_pre}LDFLAGS+=" -liconv" + export NIX_LDFLAGS${role_post}+=" -liconv" fi diff --git a/pkgs/development/libraries/libqmi/default.nix b/pkgs/development/libraries/libqmi/default.nix index 33b4983b015a..ec72578ba278 100644 --- a/pkgs/development/libraries/libqmi/default.nix +++ b/pkgs/development/libraries/libqmi/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "libqmi"; - version = "1.24.10"; + version = "1.24.12"; src = fetchurl { url = "https://www.freedesktop.org/software/libqmi/${pname}-${version}.tar.xz"; - sha256 = "1rzxapr6hb18ccvqh5fizx7zk63l47bs0p3gizycz2ysnm1i44n2"; + sha256 = "0scb8a2kh0vnzx6kxanfy2s2slnfppvrwg202rxv30m8p2i92frd"; }; outputs = [ "out" "dev" "devdoc" ]; diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix index d48b5a6ba735..5251c680361a 100644 --- a/pkgs/development/libraries/nss/default.nix +++ b/pkgs/development/libraries/nss/default.nix @@ -53,7 +53,9 @@ in stdenv.mkDerivation rec { preConfigure = "cd nss"; makeFlags = let - cpu = stdenv.hostPlatform.parsed.cpu.name; + # NSS's build systems expects aarch32 to be called arm; if we pass in armv6l/armv7l, it + # fails with a linker error + cpu = if stdenv.hostPlatform.isAarch32 then "arm" else stdenv.hostPlatform.parsed.cpu.name; in [ "NSPR_INCLUDE_DIR=${nspr.dev}/include" "NSPR_LIB_DIR=${nspr.out}/lib" @@ -64,9 +66,11 @@ in stdenv.mkDerivation rec { "USE_SYSTEM_ZLIB=1" "NSS_USE_SYSTEM_SQLITE=1" "NATIVE_CC=${buildPackages.stdenv.cc}/bin/cc" - ] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ + # Pass in CPU even if we're not cross compiling, because otherwise it tries to guess with + # uname, which can be wrong if e.g. we're compiling for aarch32 on aarch64 "OS_TEST=${cpu}" "CPU_ARCH=${cpu}" + ] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ "CROSS_COMPILE=1" "NSS_DISABLE_GTESTS=1" # don't want to build tests when cross-compiling ] ++ stdenv.lib.optional stdenv.is64bit "USE_64=1" diff --git a/pkgs/development/libraries/serd/default.nix b/pkgs/development/libraries/serd/default.nix index 9e83bdae28ed..6829275e99e4 100644 --- a/pkgs/development/libraries/serd/default.nix +++ b/pkgs/development/libraries/serd/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "serd"; - version = "0.30.2"; + version = "0.30.4"; src = fetchurl { url = "https://download.drobilla.net/${pname}-${version}.tar.bz2"; - sha256 = "00kjjgs5a8r72khgpya14scvl3n58wqwl5927y14z03j25q04ccx"; + sha256 = "168rn3m32c59qbar120f83ibcnnd987ij9p053kybgl7cmm6358c"; }; nativeBuildInputs = [ pkgconfig python3 wafHook ]; diff --git a/pkgs/development/libraries/wavpack/default.nix b/pkgs/development/libraries/wavpack/default.nix index 329de97d39e1..78794430860c 100644 --- a/pkgs/development/libraries/wavpack/default.nix +++ b/pkgs/development/libraries/wavpack/default.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "wavpack"; - version = "5.2.0"; + version = "5.3.0"; enableParallelBuilding = true; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "http://www.wavpack.com/${pname}-${version}.tar.bz2"; - sha256 = "062f97bvm466ygvix3z0kbgffvvrc5cg2ak568jaq8r56v28q8rw"; + sha256 = "00baiag7rlkzc6545dqdp4p5sr7xc3n97n7qdkgx58c544x0pw5n"; }; meta = with stdenv.lib; { diff --git a/pkgs/development/python-modules/pkgconfig/default.nix b/pkgs/development/python-modules/pkgconfig/default.nix index 2e6fb7c47058..ff9e3cc39aa3 100644 --- a/pkgs/development/python-modules/pkgconfig/default.nix +++ b/pkgs/development/python-modules/pkgconfig/default.nix @@ -4,7 +4,7 @@ buildPythonPackage rec { pname = "pkgconfig"; version = "1.5.1"; - setupHook = pkgconfig.setupHook; + setupHooks = pkgconfig.setupHooks; src = fetchPypi { inherit pname version; @@ -21,7 +21,7 @@ buildPythonPackage rec { patches = [ ./executable.patch ]; postPatch = '' - substituteInPlace pkgconfig/pkgconfig.py --replace 'PKG_CONFIG_EXE = "pkg-config"' 'PKG_CONFIG_EXE = "${pkgconfig}/bin/pkg-config"' + substituteInPlace pkgconfig/pkgconfig.py --replace 'PKG_CONFIG_EXE = "pkg-config"' 'PKG_CONFIG_EXE = "${pkgconfig}/bin/${pkgconfig.targetPrefix}pkg-config"' ''; meta = with lib; { diff --git a/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch b/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch new file mode 100644 index 000000000000..2b34da289e2d --- /dev/null +++ b/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch @@ -0,0 +1,37 @@ +From 21563405d6e2348ee457187f7fb61beb102bb367 Mon Sep 17 00:00:00 2001 +From: Frederik Rietdijk <fridh@fridh.nl> +Date: Sun, 24 May 2020 09:33:13 +0200 +Subject: [PATCH] Check base_prefix and base_exec_prefix for Python 2 + +This is a Nixpkgs-specific change so it can support virtualenvs from Nix envs. +--- + src/virtualenv/discovery/py_info.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/virtualenv/discovery/py_info.py b/src/virtualenv/discovery/py_info.py +index 6f12128..74e9218 100644 +--- a/src/virtualenv/discovery/py_info.py ++++ b/src/virtualenv/discovery/py_info.py +@@ -51,13 +51,17 @@ class PythonInfo(object): + self.version = u(sys.version) + self.os = u(os.name) + ++ config_vars = {} if sys.version_info.major is not 2 else sysconfig._CONFIG_VARS ++ base_prefix = config_vars.get("prefix") ++ base_exec_prefix = config_vars.get("exec_prefix") ++ + # information about the prefix - determines python home + self.prefix = u(abs_path(getattr(sys, "prefix", None))) # prefix we think +- self.base_prefix = u(abs_path(getattr(sys, "base_prefix", None))) # venv ++ self.base_prefix = u(abs_path(getattr(sys, "base_prefix", base_prefix))) # venv + self.real_prefix = u(abs_path(getattr(sys, "real_prefix", None))) # old virtualenv + + # information about the exec prefix - dynamic stdlib modules +- self.base_exec_prefix = u(abs_path(getattr(sys, "base_exec_prefix", None))) ++ self.base_exec_prefix = u(abs_path(getattr(sys, "base_exec_prefix", base_exec_prefix))) + self.exec_prefix = u(abs_path(getattr(sys, "exec_prefix", None))) + + self.executable = u(abs_path(sys.executable)) # the executable we were invoked via +-- +2.25.1 + diff --git a/pkgs/development/python-modules/virtualenv/default.nix b/pkgs/development/python-modules/virtualenv/default.nix index ff5172d415f7..5ca27330103d 100644 --- a/pkgs/development/python-modules/virtualenv/default.nix +++ b/pkgs/development/python-modules/virtualenv/default.nix @@ -43,6 +43,10 @@ buildPythonPackage rec { importlib-metadata ]; + patches = lib.optionals (isPy27) [ + ./0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch + ]; + meta = { description = "A tool to create isolated Python environments"; homepage = "http://www.virtualenv.org"; diff --git a/pkgs/development/python-modules/zstd/default.nix b/pkgs/development/python-modules/zstd/default.nix index 75856a88b7e0..c96e08ccb513 100644 --- a/pkgs/development/python-modules/zstd/default.nix +++ b/pkgs/development/python-modules/zstd/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace setup.py \ - --replace "/usr/bin/pkg-config" "${pkgconfig}/bin/pkg-config" + --replace "/usr/bin/pkg-config" "${pkgconfig}/bin/${pkgconfig.targetPrefix}pkg-config" ''; nativeBuildInputs = [ pkgconfig ]; diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix index 05c7a55b9d2b..17362702e322 100644 --- a/pkgs/development/tools/build-managers/cmake/default.nix +++ b/pkgs/development/tools/build-managers/cmake/default.nix @@ -63,8 +63,10 @@ stdenv.mkDerivation rec { --subst-var-by libc_lib ${lib.getLib stdenv.cc.libc} substituteInPlace Modules/FindCxxTest.cmake \ --replace "$""{PYTHON_EXECUTABLE}" ${stdenv.shell} - # BUILD_CC and BUILD_CXX are used to bootstrap cmake - configureFlags="--parallel=''${NIX_BUILD_CORES:-1} CC=$BUILD_CC CXX=$BUILD_CXX $configureFlags" + '' + # CC_FOR_BUILD and CXX_FOR_BUILD are used to bootstrap cmake + + '' + configureFlags="--parallel=''${NIX_BUILD_CORES:-1} CC=$CC_FOR_BUILD CXX=$CXX_FOR_BUILD $configureFlags" ''; configureFlags = [ diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/development/tools/build-managers/meson/default.nix index a2dc1424d65f..0a61b8d02a99 100644 --- a/pkgs/development/tools/build-managers/meson/default.nix +++ b/pkgs/development/tools/build-managers/meson/default.nix @@ -8,11 +8,11 @@ python3Packages.buildPythonApplication rec { pname = "meson"; - version = "0.54.1"; + version = "0.54.2"; src = python3Packages.fetchPypi { inherit pname version; - sha256 = "L3b7RXJ2K+E+5HkpJhAJG0UJr1eIvM6zkf4iK80Cltw="; + sha256 = "p3Fu6uj43/AC5BR2Qliatklv+DnkN2pa7XYfg8H6BFU="; }; postFixup = '' diff --git a/pkgs/development/tools/build-managers/meson/more-env-vars.patch b/pkgs/development/tools/build-managers/meson/more-env-vars.patch index a8f860f03cc7..6326f5ec3cfb 100644 --- a/pkgs/development/tools/build-managers/meson/more-env-vars.patch +++ b/pkgs/development/tools/build-managers/meson/more-env-vars.patch @@ -1,16 +1,13 @@ diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py -index ac13a710..e0d07c51 100644 +index 17058df6b..7a68b7f15 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py -@@ -119,9 +119,9 @@ def get_env_var_pair(for_machine: MachineChoice, +@@ -120,7 +120,7 @@ def get_env_var_pair(for_machine: MachineChoice, # compiling we fall back on the unprefixed host version. This # allows native builds to never need to worry about the 'BUILD_*' # ones. - ([var_name + '_FOR_BUILD'] if is_cross else [var_name]), + [var_name + '_FOR_BUILD'] + ([] if is_cross else [var_name]), # Always just the unprefixed host verions -- ([] if is_cross else [var_name]), -+ [var_name], + [var_name] )[for_machine] - for var in candidates: - value = os.environ.get(var) diff --git a/pkgs/development/tools/misc/pkg-config/default.nix b/pkgs/development/tools/misc/pkg-config/default.nix index 494b8d893d42..84f6c330f8c5 100644 --- a/pkgs/development/tools/misc/pkg-config/default.nix +++ b/pkgs/development/tools/misc/pkg-config/default.nix @@ -6,20 +6,21 @@ stdenv.mkDerivation rec { pname = "pkg-config"; version = "0.29.2"; - setupHook = ./setup-hook.sh; - src = fetchurl { url = "https://pkgconfig.freedesktop.org/releases/${pname}-${version}.tar.gz"; sha256 = "14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg"; }; + outputs = [ "out" "man" "doc" ]; + # Process Requires.private properly, see - # http://bugs.freedesktop.org/show_bug.cgi?id=4738. + # http://bugs.freedesktop.org/show_bug.cgi?id=4738, migrated to + # https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/28 patches = optional (!vanilla) ./requires-private.patch ++ optional stdenv.isCygwin ./2.36.3-not-win32.patch; # These three tests fail due to a (desired) behavior change from our ./requires-private.patch - postPatch = '' + postPatch = if vanilla then null else '' rm -f check/check-requires-private check/check-gtk check/missing ''; diff --git a/pkgs/development/tools/misc/pkg-config/setup-hook.sh b/pkgs/development/tools/misc/pkg-config/setup-hook.sh deleted file mode 100644 index 34a9b9f1173b..000000000000 --- a/pkgs/development/tools/misc/pkg-config/setup-hook.sh +++ /dev/null @@ -1,6 +0,0 @@ -addPkgConfigPath () { - addToSearchPath PKG_CONFIG_PATH $1/lib/pkgconfig - addToSearchPath PKG_CONFIG_PATH $1/share/pkgconfig -} - -addEnvHooks "$targetOffset" addPkgConfigPath diff --git a/pkgs/development/tools/misc/pkgconf/default.nix b/pkgs/development/tools/misc/pkgconf/default.nix index 02b7ff5fcd3d..fb8281ff98c4 100644 --- a/pkgs/development/tools/misc/pkgconf/default.nix +++ b/pkgs/development/tools/misc/pkgconf/default.nix @@ -1,14 +1,41 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, removeReferencesTo }: stdenv.mkDerivation rec { pname = "pkgconf"; version = "1.6.3"; + nativeBuildInputs = [ removeReferencesTo ]; + + outputs = [ "out" "lib" "dev" "man" "doc" ]; + + enableParallelBuilding = true; + src = fetchurl { url = "https://distfiles.dereferenced.org/${pname}/${pname}-${version}.tar.xz"; sha256 = "04525vv0y849vvc2pi60g5wd9fjp1wbhra2lniifi82y1ldv7w31"; }; + # Debian has outputs like these too: + # https://packages.debian.org/source/buster/pkgconf, so take it this + # reference removing is safe. + postFixup = '' + remove-references-to \ + -t "${placeholder "dev"}" \ + "${placeholder "lib"}"/lib/* \ + "${placeholder "out"}"/bin/* + remove-references-to \ + -t "${placeholder "out"}" \ + "${placeholder "lib"}"/lib/* + '' + # Move back share/aclocal. Yes, this normally goes in the dev output for good + # reason, but in this case the dev output is for the `libpkgconf` library, + # while the aclocal stuff is for the tool. The tool is already for use during + # development, so there is no reason to have separate "dev-bin" and "dev-lib" + # outputs or someting. + + '' + mv ${placeholder "dev"}/share ${placeholder "out"} + ''; + meta = with stdenv.lib; { description = "Package compiler and linker metadata toolkit"; homepage = "https://git.dereferenced.org/pkgconf/pkgconf"; diff --git a/pkgs/development/tools/misc/texinfo/cross-tools-flags.patch b/pkgs/development/tools/misc/texinfo/cross-tools-flags.patch index f0e4230d7ec2..da28a309719e 100644 --- a/pkgs/development/tools/misc/texinfo/cross-tools-flags.patch +++ b/pkgs/development/tools/misc/texinfo/cross-tools-flags.patch @@ -4,7 +4,7 @@ diff -ur texinfo-6.5/configure texinfo-6.5-patched/configure @@ -23281,7 +23281,7 @@ # env -i gives this build host configure a clean environment; # consequently, we have to re-initialize $PATH. - env -i CC="$BUILD_CC" AR="$BUILD_AR" RANLIB="$BUILD_RANLIB" \ + env -i CC="$CC_FOR_BUILD" AR="$AR_FOR_BUILD" RANLIB="$RANLIB_FOR_BUILD" \ - PATH="$PATH" \ + PATH="$PATH" CFLAGS="$NATIVE_TOOLS_CFLAGS" LDFLAGS="$NATIVE_TOOLS_LDFLAGS" \ tools_only=1 \ |