diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2020-10-06 10:25:58 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2020-10-06 10:25:58 +0200 |
commit | 692d219a9312fbe3f8b34858a7ca0e32fb72bd07 (patch) | |
tree | 4c0f5e46b2cf639e71acb43990697d769a969d2c /pkgs/build-support | |
parent | c1a0aa7eb73f86b0224a57671752673befe08953 (diff) | |
parent | 82390e264704e4e1bf1652c9bebdc30a48f7fd07 (diff) |
Merge staging-next into staging
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/docker/default.nix | 8 | ||||
-rw-r--r-- | pkgs/build-support/rust/build-rust-crate/default.nix | 12 | ||||
-rw-r--r-- | pkgs/build-support/rust/default-crate-overrides.nix | 30 |
3 files changed, 36 insertions, 14 deletions
diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index b2c132afd741..35382662cf81 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -819,7 +819,13 @@ rec { ''; result = runCommand "stream-${name}" { inherit (conf) imageName; - passthru = { inherit (conf) imageTag; }; + passthru = { + inherit (conf) imageTag; + + # Distinguish tarballs and exes at the Nix level so functions that + # take images can know in advance how the image is supposed to be used. + isExe = true; + }; buildInputs = [ makeWrapper ]; } '' makeWrapper ${streamScript} $out --add-flags ${conf} diff --git a/pkgs/build-support/rust/build-rust-crate/default.nix b/pkgs/build-support/rust/build-rust-crate/default.nix index d559aba16165..0e06f5f89aba 100644 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/default.nix @@ -4,7 +4,8 @@ # This can be useful for deploying packages with NixOps, and to share # binary dependencies between projects. -{ lib, stdenv, defaultCrateOverrides, fetchCrate, rustc, rust, cargo, jq }: +{ lib, stdenv, defaultCrateOverrides, fetchCrate, pkgsBuildBuild, rustc, rust +, cargo, jq }: let # This doesn't appear to be officially documented anywhere yet. @@ -83,6 +84,8 @@ in # A list of rust/cargo features to enable while building the crate. # Example: [ "std" "async" ] , features + # Additional native build inputs for building this crate. + , nativeBuildInputs # Additional build inputs for building this crate. # # Example: [ pkgs.openssl ] @@ -188,12 +191,13 @@ let crate = crate_ // (lib.attrByPath [ crate_.crateName ] (attr: {}) crateOverr dependencies_ = dependencies; buildDependencies_ = buildDependencies; processedAttrs = [ - "src" "buildInputs" "crateBin" "crateLib" "libName" "libPath" + "src" "nativeBuildInputs" "buildInputs" "crateBin" "crateLib" "libName" "libPath" "buildDependencies" "dependencies" "features" "crateRenames" "crateName" "version" "build" "authors" "colors" "edition" "buildTests" ]; extraDerivationAttrs = builtins.removeAttrs crate processedAttrs; + nativeBuildInputs_ = nativeBuildInputs; buildInputs_ = buildInputs; extraRustcOpts_ = extraRustcOpts; buildTests_ = buildTests; @@ -225,7 +229,8 @@ stdenv.mkDerivation (rec { src = crate.src or (fetchCrate { inherit (crate) crateName version sha256; }); name = "rust_${crate.crateName}-${crate.version}${lib.optionalString buildTests_ "-test"}"; version = crate.version; - depsBuildBuild = [ rust stdenv.cc cargo jq ]; + depsBuildBuild = [ pkgsBuildBuild.stdenv.cc ]; + nativeBuildInputs = [ rust stdenv.cc cargo jq ] ++ (crate.nativeBuildInputs or []) ++ nativeBuildInputs_; buildInputs = (crate.buildInputs or []) ++ buildInputs_; dependencies = map lib.getLib dependencies_; buildDependencies = map lib.getLib buildDependencies_; @@ -301,6 +306,7 @@ stdenv.mkDerivation (rec { verbose = crate_.verbose or true; extraRustcOpts = []; features = []; + nativeBuildInputs = []; buildInputs = []; crateOverrides = defaultCrateOverrides; preUnpack = crate_.preUnpack or ""; diff --git a/pkgs/build-support/rust/default-crate-overrides.nix b/pkgs/build-support/rust/default-crate-overrides.nix index 1c4fe9daeada..d0e69ad698a8 100644 --- a/pkgs/build-support/rust/default-crate-overrides.nix +++ b/pkgs/build-support/rust/default-crate-overrides.nix @@ -16,18 +16,21 @@ in }; libz-sys = attrs: { - buildInputs = [ pkgconfig zlib ]; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ zlib ]; extraLinkFlags = ["-L${zlib.out}/lib"]; }; curl-sys = attrs: { - buildInputs = [ pkgconfig zlib curl ]; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ zlib curl ]; propagatedBuildInputs = [ curl zlib ]; extraLinkFlags = ["-L${zlib.out}/lib"]; }; dbus = attrs: { - buildInputs = [ pkgconfig dbus ]; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ dbus ]; }; foundationdb-sys = attrs: { @@ -62,19 +65,23 @@ in libgit2-sys = attrs: { LIBGIT2_SYS_USE_PKG_CONFIG = true; - buildInputs = [ pkgconfig openssl zlib libgit2 ]; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ openssl zlib libgit2 ]; }; libsqlite3-sys = attrs: { - buildInputs = [ pkgconfig sqlite ]; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ sqlite ]; }; libssh2-sys = attrs: { - buildInputs = [ pkgconfig openssl zlib libssh2 ]; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ openssl zlib libssh2 ]; }; libdbus-sys = attrs: { - buildInputs = [ pkgconfig dbus ]; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ dbus ]; }; openssl = attrs: { @@ -82,11 +89,13 @@ in }; openssl-sys = attrs: { - buildInputs = [ pkgconfig openssl ]; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ openssl ]; }; pq-sys = attr: { - buildInputs = [ pkgconfig postgresql ]; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ postgresql ]; }; rink = attrs: { @@ -103,7 +112,8 @@ in }; thrussh-libsodium = attrs: { - buildInputs = [ pkgconfig libsodium ]; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ libsodium ]; }; xcb = attrs: { |