diff options
author | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2023-07-26 10:37:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 10:37:07 +0200 |
commit | 435d7c0799cec2492ec0a0abacb4d15d732a53af (patch) | |
tree | f46a61506168116bf4492a56670334499bf2c8a8 /pkgs/build-support | |
parent | 5c9080f33ab2013a2008ffc74fc7ea452895dbb5 (diff) | |
parent | 099935b62402f4328d96ff0331d25f98414e45ae (diff) |
Merge pull request #216365 from Stunkymonkey/use-optionalAttrs
treewide: use lib.optionalAttrs
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/release/default.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/release/nix-build.nix | 6 | ||||
-rw-r--r-- | pkgs/build-support/release/source-tarball.nix | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/pkgs/build-support/release/default.nix b/pkgs/build-support/release/default.nix index ee414ea3280d2..d09f6c8568be7 100644 --- a/pkgs/build-support/release/default.nix +++ b/pkgs/build-support/release/default.nix @@ -5,7 +5,7 @@ with pkgs; rec { sourceTarball = args: import ./source-tarball.nix ( - { inherit stdenv autoconf automake libtool; + { inherit lib stdenv autoconf automake libtool; } // args); makeSourceTarball = sourceTarball; # compatibility diff --git a/pkgs/build-support/release/nix-build.nix b/pkgs/build-support/release/nix-build.nix index 583831d4821da..348cd5b8345cd 100644 --- a/pkgs/build-support/release/nix-build.nix +++ b/pkgs/build-support/release/nix-build.nix @@ -154,8 +154,8 @@ stdenv.mkDerivation ( // - (if buildOutOfSourceTree - then { + (lib.optionalAttrs buildOutOfSourceTree + { preConfigure = # Build out of source tree and make the source tree read-only. This # helps catch violations of the GNU Coding Standards (info @@ -170,5 +170,5 @@ stdenv.mkDerivation ( ${lib.optionalString (preConfigure != null) preConfigure} ''; } - else {}) + ) ) diff --git a/pkgs/build-support/release/source-tarball.nix b/pkgs/build-support/release/source-tarball.nix index d624d071cc21b..fbc8bc6b258b6 100644 --- a/pkgs/build-support/release/source-tarball.nix +++ b/pkgs/build-support/release/source-tarball.nix @@ -10,7 +10,7 @@ if officialRelease then "" else "pre${toString (src.rev or src.revCount or "")}" -, src, stdenv, autoconf, automake, libtool +, src, lib, stdenv, autoconf, automake, libtool , # By default, provide all the GNU Build System as input. bootstrapBuildInputs ? [ autoconf automake libtool ] , ... } @ args: @@ -73,7 +73,7 @@ stdenv.mkDerivation ( } # Then, the caller-supplied attributes. - // args // + // (builtins.removeAttrs args [ "lib" ]) // # And finally, our own stuff. { @@ -117,7 +117,7 @@ stdenv.mkDerivation ( version = version + versionSuffix; }; - meta = (if args ? meta then args.meta else {}) // { + meta = (lib.optionalAttrs (args ? meta) args.meta) // { description = "Source distribution"; # Tarball builds are generally important, so give them a high |