diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/package-management/nix/default.nix')
-rw-r--r-- | nixpkgs/pkgs/tools/package-management/nix/default.nix | 69 |
1 files changed, 26 insertions, 43 deletions
diff --git a/nixpkgs/pkgs/tools/package-management/nix/default.nix b/nixpkgs/pkgs/tools/package-management/nix/default.nix index 6b512c253ce..2acf5d194e0 100644 --- a/nixpkgs/pkgs/tools/package-management/nix/default.nix +++ b/nixpkgs/pkgs/tools/package-management/nix/default.nix @@ -13,7 +13,7 @@ common = , bash, coreutils, gzip, gnutar , pkgconfig, boehmgc, perlPackages, libsodium, brotli, boost, editline, nlohmann_json , autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook_xsl_ns - , jq, libarchive, rustc, cargo + , jq, libarchive # Used by tests , gmock , busybox-sandbox-shell @@ -21,9 +21,9 @@ common = , stateDir , confDir , withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp - , withAWS ? stdenv.isLinux || stdenv.isDarwin, aws-sdk-cpp - - , name, suffix ? "", src, crates ? null + , withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin), aws-sdk-cpp + , enableStatic ? false + , name, suffix ? "", src }: let @@ -42,14 +42,14 @@ common = nativeBuildInputs = [ pkgconfig ] ++ lib.optionals is24 [ autoreconfHook autoconf-archive bison flex libxml2 libxslt - docbook5 docbook_xsl_ns jq gmock ]; + docbook5 docbook_xsl_ns jq ]; buildInputs = [ curl openssl sqlite xz bzip2 nlohmann_json brotli boost editline ] ++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium - ++ lib.optionals is24 [ libarchive rustc cargo ] + ++ lib.optionals is24 [ libarchive gmock ] ++ lib.optional withLibseccomp libseccomp ++ lib.optional withAWS ((aws-sdk-cpp.override { @@ -65,12 +65,21 @@ common = propagatedBuildInputs = [ boehmgc ]; # Seems to be required when using std::atomic with 64-bit types - NIX_LDFLAGS = lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux" || stdenv.hostPlatform.system == "armv6l-linux") "-latomic"; + NIX_LDFLAGS = + # need to list libraries individually until + # https://github.com/NixOS/nix/commit/3e85c57a6cbf46d5f0fe8a89b368a43abd26daba + # is in a release + lib.optionalString enableStatic "-lssl -lbrotlicommon -lssh2 -lz -lnghttp2 -lcrypto" + + # need to detect it here until + # https://github.com/NixOS/nix/commits/74b4737d8f0e1922ef5314a158271acf81cd79f8 + # is in a release + + lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux" || stdenv.hostPlatform.system == "armv6l-linux") "-latomic"; preConfigure = # Copy libboost_context so we don't get all of Boost in our closure. # https://github.com/NixOS/nixpkgs/issues/45462 - '' + lib.optionalString (!enableStatic) '' mkdir -p $out/lib cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib rm -f $out/lib/*.a @@ -79,11 +88,6 @@ common = patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.* ''} '' + - # Unpack the Rust crates. - lib.optionalString is24 '' - tar xvf ${crates} -C nix-rust/ - mv nix-rust/nix-vendored-crates* nix-rust/vendor - '' + # For Nix-2.3, patch around an issue where the Nix configure step pulls in the # build system's bash and other utilities when cross-compiling lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform && isExactly23) '' @@ -115,7 +119,8 @@ common = # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50 ++ lib.optional (!withLibseccomp) "--disable-seccomp-sandboxing"; - makeFlags = [ "profiledir=$(out)/etc/profile.d" ]; + makeFlags = [ "profiledir=$(out)/etc/profile.d" ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "PRECOMPILE_HEADERS=0"; installFlags = [ "sysconfdir=$(out)/etc" ]; @@ -178,10 +183,10 @@ in rec { nix = nixStable; nixStable = callPackage common (rec { - name = "nix-2.3.5"; + name = "nix-2.3.7"; src = fetchurl { url = "https://nixos.org/releases/nix/${name}/${name}.tar.xz"; - sha256 = "25445353c27d7c2703cd74216bce6458a02068965055d111765ac4186ed678c1"; + sha256 = "dd8f52849414e5a878afe7e797aa4e22bab77c875d9da5a38d5f1bada704e596"; }; inherit storeDir stateDir confDir boehmgc; @@ -190,41 +195,19 @@ in rec { }); nixUnstable = lib.lowPrio (callPackage common rec { - name = "nix-2.4${suffix}"; - suffix = "pre7534_b92f58f6"; + name = "nix-3.0${suffix}"; + suffix = "pre20200829_f156513"; src = fetchFromGitHub { owner = "NixOS"; repo = "nix"; - rev = "b92f58f6d9e44f97002d1722bd77bad939824c1c"; - sha256 = "1p791961y5v04kpz37g6hm98f1ig7i34inxl9dcj3pbqhf5kicxg"; - }; - - crates = fetchurl { - url = "https://hydra.nixos.org/build/118797694/download/1/nix-vendored-crates-2.4pre7534_b92f58f6.tar.xz"; - sha256 = "a4c2612bbd81732bbb899bc0c230e07b16f6b6150ffbb19c4907dedbbc2bf9fc"; + rev = "f15651303f8596bf34c67fc8d536b1e9e7843a87"; + hash = "sha256-HqM3Z4DLdMrf+0PPZL9ysctGg+K+i3S/IHA1GsJj0Ro="; }; inherit storeDir stateDir confDir boehmgc; }); - nixFlakes = lib.lowPrio (callPackage common rec { - name = "nix-2.4${suffix}"; - suffix = "pre20200521_00b562c"; - - src = fetchFromGitHub { - owner = "NixOS"; - repo = "nix"; - rev = "00b562c87ec4c3bbe514f5dc1f4d1c41f66f66bf"; - sha256 = "0s8is2czpkcj1x1kcjqgbnsbbl03w3fwjjiclsd44zh1ij3wb90s"; - }; - - crates = fetchurl { - url = "https://hydra.nixos.org/build/118093786/download/1/nix-vendored-crates-2.4pre20200501_941f952.tar.xz"; - sha256 = "060f4n5srdbb8vsj0m14aqch7im79a4h5g3nrs41p1xc602vhcdl"; - }; - - inherit storeDir stateDir confDir boehmgc; - }); + nixFlakes = nixUnstable; } |