diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-06-23 08:16:49 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-06-23 08:16:49 +0000 |
commit | 4dc730a187d41f9f2dce4fe2680c32dcecb79b93 (patch) | |
tree | 67673deb1649dc0a40962e70e6da302d7b6c4bf0 /nixpkgs/pkgs/build-support | |
parent | 633cab0ecb07627706c6b523e219490f019eaab5 (diff) | |
parent | 7e567a3d092b7de69cdf5deaeb8d9526de230916 (diff) | |
download | nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar.gz nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar.bz2 nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar.lz nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar.xz nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar.zst nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.zip |
Merge commit '7e567a3d092b7de69cdf5deaeb8d9526de230916'
# Conflicts: # nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/build-support')
7 files changed, 34 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/build-support/coq/default.nix b/nixpkgs/pkgs/build-support/coq/default.nix index 03922303ee34..ba300f2f8cf5 100644 --- a/nixpkgs/pkgs/build-support/coq/default.nix +++ b/nixpkgs/pkgs/build-support/coq/default.nix @@ -57,7 +57,7 @@ let append-version = p: n: p + display-pkg n "" coqPackages.${n}.version + "-"; prefix-name = foldl append-version "" namePrefix; var-coqlib-install = (optionalString (versions.isGe "8.7" coq.coq-version) "COQMF_") + "COQLIB"; - useDune2 = args.useDune2 or useDune2ifVersion fetched.version; + useDune2 = args.useDune2 or (useDune2ifVersion fetched.version); in stdenv.mkDerivation (removeAttrs ({ diff --git a/nixpkgs/pkgs/build-support/ocaml/dune.nix b/nixpkgs/pkgs/build-support/ocaml/dune.nix index 56fe8a60484e..c049878d0131 100644 --- a/nixpkgs/pkgs/build-support/ocaml/dune.nix +++ b/nixpkgs/pkgs/build-support/ocaml/dune.nix @@ -4,8 +4,8 @@ let Dune = if args.useDune2 or false then dune_2 else dune_1; in -if args ? minimumOCamlVersion && - ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion +if (args ? minimumOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion) || + (args ? minimalOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimalOCamlVersion) then throw "${pname}-${version} is not available for OCaml ${ocaml.version}" else @@ -29,7 +29,7 @@ stdenv.mkDerivation ({ runHook postInstall ''; -} // args // { +} // (builtins.removeAttrs args [ "minimalOCamlVersion" ]) // { name = "ocaml${ocaml.version}-${pname}-${version}"; diff --git a/nixpkgs/pkgs/build-support/pkg-config-wrapper/add-flags.sh b/nixpkgs/pkgs/build-support/pkg-config-wrapper/add-flags.sh index 35ecf62ca230..90aee712be63 100644 --- a/nixpkgs/pkgs/build-support/pkg-config-wrapper/add-flags.sh +++ b/nixpkgs/pkgs/build-support/pkg-config-wrapper/add-flags.sh @@ -6,7 +6,7 @@ var_templates_list=( accumulateRoles for var in "${var_templates_list[@]}"; do - mangleVarList "$var" ${role_suffixes[@]+"${role_suffixes[@]}"} + mangleVarListGeneric ":" "$var" ${role_suffixes[@]+"${role_suffixes[@]}"} done export NIX_PKG_CONFIG_WRAPPER_FLAGS_SET_@suffixSalt@=1 diff --git a/nixpkgs/pkgs/build-support/skaware/build-skaware-package.nix b/nixpkgs/pkgs/build-support/skaware/build-skaware-package.nix index 7a5db942b2cb..b27b65f48a59 100644 --- a/nixpkgs/pkgs/build-support/skaware/build-skaware-package.nix +++ b/nixpkgs/pkgs/build-support/skaware/build-skaware-package.nix @@ -99,7 +99,7 @@ in stdenv.mkDerivation { inherit description platforms; license = lib.licenses.isc; maintainers = with lib.maintainers; - [ pmahoney Profpatsch ] ++ maintainers; + [ pmahoney Profpatsch qyliss ] ++ maintainers; }; } diff --git a/nixpkgs/pkgs/build-support/trivial-builders.nix b/nixpkgs/pkgs/build-support/trivial-builders.nix index 0bf67d21b3be..219f808403cc 100644 --- a/nixpkgs/pkgs/build-support/trivial-builders.nix +++ b/nixpkgs/pkgs/build-support/trivial-builders.nix @@ -571,6 +571,22 @@ rec { installPhase = "cp -R ./ $out"; }; + /* An immutable file in the store with a length of 0 bytes. */ + emptyFile = runCommand "empty-file" { + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = "0ip26j2h11n1kgkz36rl4akv694yz65hr72q4kv4b3lxcbi65b3p"; + preferLocalBuild = true; + } "touch $out"; + + /* An immutable empty directory in the store. */ + emptyDirectory = runCommand "empty-directory" { + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5"; + preferLocalBuild = true; + } "mkdir $out"; + /* Checks the command output contains the specified version * * Although simplistic, this test assures that the main program diff --git a/nixpkgs/pkgs/build-support/trivial-builders/test/sample.nix b/nixpkgs/pkgs/build-support/trivial-builders/test/sample.nix index 060be011093a..27aee6b73dbe 100644 --- a/nixpkgs/pkgs/build-support/trivial-builders/test/sample.nix +++ b/nixpkgs/pkgs/build-support/trivial-builders/test/sample.nix @@ -12,4 +12,8 @@ in norefs = writeText "hi" "hello"; helloRef = writeText "hi" "hello ${hello}"; helloFigletRef = writeText "hi" "hello ${hello} ${figlet}"; + inherit (pkgs) + emptyFile + emptyDirectory + ; } diff --git a/nixpkgs/pkgs/build-support/wrapper-common/utils.bash b/nixpkgs/pkgs/build-support/wrapper-common/utils.bash index 66b7c3f3e83c..f773270f7de9 100644 --- a/nixpkgs/pkgs/build-support/wrapper-common/utils.bash +++ b/nixpkgs/pkgs/build-support/wrapper-common/utils.bash @@ -13,7 +13,9 @@ accumulateRoles() { fi } -mangleVarList() { +mangleVarListGeneric() { + local sep="$1" + shift local var="$1" shift local -a role_suffixes=("$@") @@ -25,11 +27,15 @@ mangleVarList() { for suffix in "${role_suffixes[@]}"; do local inputVar="${var}${suffix}" if [ -v "$inputVar" ]; then - export ${outputVar}+="${!outputVar:+ }${!inputVar}" + export ${outputVar}+="${!outputVar:+$sep}${!inputVar}" fi done } +mangleVarList() { + mangleVarListGeneric " " "$@" +} + mangleVarBool() { local var="$1" shift |