diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-06-25 18:01:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-25 18:01:21 +0000 |
commit | 2c439c14b66d645a42ed913441713b79836fcf97 (patch) | |
tree | 0a6e69dbe10052ca67680f7eebf0913c64544052 /pkgs/build-support | |
parent | aa5d10729977cd519039d1b564342b4f68dfb099 (diff) | |
parent | b82265108172c9de5a897202c6b18eca626f2d3b (diff) |
Merge master into staging-next
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/bintools-wrapper/default.nix | 4 | ||||
-rw-r--r-- | pkgs/build-support/cc-wrapper/default.nix | 4 | ||||
-rw-r--r-- | pkgs/build-support/emacs/buffer.nix | 4 | ||||
-rw-r--r-- | pkgs/build-support/pkg-config-wrapper/default.nix | 4 | ||||
-rw-r--r-- | pkgs/build-support/release/binary-tarball.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/release/debian-build.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/release/nix-build.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/release/rpm-build.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/rust/build-rust-crate/test/rcgen-crates.nix | 4 |
9 files changed, 12 insertions, 16 deletions
diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index acc433496b0e8..adaf80dcd916e 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -388,8 +388,8 @@ stdenv.mkDerivation { }; meta = - let bintools_ = if bintools != null then bintools else {}; in - (if bintools_ ? meta then removeAttrs bintools.meta ["priority"] else {}) // + let bintools_ = lib.optionalAttrs (bintools != null) bintools; in + (lib.optionalAttrs (bintools_ ? meta) (removeAttrs bintools.meta ["priority"])) // { description = lib.attrByPath ["meta" "description"] "System binary utilities" bintools_ + " (wrapper script)"; diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index ffde44c538e3a..5e919bc212bd6 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -611,8 +611,8 @@ stdenv.mkDerivation { }; meta = - let cc_ = if cc != null then cc else {}; in - (if cc_ ? meta then removeAttrs cc.meta ["priority"] else {}) // + let cc_ = lib.optionalAttrs (cc != null) cc; in + (lib.optionalAttrs (cc_ ? meta) (removeAttrs cc.meta ["priority"])) // { description = lib.attrByPath ["meta" "description"] "System C compiler" cc_ + " (wrapper script)"; diff --git a/pkgs/build-support/emacs/buffer.nix b/pkgs/build-support/emacs/buffer.nix index 8f824f4e1a579..b8bd4584e3227 100644 --- a/pkgs/build-support/emacs/buffer.nix +++ b/pkgs/build-support/emacs/buffer.nix @@ -73,7 +73,5 @@ rec { haskell-package-env = builtins.head haskell-package.env.nativeBuildInputs; in - if is-haskell-package - then withPackages [ haskell-package-env ] - else {}; + lib.optionalAttrs is-haskell-package (withPackages [ haskell-package-env ]); } diff --git a/pkgs/build-support/pkg-config-wrapper/default.nix b/pkgs/build-support/pkg-config-wrapper/default.nix index f68597662608f..f409ca3a7d4b6 100644 --- a/pkgs/build-support/pkg-config-wrapper/default.nix +++ b/pkgs/build-support/pkg-config-wrapper/default.nix @@ -119,8 +119,8 @@ stdenv.mkDerivation { }; meta = - let pkg-config_ = if pkg-config != null then pkg-config else {}; in - (if pkg-config_ ? meta then removeAttrs pkg-config.meta ["priority"] else {}) // + let pkg-config_ = lib.optionalAttrs (pkg-config != null) pkg-config; in + (lib.optionalAttrs (pkg-config_ ? meta) (removeAttrs pkg-config.meta ["priority"])) // { description = lib.attrByPath ["meta" "description"] "pkg-config" pkg-config_ + " (wrapper script)"; diff --git a/pkgs/build-support/release/binary-tarball.nix b/pkgs/build-support/release/binary-tarball.nix index 24d5b2e1cafc9..37c5f8c7ee86d 100644 --- a/pkgs/build-support/release/binary-tarball.nix +++ b/pkgs/build-support/release/binary-tarball.nix @@ -70,7 +70,7 @@ stdenv.mkDerivation ( test -n "$releaseName" && (echo "$releaseName" >> $out/nix-support/hydra-release-name) ''; - meta = (if args ? meta then args.meta else {}) // { + meta = (lib.optionalAttrs (args ? meta) args.meta) // { description = "Build of a generic binary distribution"; }; diff --git a/pkgs/build-support/release/debian-build.nix b/pkgs/build-support/release/debian-build.nix index 6e08caf0a4e53..ab84a504b54c6 100644 --- a/pkgs/build-support/release/debian-build.nix +++ b/pkgs/build-support/release/debian-build.nix @@ -86,7 +86,7 @@ vmTools.runInLinuxImage (stdenv.mkDerivation ( eval "$postInstall" ''; - meta = (if args ? meta then args.meta else {}) // { + meta = (lib.optionalAttrs (args ? meta) args.meta) // { description = "Deb package for ${diskImage.fullName}"; }; } diff --git a/pkgs/build-support/release/nix-build.nix b/pkgs/build-support/release/nix-build.nix index 83e521bb65c74..583831d4821da 100644 --- a/pkgs/build-support/release/nix-build.nix +++ b/pkgs/build-support/release/nix-build.nix @@ -146,7 +146,7 @@ stdenv.mkDerivation ( postPhases = postPhases ++ ["finalPhase"]; - meta = (if args ? meta then args.meta else {}) // { + meta = (lib.optionalAttrs (args ? meta) args.meta) // { description = if doCoverageAnalysis then "Coverage analysis" else "Nix package for ${stdenv.hostPlatform.system}"; }; diff --git a/pkgs/build-support/release/rpm-build.nix b/pkgs/build-support/release/rpm-build.nix index 8f47114705092..ccbbd57107bdc 100644 --- a/pkgs/build-support/release/rpm-build.nix +++ b/pkgs/build-support/release/rpm-build.nix @@ -46,7 +46,7 @@ vmTools.buildRPM ( done ''; - meta = (if args ? meta then args.meta else {}) // { + meta = (lib.optionalAttrs (args ? meta) args.meta) // { description = "RPM package for ${diskImage.fullName}"; }; } diff --git a/pkgs/build-support/rust/build-rust-crate/test/rcgen-crates.nix b/pkgs/build-support/rust/build-rust-crate/test/rcgen-crates.nix index e15390c3ffa80..ed273c01d26dc 100644 --- a/pkgs/build-support/rust/build-rust-crate/test/rcgen-crates.nix +++ b/pkgs/build-support/rust/build-rust-crate/test/rcgen-crates.nix @@ -24,9 +24,7 @@ , release ? true # Additional crate2nix configuration if it exists. , crateConfig - ? if builtins.pathExists ./crate-config.nix - then pkgs.callPackage ./crate-config.nix {} - else {} + ? lib.optionalAttrs (builtins.pathExists ./crate-config.nix) (pkgs.callPackage ./crate-config.nix {}) }: rec { |