Merge pull request #84214 from edolstra/update-nix

Update nixUnstable + nixFlakes, remove nix1
This commit is contained in:
Eelco Dolstra 2020-04-05 10:20:02 +02:00 committed by GitHub
commit 7121160d5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 40 deletions

View File

@ -1,4 +1,4 @@
{ lib, fetchurl, callPackage { lib, fetchurl, fetchFromGitHub, callPackage
, storeDir ? "/nix/store" , storeDir ? "/nix/store"
, stateDir ? "/nix/var" , stateDir ? "/nix/var"
, confDir ? "/etc" , confDir ? "/etc"
@ -12,6 +12,7 @@ common =
{ lib, stdenv, fetchpatch, perl, curl, bzip2, sqlite, openssl ? null, xz { lib, stdenv, fetchpatch, perl, curl, bzip2, sqlite, openssl ? null, xz
, bash, coreutils, gzip, gnutar , bash, coreutils, gzip, gnutar
, pkgconfig, boehmgc, perlPackages, libsodium, brotli, boost, editline, nlohmann_json , 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, rustc, cargo
, busybox-sandbox-shell , busybox-sandbox-shell
, storeDir , storeDir
@ -20,7 +21,7 @@ common =
, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp , withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp
, withAWS ? stdenv.isLinux || stdenv.isDarwin, aws-sdk-cpp , withAWS ? stdenv.isLinux || stdenv.isDarwin, aws-sdk-cpp
, name, suffix ? "", src, includesPerl ? false , name, suffix ? "", src, crates ? null
}: }:
let let
@ -29,7 +30,6 @@ common =
inherit name src; inherit name src;
version = lib.getVersion name; version = lib.getVersion name;
is20 = lib.versionAtLeast version "2.0pre";
is24 = lib.versionAtLeast version "2.4pre"; is24 = lib.versionAtLeast version "2.4pre";
isExactly23 = lib.versionAtLeast version "2.3" && lib.versionOlder version "2.4"; isExactly23 = lib.versionAtLeast version "2.3" && lib.versionOlder version "2.4";
@ -39,15 +39,16 @@ common =
nativeBuildInputs = nativeBuildInputs =
[ pkgconfig ] [ pkgconfig ]
++ lib.optionals (!is20) [ curl perl ] ++ lib.optionals is24 [ autoreconfHook autoconf-archive bison flex libxml2 libxslt docbook5 docbook_xsl_ns jq ];
++ lib.optionals is24 [ jq ];
buildInputs = [ curl openssl sqlite xz bzip2 nlohmann_json ] buildInputs =
[ curl openssl sqlite xz bzip2 nlohmann_json
brotli boost editline
]
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium ++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
++ lib.optionals is20 [ brotli boost editline ]
++ lib.optionals is24 [ libarchive rustc cargo ] ++ lib.optionals is24 [ libarchive rustc cargo ]
++ lib.optional withLibseccomp libseccomp ++ lib.optional withLibseccomp libseccomp
++ lib.optional (withAWS && is20) ++ lib.optional withAWS
((aws-sdk-cpp.override { ((aws-sdk-cpp.override {
apis = ["s3" "transfer"]; apis = ["s3" "transfer"];
customMemoryManagement = false; customMemoryManagement = false;
@ -66,7 +67,7 @@ common =
preConfigure = preConfigure =
# Copy libboost_context so we don't get all of Boost in our closure. # Copy libboost_context so we don't get all of Boost in our closure.
# https://github.com/NixOS/nixpkgs/issues/45462 # https://github.com/NixOS/nixpkgs/issues/45462
lib.optionalString is20 '' ''
mkdir -p $out/lib mkdir -p $out/lib
cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
rm -f $out/lib/*.a rm -f $out/lib/*.a
@ -75,6 +76,11 @@ common =
patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.* 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 # 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 # build system's bash and other utilities when cross-compiling
lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform && isExactly23) '' lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform && isExactly23) ''
@ -97,12 +103,7 @@ common =
"--disable-init-state" "--disable-init-state"
"--enable-gc" "--enable-gc"
] ]
++ lib.optionals (!is20) [ ++ lib.optionals stdenv.isLinux [
"--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
"--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
"--with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}"
"BDW_GC_LIBS=\"-lgc -lgccpp\""
] ++ lib.optionals (is20 && stdenv.isLinux) [
"--with-sandbox-shell=${sh}/bin/busybox" "--with-sandbox-shell=${sh}/bin/busybox"
] ]
++ lib.optional ( ++ lib.optional (
@ -143,7 +144,7 @@ common =
}; };
passthru = { passthru = {
perl-bindings = if includesPerl then nix else stdenv.mkDerivation { perl-bindings = stdenv.mkDerivation {
pname = "nix-perl"; pname = "nix-perl";
inherit version; inherit version;
@ -154,8 +155,7 @@ common =
# This is not cross-compile safe, don't have time to fix right now # This is not cross-compile safe, don't have time to fix right now
# but noting for future travellers. # but noting for future travellers.
nativeBuildInputs = nativeBuildInputs =
[ perl pkgconfig curl nix libsodium ] [ perl pkgconfig curl nix libsodium boost autoreconfHook autoconf-archive ];
++ lib.optional is20 boost;
configureFlags = configureFlags =
[ "--with-dbi=${perlPackages.DBI}/${perl.libPrefix}" [ "--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
@ -174,19 +174,6 @@ in rec {
nix = nixStable; nix = nixStable;
nix1 = callPackage common rec {
name = "nix-1.11.16";
src = fetchurl {
url = "http://nixos.org/releases/nix/${name}/${name}.tar.xz";
sha256 = "0ca5782fc37d62238d13a620a7b4bff6a200bab1bd63003709249a776162357c";
};
# Nix1 has the perl bindings by default, so no need to build the manually.
includesPerl = true;
inherit storeDir stateDir confDir boehmgc;
};
nixStable = callPackage common (rec { nixStable = callPackage common (rec {
name = "nix-2.3.3"; name = "nix-2.3.3";
src = fetchurl { src = fetchurl {
@ -201,10 +188,18 @@ in rec {
nixUnstable = lib.lowPrio (callPackage common rec { nixUnstable = lib.lowPrio (callPackage common rec {
name = "nix-2.4${suffix}"; name = "nix-2.4${suffix}";
suffix = "pre7250_94c93437"; suffix = "pre7346_5e7ccdc9";
src = fetchurl {
url = "https://hydra.nixos.org/build/112193977/download/3/nix-2.4${suffix}.tar.xz"; src = fetchFromGitHub {
sha256 = "f9baf241c9449c1e3e5c9610adbcd2ce9e5fbcab16aff3ba3030d2fad7b34d7b"; owner = "NixOS";
repo = "nix";
rev = "5e7ccdc9e3ddd61dc85e20c898001345bfb497a5";
sha256 = "10jg0rq92xbigbbri7harn4b75blqaf6rjgq4hhvlnggf2w9iprg";
};
crates = fetchurl {
url = https://hydra.nixos.org/build/115942497/download/1/nix-vendored-crates-2.4pre20200403_3473b19.tar.xz;
sha256 = "a83785553bb4bc5b28220562153e201ec555a00171466ac08b716f0c97aee45a";
}; };
inherit storeDir stateDir confDir boehmgc; inherit storeDir stateDir confDir boehmgc;
@ -212,10 +207,18 @@ in rec {
nixFlakes = lib.lowPrio (callPackage common rec { nixFlakes = lib.lowPrio (callPackage common rec {
name = "nix-2.4${suffix}"; name = "nix-2.4${suffix}";
suffix = "pre20200220_4a4521f"; suffix = "pre20200403_3473b19";
src = fetchurl {
url = "https://hydra.nixos.org/build/113373394/download/3/nix-2.4${suffix}.tar.xz"; src = fetchFromGitHub {
sha256 = "31fe87c40f40a590bc8f575283725d5f04ecb9aebb6b404f679d77438d75265d"; owner = "NixOS";
repo = "nix";
rev = "3473b1950a90d596a3baa080fdfdb080f55a5cc0";
sha256 = "1bb7a8a5lzmb3pzq80zxd3s9y3qv757q7032s5wvp75la9wgvmvr";
};
crates = fetchurl {
url = https://hydra.nixos.org/build/115942497/download/1/nix-vendored-crates-2.4pre20200403_3473b19.tar.xz;
sha256 = "a83785553bb4bc5b28220562153e201ec555a00171466ac08b716f0c97aee45a";
}; };
inherit storeDir stateDir confDir boehmgc; inherit storeDir stateDir confDir boehmgc;

View File

@ -25445,7 +25445,6 @@ in
boehmgc = boehmgc.override { enableLargeConfig = true; }; boehmgc = boehmgc.override { enableLargeConfig = true; };
}) })
nix nix
nix1
nixStable nixStable
nixUnstable nixUnstable
nixFlakes; nixFlakes;