From 0c0f326a024d7ae924e2e49df309797192889188 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 May 2019 20:40:59 +0200 Subject: [PATCH 001/323] WIP stdenv.mkDerivation: use __structuredAttrs --- pkgs/build-support/bintools-wrapper/default.nix | 2 ++ pkgs/build-support/cc-wrapper/default.nix | 2 ++ .../setup-hooks/multiple-outputs.sh | 16 ++++++++++------ pkgs/stdenv/generic/default-builder.sh | 2 ++ pkgs/stdenv/generic/make-derivation.nix | 2 ++ pkgs/stdenv/generic/setup.sh | 5 +---- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index c60abdd03e81b..7862fc5c37788 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -120,6 +120,8 @@ stdenv.mkDerivation { substituteAll "$wrapper" "$out/bin/$dst" chmod +x "$out/bin/$dst" } + + export wrapperName infixSalt name bintools_bin libc_bin coreutils_bin targetPrefix shell emulation '' + (if nativeTools then '' diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 151313847e40d..b3be3513b65d8 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -145,6 +145,8 @@ stdenv.mkDerivation { substituteAll "$wrapper" "$out/bin/$dst" chmod +x "$out/bin/$dst" } + + export shell coreutils_bin gnugrep_bin bintools infixSalt name wrapperName '' + (if nativeTools then '' diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index 2e95495c96fdc..49e76e5003e9b 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -7,10 +7,10 @@ postFixupHooks+=(_multioutPropagateDev) # Assign the first string containing nonempty variable to the variable named $1 _assignFirst() { local varName="$1" - local REMOVE=REMOVE # slightly hacky - we allow REMOVE (i.e. not a variable name) shift while (( $# )); do - if [ -n "${!1-}" ]; then eval "${varName}"="$1"; return; fi + if [ "$1" = REMOVE ]; then eval "${varName}"=REMOVE; return; fi + if [ ${outputs[$1]+isset} ]; then eval "${varName}"="$1"; return; fi shift done echo "Error: _assignFirst found no valid variant!" @@ -44,10 +44,14 @@ _overrideFirst outputMan "man" "$outputBin" _overrideFirst outputDevman "devman" "devdoc" "$outputMan" _overrideFirst outputInfo "info" "$outputBin" +# Backwardscompatibility to ensure $out etc. exist +for output in "${!outputs[@]}"; do + eval "export ${output}"="${outputs[$output]}" +done # Add standard flags to put files into the desired outputs. _multioutConfig() { - if [ "$outputs" = "out" ] || [ -z "${setOutputFlags-1}" ]; then return; fi; + if [ "${#outputs[@]}" -eq 1 ] || [ -z "${setOutputFlags-1}" ]; then return; fi; # try to detect share/doc/${shareDocName} # Note: sadly, $configureScript detection comes later in configurePhase, @@ -94,7 +98,7 @@ moveToOutput() { local patt="$1" local dstOut="$2" local output - for output in $outputs; do + for output in "${!outputs[@]}"; do if [ "${!output}" = "$dstOut" ]; then continue; fi local srcPath for srcPath in "${!output}"/$patt; do @@ -149,7 +153,7 @@ _multioutDocs() { # Move development-only stuff to the desired outputs. _multioutDevs() { - if [ "$outputs" = "out" ] || [ -z "${moveToDev-1}" ]; then return; fi; + if [ "${#outputs[@]}" -eq 1 ] || [ -z "${moveToDev-1}" ]; then return; fi; moveToOutput include "${!outputInclude}" # these files are sometimes provided even without using the corresponding tool moveToOutput lib/pkgconfig "${!outputDev}" @@ -166,7 +170,7 @@ _multioutDevs() { # Make the "dev" propagate other outputs needed for development. _multioutPropagateDev() { - if [ "$outputs" = "out" ]; then return; fi; + if [ ${#outputs[@]} -eq 1 ]; then return; fi; local outputFirst for outputFirst in $outputs; do diff --git a/pkgs/stdenv/generic/default-builder.sh b/pkgs/stdenv/generic/default-builder.sh index 273fc55c75523..a10f826ae5a73 100644 --- a/pkgs/stdenv/generic/default-builder.sh +++ b/pkgs/stdenv/generic/default-builder.sh @@ -1,2 +1,4 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi + source $stdenv/setup genericBuild diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index a11b280b047ee..924fbb8a46463 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -87,6 +87,7 @@ in rec { , hardeningDisable ? [] , patches ? [] + , __structuredAttrs ? true , ... } @ attrs: @@ -210,6 +211,7 @@ in rec { userHook = config.stdenv.userHook or null; __ignoreNulls = true; + inherit __structuredAttrs; inherit strictDeps; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 5b8fdde579612..445d7aa5e4002 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -5,9 +5,6 @@ if (( "${NIX_DEBUG:-0}" >= 6 )); then set -x fi -: ${outputs:=out} - - ###################################################################### # Hook handling. @@ -1156,7 +1153,7 @@ fixupPhase() { if [ -n "${setupHooks:-}" ]; then mkdir -p "${!outputDev}/nix-support" local hook - for hook in $setupHooks; do + for hook in "${setupHooks[@]}"; do local content consumeEntire content < "$hook" substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook" From f52479f2638c2e7c3b7ee8cbc8356114b8773b9e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 8 May 2019 00:41:17 +0200 Subject: [PATCH 002/323] stdenv.mkDerivation: fix substituteAll --- pkgs/build-support/bintools-wrapper/default.nix | 2 -- pkgs/build-support/cc-wrapper/default.nix | 2 -- pkgs/stdenv/generic/setup.sh | 11 +++++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 7862fc5c37788..c60abdd03e81b 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -120,8 +120,6 @@ stdenv.mkDerivation { substituteAll "$wrapper" "$out/bin/$dst" chmod +x "$out/bin/$dst" } - - export wrapperName infixSalt name bintools_bin libc_bin coreutils_bin targetPrefix shell emulation '' + (if nativeTools then '' diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index b3be3513b65d8..151313847e40d 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -145,8 +145,6 @@ stdenv.mkDerivation { substituteAll "$wrapper" "$out/bin/$dst" chmod +x "$out/bin/$dst" } - - export shell coreutils_bin gnugrep_bin bintools infixSalt name wrapperName '' + (if nativeTools then '' diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 445d7aa5e4002..f219ada18863f 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -730,11 +730,14 @@ substituteInPlace() { } _allFlags() { - for varName in $(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'); do - if (( "${NIX_DEBUG:-0}" >= 1 )); then - printf "@%s@ -> %q\n" "${varName}" "${!varName}" + local varNames="$(comm -3 <(declare | sort) <(declare -f | sort) | cut -d '=' -f 1)" + for varName in $varNames; do + if ! [ -z ${!varName+x} ] && [ $varName != _ ]; then + if (( "${NIX_DEBUG:-0}" >= 1 )); then + printf "@%s@ -> %q\n" "${varName}" "${!varName}" >&2 + fi + args+=("--subst-var" "$varName") fi - args+=("--subst-var" "$varName") done } From a5c8787a4917b1cfbda54a464893254bb77a40c0 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 8 May 2019 00:42:47 +0200 Subject: [PATCH 003/323] stdenv.mkDerivation: fix configureFlags --- .../setup-hooks/multiple-outputs.sh | 16 ++++++++-------- pkgs/stdenv/generic/setup.sh | 15 +++++++-------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index 49e76e5003e9b..508c36fab5a7f 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -70,14 +70,14 @@ _multioutConfig() { fi fi - configureFlags="\ - --bindir=${!outputBin}/bin --sbindir=${!outputBin}/sbin \ - --includedir=${!outputInclude}/include --oldincludedir=${!outputInclude}/include \ - --mandir=${!outputMan}/share/man --infodir=${!outputInfo}/share/info \ - --docdir=${!outputDoc}/share/doc/${shareDocName} \ - --libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \ - --localedir=${!outputLib}/share/locale \ - $configureFlags" + configureFlags=( + "--bindir=${!outputBin}/bin" "--sbindir=${!outputBin}/sbin" + "--includedir=${!outputInclude}/include" "--oldincludedir=${!outputInclude}/include" + "--mandir=${!outputMan}/share/man" "--infodir=${!outputInfo}/share/info" + "--docdir=${!outputDoc}/share/doc/${shareDocName}" + "--libdir=${!outputLib}/lib" "--libexecdir=${!outputLib}/libexec" + "--localedir=${!outputLib}/share/locale" + ${configureFlags[@]}) installFlags="\ pkgconfigdir=${!outputDev}/lib/pkgconfig \ diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index f219ada18863f..b5c8844421fa2 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -953,7 +953,6 @@ configurePhase() { # set to empty if unset : ${configureScript=} - : ${configureFlags=} if [[ -z "$configureScript" && -x ./configure ]]; then configureScript=./configure @@ -968,32 +967,32 @@ configurePhase() { fi if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - configureFlags="${prefixKey:---prefix=}$prefix $configureFlags" + configureFlags+=("${prefixKey:---prefix=}$prefix") fi # Add --disable-dependency-tracking to speed up some builds. if [ -z "${dontAddDisableDepTrack:-}" ]; then if [ -f "$configureScript" ] && grep -q dependency-tracking "$configureScript"; then - configureFlags="--disable-dependency-tracking $configureFlags" + configureFlags+=("--disable-dependency-tracking") fi fi # By default, disable static builds. if [ -z "${dontDisableStatic:-}" ]; then if [ -f "$configureScript" ] && grep -q enable-static "$configureScript"; then - configureFlags="--disable-static $configureFlags" + configureFlags+=("--disable-static") fi fi if [ -n "$configureScript" ]; then # Old bash empty array hack # shellcheck disable=SC2086 - local flagsArray=( - $configureFlags ${configureFlagsArray+"${configureFlagsArray[@]}"} + configureFlags+=( + ${configureFlagsArray+"${configureFlagsArray[@]}"} ) - echoCmd 'configure flags' "${flagsArray[@]}" + echoCmd 'configure flags' "${configureFlags[@]}" # shellcheck disable=SC2086 - $configureScript "${flagsArray[@]}" + $configureScript "${configureFlags[@]}" unset flagsArray else echo "no configure script, doing nothing" From 5c1f54ae9d2889bbb24531f72cb0794515317a69 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 8 May 2019 00:44:00 +0200 Subject: [PATCH 004/323] stdenv.mkDerivation: fix deps* --- pkgs/stdenv/generic/setup.sh | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index b5c8844421fa2..3c55f345fb13d 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -425,30 +425,35 @@ findInputs() { done } -# Make sure all are at least defined as empty -: ${depsBuildBuild=} ${depsBuildBuildPropagated=} -: ${nativeBuildInputs=} ${propagatedNativeBuildInputs=} ${defaultNativeBuildInputs=} -: ${depsBuildTarget=} ${depsBuildTargetPropagated=} -: ${depsHostHost=} ${depsHostHostPropagated=} -: ${buildInputs=} ${propagatedBuildInputs=} ${defaultBuildInputs=} -: ${depsTargetTarget=} ${depsTargetTargetPropagated=} - -for pkg in $depsBuildBuild $depsBuildBuildPropagated; do +depsBuildBuild=${depsBuildBuild+"${depsBuildBuild[@]}"} +depsBuildBuildPropagated=${depsBuildBuildPropagated+"${depsBuildBuildPropagated[@]}"} +nativeBuildInputs=${nativeBuildInputs+"${nativeBuildInputs[@]}"} +propagatedNativeBuildInputs=${propagatedNativeBuildInputs+"${propagatedNativeBuildInputs[@]}"} +depsBuildTarget=${depsBuildTarget+"${depsBuildTarget[@]}"} +depsBuildTargetPropagated=${depsBuildTargetPropagated+"${depsBuildTargetPropagated[@]}"} +depsHostHost=${depsHostHost+"${depsHostHost[@]}"} +depsHostHostPropagated=${depsHostHostPropagated+"${depsHostHostPropagated[@]}"} +buildInputs=${buildInputs+"${buildInputs[@]}"} +propagatedBuildInputs=${propagatedBuildInputs+"${propagatedBuildInputs[@]}"} +depsTargetTarget=${depsTargetTarget+"${depsTargetTarget[@]}"} +depsTargetTargetPropagated=${depsTargetTargetPropagated+"${depsTargetTargetPropagated[@]}"} + +for pkg in ${depsBuildBuild[@]} ${depsBuildBuildPropagated[@]}; do findInputs "$pkg" -1 -1 done -for pkg in $nativeBuildInputs $propagatedNativeBuildInputs; do +for pkg in ${nativeBuildInputs[@]} ${propagatedNativeBuildInputs[@]}; do findInputs "$pkg" -1 0 done -for pkg in $depsBuildTarget $depsBuildTargetPropagated; do +for pkg in ${depsBuildTarget[@]} ${depsBuildTargetPropagated[@]}; do findInputs "$pkg" -1 1 done -for pkg in $depsHostHost $depsHostHostPropagated; do +for pkg in ${depsHostHost[@]} ${depsHostHostPropagated[@]}; do findInputs "$pkg" 0 0 done -for pkg in $buildInputs $propagatedBuildInputs ; do +for pkg in ${buildInputs[@]} ${propagatedBuildInputs[@]} ; do findInputs "$pkg" 0 1 done -for pkg in $depsTargetTarget $depsTargetTargetPropagated; do +for pkg in ${depsTargetTarget[@]} ${depsTargetTargetPropagated[@]}; do findInputs "$pkg" 1 1 done # Default inputs must be processed last From 23e02903d768bba3db63b929d9a66ba822cc5dc6 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 8 May 2019 00:44:16 +0200 Subject: [PATCH 005/323] stdenv.mkDerivation: fix makeFlags --- pkgs/stdenv/generic/setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 3c55f345fb13d..d50fc2acca2f8 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1011,9 +1011,9 @@ buildPhase() { runHook preBuild # set to empty if unset - : ${makeFlags=} + makeFlags=${makeFlags+"${makeFlags[@]}"} - if [[ -z "$makeFlags" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + if [[ -z "${makeFlags[@]}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then echo "no Makefile, doing nothing" else foundMakefile=1 @@ -1023,7 +1023,7 @@ buildPhase() { local flagsArray=( ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} SHELL=$SHELL - $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"} + ${makeFlags[@]} ${makeFlagsArray+"${makeFlagsArray[@]}"} $buildFlags ${buildFlagsArray+"${buildFlagsArray[@]}"} ) From adc3a2796571ff5b1ff26252b4ec21ca75e582fa Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 9 May 2019 01:05:24 +0200 Subject: [PATCH 006/323] stdenv.mkDerivation: list fixes --- .../setup-hooks/multiple-outputs.sh | 10 +++---- pkgs/stdenv/generic/setup.sh | 28 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index 508c36fab5a7f..94ca465f91eaa 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -44,7 +44,7 @@ _overrideFirst outputMan "man" "$outputBin" _overrideFirst outputDevman "devman" "devdoc" "$outputMan" _overrideFirst outputInfo "info" "$outputBin" -# Backwardscompatibility to ensure $out etc. exist +# Backwards compatibility to ensure $out etc. exist for output in "${!outputs[@]}"; do eval "export ${output}"="${outputs[$output]}" done @@ -79,10 +79,10 @@ _multioutConfig() { "--localedir=${!outputLib}/share/locale" ${configureFlags[@]}) - installFlags="\ - pkgconfigdir=${!outputDev}/lib/pkgconfig \ - m4datadir=${!outputDev}/share/aclocal aclocaldir=${!outputDev}/share/aclocal \ - $installFlags" + installFlags=( + "pkgconfigdir=${!outputDev}/lib/pkgconfig" + "m4datadir=${!outputDev}/share/aclocal" "aclocaldir=${!outputDev}/share/aclocal" + ${installFlags[@]}) } diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index d50fc2acca2f8..bed1efdc9e6ca 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -922,7 +922,7 @@ unpackPhase() { patchPhase() { runHook prePatch - for i in ${patches:-}; do + for i in ${patches+"${patches[@]}"}; do header "applying patch $i" 3 local uncompress=cat case "$i" in @@ -1024,7 +1024,7 @@ buildPhase() { ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} SHELL=$SHELL ${makeFlags[@]} ${makeFlagsArray+"${makeFlagsArray[@]}"} - $buildFlags ${buildFlagsArray+"${buildFlagsArray[@]}"} + ${buildFlags+"${buildFlags[@]}"} ${buildFlagsArray+"${buildFlagsArray[@]}"} ) echoCmd 'build flags' "${flagsArray[@]}" @@ -1062,7 +1062,7 @@ checkPhase() { local flagsArray=( ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} SHELL=$SHELL - $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"} + ${makeFlags[@]} ${makeFlagsArray+"${makeFlagsArray[@]}"} ${checkFlags:-VERBOSE=y} ${checkFlagsArray+"${checkFlagsArray[@]}"} ${checkTarget} ) @@ -1088,8 +1088,8 @@ installPhase() { # shellcheck disable=SC2086 local flagsArray=( SHELL=$SHELL - $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"} - $installFlags ${installFlagsArray+"${installFlagsArray[@]}"} + ${makeFlags[@]} ${makeFlagsArray+"${makeFlagsArray[@]}"} + ${installFlags+"${installFlags[@]}"} ${installFlagsArray+"${installFlagsArray[@]}"} ${installTargets:-install} ) @@ -1123,14 +1123,14 @@ fixupPhase() { # Propagate dependencies & setup hook into the development output. declare -ra flatVars=( # Build - depsBuildBuildPropagated - propagatedNativeBuildInputs - depsBuildTargetPropagated + ${depsBuildBuildPropagated[@]} + ${propagatedNativeBuildInputs[@]} + ${depsBuildTargetPropagated[@]} # Host - depsHostHostPropagated - propagatedBuildInputs + ${depsHostHostPropagated[@]} + ${propagatedBuildInputs[@]} # Target - depsTargetTargetPropagated + ${depsTargetTargetPropagated[@]} ) declare -ra flatFiles=( "${propagatedBuildDepFiles[@]}" @@ -1160,7 +1160,7 @@ fixupPhase() { if [ -n "${setupHooks:-}" ]; then mkdir -p "${!outputDev}/nix-support" local hook - for hook in "${setupHooks[@]}"; do + for hook in ${setupHooks[@]}; do local content consumeEntire content < "$hook" substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook" @@ -1174,7 +1174,7 @@ fixupPhase() { if [ -n "${propagatedUserEnvPkgs:-}" ]; then mkdir -p "${!outputBin}/nix-support" # shellcheck disable=SC2086 - printWords $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages" + printWords ${propagatedUserEnvPkgs[@]} > "${!outputBin}/nix-support/propagated-user-env-packages" fi runHook postFixup @@ -1196,7 +1196,7 @@ installCheckPhase() { local flagsArray=( ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} SHELL=$SHELL - $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"} + ${makeFlags[@]} ${makeFlagsArray+"${makeFlagsArray[@]}"} $installCheckFlags ${installCheckFlagsArray+"${installCheckFlagsArray[@]}"} ${installCheckTarget:-installcheck} ) From 9c2f2d16d4d78105f86e6cce9b045c940d0284d5 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 9 May 2019 02:19:20 +0200 Subject: [PATCH 007/323] stdenv.mkDerivation: fix prev broken propagatedDeps --- pkgs/stdenv/generic/setup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index bed1efdc9e6ca..ee0605662fbcb 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1123,14 +1123,14 @@ fixupPhase() { # Propagate dependencies & setup hook into the development output. declare -ra flatVars=( # Build - ${depsBuildBuildPropagated[@]} - ${propagatedNativeBuildInputs[@]} - ${depsBuildTargetPropagated[@]} + depsBuildBuildPropagated + propagatedNativeBuildInputs + depsBuildTargetPropagated # Host - ${depsHostHostPropagated[@]} - ${propagatedBuildInputs[@]} + depsHostHostPropagated + propagatedBuildInputs # Target - ${depsTargetTargetPropagated[@]} + depsTargetTargetPropagated ) declare -ra flatFiles=( "${propagatedBuildDepFiles[@]}" From b3c2f89fbecaf414ba4b3e45bbadb93e6f75568f Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 9 May 2019 03:42:03 +0200 Subject: [PATCH 008/323] stdenv.mkDerivation: fix output handling --- .../setup-hooks/multiple-outputs.sh | 21 ++++++++++--------- pkgs/stdenv/generic/setup.sh | 8 +++---- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index 94ca465f91eaa..aab74abc0cb01 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -98,10 +98,10 @@ moveToOutput() { local patt="$1" local dstOut="$2" local output - for output in "${!outputs[@]}"; do - if [ "${!output}" = "$dstOut" ]; then continue; fi + for output in "${outputs[@]}"; do + if [ "${output}" = "$dstOut" ]; then continue; fi local srcPath - for srcPath in "${!output}"/$patt; do + for srcPath in "${output}"/$patt; do # apply to existing files/dirs, *including* broken symlinks if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then continue; fi @@ -109,7 +109,7 @@ moveToOutput() { echo "Removing $srcPath" rm -r "$srcPath" else - local dstPath="$dstOut${srcPath#${!output}}" + local dstPath="$dstOut${srcPath#${output}}" echo "Moving $srcPath to $dstPath" if [ -d "$dstPath" ] && [ -d "$srcPath" ] @@ -173,7 +173,7 @@ _multioutPropagateDev() { if [ ${#outputs[@]} -eq 1 ]; then return; fi; local outputFirst - for outputFirst in $outputs; do + for outputFirst in ${!outputs[@]}; do break done local propagaterOutput="$outputDev" @@ -182,22 +182,23 @@ _multioutPropagateDev() { fi # Default value: propagate binaries, includes and libraries - if [ -z "${propagatedBuildOutputs+1}" ]; then + if [ -z "${propagatedBuildOutputs[@]+1}" ]; then local po_dirty="$outputBin $outputInclude $outputLib" set +o pipefail - propagatedBuildOutputs=`echo "$po_dirty" \ + # FIXME + propagatedBuildOutputs=$(echo "$po_dirty" \ | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" \ - | sort -u | tr '\n' ' ' ` + | sort -u | tr '\n' ' ') set -o pipefail fi # The variable was explicitly set to empty or we resolved it so - if [ -z "$propagatedBuildOutputs" ]; then + if [ -z "${propagatedBuildOutputs[@]}" ]; then return fi mkdir -p "${!propagaterOutput}"/nix-support - for output in $propagatedBuildOutputs; do + for output in "${propagatedBuildOutputs[@]}"; do echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs done } diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index ee0605662fbcb..82d90c8ba808a 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1107,16 +1107,16 @@ installPhase() { fixupPhase() { # Make sure everything is writable so "strip" et al. work. local output - for output in $outputs; do - if [ -e "${!output}" ]; then chmod -R u+w "${!output}"; fi + for output in ${outputs[@]}; do + if [ -e "${output}" ]; then chmod -R u+w "${output}"; fi done runHook preFixup # Apply fixup to each output. local output - for output in $outputs; do - prefix="${!output}" runHook fixupOutput + for output in ${outputs[@]}; do + prefix="${output}" runHook fixupOutput done From 7c6fa3181bb3013b6c469ae166d12509550cd9a5 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 9 May 2019 04:00:01 +0200 Subject: [PATCH 009/323] stdenv.mkDerivation: fix more output handling And one test -ne vs test != issue --- pkgs/build-support/setup-hooks/auto-patchelf.sh | 6 +++--- pkgs/build-support/setup-hooks/separate-debug-info.sh | 2 +- pkgs/build-support/setup-hooks/win-dll-link.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/build-support/setup-hooks/auto-patchelf.sh b/pkgs/build-support/setup-hooks/auto-patchelf.sh index 52c50091d08cb..7ea5b3bc33ce0 100644 --- a/pkgs/build-support/setup-hooks/auto-patchelf.sh +++ b/pkgs/build-support/setup-hooks/auto-patchelf.sh @@ -229,9 +229,9 @@ autoPatchelf() { # fixupOutput and the postFixup hook runs later. postFixupHooks+=(' if [ -z "${dontAutoPatchelf-}" ]; then - autoPatchelf -- $(for output in $outputs; do - [ -e "${!output}" ] || continue - echo "${!output}" + autoPatchelf -- $(for output in "${outputs[@]}"; do + [ -e "${output}" ] || continue + echo "${output}" done) fi ') diff --git a/pkgs/build-support/setup-hooks/separate-debug-info.sh b/pkgs/build-support/setup-hooks/separate-debug-info.sh index 19dbb10d18e72..f7bf053510e68 100644 --- a/pkgs/build-support/setup-hooks/separate-debug-info.sh +++ b/pkgs/build-support/setup-hooks/separate-debug-info.sh @@ -20,7 +20,7 @@ _separateDebugInfo() { # Extract the Build ID. FIXME: there's probably a cleaner way. local id="$($READELF -n "$i" | sed 's/.*Build ID: \([0-9a-f]*\).*/\1/; t; d')" - if [ "${#id}" != 40 ]; then + if [ "${#id}" -ne 40 ]; then echo "could not find build ID of $i, skipping" >&2 continue fi diff --git a/pkgs/build-support/setup-hooks/win-dll-link.sh b/pkgs/build-support/setup-hooks/win-dll-link.sh index 6130f32bef86c..f88da7805220d 100644 --- a/pkgs/build-support/setup-hooks/win-dll-link.sh +++ b/pkgs/build-support/setup-hooks/win-dll-link.sh @@ -15,8 +15,8 @@ _linkDLLs() { # prefix $PATH by currently-built outputs local DLLPATH="" local outName - for outName in $outputs; do - addToSearchPath DLLPATH "${!outName}/bin" + for output in "${outputs[@]}"; do + addToSearchPath DLLPATH "${output}/bin" done DLLPATH="$DLLPATH:$PATH" From 6e95f0a9f743983611d2feb84e426e7af9505041 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 19 Aug 2019 16:28:28 +0200 Subject: [PATCH 010/323] stdenv.mkDerivation: fix further structuredAttrs issues --- .../setup-hooks/multiple-outputs.sh | 13 +++++------ pkgs/development/compilers/gcc/7/default.nix | 6 ++--- pkgs/development/compilers/gcc/builder.sh | 9 +++++--- .../gcc/common/extra-target-flags.nix | 8 +++---- pkgs/development/libraries/glibc/common.nix | 4 ++-- pkgs/development/libraries/glibc/default.nix | 12 +++++++--- .../perl-modules/generic/builder.sh | 2 ++ .../linux/kernel-headers/default.nix | 22 ++++++++----------- pkgs/stdenv/generic/setup.sh | 6 ++--- 9 files changed, 44 insertions(+), 38 deletions(-) diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index aab74abc0cb01..fbe469fd46fd9 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -45,8 +45,8 @@ _overrideFirst outputDevman "devman" "devdoc" "$outputMan" _overrideFirst outputInfo "info" "$outputBin" # Backwards compatibility to ensure $out etc. exist -for output in "${!outputs[@]}"; do - eval "export ${output}"="${outputs[$output]}" +for outputName in "${!outputs[@]}"; do + eval "export ${outputName}"="${outputs[$outputName]}" done # Add standard flags to put files into the desired outputs. @@ -77,12 +77,12 @@ _multioutConfig() { "--docdir=${!outputDoc}/share/doc/${shareDocName}" "--libdir=${!outputLib}/lib" "--libexecdir=${!outputLib}/libexec" "--localedir=${!outputLib}/share/locale" - ${configureFlags[@]}) + "${configureFlags[@]}") installFlags=( "pkgconfigdir=${!outputDev}/lib/pkgconfig" "m4datadir=${!outputDev}/share/aclocal" "aclocaldir=${!outputDev}/share/aclocal" - ${installFlags[@]}) + "${installFlags[@]}") } @@ -185,10 +185,9 @@ _multioutPropagateDev() { if [ -z "${propagatedBuildOutputs[@]+1}" ]; then local po_dirty="$outputBin $outputInclude $outputLib" set +o pipefail - # FIXME - propagatedBuildOutputs=$(echo "$po_dirty" \ + propagatedBuildOutputs=($(echo "$po_dirty" \ | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" \ - | sort -u | tr '\n' ' ') + | sort -u | tr '\n' ' ')) set -o pipefail fi diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 22d772cff6d6c..c41ac280cd743 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -235,11 +235,11 @@ stdenv.mkDerivation ({ # compiler (after the specs for the cross-gcc are created). Having # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib - )); + ))); - LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); + LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib))); inherit (import ../common/extra-target-flags.nix { diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index 07a003691d6b2..3c69ce4fa0f71 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -1,5 +1,8 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi + source $stdenv/setup +set -x oldOpts="$(shopt -po nounset)" || true set -euo pipefail @@ -17,8 +20,8 @@ fi # GCC interprets empty paths as ".", which we don't want. -if test -z "${CPATH-}"; then unset CPATH; fi -if test -z "${LIBRARY_PATH-}"; then unset LIBRARY_PATH; fi +if test -z "${CPATH-}"; then unset CPATH; else export CPATH; fi +if test -z "${LIBRARY_PATH-}"; then unset LIBRARY_PATH; else export LIBRARY_PATH; fi echo "\$CPATH is \`${CPATH-}'" echo "\$LIBRARY_PATH is \`${LIBRARY_PATH-}'" @@ -181,7 +184,7 @@ preConfigure() { mkdir -p ../mingw # --with-build-sysroot expects that: cp -R $libcCross/include ../mingw - configureFlags="$configureFlags --with-build-sysroot=`pwd`/.." + configureFlags+=("--with-build-sysroot=$(pwd)/..") fi # Eval the preConfigure script from nix expression. diff --git a/pkgs/development/compilers/gcc/common/extra-target-flags.nix b/pkgs/development/compilers/gcc/common/extra-target-flags.nix index bce9a8d47381a..c1625cc71e6d1 100644 --- a/pkgs/development/compilers/gcc/common/extra-target-flags.nix +++ b/pkgs/development/compilers/gcc/common/extra-target-flags.nix @@ -11,8 +11,8 @@ in ] ++ stdenv.lib.optionals (! crossStageStatic) [ "-B${lib.getLib dep}${dep.libdir or "/lib"}" ]); - in mkFlags libcCross - ++ lib.optionals (!crossStageStatic) (mkFlags threadsCross) + in builtins.toString (mkFlags libcCross + ++ lib.optionals (!crossStageStatic) (mkFlags threadsCross)) ; EXTRA_TARGET_LDFLAGS = let @@ -24,7 +24,7 @@ in "-Wl,-rpath,${lib.getLib dep}${dep.libdir or "/lib"}" "-Wl,-rpath-link,${lib.getLib dep}${dep.libdir or "/lib"}" ])); - in mkFlags libcCross - ++ lib.optionals (!crossStageStatic) (mkFlags threadsCross) + in builtins.toString (mkFlags libcCross + ++ lib.optionals (!crossStageStatic) (mkFlags threadsCross)) ; } diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 32be2205bcc12..7f5dab1e22b18 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -148,7 +148,7 @@ stdenv.mkDerivation ({ "libc_cv_as_needed=no" ] ++ lib.optional withGd "--with-gd"; - installFlags = [ "sysconfdir=$(out)/etc" ]; + installFlags = [ "sysconfdir=${placeholder "out"}/etc" ]; outputs = [ "out" "bin" "dev" "static" ]; @@ -189,7 +189,7 @@ stdenv.mkDerivation ({ configureScript="`pwd`/../$sourceRoot/configure" ${lib.optionalString (stdenv.cc.libc != null) - ''makeFlags="$makeFlags BUILD_LDFLAGS=-Wl,-rpath,${stdenv.cc.libc}/lib"'' + ''makeFlags+=("BUILD_LDFLAGS=-Wl,-rpath,${stdenv.cc.libc}/lib")'' } diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index 98e579cb7a6d6..7672ed0555595 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -35,11 +35,15 @@ callPackage ./common.nix { inherit stdenv; } { export NIX_DONT_SET_RPATH=1 unset CFLAGS - - # Apparently --bindir is not respected. - makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin") ''; + # Apparently --bindir is not respected. + makeFlags = [ + "bindir=${placeholder "bin"}/bin" + "sbindir=${placeholder "bin"}/sbin" + "rootsbindir=${placeholder "bin"}/sbin" + ]; + # The stackprotector and fortify hardening flags are autodetected by glibc # and enabled by default if supported. Setting it for every gcc invocation # does not work. @@ -146,6 +150,8 @@ callPackage ./common.nix { inherit stdenv; } { mv $bin/bin/getconf_ $bin/bin/getconf ''; + doInstallCheck = true; + separateDebugInfo = true; meta.description = "The GNU C Library"; diff --git a/pkgs/development/perl-modules/generic/builder.sh b/pkgs/development/perl-modules/generic/builder.sh index 9b42401fc4dcd..9fa54d2687e28 100644 --- a/pkgs/development/perl-modules/generic/builder.sh +++ b/pkgs/development/perl-modules/generic/builder.sh @@ -1,3 +1,5 @@ +if [ -e .attrs.sh ]; then source .attrs.sh; fi + source $stdenv/setup PERL5LIB="$PERL5LIB${PERL5LIB:+:}$out/lib/perl5/site_perl" diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index fb2b90689214d..b5d4c11de272d 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -36,26 +36,22 @@ let "HOSTCXX:=$(BUILD_CXX)" ]; - # Skip clean on darwin, case-sensitivity issues. - buildPhase = lib.optionalString (!stdenvNoCC.buildPlatform.isDarwin) '' - make mrproper $makeFlags - '' # For some reason, doing `make install_headers` twice, first without # INSTALL_HDR_PATH=$out then with, is neccessary to get this to work # for darwin cross. @Ericson2314 has no idea why. - + '' - make headers_install $makeFlags - ''; + buildFlags = [ "headers_install" ]; + checkTarget = [ "headers_check" ]; + installTargets = "headers_install"; + installFlags = [ "INSTALL_HDR_PATH=${placeholder "out"}" ]; - checkPhase = '' - make headers_check $makeFlags + # Skip clean on darwin, case-sensitivity issues. + preBuild = lib.optionalString (!stdenvNoCC.buildPlatform.isDarwin) '' + make mrproper "''${makeFlags[@]}" ''; - installPhase = '' - make headers_install INSTALL_HDR_PATH=$out $makeFlags - '' # Some builds (e.g. KVM) want a kernel.release. - + '' mkdir -p $out/include/config + postInstall = '' + mkdir -p $out/include/config echo "${version}-default" > $out/include/config/kernel.release '' # These oddly named file records the `SHELL` passed, which causes bootstrap diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 82d90c8ba808a..23839a125d6c5 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -972,20 +972,20 @@ configurePhase() { fi if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - configureFlags+=("${prefixKey:---prefix=}$prefix") + configureFlags=("${prefixKey:---prefix=}$prefix" "${configureFlags[@]}") fi # Add --disable-dependency-tracking to speed up some builds. if [ -z "${dontAddDisableDepTrack:-}" ]; then if [ -f "$configureScript" ] && grep -q dependency-tracking "$configureScript"; then - configureFlags+=("--disable-dependency-tracking") + configureFlags=("--disable-dependency-tracking" "${configureFlags[@]}") fi fi # By default, disable static builds. if [ -z "${dontDisableStatic:-}" ]; then if [ -f "$configureScript" ] && grep -q enable-static "$configureScript"; then - configureFlags+=("--disable-static") + configureFlags=("--disable-static" "${configureFlags[@]}") fi fi From c02f88ddd4a814eb94f2c8fcd24172c38362ea23 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 26 Oct 2019 03:02:22 +0200 Subject: [PATCH 011/323] stdenv.mkDerivation: fix propagatedBuildOutputs --- .../setup-hooks/multiple-outputs.sh | 26 +------------------ pkgs/stdenv/generic/make-derivation.nix | 7 +++++ 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index fbe469fd46fd9..d7739a311ef9f 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -172,32 +172,8 @@ _multioutDevs() { _multioutPropagateDev() { if [ ${#outputs[@]} -eq 1 ]; then return; fi; - local outputFirst - for outputFirst in ${!outputs[@]}; do - break - done - local propagaterOutput="$outputDev" - if [ -z "$propagaterOutput" ]; then - propagaterOutput="$outputFirst" - fi - - # Default value: propagate binaries, includes and libraries - if [ -z "${propagatedBuildOutputs[@]+1}" ]; then - local po_dirty="$outputBin $outputInclude $outputLib" - set +o pipefail - propagatedBuildOutputs=($(echo "$po_dirty" \ - | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" \ - | sort -u | tr '\n' ' ')) - set -o pipefail - fi - - # The variable was explicitly set to empty or we resolved it so - if [ -z "${propagatedBuildOutputs[@]}" ]; then - return - fi - mkdir -p "${!propagaterOutput}"/nix-support for output in "${propagatedBuildOutputs[@]}"; do - echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs + echo -n " ${outputs[$output]}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs done } diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 924fbb8a46463..2d0a97851bc9f 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -181,6 +181,10 @@ in rec { lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists propagatedDependencies)); + propagaterOutput = if lib.elem "dev" outputs then "dev" else lib.head outputs; + propagatedBuildOutputs = attrs.propagatedBuildOutputs or + lib.filter (i: i != propagaterOutput && lib.elem i outputs) [ "out" "bin" "dev" "lib"]; + derivationArg = (removeAttrs attrs ["meta" "passthru" "pos" @@ -243,6 +247,9 @@ in rec { inherit doCheck doInstallCheck; inherit outputs; + + inherit propagaterOutput propagatedBuildOutputs; + } // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) { cmakeFlags = (/**/ if lib.isString cmakeFlags then [cmakeFlags] From 99300801446d59332271b0eea53841de30c43882 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 26 Oct 2019 03:03:24 +0200 Subject: [PATCH 012/323] stdenv.mkDerivation: filter null deps --- pkgs/stdenv/generic/make-derivation.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 2d0a97851bc9f..d9275610e6b9d 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -128,7 +128,9 @@ in rec { references = nativeBuildInputs ++ buildInputs ++ propagatedNativeBuildInputs ++ propagatedBuildInputs; - dependencies = map (map lib.chooseDevOutputs) [ + filterNull = ds: lib.filter (d: d != null) ds; + + dependencies = map (map filterNull) (map (map lib.chooseDevOutputs) [ [ (map (drv: drv.__spliced.buildBuild or drv) depsBuildBuild) (map (drv: drv.nativeDrv or drv) nativeBuildInputs @@ -145,8 +147,8 @@ in rec { [ (map (drv: drv.__spliced.targetTarget or drv) depsTargetTarget) ] - ]; - propagatedDependencies = map (map lib.chooseDevOutputs) [ + ]); + propagatedDependencies = map (map filterNull) (map (map lib.chooseDevOutputs) [ [ (map (drv: drv.__spliced.buildBuild or drv) depsBuildBuildPropagated) (map (drv: drv.nativeDrv or drv) propagatedNativeBuildInputs) @@ -159,7 +161,7 @@ in rec { [ (map (drv: drv.__spliced.targetTarget or drv) depsTargetTargetPropagated) ] - ]; + ]); computedSandboxProfile = lib.concatMap (input: input.__propagatedSandboxProfile or []) From 3f3f38eed646d2dadf45aa00d79b4f69aa6961e1 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 26 Oct 2019 03:04:19 +0200 Subject: [PATCH 013/323] stdenv.mkDerivation: fix input bash quoting --- pkgs/stdenv/generic/setup.sh | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 23839a125d6c5..ba29f6925bc0f 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -425,35 +425,22 @@ findInputs() { done } -depsBuildBuild=${depsBuildBuild+"${depsBuildBuild[@]}"} -depsBuildBuildPropagated=${depsBuildBuildPropagated+"${depsBuildBuildPropagated[@]}"} -nativeBuildInputs=${nativeBuildInputs+"${nativeBuildInputs[@]}"} -propagatedNativeBuildInputs=${propagatedNativeBuildInputs+"${propagatedNativeBuildInputs[@]}"} -depsBuildTarget=${depsBuildTarget+"${depsBuildTarget[@]}"} -depsBuildTargetPropagated=${depsBuildTargetPropagated+"${depsBuildTargetPropagated[@]}"} -depsHostHost=${depsHostHost+"${depsHostHost[@]}"} -depsHostHostPropagated=${depsHostHostPropagated+"${depsHostHostPropagated[@]}"} -buildInputs=${buildInputs+"${buildInputs[@]}"} -propagatedBuildInputs=${propagatedBuildInputs+"${propagatedBuildInputs[@]}"} -depsTargetTarget=${depsTargetTarget+"${depsTargetTarget[@]}"} -depsTargetTargetPropagated=${depsTargetTargetPropagated+"${depsTargetTargetPropagated[@]}"} - -for pkg in ${depsBuildBuild[@]} ${depsBuildBuildPropagated[@]}; do +for pkg in ${depsBuildBuild+"${depsBuildBuild[@]}"} ${depsBuildBuildPropagated+"${depsBuildBuildPropagated[@]}"}; do findInputs "$pkg" -1 -1 done -for pkg in ${nativeBuildInputs[@]} ${propagatedNativeBuildInputs[@]}; do +for pkg in ${nativeBuildInputs+"${nativeBuildInputs[@]}"} ${propagatedNativeBuildInputs+"${propagatedNativeBuildInputs[@]}"}; do findInputs "$pkg" -1 0 done -for pkg in ${depsBuildTarget[@]} ${depsBuildTargetPropagated[@]}; do +for pkg in ${depsBuildTarget+"${depsBuildTarget[@]}"} ${depsBuildTargetPropagated+"${depsBuildTargetPropagated[@]}"}; do findInputs "$pkg" -1 1 done -for pkg in ${depsHostHost[@]} ${depsHostHostPropagated[@]}; do +for pkg in ${depsHostHost+"${depsHostHost[@]}"} ${depsHostHostPropagated+"${depsHostHostPropagated[@]}"}; do findInputs "$pkg" 0 0 done -for pkg in ${buildInputs[@]} ${propagatedBuildInputs[@]} ; do +for pkg in ${buildInputs+"${buildInputs[@]}"} ${propagatedBuildInputs+"${propagatedBuildInputs[@]}"}; do findInputs "$pkg" 0 1 done -for pkg in ${depsTargetTarget[@]} ${depsTargetTargetPropagated[@]}; do +for pkg in ${depsTargetTarget+"${depsTargetTarget[@]}"} ${depsTargetTargetPropagated+"${depsTargetTargetPropagated[@]}"}; do findInputs "$pkg" 1 1 done # Default inputs must be processed last From 88d8f220849b003b9d17e211823d6c846ba894f6 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 26 Oct 2019 15:06:28 +0200 Subject: [PATCH 014/323] glibc: export BASH_SHELL for build --- pkgs/development/libraries/glibc/common.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 7f5dab1e22b18..e6e36cd6b4d6e 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -176,6 +176,7 @@ stdenv.mkDerivation ({ # Remove absolute paths from `configure' & co.; build out-of-tree. preConfigure = '' + export BASH_SHELL export PWD_P=$(type -tP pwd) for i in configure io/ftwtest-sh; do # Can't use substituteInPlace here because replace hasn't been From 1376983a85301e4da73615e5e6843562dafa759d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 26 Oct 2019 15:06:59 +0200 Subject: [PATCH 015/323] stdenv: debug clean-up --- pkgs/development/compilers/gcc/builder.sh | 2 -- pkgs/development/libraries/glibc/default.nix | 2 -- pkgs/stdenv/generic/setup.sh | 1 + 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index 3c69ce4fa0f71..5f47389377c11 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -2,8 +2,6 @@ if [ -e .attrs.sh ]; then source .attrs.sh; fi source $stdenv/setup -set -x - oldOpts="$(shopt -po nounset)" || true set -euo pipefail diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index 7672ed0555595..bbdc25b2cd91e 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -150,8 +150,6 @@ callPackage ./common.nix { inherit stdenv; } { mv $bin/bin/getconf_ $bin/bin/getconf ''; - doInstallCheck = true; - separateDebugInfo = true; meta.description = "The GNU C Library"; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index ba29f6925bc0f..8493661d526e1 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1,6 +1,7 @@ set -eu set -o pipefail +export NIX_DEBUG if (( "${NIX_DEBUG:-0}" >= 6 )); then set -x fi From e12ef00527d06e10739f1e36732d58ec750cbe79 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 26 Oct 2019 15:16:41 +0200 Subject: [PATCH 016/323] stdenv: fix propagatedBuildOutputs --- pkgs/stdenv/generic/make-derivation.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index d9275610e6b9d..e1faadda9a46a 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -185,7 +185,7 @@ in rec { propagaterOutput = if lib.elem "dev" outputs then "dev" else lib.head outputs; propagatedBuildOutputs = attrs.propagatedBuildOutputs or - lib.filter (i: i != propagaterOutput && lib.elem i outputs) [ "out" "bin" "dev" "lib"]; + (lib.filter (i: i != propagaterOutput && lib.elem i outputs) [ "out" "bin" "dev" "lib"]); derivationArg = (removeAttrs attrs From 7972a0ea9e9867c93eccc6b7e209a7e026f211a7 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 26 Oct 2019 15:35:48 +0200 Subject: [PATCH 017/323] treewide: *Flags are lists --- pkgs/stdenv/generic/make-derivation.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index e1faadda9a46a..8c0c6ea8186b8 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -91,6 +91,11 @@ in rec { , ... } @ attrs: + assert lib.isList configureFlags; + assert lib.isList cmakeFlags; + assert lib.isList (attrs.makeFlags or []); + assert lib.isList (attrs.checkFlags or []); + let # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when # no package has `doCheck = true`. From 3ae02e8eba7487ca8b26a6194f9986159a38219d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 26 Oct 2019 17:39:27 +0200 Subject: [PATCH 018/323] treewide: *Flags are lists, part 2 --- pkgs/build-support/substitute/substitute-all.sh | 2 ++ pkgs/stdenv/generic/make-derivation.nix | 7 +++---- pkgs/stdenv/generic/setup.sh | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/substitute/substitute-all.sh b/pkgs/build-support/substitute/substitute-all.sh index ec220481fcc09..e20fa41f135b7 100644 --- a/pkgs/build-support/substitute/substitute-all.sh +++ b/pkgs/build-support/substitute/substitute-all.sh @@ -1,3 +1,5 @@ +source .attrs.sh + source $stdenv/setup eval "$preInstall" diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 8c0c6ea8186b8..230637c817892 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -91,10 +91,12 @@ in rec { , ... } @ attrs: + assert lib.isList (attrs.buildFlags or []); assert lib.isList configureFlags; assert lib.isList cmakeFlags; assert lib.isList (attrs.makeFlags or []); assert lib.isList (attrs.checkFlags or []); + assert lib.isList (attrs.patchFlags or []); let # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when @@ -241,10 +243,7 @@ in rec { depsTargetTargetPropagated = lib.elemAt (lib.elemAt propagatedDependencies 2) 0; # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck - configureFlags = let inherit (lib) optional elem; in - (/**/ if lib.isString configureFlags then [configureFlags] - else if configureFlags == null then [] - else configureFlags) + configureFlags = let inherit (lib) elem optional; in configureFlags ++ optional (elem "build" configurePlatforms) "--build=${stdenv.buildPlatform.config}" ++ optional (elem "host" configurePlatforms) "--host=${stdenv.hostPlatform.config}" ++ optional (elem "target" configurePlatforms) "--target=${stdenv.targetPlatform.config}"; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 8493661d526e1..79c43ed96b4da 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -929,7 +929,7 @@ patchPhase() { esac # "2>&1" is a hack to make patch fail if the decompressor fails (nonexistent patch, etc.) # shellcheck disable=SC2086 - $uncompress < "$i" 2>&1 | patch ${patchFlags:--p1} + $uncompress < "$i" 2>&1 | patch "${patchFlags[@]:--p1}" done runHook postPatch From ceb5346aaefbd86ff9cabd657c947eed735326c7 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 27 Oct 2019 11:00:00 +0100 Subject: [PATCH 019/323] ruby: workaround __toString issue with toJSON revert after nixos/nix#3167 is released --- pkgs/development/interpreters/ruby/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 58ccf5ae9b413..607beb35f075d 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -25,6 +25,7 @@ let generic = { version, sha256 }: let ver = version; + versionString = version.__toString version; tag = ver.gitTag; atLeast25 = lib.versionAtLeast ver.majMin "2.5"; atLeast27 = lib.versionAtLeast ver.majMin "2.7"; @@ -57,7 +58,7 @@ let }: stdenv.mkDerivation rec { pname = "ruby"; - inherit version; + version = versionString; src = if useRailsExpress then fetchFromGitHub { owner = "ruby"; From d9d7df9300280effa0189ee64dfafaf1dea9188c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 27 Oct 2019 22:27:27 +0100 Subject: [PATCH 020/323] pyside: fix syntax --- pkgs/stdenv/generic/setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 79c43ed96b4da..a76f0812607c1 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1013,6 +1013,7 @@ buildPhase() { SHELL=$SHELL ${makeFlags[@]} ${makeFlagsArray+"${makeFlagsArray[@]}"} ${buildFlags+"${buildFlags[@]}"} ${buildFlagsArray+"${buildFlagsArray[@]}"} + ${buildTargets+"${buildTargets[@]}"} ) echoCmd 'build flags' "${flagsArray[@]}" From 0bd4bc8ac16851911893ef7fe7e55874f5ff5082 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 29 Oct 2019 23:20:05 +0100 Subject: [PATCH 021/323] buildenv: use .attrs.json --- pkgs/build-support/buildenv/builder.pl | 30 +++++++++---------------- pkgs/build-support/buildenv/default.nix | 8 ++++--- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/pkgs/build-support/buildenv/builder.pl b/pkgs/build-support/buildenv/builder.pl index fc6ffce735cc3..2134435acfd30 100755 --- a/pkgs/build-support/buildenv/builder.pl +++ b/pkgs/build-support/buildenv/builder.pl @@ -6,13 +6,15 @@ use File::Path; use File::Basename; use File::Compare; +use File::Slurp qw(read_file); use JSON::PP; STDOUT->autoflush(1); -my $out = $ENV{"out"}; +my $nixAttrs = decode_json(read_file(".attrs.json")); +my $out = $nixAttrs->{outputs}->{out}; -my @pathsToLink = split ' ', $ENV{"pathsToLink"}; +my @pathsToLink = @{$nixAttrs->{pathsToLink}}; sub isInPathsToLink { my $path = shift; @@ -176,24 +178,13 @@ sub addPkg { } } -# Read packages list. -my $pkgs; - -if (exists $ENV{"pkgsPath"}) { - open FILE, $ENV{"pkgsPath"}; - $pkgs = ; - close FILE; -} else { - $pkgs = $ENV{"pkgs"} -} - # Symlink to the packages that have been installed explicitly by the # user. -for my $pkg (@{decode_json $pkgs}) { +for my $pkg (@{$nixAttrs->{pkgs}}) { for my $path (@{$pkg->{paths}}) { addPkg($path, - $ENV{"ignoreCollisions"} eq "1", - $ENV{"checkCollisionContents"} eq "1", + $nixAttrs->{ignoreCollisions}, + $nixAttrs->{checkCollisionContents}, $pkg->{priority}) if -e $path; } @@ -209,13 +200,12 @@ sub addPkg { my @pkgDirs = keys %postponed; %postponed = (); foreach my $pkgDir (sort @pkgDirs) { - addPkg($pkgDir, 2, $ENV{"checkCollisionContents"} eq "1", $priorityCounter++); + addPkg($pkgDir, 2, $nixAttrs->{"checkCollisionContents"}, $priorityCounter++); } } - # Create the symlinks. -my $extraPrefix = $ENV{"extraPrefix"}; +my $extraPrefix = $nixAttrs->{extraPrefix}; my $nrLinks = 0; foreach my $relName (sort keys %symlinks) { my ($target, $priority) = @{$symlinks{$relName}}; @@ -236,7 +226,7 @@ sub addPkg { print STDERR "created $nrLinks symlinks in user environment\n"; -my $manifest = $ENV{"manifest"}; +my $manifest = $nixAttrs->{manifest}; if ($manifest) { symlink($manifest, "$out/manifest") or die "cannot create manifest"; } diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix index 7f2427777f922..d9625edfae72c 100644 --- a/pkgs/build-support/buildenv/default.nix +++ b/pkgs/build-support/buildenv/default.nix @@ -48,13 +48,14 @@ let src = ./builder.pl; inherit (builtins) storeDir; }; + perlPkgs = buildPackages.perlPackages; in runCommand name rec { inherit manifest ignoreCollisions checkCollisionContents passthru meta pathsToLink extraPrefix postBuild buildInputs; - pkgs = builtins.toJSON (map (drv: { + pkgs = map (drv: { paths = # First add the usual output(s): respect if user has chosen explicitly, # and otherwise use `meta.outputsToInstall`. The attribute is guaranteed @@ -68,13 +69,14 @@ runCommand name ++ lib.filter (p: p!=null) (builtins.map (outName: drv.${outName} or null) extraOutputsToInstall); priority = drv.meta.priority or 5; - }) paths); + }) paths; preferLocalBuild = true; allowSubstitutes = false; # XXX: The size is somewhat arbitrary - passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else null; } '' + source .attrs.sh + export PERL5LIB=${perlPkgs.makePerlPath (with perlPkgs; [ FileSlurp ])} ${buildPackages.perl}/bin/perl -w ${builder} eval "$postBuild" '') From 2691d796d1ec4f2d2025fac28697cb2c49c11613 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 29 Oct 2019 23:21:41 +0100 Subject: [PATCH 022/323] nukeReferences: __structuredAttrs compat --- pkgs/build-support/nuke-references/builder.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/build-support/nuke-references/builder.sh b/pkgs/build-support/nuke-references/builder.sh index 7da322032185d..699f011409d3e 100644 --- a/pkgs/build-support/nuke-references/builder.sh +++ b/pkgs/build-support/nuke-references/builder.sh @@ -1,3 +1,5 @@ +source .attrs.sh + source $stdenv/setup mkdir -p $out/bin From 5847cf2f07a7dc79ef754c87301083d4ad36500f Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 29 Oct 2019 23:22:21 +0100 Subject: [PATCH 023/323] libxml2: fix pythonSupport buildEnv postStart --- pkgs/top-level/all-packages.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2194fcbc56c9e..a5b105adefbc7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13098,7 +13098,8 @@ in inherit (libxml2) passthru; # the hook to find catalogs is hidden by buildEnv postBuild = '' - mkdir "$out/nix-support" + out="''${outputs[out]}" + mkdir -p "$out/nix-support" cp '${libxml2.dev}/nix-support/propagated-build-inputs' "$out/nix-support/" ''; }; From 4a58d6e06983e57613d6e85d5363af7d965780f5 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 30 Oct 2019 00:40:50 +0100 Subject: [PATCH 024/323] mkDerivation: assert NIX_*_FLAGS are strings --- pkgs/stdenv/generic/make-derivation.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 230637c817892..90707a1bc7c17 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -97,6 +97,9 @@ in rec { assert lib.isList (attrs.makeFlags or []); assert lib.isList (attrs.checkFlags or []); assert lib.isList (attrs.patchFlags or []); + assert lib.isString (attrs.NIX_LDFLAGS or ""); + assert lib.isString (attrs.NIX_CFLAGS_COMPILE or ""); + assert lib.isString (attrs.NIX_CFLAGS_LINK or ""); let # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when From 983382de5b67a37b050acdd08aca8c6fde4e9f3a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 30 Oct 2019 02:44:54 +0100 Subject: [PATCH 025/323] glibcLocales: inline builder --- .../libraries/glibc/locales-builder.sh | 17 ----------------- pkgs/development/libraries/glibc/locales.nix | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 19 deletions(-) delete mode 100644 pkgs/development/libraries/glibc/locales-builder.sh diff --git a/pkgs/development/libraries/glibc/locales-builder.sh b/pkgs/development/libraries/glibc/locales-builder.sh deleted file mode 100644 index d732e208fa22a..0000000000000 --- a/pkgs/development/libraries/glibc/locales-builder.sh +++ /dev/null @@ -1,17 +0,0 @@ -# Glibc cannot have itself in its RPATH. -export NIX_NO_SELF_RPATH=1 - -source $stdenv/setup - -postConfigure() { - # Hack: get rid of the `-static' flag set by the bootstrap stdenv. - # This has to be done *after* `configure' because it builds some - # test binaries. - export NIX_CFLAGS_LINK= - export NIX_LDFLAGS_BEFORE= - - export NIX_DONT_SET_RPATH=1 - unset CFLAGS -} - -genericBuild diff --git a/pkgs/development/libraries/glibc/locales.nix b/pkgs/development/libraries/glibc/locales.nix index 0dc191974155c..3fd1bdb3c41f3 100644 --- a/pkgs/development/libraries/glibc/locales.nix +++ b/pkgs/development/libraries/glibc/locales.nix @@ -13,10 +13,21 @@ callPackage ./common.nix { inherit stdenv; } { name = "glibc-locales"; - builder = ./locales-builder.sh; - outputs = [ "out" ]; + NIX_NO_SELF_RPATH = 1; + + # Hack: get rid of the `-static' flag set by the bootstrap stdenv. + # This has to be done *after* `configure' because it builds some + # test binaries. + postConfigure = '' + export NIX_CFLAGS_LINK= + export NIX_LDFLAGS_BEFORE= + + export NIX_DONT_SET_RPATH=1 + unset CFLAGS + ''; + # Awful hack: `localedef' doesn't allow the path to `locale-archive' # to be overriden, but you *can* specify a prefix, i.e. it will use # //lib/locale/locale-archive. So we use From 5bdefbb7818a67051a8588b929f38d1e64ccd7b9 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 30 Oct 2019 02:53:09 +0100 Subject: [PATCH 026/323] stdenv: export NIX_*FLAGS --- pkgs/stdenv/generic/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index a76f0812607c1..187ef9cbd506d 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1,7 +1,7 @@ set -eu set -o pipefail -export NIX_DEBUG +export NIX_DEBUG NIX_LDFLAGS NIX_CFLAGS_COMPILE NIX_CFLAGS_LINK if (( "${NIX_DEBUG:-0}" >= 6 )); then set -x fi From 9b2f6f87b6ff6b2f956b8f65b4c46f15865f4a30 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 30 Oct 2019 12:54:39 +0100 Subject: [PATCH 027/323] treewide: fix flags types --- pkgs/os-specific/linux/amdgpu-pro/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/amdgpu-pro/default.nix b/pkgs/os-specific/linux/amdgpu-pro/default.nix index b72944a49eb19..18b7f047538af 100644 --- a/pkgs/os-specific/linux/amdgpu-pro/default.nix +++ b/pkgs/os-specific/linux/amdgpu-pro/default.nix @@ -75,7 +75,7 @@ in stdenv.mkDerivation rec { preBuild = optionalString (!libsOnly) '' pushd usr/src/amdgpu-${build} - makeFlags="$makeFlags M=$(pwd)" + makeFlags+=("M=$(pwd)") patchShebangs pre-build.sh ./pre-build.sh ${kernel.version} popd @@ -96,7 +96,7 @@ in stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = "-Werror"; - makeFlags = optionalString (!libsOnly) + makeFlags = optional (!libsOnly) "-C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build modules"; depLibPath = makeLibraryPath [ From 02df34044c296f44512d3d6911385f8ee78e3932 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 30 Oct 2019 13:38:26 +0100 Subject: [PATCH 028/323] xorg.*: source .attrs.sh --- pkgs/servers/x11/xorg/builder.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/x11/xorg/builder.sh b/pkgs/servers/x11/xorg/builder.sh index 5a832cb14d539..98e4685d4bd46 100644 --- a/pkgs/servers/x11/xorg/builder.sh +++ b/pkgs/servers/x11/xorg/builder.sh @@ -1,4 +1,5 @@ # This is the builder for all X.org components. +source .attrs.sh source $stdenv/setup @@ -27,7 +28,7 @@ postInstall() { } -installFlags="appdefaultdir=$out/share/X11/app-defaults $installFlags" +installFlags+=("appdefaultdir=$out/share/X11/app-defaults") if test -n "$x11BuildHook"; then From 225317351a53a5e0cb1ff563da153d58a91f87c8 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 30 Oct 2019 23:57:04 +0100 Subject: [PATCH 029/323] mkDerivation: fix $srcs handling --- pkgs/stdenv/generic/setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 187ef9cbd506d..6d2a88281c3d0 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -839,13 +839,13 @@ unpackFile() { unpackPhase() { runHook preUnpack - if [ -z "${srcs:-}" ]; then + if [ -z ${srcs+"${srcs[@]}"} ]; then if [ -z "${src:-}" ]; then # shellcheck disable=SC2016 echo 'variable $src or $srcs should point to the source' exit 1 fi - srcs="$src" + srcs=("$src") fi # To determine the source directory created by unpacking the @@ -860,7 +860,7 @@ unpackPhase() { done # Unpack all source archives. - for i in $srcs; do + for i in "${srcs[@]}"; do unpackFile "$i" done From f246ce0bf315a2a2b05f0b76258dadf176cb95a1 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 31 Oct 2019 02:16:54 +0100 Subject: [PATCH 030/323] tzdata: handle structuredAttrs --- pkgs/data/misc/tzdata/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/data/misc/tzdata/default.nix b/pkgs/data/misc/tzdata/default.nix index 3227d9a76235b..51c5fab9a78bb 100644 --- a/pkgs/data/misc/tzdata/default.nix +++ b/pkgs/data/misc/tzdata/default.nix @@ -16,6 +16,7 @@ stdenv.mkDerivation rec { ]; sourceRoot = "."; + dontMakeSourcesWritable = true; outputs = [ "out" "bin" "man" "dev" ]; propagatedBuildOutputs = []; @@ -44,7 +45,7 @@ stdenv.mkDerivation rec { preInstall = '' mv zic.o zic.o.orig mv zic zic.orig - make $makeFlags cc=cc AR=ar zic + make "''${makeFlags[@]}" cc=cc AR=ar zic mv zic zic-native mv zic.o.orig zic.o mv zic.orig zic From 5916d4eb9ac24b09b883d764365e7189c8f4ba92 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 1 Nov 2019 21:44:21 +0000 Subject: [PATCH 031/323] WIP: stdenv: Fix bash for more set -u + structured attrs --- pkgs/build-support/setup-hooks/multiple-outputs.sh | 2 +- pkgs/stdenv/generic/setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index d7739a311ef9f..0a6e16011b077 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -173,7 +173,7 @@ _multioutPropagateDev() { if [ ${#outputs[@]} -eq 1 ]; then return; fi; mkdir -p "${!propagaterOutput}"/nix-support - for output in "${propagatedBuildOutputs[@]}"; do + for output in "${propagatedBuildOutputs[@]+${propagatedBuildOutputs[@]}}"; do echo -n " ${outputs[$output]}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs done } diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 6d2a88281c3d0..1d24ca339fcdf 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1132,7 +1132,7 @@ fixupPhase() { local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]" local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}" - [[ "${!propagatedInputsSlice}" ]] || continue + [[ "${!propagatedInputsSlice-}" ]] || continue mkdir -p "${!outputDev}/nix-support" # shellcheck disable=SC2086 From aaca94ce7c41bc786e0f63404ee85eb2a88e379e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 2 Nov 2019 13:12:56 +0100 Subject: [PATCH 032/323] unbound: fix --- pkgs/tools/networking/unbound/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/networking/unbound/default.nix b/pkgs/tools/networking/unbound/default.nix index 18d9defdd9462..019cec034c2a9 100644 --- a/pkgs/tools/networking/unbound/default.nix +++ b/pkgs/tools/networking/unbound/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { # This avoids gnutls.out -> unbound.lib -> openssl.out. # There was some problem with this on Darwin; let's not complicate non-Linux. '' - configureFlags="$configureFlags --with-nettle=${nettle.dev} --with-libunbound-only" + configureFlags+=("--with-nettle=${nettle.dev}" "--with-libunbound-only") configurePhase buildPhase installPhase From 9786455bf02904420172362001849d6ceda2e037 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 3 Nov 2019 22:57:05 +0100 Subject: [PATCH 033/323] stdenv: installTargets is a list --- pkgs/os-specific/linux/kernel-headers/default.nix | 2 +- pkgs/stdenv/generic/make-derivation.nix | 1 + pkgs/stdenv/generic/setup.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index b5d4c11de272d..8b7445a4fbf98 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -41,7 +41,7 @@ let # for darwin cross. @Ericson2314 has no idea why. buildFlags = [ "headers_install" ]; checkTarget = [ "headers_check" ]; - installTargets = "headers_install"; + installTargets = [ "headers_install" ]; installFlags = [ "INSTALL_HDR_PATH=${placeholder "out"}" ]; # Skip clean on darwin, case-sensitivity issues. diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 90707a1bc7c17..fc14f8b72f9c5 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -97,6 +97,7 @@ in rec { assert lib.isList (attrs.makeFlags or []); assert lib.isList (attrs.checkFlags or []); assert lib.isList (attrs.patchFlags or []); + assert lib.isList (attrs.installTargets or []); assert lib.isString (attrs.NIX_LDFLAGS or ""); assert lib.isString (attrs.NIX_CFLAGS_COMPILE or ""); assert lib.isString (attrs.NIX_CFLAGS_LINK or ""); diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 1d24ca339fcdf..f54d8daa6a1b4 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1079,7 +1079,7 @@ installPhase() { SHELL=$SHELL ${makeFlags[@]} ${makeFlagsArray+"${makeFlagsArray[@]}"} ${installFlags+"${installFlags[@]}"} ${installFlagsArray+"${installFlagsArray[@]}"} - ${installTargets:-install} + "${installTargets[@]:-install}" ) echoCmd 'install flags' "${flagsArray[@]}" From fcf30f4776301222241e7909b3bb25c0dd3431ef Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 3 Nov 2019 23:00:06 +0100 Subject: [PATCH 034/323] linux-pam: fix configureFlags --- pkgs/os-specific/linux/pam/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix index d1a035d744807..0fd2ba7b9a530 100644 --- a/pkgs/os-specific/linux/pam/default.nix +++ b/pkgs/os-specific/linux/pam/default.nix @@ -45,13 +45,13 @@ stdenv.mkDerivation rec { # $out/etc was also missed: pam_env(login:session): Unable to open config file preConfigure = '' - configureFlags="$configureFlags --includedir=$out/include/security" + configureFlags+=("--includedir=$out/include/security") '' + stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") '' - # export ac_cv_search_crypt=no - # (taken from Alpine linux, apparently insecure but also doesn't build O:)) - # disable insecure modules - # sed -e 's/pam_rhosts//g' -i modules/Makefile.am - sed -e 's/pam_rhosts//g' -i modules/Makefile.in + # export ac_cv_search_crypt=no + # (taken from Alpine linux, apparently insecure but also doesn't build O:)) + # disable insecure modules + # sed -e 's/pam_rhosts//g' -i modules/Makefile.am + sed -e 's/pam_rhosts//g' -i modules/Makefile.in ''; doCheck = false; # fails From 2351f2049e9a8adf39a3b11dbfb840f5b434460e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 3 Nov 2019 23:00:32 +0100 Subject: [PATCH 035/323] stdenv: fix srcs handling --- pkgs/stdenv/generic/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index f54d8daa6a1b4..01c3e6f8abd08 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -839,7 +839,7 @@ unpackFile() { unpackPhase() { runHook preUnpack - if [ -z ${srcs+"${srcs[@]}"} ]; then + if [ -z ${srcs-"${srcs[@]}"} ]; then if [ -z "${src:-}" ]; then # shellcheck disable=SC2016 echo 'variable $src or $srcs should point to the source' From 088ad200fef52dda79a198e4daf6ebff12805ae2 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 4 Nov 2019 14:21:08 +0100 Subject: [PATCH 036/323] python: temporary export hack probably add mkDerivation.env attrs to be exported --- pkgs/development/interpreters/python/cpython/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index e75bd0a09875e..e229ead122072 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -178,6 +178,7 @@ in with passthru; stdenv.mkDerivation { for i in /usr /sw /opt /pkg; do # improve purity substituteInPlace ./setup.py --replace $i /no-such-path done + export LIBS LDFLAGS CPPFLAGS PYTHONHASHSEED '' + optionalString stdenv.isDarwin '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -msse2" export MACOSX_DEPLOYMENT_TARGET=10.6 From 15cc5faba579a2f7d23617a802dc6b024ba200b7 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 4 Nov 2019 14:21:57 +0100 Subject: [PATCH 037/323] pythonImportsCheck: fix for structured attrs --- .../interpreters/python/hooks/python-imports-check-hook.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh index 0fc55145a8ebc..de50ab80bf995 100644 --- a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh @@ -4,9 +4,10 @@ echo "Sourcing python-imports-check-hook.sh" pythonImportsCheckPhase () { echo "Executing pythonImportsCheckPhase" - if [ -n "$pythonImportsCheck" ]; then - echo "Check whether the following modules can be imported: $pythonImportsCheck" - cd $out && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"pythonImportsCheck\"].split()))'" + if [ -n "${pythonImportsCheck[@]-}" ]; then + echo "Check whether the following modules can be imported: ${pythonImportsCheck[@]}" + export PYTHON_IMPORTS_CHECK="${pythonImportsCheck[@]}" + cd $out && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"PYTHON_IMPORTS_CHECK\"].split()))'" fi } From f443ee29646c1ef657202a4674b2c807305f2f30 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 4 Nov 2019 14:22:19 +0100 Subject: [PATCH 038/323] treewide: remove some unneeded phases --- pkgs/development/libraries/apache-activemq/default.nix | 2 -- pkgs/servers/sql/sqlite/jdbc/default.nix | 2 -- 2 files changed, 4 deletions(-) diff --git a/pkgs/development/libraries/apache-activemq/default.nix b/pkgs/development/libraries/apache-activemq/default.nix index 9fc11555b697c..9cb6bfdc93769 100644 --- a/pkgs/development/libraries/apache-activemq/default.nix +++ b/pkgs/development/libraries/apache-activemq/default.nix @@ -9,8 +9,6 @@ stdenv.mkDerivation rec { url = "mirror://apache/activemq/${version}/${pname}-${version}-bin.tar.gz"; }; - phases = [ "unpackPhase" "installPhase" ]; - installPhase = '' mkdir -p $out mv * $out/ diff --git a/pkgs/servers/sql/sqlite/jdbc/default.nix b/pkgs/servers/sql/sqlite/jdbc/default.nix index f5444bb068368..94d25b3a37afd 100644 --- a/pkgs/servers/sql/sqlite/jdbc/default.nix +++ b/pkgs/servers/sql/sqlite/jdbc/default.nix @@ -11,8 +11,6 @@ stdenv.mkDerivation rec { sha256 = "1xk5fi2wzq3jspvbdm5hvs78501i14jy3v7x6fjnh5fnpqdacpd4"; }; - phases = [ "installPhase" ]; - installPhase = '' install -m444 -D ${src}/share/java/*${pname}-${version}.jar "$out/share/java/${pname}-${version}.jar" ''; From 097d5862031ba75ab4cac8b2018cd7634de0e5fd Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 4 Nov 2019 14:22:37 +0100 Subject: [PATCH 039/323] bootstrapped-pip: fix with structured-attrs --- .../python-modules/bootstrapped-pip/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/bootstrapped-pip/default.nix b/pkgs/development/python-modules/bootstrapped-pip/default.nix index 8bb713b764161..a9d4b399c6275 100644 --- a/pkgs/development/python-modules/bootstrapped-pip/default.nix +++ b/pkgs/development/python-modules/bootstrapped-pip/default.nix @@ -11,6 +11,7 @@ stdenv.mkDerivation rec { srcs = [ wheel.src pip.src setuptools.src ]; sourceRoot = "."; + dontMakeSourcesWritable = true; dontUseSetuptoolsBuild = true; dontUsePipInstall = true; @@ -21,16 +22,17 @@ stdenv.mkDerivation rec { (pipInstallHook.override{pip=null;}) (setuptoolsBuildHook.override{setuptools=null; wheel=null;}) ]; + nativeBuildInputs = [ makeWrapper unzip ]; + buildInputs = [ python ]; + + postUnpack = '' + chmod -R u+w * + ''; postPatch = '' mkdir -p $out/bin ''; - nativeBuildInputs = [ makeWrapper unzip ]; - buildInputs = [ python ]; - - buildPhase = ":"; - installPhase = stdenv.lib.strings.optionalString (!stdenv.hostPlatform.isWindows) '' export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0 '' + '' From 64037516dbb13d49735b213b24e2213c24bf5776 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 4 Nov 2019 15:21:50 +0100 Subject: [PATCH 040/323] python: temporary export hack --- pkgs/development/interpreters/python/cpython/2.7/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index e6b3dff433b3a..8a9eca8ddd7a2 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -124,6 +124,7 @@ let for i in /usr /sw /opt /pkg; do substituteInPlace ./setup.py --replace $i /no-such-path done + export LDFLAGS DETERMINISTIC_BUILD C_INCLUDE_PATH LIBRARY_PATH; '' + optionalString (stdenv ? cc && stdenv.cc.libc != null) '' for i in Lib/plat-*/regen; do substituteInPlace $i --replace /usr/include/ ${stdenv.cc.libc}/include/ From 6a2c8c060633965d6d26e92c600bec26b13b2061 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 4 Nov 2019 15:22:15 +0100 Subject: [PATCH 041/323] meson: fix for structured attrs --- .../tools/build-managers/meson/setup-hook.sh | 33 ++++++++++--------- pkgs/os-specific/linux/systemd/default.nix | 3 +- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/pkgs/development/tools/build-managers/meson/setup-hook.sh b/pkgs/development/tools/build-managers/meson/setup-hook.sh index 8d76ecdaf32ba..5cf3109f6e5d5 100644 --- a/pkgs/development/tools/build-managers/meson/setup-hook.sh +++ b/pkgs/development/tools/build-managers/meson/setup-hook.sh @@ -2,7 +2,7 @@ mesonConfigurePhase() { runHook preConfigure if [ -z "${dontAddPrefix-}" ]; then - mesonFlags="--prefix=$prefix $mesonFlags" + mesonFlags=("--prefix=$prefix" ${mesonFlags[@]+"${mesonFlags[@]}"}) fi # Build release by default. @@ -11,21 +11,22 @@ mesonConfigurePhase() { fi # See multiple-outputs.sh and meson’s coredata.py - mesonFlags="\ - --libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \ - --bindir=${!outputBin}/bin --sbindir=${!outputBin}/sbin \ - --includedir=${!outputInclude}/include \ - --mandir=${!outputMan}/share/man --infodir=${!outputInfo}/share/info \ - --localedir=${!outputLib}/share/locale \ - -Dauto_features=${mesonAutoFeatures:-enabled} \ - -Dwrap_mode=${mesonWrapMode:-nodownload} \ - $mesonFlags" - - mesonFlags="${crossMesonFlags+$crossMesonFlags }--buildtype=${mesonBuildType:-plain} $mesonFlags" - - echo "meson flags: $mesonFlags ${mesonFlagsArray[@]}" - - CC=@cc@/bin/cc CXX=@cc@/bin/c++ meson build $mesonFlags "${mesonFlagsArray[@]}" + mesonFlags=( + "--libdir=${!outputLib}/lib" "--libexecdir=${!outputLib}/libexec" + "--bindir=${!outputBin}/bin" "--sbindir=${!outputBin}/sbin" + "--includedir=${!outputInclude}/include" + "--mandir=${!outputMan}/share/man" "--infodir=${!outputInfo}/share/info" + "--localedir=${!outputLib}/share/locale" + "-Dauto_features=${mesonAutoFeatures:-enabled}" + "-Dwrap_mode=${mesonWrapMode:-nodownload}" + ${mesonFlags[@]+"${mesonFlags[@]}"} + ) + + mesonFlags=(${crossMesonFlags+"$crossMesonFlags"} "--buildtype=${mesonBuildType:-plain}" "${mesonFlags[@]}") + + echo "meson flags: ${mesonFlags[@]}" + + CC=@cc@/bin/cc CXX=@cc@/bin/c++ meson build "${mesonFlags[@]}" cd build if ! [[ -v enableParallelBuilding ]]; then diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 3462801c07c46..5ba7f28092af9 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -133,10 +133,11 @@ in stdenv.mkDerivation { # Upstream defaulted to disable manpages since they optimize for the much # more frequent development builds "-Dman=true" + + "-Dntp-servers=\"0.nixos.pool.ntp.org 1.nixos.pool.ntp.org 2.nixos.pool.ntp.org 3.nixos.pool.ntp.org\"" ]; preConfigure = '' - mesonFlagsArray+=(-Dntp-servers="0.nixos.pool.ntp.org 1.nixos.pool.ntp.org 2.nixos.pool.ntp.org 3.nixos.pool.ntp.org") export LC_ALL="en_US.UTF-8"; # FIXME: patch this in systemd properly (and send upstream). # already fixed in f00929ad622c978f8ad83590a15a765b4beecac9: (u)mount From 49b60c20155d14e223425b47ec7f5be3713d89da Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 4 Nov 2019 21:10:12 +0100 Subject: [PATCH 042/323] ghc8XX-binary: temporary export hack --- pkgs/development/compilers/ghc/8.2.2-binary.nix | 3 +++ pkgs/development/compilers/ghc/8.6.3-binary.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pkgs/development/compilers/ghc/8.2.2-binary.nix b/pkgs/development/compilers/ghc/8.2.2-binary.nix index d68bf7e24b5e0..d740decafe83f 100644 --- a/pkgs/development/compilers/ghc/8.2.2-binary.nix +++ b/pkgs/development/compilers/ghc/8.2.2-binary.nix @@ -60,6 +60,9 @@ stdenv.mkDerivation rec { ${libEnvVar} = libPath; postUnpack = + '' + export ${libEnvVar} + '' + # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib # during linking stdenv.lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/compilers/ghc/8.6.3-binary.nix b/pkgs/development/compilers/ghc/8.6.3-binary.nix index 152bd5e4874c7..da807042b4e97 100644 --- a/pkgs/development/compilers/ghc/8.6.3-binary.nix +++ b/pkgs/development/compilers/ghc/8.6.3-binary.nix @@ -52,6 +52,9 @@ stdenv.mkDerivation rec { ${libEnvVar} = libPath; postUnpack = + '' + export ${libEnvVar} + '' + # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib # during linking stdenv.lib.optionalString stdenv.isDarwin '' From e36332b754451be65ad095074265f272ca56e6d2 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 5 Nov 2019 00:23:02 +0100 Subject: [PATCH 043/323] cmake: fix for structured attrs --- .../tools/build-managers/cmake/setup-hook.sh | 122 +++++++++--------- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index 6f3d33bcaa7cb..9356ec0633a52 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -31,7 +31,7 @@ cmakeConfigurePhase() { fi if [ -z "${dontAddPrefix-}" ]; then - cmakeFlags="-DCMAKE_INSTALL_PREFIX=$prefix $cmakeFlags" + cmakeFlags=("-DCMAKE_INSTALL_PREFIX=$prefix" ${cmakeFlags[@]+"${cmakeFlags[@]}"}) fi # We should set the proper `CMAKE_SYSTEM_NAME`. @@ -40,72 +40,76 @@ cmakeConfigurePhase() { # Unfortunately cmake seems to expect absolute paths for ar, ranlib, and # strip. Otherwise they are taken to be relative to the source root of the # package being built. - cmakeFlags="-DCMAKE_CXX_COMPILER=$CXX $cmakeFlags" - cmakeFlags="-DCMAKE_C_COMPILER=$CC $cmakeFlags" - cmakeFlags="-DCMAKE_AR=$(command -v $AR) $cmakeFlags" - cmakeFlags="-DCMAKE_RANLIB=$(command -v $RANLIB) $cmakeFlags" - cmakeFlags="-DCMAKE_STRIP=$(command -v $STRIP) $cmakeFlags" - - # on macOS we want to prefer Unix-style headers to Frameworks - # because we usually do not package the framework - cmakeFlags="-DCMAKE_FIND_FRAMEWORK=last $cmakeFlags" - - # we never want to use the global macOS SDK - cmakeFlags="-DCMAKE_OSX_SYSROOT= $cmakeFlags" - - # disable OSX deployment target - # we don't want our binaries to have a "minimum" OSX version - cmakeFlags="-DCMAKE_OSX_DEPLOYMENT_TARGET= $cmakeFlags" - - # correctly detect our clang compiler - cmakeFlags="-DCMAKE_POLICY_DEFAULT_CMP0025=NEW $cmakeFlags" - - # This installs shared libraries with a fully-specified install - # name. By default, cmake installs shared libraries with just the - # basename as the install name, which means that, on Darwin, they - # can only be found by an executable at runtime if the shared - # libraries are in a system path or in the same directory as the - # executable. This flag makes the shared library accessible from its - # nix/store directory. - cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=${!outputLib}/lib $cmakeFlags" - - # This ensures correct paths with multiple output derivations - # It requires the project to use variables from GNUInstallDirs module - # https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html - cmakeFlags="-DCMAKE_INSTALL_BINDIR=${!outputBin}/bin $cmakeFlags" - cmakeFlags="-DCMAKE_INSTALL_SBINDIR=${!outputBin}/sbin $cmakeFlags" - cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputInclude}/include $cmakeFlags" - cmakeFlags="-DCMAKE_INSTALL_OLDINCLUDEDIR=${!outputInclude}/include $cmakeFlags" - cmakeFlags="-DCMAKE_INSTALL_MANDIR=${!outputMan}/share/man $cmakeFlags" - cmakeFlags="-DCMAKE_INSTALL_INFODIR=${!outputInfo}/share/info $cmakeFlags" - cmakeFlags="-DCMAKE_INSTALL_DOCDIR=${!outputDoc}/share/doc/${shareDocName} $cmakeFlags" - cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags" - cmakeFlags="-DCMAKE_INSTALL_LIBEXECDIR=${!outputLib}/libexec $cmakeFlags" - cmakeFlags="-DCMAKE_INSTALL_LOCALEDIR=${!outputLib}/share/locale $cmakeFlags" + cmakeFlags=( + "-DCMAKE_CXX_COMPILER=$CXX" + "-DCMAKE_C_COMPILER=$CC" + "-DCMAKE_AR=$(command -v $AR)" + "-DCMAKE_RANLIB=$(command -v $RANLIB)" + "-DCMAKE_STRIP=$(command -v $STRIP)" + + # on macOS we want to prefer Unix-style headers to Frameworks + # because we usually do not package the framework + "-DCMAKE_FIND_FRAMEWORK=last" + + # we never want to use the global macOS SDK + "-DCMAKE_OSX_SYSROOT=" + + # disable OSX deployment target + # we don't want our binaries to have a "minimum" OSX version + "-DCMAKE_OSX_DEPLOYMENT_TARGET=" + + # correctly detect our clang compiler + "-DCMAKE_POLICY_DEFAULT_CMP0025=NEW" + + # This installs shared libraries with a fully-specified install + # name. By default, cmake installs shared libraries with just the + # basename as the install name, which means that, on Darwin, they + # can only be found by an executable at runtime if the shared + # libraries are in a system path or in the same directory as the + # executable. This flag makes the shared library accessible from its + # nix/store directory. + "-DCMAKE_INSTALL_NAME_DIR=${!outputLib}/lib" + + # This ensures correct paths with multiple output derivations + # It requires the project to use variables from GNUInstallDirs module + # https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html + "-DCMAKE_INSTALL_BINDIR=${!outputBin}/bin" + "-DCMAKE_INSTALL_SBINDIR=${!outputBin}/sbin" + "-DCMAKE_INSTALL_INCLUDEDIR=${!outputInclude}/include" + "-DCMAKE_INSTALL_OLDINCLUDEDIR=${!outputInclude}/include" + "-DCMAKE_INSTALL_MANDIR=${!outputMan}/share/man" + "-DCMAKE_INSTALL_INFODIR=${!outputInfo}/share/info" + "-DCMAKE_INSTALL_DOCDIR=${!outputDoc}/share/doc/${shareDocName}" + "-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib" + "-DCMAKE_INSTALL_LIBEXECDIR=${!outputLib}/libexec" + "-DCMAKE_INSTALL_LOCALEDIR=${!outputLib}/share/locale" + + # Avoid cmake resetting the rpath of binaries, on make install + # And build always Release, to ensure optimisation flags + "-DCMAKE_BUILD_TYPE=${cmakeBuildType:-Release}" "-DCMAKE_SKIP_BUILD_RPATH=ON" + + # Disable user package registry to avoid potential side effects + # and unecessary attempts to access non-existent home folder + # https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#disabling-the-package-registry + "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" + "-DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF" + "-DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF" + + ${cmakeFlags[@]+"${cmakeFlags[@]}"} + ${cmakeFlagsArray[@]+"${cmakeFlagsArray[@]}"} + ) # Don’t build tests when doCheck = false if [ -z "${doCheck-}" ]; then - cmakeFlags="-DBUILD_TESTING=OFF $cmakeFlags" + cmakeFlags=("-DBUILD_TESTING=OFF" "${cmakeFlags[@]}") fi - - # Avoid cmake resetting the rpath of binaries, on make install - # And build always Release, to ensure optimisation flags - cmakeFlags="-DCMAKE_BUILD_TYPE=${cmakeBuildType:-Release} -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags" - - # Disable user package registry to avoid potential side effects - # and unecessary attempts to access non-existent home folder - # https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#disabling-the-package-registry - cmakeFlags="-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON $cmakeFlags" - cmakeFlags="-DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF $cmakeFlags" - cmakeFlags="-DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF $cmakeFlags" - if [ "${buildPhase-}" = ninjaBuildPhase ]; then - cmakeFlags="-GNinja $cmakeFlags" + cmakeFlags=("-GNinja" "${cmakeFlags[@]}") fi - echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}" + echo "cmake flags: ${cmakeFlags[@]}" - cmake ${cmakeDir:-.} $cmakeFlags "${cmakeFlagsArray[@]}" + cmake ${cmakeDir:-.} "${cmakeFlags[@]}" if ! [[ -v enableParallelBuilding ]]; then enableParallelBuilding=1 From 8ecdc39968101313b7bf0cf35db6af9ecae4dead Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 5 Nov 2019 00:23:36 +0100 Subject: [PATCH 044/323] ninja: fix for structured attrs --- pkgs/development/compilers/swift/default.nix | 2 +- pkgs/development/tools/build-managers/ninja/setup-hook.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix index 817f81f9257b7..cc64b7c7ebffe 100644 --- a/pkgs/development/compilers/swift/default.nix +++ b/pkgs/development/compilers/swift/default.nix @@ -259,7 +259,7 @@ stdenv.mkDerivation { # TODO: investigate the non-working tests checkPhase = '' checkTarget=check-swift-all - ninjaFlags='-C buildbot_linux/swift-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}' + ninjaFlags=('-C buildbot_linux/swift-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}') ninjaCheckPhase ''; diff --git a/pkgs/development/tools/build-managers/ninja/setup-hook.sh b/pkgs/development/tools/build-managers/ninja/setup-hook.sh index 7d8087ad13422..f4b8f9905333a 100644 --- a/pkgs/development/tools/build-managers/ninja/setup-hook.sh +++ b/pkgs/development/tools/build-managers/ninja/setup-hook.sh @@ -10,7 +10,7 @@ ninjaBuildPhase() { local flagsArray=( -j$buildCores -l$NIX_BUILD_CORES - $ninjaFlags "${ninjaFlagsArray[@]}" + ${ninjaFlags[@]+"${ninjaFlags[@]}"} ) echoCmd 'build flags' "${flagsArray[@]}" @@ -28,8 +28,8 @@ ninjaInstallPhase() { # shellcheck disable=SC2086 local flagsArray=( - $ninjaFlags "${ninjaFlagsArray[@]}" - ${installTargets:-install} + ${ninjaFlags[@]+"${ninjaFlags[@]}"} + "${installTargets[@]-install}" ) echoCmd 'install flags' "${flagsArray[@]}" @@ -62,7 +62,7 @@ ninjaCheckPhase() { local flagsArray=( -j$buildCores -l$NIX_BUILD_CORES - $ninjaFlags "${ninjaFlagsArray[@]}" + ${ninjaFlags[@]+"${ninjaFlags[@]}"} $checkTarget ) From 12b0ee200c0473a8725b28fdf49c484e2cb1528c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 5 Nov 2019 00:44:20 +0100 Subject: [PATCH 045/323] stdenv: installFlags is a list --- pkgs/stdenv/generic/make-derivation.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index fc14f8b72f9c5..b173b80209544 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -97,6 +97,7 @@ in rec { assert lib.isList (attrs.makeFlags or []); assert lib.isList (attrs.checkFlags or []); assert lib.isList (attrs.patchFlags or []); + assert lib.isList (attrs.installFlags or []); assert lib.isList (attrs.installTargets or []); assert lib.isString (attrs.NIX_LDFLAGS or ""); assert lib.isString (attrs.NIX_CFLAGS_COMPILE or ""); From c168f128af888cb347faf2dde89fefb58f30481a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 5 Nov 2019 21:18:29 +0100 Subject: [PATCH 046/323] stdenv: introduce env dict exporting vars --- pkgs/development/compilers/gcc/8/default.nix | 55 +++++++++---------- pkgs/development/compilers/gcc/builder.sh | 2 - .../compilers/ghc/8.2.2-binary.nix | 5 +- .../compilers/ghc/8.6.3-binary.nix | 5 +- .../python/cpython/2.7/default.nix | 14 ++--- .../interpreters/python/cpython/default.nix | 15 ++--- pkgs/development/libraries/glibc/common.nix | 3 +- .../libraries/libomxil-bellagio/default.nix | 2 +- .../python-modules/python-jose/default.nix | 2 +- pkgs/stdenv/generic/make-derivation.nix | 5 ++ pkgs/stdenv/generic/setup.sh | 5 +- 11 files changed, 56 insertions(+), 57 deletions(-) diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index c6b785f84a4e4..545eb3dca6e30 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -84,7 +84,6 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -165,8 +164,6 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; - preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; inherit version hostPlatform langGo; @@ -210,31 +207,33 @@ stdenv.mkDerivation ({ installTargets = optional stripped "install-strip"; - # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; - - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the - # library headers and binaries, regarless of the language being compiled. - # - # Likewise, the LTO code doesn't find zlib. - # - # Cross-compiling, we need gcc not to read ./specs in order to build the g++ - # compiler (after the specs for the cross-gcc are created). Having - # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - - CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] - ++ optional (zlib != null) zlib - )); - - LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); - - inherit - (import ../common/extra-target-flags.nix { - inherit stdenv crossStageStatic libcCross threadsCross; - }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS - ; + env = { + NIX_NO_SELF_RPATH = true; + + inherit + (import ../common/extra-target-flags.nix { + inherit stdenv crossStageStatic libcCross threadsCross; + }) + EXTRA_TARGET_FLAGS + EXTRA_TARGET_LDFLAGS + ; + } // optionalAttrs (targetPlatform == hostPlatform) { + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. + CPATH = makeSearchPathOutput "dev" "include" (optional (zlib != null) zlib); + LIBRARY_PATH = makeLibraryPath (optional (zlib != null) zlib); + } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { + # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 + CC = "gcc -m64"; + } // optionalAttrs hostPlatform.isSunOS { + NIX_LDFLAGS = "-lm -ldl"; + }; passthru = { inherit langC langCC langObjC langObjCpp langFortran langGo version; diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index 5f47389377c11..d80cbc3eb9074 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -18,8 +18,6 @@ fi # GCC interprets empty paths as ".", which we don't want. -if test -z "${CPATH-}"; then unset CPATH; else export CPATH; fi -if test -z "${LIBRARY_PATH-}"; then unset LIBRARY_PATH; else export LIBRARY_PATH; fi echo "\$CPATH is \`${CPATH-}'" echo "\$LIBRARY_PATH is \`${LIBRARY_PATH-}'" diff --git a/pkgs/development/compilers/ghc/8.2.2-binary.nix b/pkgs/development/compilers/ghc/8.2.2-binary.nix index d740decafe83f..683100140cf95 100644 --- a/pkgs/development/compilers/ghc/8.2.2-binary.nix +++ b/pkgs/development/compilers/ghc/8.2.2-binary.nix @@ -57,12 +57,9 @@ stdenv.mkDerivation rec { # Cannot patchelf beforehand due to relative RPATHs that anticipate # the final install location/ - ${libEnvVar} = libPath; + env.${libEnvVar} = libPath; postUnpack = - '' - export ${libEnvVar} - '' + # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib # during linking stdenv.lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/compilers/ghc/8.6.3-binary.nix b/pkgs/development/compilers/ghc/8.6.3-binary.nix index da807042b4e97..8efecd2917ca7 100644 --- a/pkgs/development/compilers/ghc/8.6.3-binary.nix +++ b/pkgs/development/compilers/ghc/8.6.3-binary.nix @@ -49,12 +49,9 @@ stdenv.mkDerivation rec { # Cannot patchelf beforehand due to relative RPATHs that anticipate # the final install location/ - ${libEnvVar} = libPath; + env.${libEnvVar} = libPath; postUnpack = - '' - export ${libEnvVar} - '' + # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib # during linking stdenv.lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 8a9eca8ddd7a2..483c0bc72e465 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -124,7 +124,6 @@ let for i in /usr /sw /opt /pkg; do substituteInPlace ./setup.py --replace $i /no-such-path done - export LDFLAGS DETERMINISTIC_BUILD C_INCLUDE_PATH LIBRARY_PATH; '' + optionalString (stdenv ? cc && stdenv.cc.libc != null) '' for i in Lib/plat-*/regen; do substituteInPlace $i --replace /usr/include/ ${stdenv.cc.libc}/include/ @@ -204,12 +203,13 @@ in with passthru; stdenv.mkDerivation ({ inherit src patches buildInputs nativeBuildInputs preConfigure configureFlags; - LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; - inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH; - - NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2" - + optionalString stdenv.hostPlatform.isMusl " -DTHREAD_STACK_SIZE=0x100000"; - DETERMINISTIC_BUILD = 1; + env = { + LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; + inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH; + NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2" + + optionalString stdenv.hostPlatform.isMusl " -DTHREAD_STACK_SIZE=0x100000"; + DETERMINISTIC_BUILD = 1; + }; setupHook = python-setup-hook sitePackages; diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index e229ead122072..cbedd8cde481a 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -130,12 +130,14 @@ in with passthru; stdenv.mkDerivation { substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" ''; - CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs); - LDFLAGS = concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs); - LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"} ${optionalString (ncurses != null) "-lncurses"}"; - NIX_LDFLAGS = optionalString stdenv.isLinux "-lgcc_s"; - # Determinism: We fix the hashes of str, bytes and datetime objects. - PYTHONHASHSEED=0; + env = { + CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs); + LDFLAGS = concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs); + LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"} ${optionalString (ncurses != null) "-lncurses"}"; + NIX_LDFLAGS = optionalString stdenv.isLinux "-lgcc_s"; + # Determinism: We fix the hashes of str, bytes and datetime objects. + PYTHONHASHSEED = 0; + }; configureFlags = [ "--enable-shared" @@ -178,7 +180,6 @@ in with passthru; stdenv.mkDerivation { for i in /usr /sw /opt /pkg; do # improve purity substituteInPlace ./setup.py --replace $i /no-such-path done - export LIBS LDFLAGS CPPFLAGS PYTHONHASHSEED '' + optionalString stdenv.isDarwin '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -msse2" export MACOSX_DEPLOYMENT_TARGET=10.6 diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index e6e36cd6b4d6e..6262ea596626b 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -159,7 +159,7 @@ stdenv.mkDerivation ({ # Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to # prevent a retained dependency on the bootstrap tools in the stdenv-linux # bootstrap. - BASH_SHELL = "/bin/sh"; + env.BASH_SHELL = "/bin/sh"; passthru = { inherit version; }; } @@ -176,7 +176,6 @@ stdenv.mkDerivation ({ # Remove absolute paths from `configure' & co.; build out-of-tree. preConfigure = '' - export BASH_SHELL export PWD_P=$(type -tP pwd) for i in configure io/ftwtest-sh; do # Can't use substituteInPlace here because replace hasn't been diff --git a/pkgs/development/libraries/libomxil-bellagio/default.nix b/pkgs/development/libraries/libomxil-bellagio/default.nix index 4d45c6872e4c6..e0c38dcdd4061 100644 --- a/pkgs/development/libraries/libomxil-bellagio/default.nix +++ b/pkgs/development/libraries/libomxil-bellagio/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { # Fix for #40213, probably permanent, because upstream doesn't seem to be # developed anymore. Alternatively, gcc7Stdenv could be used. - NIX_CFLAGS_COMPILE = "-Wno-error=array-bounds"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=array-bounds"; meta = with stdenv.lib; { homepage = https://sourceforge.net/projects/omxil/; diff --git a/pkgs/development/python-modules/python-jose/default.nix b/pkgs/development/python-modules/python-jose/default.nix index a9377c4a1c213..a509755a12ba9 100644 --- a/pkgs/development/python-modules/python-jose/default.nix +++ b/pkgs/development/python-modules/python-jose/default.nix @@ -26,7 +26,7 @@ buildPythonPackage rec { ''; # https://github.com/mpdavis/python-jose/issues/149 - PYTEST_ADDOPTS = "-k 'not test_invalid_claims_json and not test_invalid_claims'"; + env.PYTEST_ADDOPTS = "-k 'not test_invalid_claims_json and not test_invalid_claims'"; propagatedBuildInputs = [ future six ecdsa rsa ]; diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index b173b80209544..5af631ac3e415 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -89,6 +89,8 @@ in rec { , patches ? [] , __structuredAttrs ? true + , env ? {} + , ... } @ attrs: assert lib.isList (attrs.buildFlags or []); @@ -102,6 +104,7 @@ in rec { assert lib.isString (attrs.NIX_LDFLAGS or ""); assert lib.isString (attrs.NIX_CFLAGS_COMPILE or ""); assert lib.isString (attrs.NIX_CFLAGS_LINK or ""); + assert lib.all (v: lib.isString v || lib.isBool v || lib.isInt) (lib.attrValues env); let # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when @@ -219,6 +222,8 @@ in rec { args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; inherit stdenv; + inherit env; + # The `system` attribute of a derivation has special meaning to Nix. # Derivations set it to choose what sort of machine could be used to # execute the build, The build platform entirely determines this, diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 01c3e6f8abd08..6e023da4b0d6c 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1,7 +1,6 @@ set -eu set -o pipefail -export NIX_DEBUG NIX_LDFLAGS NIX_CFLAGS_COMPILE NIX_CFLAGS_LINK if (( "${NIX_DEBUG:-0}" >= 6 )); then set -x fi @@ -216,6 +215,10 @@ printWords() { ###################################################################### # Initialisation. +# export all vars that should be in the ENV +for envVar in "${!env[@]}"; do + export $envVar="${env[$envVar]}" +done # Set a fallback default value for SOURCE_DATE_EPOCH, used by some # build tools to provide a deterministic substitute for the "current" From 55442b8bd3597b7eb439be12b6e006db961b8d39 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 5 Nov 2019 21:19:11 +0100 Subject: [PATCH 047/323] treewide: structured attrs fixes --- pkgs/development/compilers/smlnj/default.nix | 2 +- .../tools/misc/automake/automake-1.11.x.nix | 49 +++++++++++++++++-- .../tools/misc/automake/builder.sh | 47 ------------------ .../linux/tcp-wrappers/default.nix | 2 +- 4 files changed, 46 insertions(+), 54 deletions(-) delete mode 100644 pkgs/development/tools/misc/automake/builder.sh diff --git a/pkgs/development/compilers/smlnj/default.nix b/pkgs/development/compilers/smlnj/default.nix index a79c9a702c4f3..2c36fd3d894db 100644 --- a/pkgs/development/compilers/smlnj/default.nix +++ b/pkgs/development/compilers/smlnj/default.nix @@ -56,7 +56,7 @@ in stdenv.mkDerivation { ''; unpackPhase = '' - for s in $sources; do + for s in "''${sources[@]}"; do b=$(basename $s) cp $s ''${b#*-} done diff --git a/pkgs/development/tools/misc/automake/automake-1.11.x.nix b/pkgs/development/tools/misc/automake/automake-1.11.x.nix index a5aa44abcdefc..d1bfc2d71f9ec 100644 --- a/pkgs/development/tools/misc/automake/automake-1.11.x.nix +++ b/pkgs/development/tools/misc/automake/automake-1.11.x.nix @@ -3,11 +3,6 @@ stdenv.mkDerivation rec { name = "automake-1.11.6"; - # TODO: Remove the `aclocal' wrapper when $ACLOCAL_PATH support is - # available upstream; see - # . - builder = ./builder.sh; - setupHook = ./setup-hook.sh; src = fetchurl { @@ -31,6 +26,50 @@ stdenv.mkDerivation rec { # Run the test suite in parallel. enableParallelBuilding = true; + # Wrap the given `aclocal' program, appending extra `-I' flags + # corresponding to the directories listed in $ACLOCAL_PATH. (Note + # that `wrapProgram' can't be used for that purpose since it can only + # prepend flags, not append them.) + postInstall = '' + wrapAclocal() { + local program="$1" + local wrapped="$(dirname $program)/.$(basename $program)-wrapped" + + mv "$program" "$wrapped" + cat > "$program"< "$program"< Date: Tue, 5 Nov 2019 21:20:30 +0100 Subject: [PATCH 048/323] stdenv: fix env assertion logic --- pkgs/stdenv/generic/make-derivation.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 5af631ac3e415..d53ebbecd3cb1 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -104,7 +104,7 @@ in rec { assert lib.isString (attrs.NIX_LDFLAGS or ""); assert lib.isString (attrs.NIX_CFLAGS_COMPILE or ""); assert lib.isString (attrs.NIX_CFLAGS_LINK or ""); - assert lib.all (v: lib.isString v || lib.isBool v || lib.isInt) (lib.attrValues env); + assert lib.all (v: lib.isString v || lib.isBool v || lib.isInt v) (lib.attrValues env); let # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when From e6630e6ec869c40b6b8e0345f1dc27c187dd70ea Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 6 Nov 2019 00:30:33 +0100 Subject: [PATCH 049/323] treewide: use env.* for vars to be exported in ENV --- .../networking/browsers/w3m/default.nix | 20 +++++------ .../git-and-tools/git/default.nix | 4 +-- pkgs/development/compilers/nasm/default.nix | 2 +- pkgs/development/libraries/avahi/default.nix | 2 +- .../libraries/aws-c-common/default.nix | 2 +- pkgs/development/libraries/boost/generic.nix | 2 +- pkgs/development/libraries/dbus/default.nix | 6 ++-- pkgs/development/libraries/glib/default.nix | 20 +++++------ pkgs/development/libraries/glibc/common.nix | 9 ++--- pkgs/development/libraries/glibc/default.nix | 35 ++++++++++--------- pkgs/development/libraries/glibc/locales.nix | 2 +- pkgs/development/libraries/gpgme/default.nix | 2 +- pkgs/development/libraries/grpc/default.nix | 2 +- .../libraries/gstreamer/good/default.nix | 8 ++--- .../libraries/http-parser/default.nix | 2 +- .../development/libraries/ilmbase/default.nix | 2 +- .../development/libraries/libcaca/default.nix | 4 +-- .../libraries/libglvnd/default.nix | 2 +- pkgs/development/libraries/libpfm/default.nix | 12 +++---- .../libraries/libsndfile/default.nix | 2 +- .../development/libraries/libusb1/default.nix | 2 +- .../libraries/libvdpau/default.nix | 2 +- pkgs/development/libraries/mesa/default.nix | 2 +- pkgs/development/libraries/nss/default.nix | 2 +- pkgs/development/libraries/pango/default.nix | 4 +-- .../libraries/qt-5/mkDerivation.nix | 6 ++-- pkgs/development/libraries/sqlite/default.nix | 2 +- pkgs/development/libraries/v8/default.nix | 2 +- pkgs/development/libraries/zlib/default.nix | 2 +- .../python-modules/cffi/default.nix | 2 +- .../ruby-modules/gem-config/default.nix | 6 ++-- .../tools/documentation/doxygen/default.nix | 2 +- .../tools/misc/binutils/default.nix | 2 +- pkgs/development/tools/misc/gdb/default.nix | 2 +- pkgs/os-specific/linux/libselinux/default.nix | 2 +- pkgs/os-specific/linux/libsepol/default.nix | 2 +- pkgs/os-specific/linux/musl/default.nix | 8 +++-- pkgs/os-specific/linux/systemd/default.nix | 2 +- pkgs/servers/pulseaudio/default.nix | 2 +- pkgs/servers/sql/postgresql/default.nix | 2 +- pkgs/shells/bash/4.4.nix | 2 +- pkgs/stdenv/adapters.nix | 18 +++++++--- pkgs/stdenv/generic/make-derivation.nix | 8 +++-- pkgs/tools/archivers/unzip/default.nix | 2 +- pkgs/tools/misc/coreutils/default.nix | 14 ++++---- pkgs/tools/misc/fontforge/default.nix | 2 +- pkgs/tools/package-management/nix/default.nix | 7 ++-- 47 files changed, 131 insertions(+), 118 deletions(-) diff --git a/pkgs/applications/networking/browsers/w3m/default.nix b/pkgs/applications/networking/browsers/w3m/default.nix index 373fa43c72c3e..b1720df5ed718 100644 --- a/pkgs/applications/networking/browsers/w3m/default.nix +++ b/pkgs/applications/networking/browsers/w3m/default.nix @@ -35,12 +35,16 @@ in stdenv.mkDerivation rec { sha256 = "1fbg2p8qh2gvi3g4iz4q6vc0k70pf248r4yndi5lcn2m3mzvjx0i"; }; - NIX_LDFLAGS = optionalString stdenv.isSunOS "-lsocket -lnsl"; - - # we must set these so that the generated files (e.g. w3mhelp.cgi) contain - # the correct paths. - PERL = "${perl}/bin/perl"; - MAN = "${man}/bin/man"; + env = { + NIX_LDFLAGS = optionalString stdenv.isSunOS "-lsocket -lnsl"; + # we must set these so that the generated files (e.g. w3mhelp.cgi) contain + # the correct paths. + PERL = "${perl}/bin/perl"; + MAN = "${man}/bin/man"; + # for w3mimgdisplay + # see: https://bbs.archlinux.org/viewtopic.php?id=196093 + LIBS = optionalString x11Support "-lX11"; + }; makeFlags = [ "AR=${stdenv.cc.bintools.targetPrefix}ar" ]; @@ -86,10 +90,6 @@ in stdenv.mkDerivation rec { enableParallelBuilding = false; - # for w3mimgdisplay - # see: https://bbs.archlinux.org/viewtopic.php?id=196093 - LIBS = optionalString x11Support "-lX11"; - meta = { homepage = http://w3m.sourceforge.net/; description = "A text-mode web browser"; diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index 7c46d26bf5b31..142b805821dc4 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -74,8 +74,8 @@ stdenv.mkDerivation { ++ stdenv.lib.optionals withLibsecret [ pkgconfig glib libsecret ]; # required to support pthread_cancel() - NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.cc.isClang) "-lgcc_s" - + stdenv.lib.optionalString (stdenv.isFreeBSD) "-lthr"; + env.NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.cc.isClang) "-lgcc_s" + + stdenv.lib.optionalString (stdenv.isFreeBSD) " -lthr"; configureFlags = stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_fread_reads_directories=yes" diff --git a/pkgs/development/compilers/nasm/default.nix b/pkgs/development/compilers/nasm/default.nix index f5645ae021921..20e8865a015c6 100644 --- a/pkgs/development/compilers/nasm/default.nix +++ b/pkgs/development/compilers/nasm/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { make golden && make test ''; - NIX_CFLAGS_COMPILE="-Wno-error=attributes"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=attributes"; meta = with stdenv.lib; { homepage = https://www.nasm.us/; diff --git a/pkgs/development/libraries/avahi/default.nix b/pkgs/development/libraries/avahi/default.nix index babfd6849a849..66672f7657667 100644 --- a/pkgs/development/libraries/avahi/default.nix +++ b/pkgs/development/libraries/avahi/default.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { # autoipd won't build on darwin ++ stdenv.lib.optional stdenv.isDarwin "--disable-autoipd"; - NIX_CFLAGS_COMPILE = "-DAVAHI_SERVICE_DIR=\"/etc/avahi/services\""; + env.NIX_CFLAGS_COMPILE = "-DAVAHI_SERVICE_DIR=\"/etc/avahi/services\""; preBuild = stdenv.lib.optionalString stdenv.isDarwin '' sed -i '20 i\ diff --git a/pkgs/development/libraries/aws-c-common/default.nix b/pkgs/development/libraries/aws-c-common/default.nix index b10797d3d56fb..1e629d4f1605b 100644 --- a/pkgs/development/libraries/aws-c-common/default.nix +++ b/pkgs/development/libraries/aws-c-common/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-nullability-extension -Wno-typedef-redefinition"; meta = with lib; { diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix index 82bcd49592d4a..41437e6af5d5f 100644 --- a/pkgs/development/libraries/boost/generic.nix +++ b/pkgs/development/libraries/boost/generic.nix @@ -136,7 +136,7 @@ stdenv.mkDerivation { EOF ''; - NIX_CFLAGS_LINK = stdenv.lib.optionalString stdenv.isDarwin + env.NIX_CFLAGS_LINK = stdenv.lib.optionalString stdenv.isDarwin "-headerpad_max_install_names"; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix index 5024ea3ef2494..5b508f47d4c3f 100644 --- a/pkgs/development/libraries/dbus/default.nix +++ b/pkgs/development/libraries/dbus/default.nix @@ -78,8 +78,10 @@ stdenv.mkDerivation rec { # Enable X11 autolaunch support in libdbus. This doesn't actually depend on X11 # (it just execs dbus-launch in dbus.tools), contrary to what the configure script demands. # problems building without x11Support so disabled in that case for now - NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-DDBUS_ENABLE_X11_AUTOLAUNCH=1"; - NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed"; + env = { + NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-DDBUS_ENABLE_X11_AUTOLAUNCH=1"; + NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed"; + }; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 0febed9f9c962..0d98c9172df59 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -118,12 +118,15 @@ stdenv.mkDerivation rec { "-Ddevbindir=${placeholder ''dev''}/bin" ]; - NIX_CFLAGS_COMPILE = toString [ - "-Wno-error=nonnull" - # Default for release buildtype but passed manually because - # we're using plain - "-DG_DISABLE_CAST_CHECKS" - ]; + env = { + NIX_CFLAGS_COMPILE = "-Wno-error=nonnull" + + # Default for release buildtype but passed manually because + # we're using plain + " -DG_DISABLE_CAST_CHECKS"; + LIBELF_CFLAGS = optionalString stdenv.isFreeBSD "-I${libelf}"; + LIBELF_LIBS = optionalString stdenv.isFreeBSD "-L${libelf} -lelf"; + DETERMINISTIC_BUILD = 1; + }; postPatch = '' # substitute fix-gio-launch-desktop-path.patch @@ -138,11 +141,6 @@ stdenv.mkDerivation rec { patchShebangs tests/gen-casemap-txt.py ''; - LIBELF_CFLAGS = optional stdenv.isFreeBSD "-I${libelf}"; - LIBELF_LIBS = optional stdenv.isFreeBSD "-L${libelf} -lelf"; - - DETERMINISTIC_BUILD = 1; - postInstall = '' moveToOutput "share/glib-2.0" "$dev" substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$dev" diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 6262ea596626b..1fd1adf79442a 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -37,12 +37,13 @@ let version = "2.27"; patchSuffix = ""; sha256 = "0wpwq7gsm7sd6ysidv0z575ckqdg13cr2njyfgrbgh4f65adwwji"; + inherit (lib) foldl recursiveUpdate; in assert withLinuxHeaders -> linuxHeaders != null; assert withGd -> gd != null && libpng != null; -stdenv.mkDerivation ({ +stdenv.mkDerivation (foldl recursiveUpdate {} [ { inherit version; linuxHeaders = if withLinuxHeaders then linuxHeaders else null; @@ -164,7 +165,7 @@ stdenv.mkDerivation ({ passthru = { inherit version; }; } -// (removeAttrs args [ "withLinuxHeaders" "withGd" ]) // +(removeAttrs args [ "withLinuxHeaders" "withGd" ]) { name = name + "-${version}${patchSuffix}"; @@ -227,11 +228,11 @@ stdenv.mkDerivation ({ } // meta; } -// lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) { +(lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) { preInstall = null; # clobber the native hook # To avoid a dependency on the build system 'bash'. preFixup = '' rm -f $bin/bin/{ldd,tzselect,catchsegv,xtrace} ''; -}) +}) ]) diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index bbdc25b2cd91e..c55b465014449 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -24,7 +24,24 @@ callPackage ./common.nix { inherit stdenv; } { # (For example, if you define `patches = [...]` here, it will # override the patches in `common.nix`.) - NIX_NO_SELF_RPATH = true; + env = { + NIX_NO_SELF_RPATH = true; + NIX_CFLAGS_COMPILE = stdenv.lib.concatStringsSep " " + (if !stdenv.hostPlatform.isMusl + # TODO: This (returning a string or `null`, instead of a list) is to + # not trigger a mass rebuild due to the introduction of the + # musl-specific flags below. + # At next change to non-musl glibc builds, remove this `then` + # and the above condition, instead keeping only the `else` below. + then stdenv.lib.optional withGd "-Wno-error=stringop-truncation" + else + builtins.concatLists [ + (stdenv.lib.optionals withGd gdCflags) + # Fix -Werror build failure when building glibc with musl with GCC >= 8, see: + # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798 + (stdenv.lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias") + ]); + }; postConfigure = '' # Hack: get rid of the `-static' flag set by the bootstrap stdenv. @@ -52,22 +69,6 @@ callPackage ./common.nix { inherit stdenv; } { # limit rebuilds by only disabling pie w/musl ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "pie"; - NIX_CFLAGS_COMPILE = - if !stdenv.hostPlatform.isMusl - # TODO: This (returning a string or `null`, instead of a list) is to - # not trigger a mass rebuild due to the introduction of the - # musl-specific flags below. - # At next change to non-musl glibc builds, remove this `then` - # and the above condition, instead keeping only the `else` below. - then (if withGd then gdCflags else null) - else - (builtins.concatLists [ - (stdenv.lib.optionals withGd gdCflags) - # Fix -Werror build failure when building glibc with musl with GCC >= 8, see: - # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798 - (stdenv.lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias") - ]); - # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for # any program we run, because the gcc will have been placed at a new # store path than that determined when built (as a source for the diff --git a/pkgs/development/libraries/glibc/locales.nix b/pkgs/development/libraries/glibc/locales.nix index 3fd1bdb3c41f3..fb18561cbbea7 100644 --- a/pkgs/development/libraries/glibc/locales.nix +++ b/pkgs/development/libraries/glibc/locales.nix @@ -15,7 +15,7 @@ callPackage ./common.nix { inherit stdenv; } { outputs = [ "out" ]; - NIX_NO_SELF_RPATH = 1; + env.NIX_NO_SELF_RPATH = 1; # Hack: get rid of the `-static' flag set by the bootstrap stdenv. # This has to be done *after* `configure' because it builds some diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix index ed2b5563bd373..49edecc429ded 100644 --- a/pkgs/development/libraries/gpgme/default.nix +++ b/pkgs/development/libraries/gpgme/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { # fit in the limit. https://github.com/NixOS/nix/pull/1085 ++ lib.optionals stdenv.isDarwin [ "--disable-gpg-test" ]; - NIX_CFLAGS_COMPILE = toString ( + env.NIX_CFLAGS_COMPILE = toString ( # qgpgme uses Q_ASSERT which retains build inputs at runtime unless # debugging is disabled lib.optional (qtbase != null) "-DQT_NO_DEBUG" diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix index abcd3abaf3097..a38934e188a5d 100644 --- a/pkgs/development/libraries/grpc/default.nix +++ b/pkgs/development/libraries/grpc/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=unknown-warning-option"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=unknown-warning-option"; enableParallelBuilds = true; diff --git a/pkgs/development/libraries/gstreamer/good/default.nix b/pkgs/development/libraries/gstreamer/good/default.nix index a7c2bcf838e7b..42b45e8ad13cd 100644 --- a/pkgs/development/libraries/gstreamer/good/default.nix +++ b/pkgs/development/libraries/gstreamer/good/default.nix @@ -127,11 +127,9 @@ stdenv.mkDerivation rec { ]; - NIX_LDFLAGS = [ - # linking error on Darwin - # https://github.com/NixOS/nixpkgs/pull/70690#issuecomment-553694896 - "-lncurses" - ]; + # linking error on Darwin + # https://github.com/NixOS/nixpkgs/pull/70690#issuecomment-553694896 + env.NIX_LDFLAGS = "-lncurses"; # fails 1 tests with "Unexpected critical/warning: g_object_set_is_valid_property: object class 'GstRtpStorage' has no property named ''" doCheck = false; diff --git a/pkgs/development/libraries/http-parser/default.nix b/pkgs/development/libraries/http-parser/default.nix index 4b1a695ca551d..f8b4c6e967535 100644 --- a/pkgs/development/libraries/http-parser/default.nix +++ b/pkgs/development/libraries/http-parser/default.nix @@ -13,7 +13,7 @@ in stdenv.mkDerivation { sha256 = "1qs6x3n2nrcj1wiik5pg5i16inykf7rcfdfdy7rwyzf40pvdl3c2"; }; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; patches = [ ./build-shared.patch ]; makeFlags = [ "DESTDIR=" "PREFIX=$(out)" ]; buildFlags = [ "library" ]; diff --git a/pkgs/development/libraries/ilmbase/default.nix b/pkgs/development/libraries/ilmbase/default.nix index 00cdda1e57084..64f866bb15677 100644 --- a/pkgs/development/libraries/ilmbase/default.nix +++ b/pkgs/development/libraries/ilmbase/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ automake autoconf libtool which ]; - NIX_CFLAGS_LINK = "-pthread"; + env.NIX_CFLAGS_LINK = "-pthread"; patches = [ ./bootstrap.patch diff --git a/pkgs/development/libraries/libcaca/default.nix b/pkgs/development/libraries/libcaca/default.nix index 7773fe46c0cea..07f7c388680e1 100644 --- a/pkgs/development/libraries/libcaca/default.nix +++ b/pkgs/development/libraries/libcaca/default.nix @@ -17,9 +17,9 @@ stdenv.mkDerivation rec { configureFlags = [ (if x11Support then "--enable-x11" else "--disable-x11") - ]; + ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING"; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/libglvnd/default.nix b/pkgs/development/libraries/libglvnd/default.nix index 55b801b0b0d54..1250830a4cb18 100644 --- a/pkgs/development/libraries/libglvnd/default.nix +++ b/pkgs/development/libraries/libglvnd/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { --replace "-Xlinker --version-script=$(VERSION_SCRIPT)" "-Xlinker" ''; - NIX_CFLAGS_COMPILE = toString ([ + env.NIX_CFLAGS_COMPILE = toString ([ "-UDEFAULT_EGL_VENDOR_CONFIG_DIRS" # FHS paths are added so that non-NixOS applications can find vendor files. "-DDEFAULT_EGL_VENDOR_CONFIG_DIRS=\"${addOpenGLRunpath.driverLink}/share/glvnd/egl_vendor.d:/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d\"" diff --git a/pkgs/development/libraries/libpfm/default.nix b/pkgs/development/libraries/libpfm/default.nix index 3398d3feb94f3..a201e0956dc41 100644 --- a/pkgs/development/libraries/libpfm/default.nix +++ b/pkgs/development/libraries/libpfm/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, enableShared ? true }: -stdenv.mkDerivation (rec { +stdenv.mkDerivation (stdenv.lib.recursiveUpdate rec { version = "4.10.1"; pname = "libpfm"; @@ -16,7 +16,7 @@ stdenv.mkDerivation (rec { "SYS=${stdenv.hostPlatform.uname.system}" ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; meta = with stdenv.lib; { description = "Helper library to program the performance monitoring events"; @@ -30,8 +30,6 @@ stdenv.mkDerivation (rec { maintainers = [ maintainers.pierron ]; platforms = platforms.linux; }; -} // stdenv.lib.optionalAttrs ( ! enableShared ) -{ - CONFIG_PFMLIB_SHARED = "n"; -} -) +} (stdenv.lib.optionalAttrs (!enableShared) { + env.CONFIG_PFMLIB_SHARED = "n"; +})) diff --git a/pkgs/development/libraries/libsndfile/default.nix b/pkgs/development/libraries/libsndfile/default.nix index b150dd0f59c33..90925d872fc90 100644 --- a/pkgs/development/libraries/libsndfile/default.nix +++ b/pkgs/development/libraries/libsndfile/default.nix @@ -59,7 +59,7 @@ stdenv.mkDerivation rec { ''; # Needed on Darwin. - NIX_CFLAGS_LINK = "-logg -lvorbis"; + env.NIX_CFLAGS_LINK = "-logg -lvorbis"; meta = with stdenv.lib; { description = "A C library for reading and writing files containing sampled sound"; diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix index 9d90304042c8a..6b6de75f98181 100644 --- a/pkgs/development/libraries/libusb1/default.nix +++ b/pkgs/development/libraries/libusb1/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation (rec { stdenv.lib.optional enableSystemd systemd ++ stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ]; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; preFixup = stdenv.lib.optionalString stdenv.isLinux '' sed 's,-ludev,-L${stdenv.lib.getLib systemd}/lib -ludev,' -i $out/lib/libusb-1.0.la diff --git a/pkgs/development/libraries/libvdpau/default.nix b/pkgs/development/libraries/libvdpau/default.nix index e6a57f1e38c4f..51255175431d5 100644 --- a/pkgs/development/libraries/libvdpau/default.nix +++ b/pkgs/development/libraries/libvdpau/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { configureFlags = stdenv.lib.optional stdenv.isLinux "--with-module-dir=${mesa.drivers.driverLink}/lib/vdpau"; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lX11"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lX11"; installFlags = [ "moduledir=$(out)/lib/vdpau" ]; diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 9582e1bf1bfbb..bd34c76ed975b 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -183,7 +183,7 @@ stdenv.mkDerivation { done ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-fno-common"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-fno-common"; passthru = { inherit libdrm; diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix index df9c326087836..74d4064f80d43 100644 --- a/pkgs/development/libraries/nss/default.nix +++ b/pkgs/development/libraries/nss/default.nix @@ -68,7 +68,7 @@ in stdenv.mkDerivation rec { ] ++ stdenv.lib.optional stdenv.is64bit "USE_64=1" ++ stdenv.lib.optional stdenv.isDarwin "CCC=clang++"; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; # TODO(@oxij): investigate this: `make -n check` works but `make # check` fails with "no rule", same for "installcheck". diff --git a/pkgs/development/libraries/pango/default.nix b/pkgs/development/libraries/pango/default.nix index ecb0f16c72c5f..917f292f782f0 100644 --- a/pkgs/development/libraries/pango/default.nix +++ b/pkgs/development/libraries/pango/default.nix @@ -43,9 +43,9 @@ in stdenv.mkDerivation rec { enableParallelBuilding = true; # Fontconfig error: Cannot load default config file - FONTCONFIG_FILE = makeFontsConf { + env.FONTCONFIG_FILE = toString (makeFontsConf { fontDirectories = [ freefont_ttf ]; - }; + }); doCheck = false; # /layout/valid-1.markup: FAIL diff --git a/pkgs/development/libraries/qt-5/mkDerivation.nix b/pkgs/development/libraries/qt-5/mkDerivation.nix index 2c6333cb02045..438db9f2ccc7b 100644 --- a/pkgs/development/libraries/qt-5/mkDerivation.nix +++ b/pkgs/development/libraries/qt-5/mkDerivation.nix @@ -12,9 +12,9 @@ let qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ] ++ (args.qmakeFlags or []); - NIX_CFLAGS_COMPILE = toString ( + env.NIX_CFLAGS_COMPILE = toString ( optional (!debug) "-DQT_NO_DEBUG" - ++ lib.toList (args.NIX_CFLAGS_COMPILE or [])); + ++ lib.toList (args.env.NIX_CFLAGS_COMPILE or "")); cmakeFlags = (args.cmakeFlags or []) @@ -29,4 +29,4 @@ let }; in -mkDerivation (args // args_) +mkDerivation (lib.recursiveUpdate args args_) diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index d904637fcd386..fa29d4c0cc1ad 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-threadsafe" ] ++ optional interactive "--enable-readline"; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-DSQLITE_ENABLE_COLUMN_METADATA" "-DSQLITE_ENABLE_DBSTAT_VTAB" "-DSQLITE_ENABLE_JSON1" diff --git a/pkgs/development/libraries/v8/default.nix b/pkgs/development/libraries/v8/default.nix index a02e540173d84..e85c655812896 100644 --- a/pkgs/development/libraries/v8/default.nix +++ b/pkgs/development/libraries/v8/default.nix @@ -99,7 +99,7 @@ stdenv.mkDerivation rec { # with gcc8, -Wclass-memaccess became part of -Wall and causes logging limit # to be exceeded - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-class-memaccess"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-class-memaccess"; nativeBuildInputs = [ gn ninja pkgconfig python ] ++ stdenv.lib.optionals stdenv.isDarwin [ xcbuild darwin.DarwinTools ]; diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index 71da686ce48f4..b98a00fbad85b 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -83,7 +83,7 @@ stdenv.mkDerivation (rec { # As zlib takes part in the stdenv building, we don't want references # to the bootstrap-tools libgcc (as uses to happen on arm/mips) - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.hostPlatform.isDarwin) "-static-libgcc"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.hostPlatform.isDarwin) "-static-libgcc"; # We don't strip on static cross-compilation because of reports that native # stripping corrupted the target library; see commit 12e960f5 for the report. diff --git a/pkgs/development/python-modules/cffi/default.nix b/pkgs/development/python-modules/cffi/default.nix index b05aeebf9d4d5..a8eac51f9bcbd 100644 --- a/pkgs/development/python-modules/cffi/default.nix +++ b/pkgs/development/python-modules/cffi/default.nix @@ -29,7 +29,7 @@ if isPyPy then null else buildPythonPackage rec { ''; # The tests use -Werror but with python3.6 clang detects some unreachable code. - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument -Wno-unreachable-code"; doCheck = !stdenv.hostPlatform.isMusl && !stdenv.isDarwin; # TODO: Investigate diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix index c1eb82c5fa807..fc95a7aa6157d 100644 --- a/pkgs/development/ruby-modules/gem-config/default.nix +++ b/pkgs/development/ruby-modules/gem-config/default.nix @@ -120,7 +120,7 @@ in }; dep-selector-libgecode = attrs: { - USE_SYSTEM_GECODE = true; + env.USE_SYSTEM_GECODE = true; postInstall = '' installPath=$(cat $out/nix-support/gem-meta/install-path) sed -i $installPath/lib/dep-selector-libgecode.rb -e 's@VENDORED_GECODE_DIR =.*@VENDORED_GECODE_DIR = "${gecode_3}"@' @@ -236,7 +236,7 @@ in nativeBuildInputs = [ pkgconfig ]; buildInputs = [ openssl ]; hardeningDisable = [ "format" ]; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=stringop-overflow" "-Wno-error=implicit-fallthrough" "-Wno-error=sizeof-pointer-memaccess" @@ -496,7 +496,7 @@ in sassc = attrs: { nativeBuildInputs = [ rake ]; dontBuild = false; - SASS_LIBSASS_PATH = toString libsass; + env.SASS_LIBSASS_PATH = toString libsass; postPatch = '' substituteInPlace lib/sassc/native.rb \ --replace 'gem_root = spec.gem_dir' 'gem_root = File.join(__dir__, "../../")' diff --git a/pkgs/development/tools/documentation/doxygen/default.nix b/pkgs/development/tools/documentation/doxygen/default.nix index af73ce25d422b..aa007f91bc1ad 100644 --- a/pkgs/development/tools/documentation/doxygen/default.nix +++ b/pkgs/development/tools/documentation/doxygen/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { [ "-DICONV_INCLUDE_DIR=${libiconv}/include" ] ++ stdenv.lib.optional (qt4 != null) "-Dbuild_wizard=YES"; - NIX_CFLAGS_COMPILE = + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9"; enableParallelBuilding = true; diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 82365d986b8a3..debcfdae11d95 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -103,7 +103,7 @@ stdenv.mkDerivation { # As binutils takes part in the stdenv building, we don't want references # to the bootstrap-tools libgcc (as uses to happen on arm/mips) - NIX_CFLAGS_COMPILE = if stdenv.hostPlatform.isDarwin + env.NIX_CFLAGS_COMPILE = if stdenv.hostPlatform.isDarwin then "-Wno-string-plus-int -Wno-deprecated-declarations" else "-static-libgcc"; diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index e125b7418f6b5..31555b3d6e4ff 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -60,7 +60,7 @@ stdenv.mkDerivation rec { # darwin build fails with format hardening since v7.12 hardeningDisable = stdenv.lib.optionals stdenv.isDarwin [ "format" ]; - NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral"; + env.NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral"; # TODO(@Ericson2314): Always pass "--target" and always prefix. configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target"; diff --git a/pkgs/os-specific/linux/libselinux/default.nix b/pkgs/os-specific/linux/libselinux/default.nix index 39e97f8473c8c..7cab9a08d6764 100644 --- a/pkgs/os-specific/linux/libselinux/default.nix +++ b/pkgs/os-specific/linux/libselinux/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { # command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror] hardeningDisable = [ "fortify" ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; makeFlags = [ "PREFIX=$(out)" diff --git a/pkgs/os-specific/linux/libsepol/default.nix b/pkgs/os-specific/linux/libsepol/default.nix index b31554d6cee4f..2b42e1cbe79b9 100644 --- a/pkgs/os-specific/linux/libsepol/default.nix +++ b/pkgs/os-specific/linux/libsepol/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { "SHLIBDIR=$(out)/lib" ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; passthru = { inherit se_release se_url; }; diff --git a/pkgs/os-specific/linux/musl/default.nix b/pkgs/os-specific/linux/musl/default.nix index 93e9ba614f881..c1b7cc54b7a29 100644 --- a/pkgs/os-specific/linux/musl/default.nix +++ b/pkgs/os-specific/linux/musl/default.nix @@ -57,8 +57,6 @@ stdenv.mkDerivation rec { sha256 = "0hfadrycb60sm6hb6by4ycgaqc9sgrhh42k39v8xpmcvdzxrsq2n"; }) ]; - CFLAGS = [ "-fstack-protector-strong" ] - ++ lib.optional stdenv.hostPlatform.isPower "-mlong-double-64"; configureFlags = [ "--enable-shared" @@ -73,7 +71,11 @@ stdenv.mkDerivation rec { dontDisableStatic = true; separateDebugInfo = true; - NIX_DONT_SET_RPATH = true; + env = { + NIX_DONT_SET_RPATH = true; + CFLAGS = "-fstack-protector-strong" + + lib.optionalString stdenv.hostPlatform.isPower "-mlong-double-64"; + }; postInstall = '' # Not sure why, but link in all but scsi directory as that's what uclibc/glibc do. diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 5ba7f28092af9..a4ba4a4c6f23f 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -181,7 +181,7 @@ in stdenv.mkDerivation { --replace "SYSTEMD_CGROUP_AGENT_PATH" "_SYSTEMD_CGROUP_AGENT_PATH" ''; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ # Can't say ${polkit.bin}/bin/pkttyagent here because that would # lead to a cyclic dependency. "-UPOLKIT_AGENT_BINARY_PATH" "-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\"" diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index da201765e55e0..7549a5fd7789f 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -97,7 +97,7 @@ stdenv.mkDerivation rec { # the alternative is to copy the files from /usr/include to src, but there are # probably a large number of files that would need to be copied (I stopped # after the seventh) - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I/usr/include"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I/usr/include"; installFlags = [ "sysconfdir=${placeholder "out"}/etc" diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix index 3f05b3e36c197..9e7f5b14b2e1f 100644 --- a/pkgs/servers/sql/postgresql/default.nix +++ b/pkgs/servers/sql/postgresql/default.nix @@ -44,7 +44,7 @@ let buildFlags = [ "world" ]; - NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; + env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; # Otherwise it retains a reference to compiler and fails; see #44767. TODO: better. preConfigure = "CC=${stdenv.cc.targetPrefix}cc"; diff --git a/pkgs/shells/bash/4.4.nix b/pkgs/shells/bash/4.4.nix index 121368abf4c70..c0d9999f6e275 100644 --- a/pkgs/shells/bash/4.4.nix +++ b/pkgs/shells/bash/4.4.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "man" "doc" "info" ]; - NIX_CFLAGS_COMPILE = '' + env.NIX_CFLAGS_COMPILE = '' -DSYS_BASHRC="/etc/bashrc" -DSYS_BASH_LOGOUT="/etc/bash_logout" -DDEFAULT_PATH_VALUE="/no-such-path" diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 041964bcacc28..d2280428b5c5e 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -43,7 +43,9 @@ rec { if stdenv'.hostPlatform.isDarwin then throw "Cannot build fully static binaries on Darwin/macOS" else stdenv'.mkDerivation (args // { - NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") + " -static"; + env = (args.env or {}) // { + NIX_CFLAGS_LINK = (args.env.NIX_CFLAGS_LINK or "") + " -static"; + }; configureFlags = (args.configureFlags or []) ++ [ "--disable-shared" # brrr... ]; @@ -182,7 +184,9 @@ rec { keepDebugInfo = stdenv: stdenv // { mkDerivation = args: stdenv.mkDerivation (args // { dontStrip = true; - NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -ggdb -Og"; + env = (args.env or {}) // { + NIX_CFLAGS_COMPILE = (args.env.NIX_CFLAGS_COMPILE or "") + " -ggdb -Og"; + }; }); }; @@ -190,7 +194,9 @@ rec { /* Modify a stdenv so that it uses the Gold linker. */ useGoldLinker = stdenv: stdenv // { mkDerivation = args: stdenv.mkDerivation (args // { - NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") + " -fuse-ld=gold"; + env = (args.env or {}) // { + NIX_CFLAGS_LINK = (args.env.NIX_CFLAGS_LINK or "") + " -fuse-ld=gold"; + }; }); }; @@ -201,8 +207,10 @@ rec { WARNING: this breaks purity! */ impureUseNativeOptimizations = stdenv: stdenv // { mkDerivation = args: stdenv.mkDerivation (args // { - NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -march=native"; - NIX_ENFORCE_NO_NATIVE = false; + env = (args.env or {}) // { + NIX_CFLAGS_COMPILE = (args.env.NIX_CFLAGS_COMPILE or "") + " -march=native"; + NIX_ENFORCE_NO_NATIVE = false; + }; preferLocalBuild = true; allowSubstitutes = false; diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index d53ebbecd3cb1..fc5da4a6e87d0 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -101,9 +101,11 @@ in rec { assert lib.isList (attrs.patchFlags or []); assert lib.isList (attrs.installFlags or []); assert lib.isList (attrs.installTargets or []); - assert lib.isString (attrs.NIX_LDFLAGS or ""); - assert lib.isString (attrs.NIX_CFLAGS_COMPILE or ""); - assert lib.isString (attrs.NIX_CFLAGS_LINK or ""); + assert !(attrs ? NIX_LDFLAGS); + assert !(attrs ? NIX_CFLAGS_COMPILE); + assert !(attrs ? NIX_CFLAGS_LINK); + assert !(attrs ? NIX_NO_SELF_RPATH); + assert !(attrs ? NIX_DONT_SET_RPATH); assert lib.all (v: lib.isString v || lib.isBool v || lib.isInt v) (lib.attrValues env); let diff --git a/pkgs/tools/archivers/unzip/default.nix b/pkgs/tools/archivers/unzip/default.nix index b8f649fbdcbb9..fc87b533edc26 100644 --- a/pkgs/tools/archivers/unzip/default.nix +++ b/pkgs/tools/archivers/unzip/default.nix @@ -53,7 +53,7 @@ stdenv.mkDerivation { makefile = "unix/Makefile"; - NIX_LDFLAGS = "-lbz2" + stdenv.lib.optionalString enableNLS " -lnatspec"; + env.NIX_LDFLAGS = "-lbz2" + stdenv.lib.optionalString enableNLS " -lnatspec"; buildFlags = [ "generic" diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index cbe97dda9e5ab..f996c7fab89de 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -15,7 +15,7 @@ assert selinuxSupport -> libselinux != null && libsepol != null; with lib; -stdenv.mkDerivation rec { +stdenv.mkDerivation (recursiveUpdate rec { pname = "coreutils"; version = "8.31"; @@ -106,8 +106,10 @@ stdenv.mkDerivation rec { # man/sha512sum.td/sha512sum’. enableParallelBuilding = false; - NIX_LDFLAGS = optionalString selinuxSupport "-lsepol"; - FORCE_UNSAFE_CONFIGURE = optionalString stdenv.hostPlatform.isSunOS "1"; + env = { + NIX_LDFLAGS = optionalString selinuxSupport "-lsepol"; + FORCE_UNSAFE_CONFIGURE = optionalString stdenv.hostPlatform.isSunOS "1"; + }; # Works around a bug with 8.26: # Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually). Stop. @@ -144,7 +146,7 @@ stdenv.mkDerivation rec { maintainers = [ maintainers.eelco ]; }; -} // optionalAttrs stdenv.hostPlatform.isMusl { +} (optionalAttrs stdenv.hostPlatform.isMusl { # Work around a bogus warning in conjunction with musl. - NIX_CFLAGS_COMPILE = "-Wno-error"; -} + env.NIX_CFLAGS_COMPILE = "-Wno-error"; +})) diff --git a/pkgs/tools/misc/fontforge/default.nix b/pkgs/tools/misc/fontforge/default.nix index 6239e83959816..63fa28dfd5dfe 100644 --- a/pkgs/tools/misc/fontforge/default.nix +++ b/pkgs/tools/misc/fontforge/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { ''; # do not use x87's 80-bit arithmetic, rouding errors result in very different font binaries - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isi686 "-msse2 -mfpmath=sse"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isi686 "-msse2 -mfpmath=sse"; nativeBuildInputs = [ pkgconfig autoconf automake gnum4 libtool perl gettext ]; buildInputs = [ diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index ce2936f96f3f3..72e652883b873 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -30,8 +30,6 @@ common = is20 = lib.versionAtLeast version "2.0pre"; - VERSION_SUFFIX = lib.optionalString fromGit suffix; - outputs = [ "out" "dev" "man" "doc" ]; nativeBuildInputs = @@ -57,7 +55,10 @@ common = propagatedBuildInputs = [ boehmgc ]; # Seems to be required when using std::atomic with 64-bit types - NIX_LDFLAGS = lib.optionalString (stdenv.hostPlatform.system == "armv6l-linux") "-latomic"; + env = { + NIX_LDFLAGS = lib.optionalString (stdenv.hostPlatform.system == "armv6l-linux") "-latomic"; + VERSION_SUFFIX = lib.optionalString fromGit suffix; + }; preConfigure = # Copy libboost_context so we don't get all of Boost in our closure. From f90ca1e0dabcd6acea84e31ef64d37bdcd07b2ac Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 9 Nov 2019 17:04:23 +0000 Subject: [PATCH 050/323] mkDerivation: Push env assertions deeper onto just that attribute The increased laziness fixes some infinite recursions. --- pkgs/stdenv/generic/make-derivation.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index fc5da4a6e87d0..794c8ff2917a8 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -106,7 +106,6 @@ in rec { assert !(attrs ? NIX_CFLAGS_LINK); assert !(attrs ? NIX_NO_SELF_RPATH); assert !(attrs ? NIX_DONT_SET_RPATH); - assert lib.all (v: lib.isString v || lib.isBool v || lib.isInt v) (lib.attrValues env); let # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when @@ -224,7 +223,9 @@ in rec { args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; inherit stdenv; - inherit env; + env = + assert lib.all (v: lib.isString v || lib.isBool v || lib.isInt v) (lib.attrValues env); + env; # The `system` attribute of a derivation has special meaning to Nix. # Derivations set it to choose what sort of machine could be used to From 054a8035812f0eec27e064a92c1f5b975e2707e1 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 9 Nov 2019 17:05:44 +0000 Subject: [PATCH 051/323] darwin stdenv: Get rid of some `rec { .. }` While they weren't causing a problem per-se, it's just another footgun with already super complex bootstrapping. Better to be explicit with some `let`s. --- pkgs/stdenv/darwin/default.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 86a6e33c94248..d3c7f3d2d3316 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -300,7 +300,9 @@ in rec { }; stage4 = prevStage: let - persistent = self: super: with prevStage; { + persistent = self: super: with prevStage; let + libxml2-nopython = super.libxml2.override { pythonSupport = false; }; + in { inherit gnumake gzip gnused bzip2 gawk ed xz patch bash ncurses libffi zlib gmp pcre gnugrep @@ -325,11 +327,11 @@ in rec { }); in { inherit tools libraries; } // tools // libraries); - darwin = super.darwin // rec { + darwin = super.darwin // { inherit (darwin) dyld Libsystem libiconv locale; cctools = super.darwin.cctools.override { enableTapiSupport = false; }; - libxml2-nopython = super.libxml2.override { pythonSupport = false; }; + inherit libxml2-nopython; CF = super.darwin.CF.override { libxml2 = libxml2-nopython; python = prevStage.python; @@ -385,7 +387,10 @@ in rec { # Need to get rid of these when cross-compiling. inherit binutils binutils-unwrapped; }; - in import ../generic rec { + cc = pkgs.llvmPackages.libcxxClang.override { + cc = pkgs.llvmPackages.clang-unwrapped; + }; + in import ../generic { name = "stdenv-darwin"; inherit config; @@ -406,9 +411,7 @@ in rec { initialPath = import ../common-path.nix { inherit pkgs; }; shell = "${pkgs.bash}/bin/bash"; - cc = pkgs.llvmPackages.libcxxClang.override { - cc = pkgs.llvmPackages.clang-unwrapped; - }; + inherit cc; extraNativeBuildInputs = []; extraBuildInputs = [ pkgs.darwin.CF ]; From 624dd8286c6fa996a817ef8512618387d8151722 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 9 Nov 2019 17:07:01 +0000 Subject: [PATCH 052/323] treewide: Use `env` for many for environment variables --- lib/tests/release.nix | 2 +- pkgs/applications/audio/audacity/default.nix | 2 +- .../audio/audio-recorder/default.nix | 2 +- pkgs/applications/audio/axoloti/libusb1.nix | 2 +- pkgs/applications/audio/bs1770gain/default.nix | 2 +- pkgs/applications/audio/chuck/default.nix | 4 ++-- pkgs/applications/audio/easytag/default.nix | 2 +- .../audio/freewheeling/default.nix | 2 +- pkgs/applications/audio/jack-rack/default.nix | 2 +- pkgs/applications/audio/jamin/default.nix | 2 +- pkgs/applications/audio/kid3/default.nix | 2 +- pkgs/applications/audio/klick/default.nix | 2 +- pkgs/applications/audio/lash/default.nix | 2 +- .../applications/audio/lsp-plugins/default.nix | 2 +- .../audio/pianobooster/default.nix | 2 +- pkgs/applications/audio/sayonara/default.nix | 2 +- .../audio/sound-juicer/default.nix | 2 +- .../audio/soundscape-renderer/default.nix | 2 +- .../applications/audio/squishyball/default.nix | 2 +- pkgs/applications/audio/svox/default.nix | 2 +- .../applications/audio/timemachine/default.nix | 2 +- pkgs/applications/blockchains/dcrd.nix | 2 +- pkgs/applications/blockchains/dcrwallet.nix | 2 +- .../display-managers/lightdm/gtk-greeter.nix | 2 +- .../editors/gnome-builder/default.nix | 2 +- .../editors/gnome-latex/default.nix | 2 +- pkgs/applications/editors/nedit/default.nix | 2 +- pkgs/applications/editors/texmacs/darwin.nix | 2 +- pkgs/applications/editors/texmacs/default.nix | 2 +- pkgs/applications/editors/texmaker/default.nix | 2 +- pkgs/applications/gis/grass/default.nix | 2 +- .../graphics/ahoviewer/default.nix | 2 +- pkgs/applications/graphics/freepv/default.nix | 2 +- pkgs/applications/graphics/gnuclad/default.nix | 2 +- pkgs/applications/graphics/goxel/default.nix | 2 +- pkgs/applications/graphics/gqview/default.nix | 2 +- pkgs/applications/graphics/hugin/default.nix | 2 +- pkgs/applications/graphics/imgcat/default.nix | 2 +- pkgs/applications/graphics/k3d/default.nix | 2 +- pkgs/applications/graphics/krita/default.nix | 2 +- .../graphics/luminance-hdr/default.nix | 2 +- pkgs/applications/graphics/xournal/default.nix | 2 +- pkgs/applications/misc/apvlv/default.nix | 2 +- pkgs/applications/misc/blender/default.nix | 4 ++-- pkgs/applications/misc/cgminer/default.nix | 2 +- pkgs/applications/misc/doomseeker/default.nix | 2 +- pkgs/applications/misc/fbreader/default.nix | 2 +- pkgs/applications/misc/getxbook/default.nix | 2 +- .../misc/gnome-recipes/default.nix | 2 +- .../misc/golden-cheetah/default.nix | 2 +- pkgs/applications/misc/grip/default.nix | 2 +- pkgs/applications/misc/gxneur/default.nix | 2 +- pkgs/applications/misc/k2pdfopt/default.nix | 2 +- pkgs/applications/misc/keepassx/community.nix | 4 ++-- pkgs/applications/misc/merkaartor/default.nix | 2 +- pkgs/applications/misc/mlterm/default.nix | 2 +- .../misc/mysql-workbench/default.nix | 2 +- pkgs/applications/misc/navit/default.nix | 2 +- .../misc/netsurf/libcss/default.nix | 2 +- .../misc/netsurf/libwapcaplet/default.nix | 2 +- pkgs/applications/misc/osm2xmap/default.nix | 2 +- .../applications/misc/prusa-slicer/default.nix | 2 +- pkgs/applications/misc/sdcv/default.nix | 2 +- pkgs/applications/misc/tangogps/default.nix | 2 +- pkgs/applications/misc/vp/default.nix | 2 +- pkgs/applications/misc/xfontsel/default.nix | 2 +- pkgs/applications/misc/xmr-stak/default.nix | 2 +- pkgs/applications/misc/xsw/default.nix | 2 +- pkgs/applications/misc/xterm/default.nix | 2 +- .../networking/browsers/firefox/common.nix | 2 +- .../networking/cluster/mesos/default.nix | 2 +- .../feedreaders/newsboat/default.nix | 2 +- .../networking/gopher/gopherclient/default.nix | 2 +- .../instant-messengers/baresip/default.nix | 2 +- .../instant-messengers/linphone/default.nix | 2 +- .../pidgin-plugins/purple-matrix/default.nix | 2 +- .../pidgin-plugins/skype4pidgin/default.nix | 2 +- .../pidgin-plugins/telegram-purple/default.nix | 2 +- .../pidgin-plugins/tox-prpl/default.nix | 2 +- .../instant-messengers/pidgin/default.nix | 2 +- .../instant-messengers/psi/default.nix | 4 ++-- .../skype-call-recorder/default.nix | 2 +- .../instant-messengers/swift-im/default.nix | 2 +- .../telegram/tdesktop/default.nix | 2 +- .../instant-messengers/vacuum/default.nix | 2 +- .../networking/irc/bip/default.nix | 2 +- .../networking/irc/quassel/default.nix | 2 +- .../networking/mailreaders/balsa/default.nix | 2 +- .../networking/mailreaders/neomutt/default.nix | 2 +- .../networking/p2p/transgui/default.nix | 2 +- .../networking/p2p/transmission/default.nix | 2 +- .../networking/remote/putty/default.nix | 2 +- pkgs/applications/office/calligra/default.nix | 2 +- pkgs/applications/office/gnucash/default.nix | 2 +- pkgs/applications/office/kmymoney/default.nix | 2 +- .../office/libreoffice/default.nix | 2 +- .../office/libreoffice/src-fresh/override.nix | 4 +++- pkgs/applications/office/planner/default.nix | 2 +- .../office/wordgrinder/default.nix | 2 +- pkgs/applications/radio/gnuradio/default.nix | 2 +- pkgs/applications/radio/xlog/default.nix | 2 +- .../science/astronomy/gildas/default.nix | 4 ++-- .../science/astronomy/xplanet/default.nix | 2 +- .../science/biology/cmtk/default.nix | 2 +- .../science/chemistry/avogadro/default.nix | 2 +- .../science/chemistry/pymol/default.nix | 2 +- .../applications/science/logic/avy/default.nix | 2 +- .../science/math/calculix/default.nix | 2 +- .../applications/science/math/giac/default.nix | 2 +- .../science/misc/boinc/default.nix | 2 +- pkgs/applications/science/misc/golly/beta.nix | 2 +- .../science/misc/golly/default.nix | 2 +- .../applications/science/misc/vite/default.nix | 2 +- .../svn-all-fast-export/default.nix | 2 +- .../version-management/rcs/default.nix | 2 +- pkgs/applications/video/aegisub/default.nix | 2 +- pkgs/applications/video/byzanz/default.nix | 2 +- pkgs/applications/video/handbrake/default.nix | 2 +- pkgs/applications/video/kino/default.nix | 2 +- pkgs/applications/video/mplayer/default.nix | 2 +- pkgs/applications/video/mpv/default.nix | 2 +- pkgs/applications/video/shotcut/default.nix | 2 +- pkgs/applications/video/wxcam/default.nix | 2 +- pkgs/applications/video/xvidcap/default.nix | 2 +- .../virtualization/bochs/default.nix | 4 ++-- .../virtualization/open-vm-tools/default.nix | 2 +- .../virtualization/tini/default.nix | 2 +- .../virtualbox/guest-additions/default.nix | 2 +- pkgs/applications/virtualization/xen/4.10.nix | 2 +- pkgs/applications/virtualization/xen/4.5.nix | 2 +- pkgs/applications/virtualization/xen/4.8.nix | 2 +- .../window-managers/compton/default.nix | 2 +- .../window-managers/fbpanel/default.nix | 2 +- .../window-managers/matchbox/default.nix | 2 +- .../windowmaker/dockapps/wmsm.app.nix | 2 +- pkgs/data/misc/scowl/default.nix | 2 +- pkgs/desktops/deepin/dde-kwin/default.nix | 2 +- .../deepin/deepin-movie-reborn/default.nix | 2 +- pkgs/desktops/enlightenment/efl.nix | 2 +- .../desktop/mail-notification/default.nix | 2 +- .../gnome-2/platform/gtkhtml/default.nix | 2 +- .../gnome-2/platform/libglade/default.nix | 2 +- pkgs/desktops/gnome-3/apps/vinagre/default.nix | 2 +- pkgs/desktops/gnome-3/core/evince/default.nix | 2 +- .../gnome-3/core/gnome-contacts/default.nix | 2 +- .../core/gnome-settings-daemon/default.nix | 2 +- pkgs/desktops/mate/atril/default.nix | 2 +- pkgs/desktops/mate/mate-applets/default.nix | 2 +- .../mate/mate-notification-daemon/default.nix | 2 +- pkgs/desktops/mate/mate-panel/default.nix | 2 +- .../mate/mate-settings-daemon/default.nix | 2 +- .../elementary-settings-daemon/default.nix | 2 +- pkgs/desktops/rox/rox-filer/default.nix | 2 +- .../xfce/applications/mousepad/default.nix | 2 +- pkgs/desktops/xfce/core/exo/default.nix | 2 +- .../xfce/core/xfce4-session/default.nix | 2 +- .../xfce4-pulseaudio-plugin/default.nix | 2 +- pkgs/development/compilers/avian/default.nix | 2 +- pkgs/development/compilers/chez/default.nix | 2 +- pkgs/development/compilers/clasp/default.nix | 2 +- pkgs/development/compilers/edk2/default.nix | 2 +- pkgs/development/compilers/eql/default.nix | 2 +- pkgs/development/compilers/gcc/4.8/default.nix | 2 +- pkgs/development/compilers/gcc/4.9/default.nix | 2 +- pkgs/development/compilers/gcc/5/default.nix | 4 ++-- pkgs/development/compilers/gcc/6/default.nix | 4 ++-- pkgs/development/compilers/gcc/7/default.nix | 6 +++--- pkgs/development/compilers/gcc/9/default.nix | 4 ++-- .../compilers/gcc/snapshot/default.nix | 6 +++--- pkgs/development/compilers/gcl/default.nix | 2 +- pkgs/development/compilers/gerbil/build.nix | 2 +- pkgs/development/compilers/hhvm/default.nix | 4 ++-- pkgs/development/compilers/iasl/default.nix | 2 +- pkgs/development/compilers/llvm/7/lldb.nix | 2 +- pkgs/development/compilers/mono/generic.nix | 2 +- pkgs/development/compilers/nim/default.nix | 2 +- pkgs/development/compilers/ocaml/3.11.2.nix | 2 +- pkgs/development/compilers/opa/default.nix | 2 +- .../compilers/openjdk/openjfx/11.nix | 2 +- .../compilers/openjdk/openjfx/12.nix | 2 +- pkgs/development/compilers/rust/rustc.nix | 2 +- pkgs/development/compilers/yap/default.nix | 2 +- pkgs/development/compilers/z88dk/default.nix | 2 +- .../development/interpreters/clisp/default.nix | 2 +- pkgs/development/interpreters/clisp/hg.nix | 2 +- .../interpreters/gnu-apl/default.nix | 2 +- pkgs/development/interpreters/io/default.nix | 2 +- .../interpreters/jimtcl/default.nix | 2 +- pkgs/development/interpreters/love/0.10.nix | 2 +- pkgs/development/interpreters/love/0.7.nix | 2 +- pkgs/development/interpreters/love/0.8.nix | 2 +- pkgs/development/interpreters/love/0.9.nix | 2 +- pkgs/development/interpreters/love/11.1.nix | 2 +- pkgs/development/interpreters/lush/default.nix | 2 +- .../interpreters/nix-exec/default.nix | 2 +- .../development/interpreters/pixie/default.nix | 18 ++++++++++-------- pkgs/development/interpreters/pure/default.nix | 2 +- .../interpreters/python/cpython/2.7/boot.nix | 8 +++++--- .../interpreters/python/pypy/default.nix | 8 +++++--- .../interpreters/racket/default.nix | 2 +- .../development/interpreters/renpy/default.nix | 2 +- pkgs/development/libraries/bamf/default.nix | 2 +- .../libraries/belle-sip/default.nix | 2 +- .../libraries/boringssl/default.nix | 2 +- pkgs/development/libraries/buddy/default.nix | 2 +- pkgs/development/libraries/bullet/default.nix | 2 +- pkgs/development/libraries/bzrtp/default.nix | 2 +- .../development/libraries/clucene-core/2.x.nix | 2 +- .../libraries/cpp-hocon/default.nix | 2 +- pkgs/development/libraries/cppdb/default.nix | 2 +- pkgs/development/libraries/crc32c/default.nix | 2 +- pkgs/development/libraries/cre2/default.nix | 2 +- pkgs/development/libraries/cwiid/default.nix | 2 +- .../development/libraries/directfb/default.nix | 2 +- .../libraries/easyloggingpp/default.nix | 2 +- pkgs/development/libraries/epoxy/default.nix | 2 +- pkgs/development/libraries/ffms/default.nix | 2 +- pkgs/development/libraries/flatpak/default.nix | 2 +- pkgs/development/libraries/flint/default.nix | 2 +- pkgs/development/libraries/gdal/gdal-1_11.nix | 2 +- pkgs/development/libraries/gegl/4.0.nix | 2 +- pkgs/development/libraries/geis/default.nix | 2 +- pkgs/development/libraries/glm/default.nix | 2 +- .../gnome-online-accounts/default.nix | 2 +- .../libraries/gperftools/default.nix | 2 +- pkgs/development/libraries/gsl/default.nix | 2 +- pkgs/development/libraries/gsl/gsl-1_16.nix | 2 +- pkgs/development/libraries/gtk/3.x.nix | 2 +- .../development/libraries/java/swt/default.nix | 2 +- .../libraries/leatherman/default.nix | 2 +- .../libraries/libbluray/default.nix | 2 +- pkgs/development/libraries/libcbor/default.nix | 2 +- .../libraries/libclxclient/default.nix | 2 +- .../libraries/libdiscid/default.nix | 2 +- .../development/libraries/libdvdread/4.9.9.nix | 2 +- .../libraries/libdvdread/default.nix | 2 +- pkgs/development/libraries/libdynd/default.nix | 2 +- .../libraries/libe-book/default.nix | 2 +- .../libraries/libfakekey/default.nix | 2 +- .../libraries/libfaketime/default.nix | 2 +- pkgs/development/libraries/libfpx/default.nix | 2 +- .../libraries/libgdiplus/default.nix | 2 +- .../libraries/libguestfs/default.nix | 2 +- .../libraries/libjson-rpc-cpp/default.nix | 2 +- .../libraries/libmatchbox/default.nix | 2 +- .../libraries/libmemcached/default.nix | 2 +- .../libraries/libmikmod/default.nix | 2 +- pkgs/development/libraries/libnfs/default.nix | 2 +- .../development/libraries/liboping/default.nix | 2 +- pkgs/development/libraries/libqtav/default.nix | 2 +- pkgs/development/libraries/librdf/redland.nix | 2 +- pkgs/development/libraries/librsvg/default.nix | 2 +- .../libraries/libsoundio/default.nix | 2 +- .../libraries/libtoxcore/new-api.nix | 2 +- .../libraries/libunique/default.nix | 2 +- pkgs/development/libraries/libvirt/default.nix | 2 +- .../libraries/libwhereami/default.nix | 2 +- pkgs/development/libraries/libwps/default.nix | 2 +- .../libraries/mediastreamer/default.nix | 4 ++-- pkgs/development/libraries/mlt/qt-5.nix | 2 +- pkgs/development/libraries/mps/default.nix | 2 +- pkgs/development/libraries/newt/default.nix | 2 +- pkgs/development/libraries/ntrack/default.nix | 2 +- .../libraries/openal-soft/default.nix | 2 +- pkgs/development/libraries/opencv/3.x.nix | 2 +- pkgs/development/libraries/opencv/4.x.nix | 2 +- pkgs/development/libraries/opencv/default.nix | 2 +- .../libraries/openexrid-unstable/default.nix | 2 +- pkgs/development/libraries/openvdb/default.nix | 4 ++-- .../libraries/phonon/backends/gstreamer.nix | 2 +- pkgs/development/libraries/phonon/default.nix | 2 +- .../libraries/poly2tri-c/default.nix | 2 +- .../libraries/portaudio/default.nix | 2 +- .../libraries/prometheus-cpp/default.nix | 2 +- pkgs/development/libraries/qoauth/default.nix | 4 ++-- .../libraries/qt-4.x/4.8/default.nix | 6 +++--- .../libraries/qt-5/modules/qtbase.nix | 2 +- .../libraries/qt-5/modules/qtmultimedia.nix | 2 +- .../libraries/qt-5/modules/qtserialport.nix | 2 +- .../libraries/qt-5/modules/qttools.nix | 2 +- .../libraries/qt-5/modules/qtwebengine.nix | 2 +- .../libraries/qt-5/modules/qtwebkit.nix | 2 +- .../libraries/qt-5/modules/qtwebview.nix | 2 +- .../libraries/qt-mobility/default.nix | 2 +- .../libraries/qtinstaller/default.nix | 2 +- pkgs/development/libraries/rdkafka/default.nix | 2 +- .../science/benchmark/papi/default.nix | 2 +- .../libraries/science/math/nccl/default.nix | 2 +- .../libraries/science/math/osi/default.nix | 4 ++-- .../libraries/science/math/suitesparse/4.4.nix | 2 +- .../science/math/suitesparse/default.nix | 2 +- .../libraries/silgraphite/default.nix | 2 +- pkgs/development/libraries/smpeg/default.nix | 2 +- .../libraries/spatialite-tools/default.nix | 2 +- pkgs/development/libraries/spdk/default.nix | 2 +- pkgs/development/libraries/spice/default.nix | 2 +- pkgs/development/libraries/tinyxml/2.6.2.nix | 2 +- pkgs/development/libraries/ucl/default.nix | 2 +- pkgs/development/libraries/uri/default.nix | 2 +- .../development/libraries/usbredir/default.nix | 2 +- pkgs/development/libraries/ustr/default.nix | 2 +- pkgs/development/libraries/v8/3.14.nix | 2 +- pkgs/development/libraries/v8/5_x.nix | 2 +- pkgs/development/libraries/vigra/default.nix | 2 +- .../libraries/wxwidgets/2.8/default.nix | 2 +- .../libraries/wxwidgets/3.0/mac.nix | 2 +- .../development/libraries/xine-lib/default.nix | 2 +- pkgs/development/libraries/xmlsec/default.nix | 2 +- .../libraries/zeroc-ice/default.nix | 2 +- .../libraries/zookeeper_mt/default.nix | 2 +- pkgs/development/misc/amdapp-sdk/default.nix | 2 +- pkgs/development/misc/qmk_firmware/default.nix | 2 +- .../ocaml-modules/curses/default.nix | 2 +- .../python-modules/cld2-cffi/default.nix | 2 +- .../python-modules/kiwisolver/default.nix | 2 +- .../python-modules/matplotlib/2.nix | 2 +- .../python-modules/matplotlib/default.nix | 2 +- .../python-modules/numba/default.nix | 2 +- .../python-modules/pivy/default.nix | 2 +- .../python-modules/protobuf/default.nix | 2 +- .../python-modules/py3exiv2/default.nix | 2 +- .../python-modules/pyezminc/default.nix | 2 +- .../python-modules/pygtk/default.nix | 2 +- .../python-modules/pypoppler/default.nix | 2 +- .../python-modules/pyscard/default.nix | 2 +- .../python-modules/pysvn/default.nix | 2 +- .../python-modules/python-uinput/default.nix | 2 +- .../python-modules/pytorch/default.nix | 2 +- .../python-modules/roboschool/default.nix | 2 +- pkgs/development/r-modules/generic-builder.nix | 2 +- pkgs/development/tools/analysis/rr/default.nix | 2 +- .../tools/database/sqlitebrowser/default.nix | 2 +- pkgs/development/tools/diesel-cli/default.nix | 2 +- pkgs/development/tools/misc/bossa/default.nix | 2 +- pkgs/development/tools/misc/hydra/default.nix | 2 +- pkgs/development/tools/misc/indent/default.nix | 2 +- .../tools/misc/kconfig-frontends/default.nix | 2 +- .../development/tools/misc/openocd/default.nix | 2 +- .../tools/misc/tcptrack/default.nix | 2 +- pkgs/development/tools/misc/uisp/default.nix | 2 +- pkgs/development/tools/misc/xxdiff/default.nix | 2 +- pkgs/development/tools/nrpl/default.nix | 2 +- pkgs/development/tools/tora/default.nix | 4 ++-- pkgs/development/tools/xcbuild/default.nix | 2 +- pkgs/development/web/kore/default.nix | 2 +- pkgs/games/0ad/game.nix | 2 +- pkgs/games/airstrike/default.nix | 2 +- pkgs/games/armagetronad/default.nix | 2 +- pkgs/games/asc/default.nix | 2 +- pkgs/games/beret/default.nix | 6 +++--- pkgs/games/bitsnbots/default.nix | 4 ++-- pkgs/games/blackshades/default.nix | 2 +- pkgs/games/btanks/default.nix | 2 +- pkgs/games/devilutionx/default.nix | 2 +- pkgs/games/dxx-rebirth/default.nix | 2 +- pkgs/games/eboard/default.nix | 4 ++-- pkgs/games/eduke32/default.nix | 2 +- pkgs/games/egoboo/default.nix | 2 +- pkgs/games/exult/default.nix | 2 +- pkgs/games/globulation/default.nix | 2 +- pkgs/games/gnujump/default.nix | 2 +- pkgs/games/gzdoom/default.nix | 2 +- pkgs/games/hedgewars/default.nix | 2 +- pkgs/games/instead/default.nix | 2 +- pkgs/games/ivan/default.nix | 2 +- pkgs/games/liquidwar/5.nix | 2 +- pkgs/games/liquidwar/default.nix | 2 +- pkgs/games/macopix/default.nix | 2 +- pkgs/games/naev/default.nix | 2 +- pkgs/games/nexuiz/default.nix | 2 +- pkgs/games/onscripter-en/default.nix | 2 +- pkgs/games/opendungeons/default.nix | 2 +- pkgs/games/openlierox/default.nix | 2 +- pkgs/games/openspades/default.nix | 2 +- pkgs/games/pokerth/default.nix | 2 +- pkgs/games/rogue/default.nix | 2 +- pkgs/games/scorched3d/default.nix | 2 +- pkgs/games/spring/default.nix | 2 +- pkgs/games/stuntrally/default.nix | 2 +- pkgs/games/tdm/default.nix | 2 +- pkgs/games/tome4/default.nix | 2 +- pkgs/games/tremulous/default.nix | 2 +- pkgs/games/ufoai/default.nix | 2 +- pkgs/games/xbill/default.nix | 2 +- pkgs/games/xpilot/bloodspilot-client.nix | 2 +- pkgs/games/xsok/default.nix | 2 +- pkgs/games/xsokoban/default.nix | 2 +- pkgs/games/zaz/default.nix | 2 +- pkgs/games/zdoom/default.nix | 2 +- pkgs/games/zod/default.nix | 2 +- pkgs/games/zoom/default.nix | 2 +- pkgs/misc/cups/drivers/cups-bjnp/default.nix | 2 +- pkgs/misc/drivers/utsushi/default.nix | 2 +- pkgs/misc/emulators/fakenes/default.nix | 2 +- pkgs/misc/emulators/gens-gs/default.nix | 2 +- pkgs/misc/emulators/mame/default.nix | 2 +- pkgs/misc/emulators/wine/base.nix | 2 +- pkgs/misc/emulators/wxmupen64plus/default.nix | 2 +- pkgs/misc/screensavers/rss-glx/default.nix | 4 ++-- .../diskdev_cmds/default.nix | 4 ++-- .../apple-source-releases/dtrace/default.nix | 4 ++-- .../network_cmds/default.nix | 2 +- .../system_cmds/default.nix | 2 +- .../apple-source-releases/top/default.nix | 2 +- .../apple-source-releases/xnu/default.nix | 2 +- pkgs/os-specific/darwin/maloader/default.nix | 2 +- .../darwin/swift-corelibs/corefoundation.nix | 15 +++++++++------ pkgs/os-specific/linux/amdgpu-pro/default.nix | 2 +- pkgs/os-specific/linux/anbox/default.nix | 2 +- pkgs/os-specific/linux/conky/default.nix | 2 +- pkgs/os-specific/linux/crda/default.nix | 2 +- pkgs/os-specific/linux/cryptsetup/default.nix | 2 +- .../linux/disk-indicator/default.nix | 2 +- pkgs/os-specific/linux/dropwatch/default.nix | 2 +- pkgs/os-specific/linux/ebtables/default.nix | 2 +- pkgs/os-specific/linux/ena/default.nix | 2 +- .../linux/firmware/fwupdate/default.nix | 2 +- pkgs/os-specific/linux/kernel/perf.nix | 2 +- .../linux/lttng-modules/default.nix | 2 +- pkgs/os-specific/linux/open-iscsi/default.nix | 4 ++-- pkgs/os-specific/linux/pktgen/default.nix | 2 +- pkgs/os-specific/linux/rtkit/default.nix | 2 +- pkgs/os-specific/linux/rtl8814au/default.nix | 2 +- pkgs/os-specific/linux/rtl8821au/default.nix | 2 +- pkgs/os-specific/linux/sssd/default.nix | 2 +- pkgs/os-specific/linux/sysdig/default.nix | 2 +- pkgs/os-specific/linux/sysklogd/default.nix | 2 +- pkgs/os-specific/linux/tiptop/default.nix | 2 +- pkgs/os-specific/linux/tmon/default.nix | 2 +- pkgs/os-specific/linux/usermount/default.nix | 2 +- pkgs/os-specific/linux/wireguard/default.nix | 2 +- pkgs/servers/computing/torque/default.nix | 2 +- pkgs/servers/dict/libmaa.nix | 2 +- pkgs/servers/fcgiwrap/default.nix | 2 +- pkgs/servers/fingerd/bsd-fingerd/default.nix | 2 +- pkgs/servers/ftp/vsftpd/default.nix | 2 +- pkgs/servers/http/apache-httpd/2.4.nix | 2 +- pkgs/servers/http/nginx/generic.nix | 2 +- pkgs/servers/http/openresty/default.nix | 2 +- pkgs/servers/http/tengine/default.nix | 2 +- pkgs/servers/mail/archiveopteryx/default.nix | 2 +- pkgs/servers/mail/opensmtpd/extras.nix | 2 +- pkgs/servers/mail/postfix/default.nix | 2 +- pkgs/servers/mail/postfix/pfixtools.nix | 2 +- pkgs/servers/memcached/default.nix | 2 +- pkgs/servers/nosql/aerospike/default.nix | 2 +- pkgs/servers/nosql/mongodb/default.nix | 2 +- pkgs/servers/prayer/default.nix | 2 +- pkgs/servers/shishi/default.nix | 2 +- pkgs/servers/sip/freeswitch/default.nix | 2 +- pkgs/servers/sql/mysql/5.7.x.nix | 8 +++++--- pkgs/servers/sql/percona/5.6.x.nix | 4 ++-- pkgs/servers/sql/postgresql/ext/postgis.nix | 2 +- pkgs/servers/tvheadend/default.nix | 2 +- pkgs/servers/uwsgi/default.nix | 2 +- pkgs/servers/varnish/digest.nix | 2 +- pkgs/servers/web-apps/fileshelter/default.nix | 2 +- pkgs/shells/bash/5.0.nix | 2 +- pkgs/tools/X11/x11spice/default.nix | 2 +- pkgs/tools/X11/xpra/default.nix | 2 +- pkgs/tools/archivers/p7zip/default.nix | 2 +- pkgs/tools/audio/darkice/default.nix | 2 +- pkgs/tools/audio/gvolicon/default.nix | 2 +- pkgs/tools/audio/pa-applet/default.nix | 2 +- pkgs/tools/backup/chunksync/default.nix | 2 +- pkgs/tools/cd-dvd/cdrdao/default.nix | 2 +- pkgs/tools/compression/pbzip2/default.nix | 2 +- pkgs/tools/filesystems/blobfuse/default.nix | 2 +- .../filesystems/reiserfsprogs/default.nix | 2 +- pkgs/tools/filesystems/sshfs-fuse/default.nix | 2 +- pkgs/tools/filesystems/svnfs/default.nix | 4 ++-- pkgs/tools/filesystems/udftools/default.nix | 2 +- pkgs/tools/graphics/appleseed/default.nix | 2 +- pkgs/tools/graphics/asymptote/default.nix | 2 +- pkgs/tools/graphics/fim/default.nix | 2 +- pkgs/tools/graphics/qrcode/default.nix | 2 +- pkgs/tools/graphics/quirc/default.nix | 2 +- pkgs/tools/graphics/zbar/default.nix | 2 +- .../fcitx-engines/fcitx-unikey/default.nix | 2 +- pkgs/tools/misc/aescrypt/default.nix | 2 +- pkgs/tools/misc/grub/2.0x.nix | 2 +- pkgs/tools/misc/grub/trusted.nix | 2 +- pkgs/tools/misc/ipxe/default.nix | 2 +- pkgs/tools/misc/memtest86+/default.nix | 2 +- pkgs/tools/misc/osm2pgsql/default.nix | 2 +- pkgs/tools/misc/parcellite/default.nix | 2 +- pkgs/tools/misc/qjoypad/default.nix | 2 +- pkgs/tools/misc/snapper/default.nix | 2 +- pkgs/tools/misc/tealdeer/default.nix | 2 +- pkgs/tools/misc/timidity/default.nix | 2 +- pkgs/tools/misc/toybox/default.nix | 2 +- pkgs/tools/misc/wv2/default.nix | 2 +- pkgs/tools/misc/wyrd/default.nix | 2 +- pkgs/tools/networking/altermime/default.nix | 2 +- pkgs/tools/networking/atftp/default.nix | 2 +- pkgs/tools/networking/atinout/default.nix | 2 +- pkgs/tools/networking/bsd-finger/default.nix | 2 +- pkgs/tools/networking/bwm-ng/default.nix | 2 +- .../connman/connman-ncurses/default.nix | 2 +- pkgs/tools/networking/dhcp/default.nix | 2 +- pkgs/tools/networking/dibbler/default.nix | 2 +- pkgs/tools/networking/dnstracer/default.nix | 2 +- pkgs/tools/networking/dsniff/default.nix | 2 +- pkgs/tools/networking/iodine/default.nix | 2 +- pkgs/tools/networking/libnids/default.nix | 2 +- pkgs/tools/networking/libreswan/default.nix | 2 +- pkgs/tools/networking/lsh/default.nix | 2 +- pkgs/tools/networking/mailutils/default.nix | 2 +- pkgs/tools/networking/nbd/default.nix | 2 +- .../network-manager/iodine/default.nix | 2 +- .../networking/network-manager/strongswan.nix | 2 +- pkgs/tools/networking/nfstrace/default.nix | 4 ++-- pkgs/tools/networking/ntopng/default.nix | 2 +- pkgs/tools/networking/openfortivpn/default.nix | 2 +- pkgs/tools/networking/packetdrill/default.nix | 2 +- pkgs/tools/networking/ripmime/default.nix | 2 +- pkgs/tools/networking/siege/default.nix | 2 +- pkgs/tools/networking/sipsak/default.nix | 2 +- pkgs/tools/networking/ssmtp/default.nix | 2 +- pkgs/tools/networking/strongswan/default.nix | 2 +- pkgs/tools/networking/tracebox/default.nix | 2 +- pkgs/tools/networking/uwimap/default.nix | 2 +- pkgs/tools/networking/wrk/default.nix | 2 +- pkgs/tools/package-management/rpm/default.nix | 2 +- pkgs/tools/package-management/xbps/default.nix | 2 +- pkgs/tools/security/chaps/default.nix | 2 +- pkgs/tools/security/gpgstats/default.nix | 2 +- pkgs/tools/security/haka/default.nix | 2 +- pkgs/tools/security/opensc/default.nix | 2 +- pkgs/tools/security/super/default.nix | 2 +- pkgs/tools/security/tor/default.nix | 2 +- pkgs/tools/security/trousers/default.nix | 2 +- pkgs/tools/system/acpica-tools/default.nix | 2 +- pkgs/tools/system/ddrescueview/default.nix | 2 +- pkgs/tools/system/facter/default.nix | 2 +- pkgs/tools/system/gdmap/default.nix | 2 +- pkgs/tools/system/hardinfo/default.nix | 2 +- pkgs/tools/system/hardlink/default.nix | 2 +- pkgs/tools/system/ipmiutil/default.nix | 2 +- pkgs/tools/system/netdata/default.nix | 2 +- pkgs/tools/system/opencl-info/default.nix | 2 +- pkgs/tools/system/rowhammer-test/default.nix | 2 +- pkgs/tools/system/stress-ng/default.nix | 2 +- pkgs/tools/system/testdisk/default.nix | 2 +- pkgs/tools/text/kytea/default.nix | 2 +- .../text/multitran/libmtquery/default.nix | 2 +- pkgs/tools/text/sgml/jade/default.nix | 2 +- pkgs/tools/text/silver-searcher/default.nix | 2 +- pkgs/tools/typesetting/sile/default.nix | 2 +- pkgs/tools/video/mjpegtools/default.nix | 2 +- pkgs/tools/video/swfmill/default.nix | 2 +- .../google-compute-engine-oslogin/default.nix | 4 ++-- 552 files changed, 616 insertions(+), 603 deletions(-) diff --git a/lib/tests/release.nix b/lib/tests/release.nix index 737d142d25324..ba046882392fe 100644 --- a/lib/tests/release.nix +++ b/lib/tests/release.nix @@ -2,7 +2,7 @@ pkgs.runCommandNoCC "nixpkgs-lib-tests" { buildInputs = [ pkgs.nix (import ./check-eval.nix) ]; - NIX_PATH="nixpkgs=${pkgs.path}"; + env.NIX_PATH="nixpkgs=${pkgs.path}"; } '' datadir="${pkgs.nix}/share" export TEST_ROOT=$(pwd)/test-tmp diff --git a/pkgs/applications/audio/audacity/default.nix b/pkgs/applications/audio/audacity/default.nix index 57e0c52e64061..95f194ed2eed9 100644 --- a/pkgs/applications/audio/audacity/default.nix +++ b/pkgs/applications/audio/audacity/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { ]; # audacity only looks for lame and ffmpeg at runtime, so we need to link them in manually - NIX_LDFLAGS = toString [ + env.NIX_LDFLAGS = toString [ # LAME "-lmp3lame" # ffmpeg diff --git a/pkgs/applications/audio/audio-recorder/default.nix b/pkgs/applications/audio/audio-recorder/default.nix index 534b87e9fa743..a93f3f893ff56 100644 --- a/pkgs/applications/audio/audio-recorder/default.nix +++ b/pkgs/applications/audio/audio-recorder/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { }; # https://bugs.launchpad.net/audio-recorder/+bug/1784622 - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; nativeBuildInputs = [ pkgconfig intltool wrapGAppsHook ]; diff --git a/pkgs/applications/audio/axoloti/libusb1.nix b/pkgs/applications/audio/axoloti/libusb1.nix index 1a6ebd346ccab..65e84e41233dd 100644 --- a/pkgs/applications/audio/axoloti/libusb1.nix +++ b/pkgs/applications/audio/axoloti/libusb1.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { }) ]; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; preFixup = stdenv.lib.optionalString stdenv.isLinux '' sed 's,-ludev,-L${systemd.lib}/lib -ludev,' -i $out/lib/libusb-1.0.la diff --git a/pkgs/applications/audio/bs1770gain/default.nix b/pkgs/applications/audio/bs1770gain/default.nix index 2dee463aeee23..b8b0ad1e9d6cc 100644 --- a/pkgs/applications/audio/bs1770gain/default.nix +++ b/pkgs/applications/audio/bs1770gain/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { buildInputs = [ ffmpeg sox ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; meta = with stdenv.lib; { description = "A audio/video loudness scanner implementing ITU-R BS.1770"; diff --git a/pkgs/applications/audio/chuck/default.nix b/pkgs/applications/audio/chuck/default.nix index 04b31ae2c0b32..367f60a6e43c1 100644 --- a/pkgs/applications/audio/chuck/default.nix +++ b/pkgs/applications/audio/chuck/default.nix @@ -19,8 +19,8 @@ stdenv.mkDerivation rec { patches = [ ./darwin-limits.patch ]; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-missing-sysroot"; - NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework MultitouchSupport"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-missing-sysroot"; + env.NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework MultitouchSupport"; postPatch = '' substituteInPlace src/core/makefile.x/makefile.osx \ diff --git a/pkgs/applications/audio/easytag/default.nix b/pkgs/applications/audio/easytag/default.nix index 4c2b97e727f47..9f983ee41ad1c 100644 --- a/pkgs/applications/audio/easytag/default.nix +++ b/pkgs/applications/audio/easytag/default.nix @@ -14,7 +14,7 @@ in stdenv.mkDerivation rec { sha256 = "1mbxnqrw1fwcgraa1bgik25vdzvf97vma5pzknbwbqq5ly9fwlgw"; }; - NIX_LDFLAGS = "-lid3tag -lz"; + env.NIX_LDFLAGS = "-lid3tag -lz"; nativeBuildInputs = [ pkgconfig intltool itstool libxml2 wrapGAppsHook ]; buildInputs = [ diff --git a/pkgs/applications/audio/freewheeling/default.nix b/pkgs/applications/audio/freewheeling/default.nix index 34494871f29c1..deffbb3a3fbf2 100644 --- a/pkgs/applications/audio/freewheeling/default.nix +++ b/pkgs/applications/audio/freewheeling/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { configureFlags = oldAttrs.configureFlags ++ [ "--enable-openssl-compatibility" ]; })) ]; - NIX_CFLAGS_COMPILE = toString + env.NIX_CFLAGS_COMPILE = toString (makeSDLFlags [ SDL SDL_ttf SDL_gfx ] ++ [ "-I${libxml2.dev}/include/libxml2" ]); hardeningDisable = [ "format" ]; diff --git a/pkgs/applications/audio/jack-rack/default.nix b/pkgs/applications/audio/jack-rack/default.nix index 41b40223b87fb..16db812c6a79b 100644 --- a/pkgs/applications/audio/jack-rack/default.nix +++ b/pkgs/applications/audio/jack-rack/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libjack2 ladspaH gtk2 alsaLib libxml2 librdf ]; - NIX_LDFLAGS = "-ldl -lm -lpthread"; + env.NIX_LDFLAGS = "-ldl -lm -lpthread"; meta = { description = ''An effects "rack" for the JACK low latency audio API''; diff --git a/pkgs/applications/audio/jamin/default.nix b/pkgs/applications/audio/jamin/default.nix index 818630585cfdf..0b3f4af31557a 100644 --- a/pkgs/applications/audio/jamin/default.nix +++ b/pkgs/applications/audio/jamin/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation { buildInputs = [ fftwFloat gtk2 ladspaPlugins libjack2 liblo libxml2 makeWrapper ] ++ (with perlPackages; [ perl XMLParser ]); - NIX_LDFLAGS = "-ldl"; + env.NIX_LDFLAGS = "-ldl"; postInstall = '' wrapProgram $out/bin/jamin --set LADSPA_PATH ${ladspaPlugins}/lib/ladspa diff --git a/pkgs/applications/audio/kid3/default.nix b/pkgs/applications/audio/kid3/default.nix index 75ffd083a5a48..c53d13775bcec 100644 --- a/pkgs/applications/audio/kid3/default.nix +++ b/pkgs/applications/audio/kid3/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { qtbase qttools qtmultimedia qtquickcontrols ]; cmakeFlags = [ "-DWITH_APPS=Qt;CLI" ]; - NIX_LDFLAGS = "-lm -lpthread"; + env.NIX_LDFLAGS = "-lm -lpthread"; preConfigure = '' export DOCBOOKDIR="${docbook_xsl}/xml/xsl/docbook/" diff --git a/pkgs/applications/audio/klick/default.nix b/pkgs/applications/audio/klick/default.nix index f33245d8f1c95..eb5fa2cecaad8 100644 --- a/pkgs/applications/audio/klick/default.nix +++ b/pkgs/applications/audio/klick/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ sconsPackages.scons_3_0_1 pkgconfig ]; buildInputs = [ libsamplerate libsndfile liblo libjack2 boost ]; prefixKey = "PREFIX="; - NIX_CFLAGS_COMPILE = "-fpermissive"; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; meta = { homepage = http://das.nasophon.de/klick/; diff --git a/pkgs/applications/audio/lash/default.nix b/pkgs/applications/audio/lash/default.nix index 0dbe60b6a6154..f9797a2f84cd4 100644 --- a/pkgs/applications/audio/lash/default.nix +++ b/pkgs/applications/audio/lash/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { buildInputs = [ alsaLib gtk2 libjack2 libxml2 makeWrapper pkgconfig readline ]; propagatedBuildInputs = [ libuuid ]; - NIX_LDFLAGS = "-lm -lpthread -luuid"; + env.NIX_LDFLAGS = "-lm -lpthread -luuid"; postInstall = '' for i in lash_control lash_panel diff --git a/pkgs/applications/audio/lsp-plugins/default.nix b/pkgs/applications/audio/lsp-plugins/default.nix index b146fcecc8ec7..15c387a97baef 100644 --- a/pkgs/applications/audio/lsp-plugins/default.nix +++ b/pkgs/applications/audio/lsp-plugins/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { "PREFIX=${placeholder ''out''}" ]; - NIX_CFLAGS_COMPILE = "-DLSP_NO_EXPERIMENTAL"; + env.NIX_CFLAGS_COMPILE = "-DLSP_NO_EXPERIMENTAL"; doCheck = true; diff --git a/pkgs/applications/audio/pianobooster/default.nix b/pkgs/applications/audio/pianobooster/default.nix index f2130fe55590b..e56622657e75c 100644 --- a/pkgs/applications/audio/pianobooster/default.nix +++ b/pkgs/applications/audio/pianobooster/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { preConfigure = "cd src"; buildInputs = [ alsaLib cmake makeWrapper libGLU libGL qt4 ]; - NIX_LDFLAGS = "-lGL -lpthread"; + env.NIX_LDFLAGS = "-lGL -lpthread"; postInstall = '' wrapProgram $out/bin/pianobooster \ diff --git a/pkgs/applications/audio/sayonara/default.nix b/pkgs/applications/audio/sayonara/default.nix index c4258174500fd..89ad9b05b7a9c 100644 --- a/pkgs/applications/audio/sayonara/default.nix +++ b/pkgs/applications/audio/sayonara/default.nix @@ -66,7 +66,7 @@ mkDerivation rec { ]; # gstreamer cannot otherwise be found - NIX_CFLAGS_COMPILE = "-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0"; + env.NIX_CFLAGS_COMPILE = "-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0"; postInstall = '' qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0") diff --git a/pkgs/applications/audio/sound-juicer/default.nix b/pkgs/applications/audio/sound-juicer/default.nix index 7f22a03c1bb4b..0819da45d5044 100644 --- a/pkgs/applications/audio/sound-juicer/default.nix +++ b/pkgs/applications/audio/sound-juicer/default.nix @@ -22,7 +22,7 @@ in stdenv.mkDerivation rec{ gst_all_1.gst-libav ]; - NIX_CFLAGS_COMPILE="-Wno-error=format-nonliteral"; + env.NIX_CFLAGS_COMPILE="-Wno-error=format-nonliteral"; passthru = { updateScript = gnome3.updateScript { diff --git a/pkgs/applications/audio/soundscape-renderer/default.nix b/pkgs/applications/audio/soundscape-renderer/default.nix index 5b5f01eef5cc8..29c093f7152b3 100644 --- a/pkgs/applications/audio/soundscape-renderer/default.nix +++ b/pkgs/applications/audio/soundscape-renderer/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation { # Without it doesn't find all of the boost libraries. BOOST_LIB_DIR="${boost}/lib"; # uses the deprecated get_generic_category() in boost_system - NIX_CFLAGS_COMPILE="-DBOOST_SYSTEM_ENABLE_DEPRECATED=1"; + env.NIX_CFLAGS_COMPILE="-DBOOST_SYSTEM_ENABLE_DEPRECATED=1"; LC_ALL = "en_US.UTF-8"; diff --git a/pkgs/applications/audio/squishyball/default.nix b/pkgs/applications/audio/squishyball/default.nix index 496ce779ffb57..4df9c8243d00c 100644 --- a/pkgs/applications/audio/squishyball/default.nix +++ b/pkgs/applications/audio/squishyball/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { buildInputs = [ flac libao libvorbis ncurses opusfile ]; - NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS"; + env.NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS"; patches = [ ./gnu-screen.patch ]; diff --git a/pkgs/applications/audio/svox/default.nix b/pkgs/applications/audio/svox/default.nix index 3e9fe4725afd4..3060c80a38ec4 100644 --- a/pkgs/applications/audio/svox/default.nix +++ b/pkgs/applications/audio/svox/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation { cp lang/*.bin $out/share/pico/lang ''; - NIX_CFLAGS_COMPILE = "-include stdint.h"; + env.NIX_CFLAGS_COMPILE = "-include stdint.h"; meta = with stdenv.lib; { description = "Text-to-speech engine"; diff --git a/pkgs/applications/audio/timemachine/default.nix b/pkgs/applications/audio/timemachine/default.nix index 48dd3f39e88fe..4b2e974caf130 100644 --- a/pkgs/applications/audio/timemachine/default.nix +++ b/pkgs/applications/audio/timemachine/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { preConfigure = "./autogen.sh"; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; meta = { description = "JACK audio recorder"; diff --git a/pkgs/applications/blockchains/dcrd.nix b/pkgs/applications/blockchains/dcrd.nix index 16d39e85da153..8bfa90633e134 100644 --- a/pkgs/applications/blockchains/dcrd.nix +++ b/pkgs/applications/blockchains/dcrd.nix @@ -9,7 +9,7 @@ buildGoPackage rec { buildInputs = [ go git dep cacert ]; GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt"; - NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + env.NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; src = fetchgit { inherit rev; diff --git a/pkgs/applications/blockchains/dcrwallet.nix b/pkgs/applications/blockchains/dcrwallet.nix index 163ed2615d33e..798d1b09f59f2 100644 --- a/pkgs/applications/blockchains/dcrwallet.nix +++ b/pkgs/applications/blockchains/dcrwallet.nix @@ -9,7 +9,7 @@ buildGoPackage rec { buildInputs = [ go git dep cacert ]; GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt"; - NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + env.NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; src = fetchgit { inherit rev; diff --git a/pkgs/applications/display-managers/lightdm/gtk-greeter.nix b/pkgs/applications/display-managers/lightdm/gtk-greeter.nix index be586bdac9bce..f31b0bc6f9130 100644 --- a/pkgs/applications/display-managers/lightdm/gtk-greeter.nix +++ b/pkgs/applications/display-managers/lightdm/gtk-greeter.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { configureFlagsArray+=( --enable-at-spi-command="${at-spi2-core}/libexec/at-spi-bus-launcher --launch-immediately" ) ''; - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; installFlags = [ "localstatedir=\${TMPDIR}" diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix index bda0552e7529a..f32885a76581f 100644 --- a/pkgs/applications/editors/gnome-builder/default.nix +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -109,7 +109,7 @@ stdenv.mkDerivation rec { patchShebangs build-aux/meson/post_install.py ''; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; mesonFlags = [ "-Dpython_libprefix=${python3.libPrefix}" diff --git a/pkgs/applications/editors/gnome-latex/default.nix b/pkgs/applications/editors/gnome-latex/default.nix index cfd3a4289901f..833ed08e53b53 100644 --- a/pkgs/applications/editors/gnome-latex/default.nix +++ b/pkgs/applications/editors/gnome-latex/default.nix @@ -11,7 +11,7 @@ in stdenv.mkDerivation { sha256 = "1jdca9yhm7mm1aijd1a5amphgn15142kngky3id2am379ixrq1hg"; }; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; configureFlags = ["--disable-dconf-migration"]; nativeBuildInputs = [ diff --git a/pkgs/applications/editors/nedit/default.nix b/pkgs/applications/editors/nedit/default.nix index e1d1fa3070a91..796a7abdaf4ea 100644 --- a/pkgs/applications/editors/nedit/default.nix +++ b/pkgs/applications/editors/nedit/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { # the linux config works fine on darwin too! buildFlags = stdenv.lib.optional (stdenv.isLinux || stdenv.isDarwin) "linux"; - NIX_CFLAGS_COMPILE="-DBUILD_UNTESTED_NEDIT -L${motif}/lib"; + env.NIX_CFLAGS_COMPILE="-DBUILD_UNTESTED_NEDIT -L${motif}/lib"; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/applications/editors/texmacs/darwin.nix b/pkgs/applications/editors/texmacs/darwin.nix index 5d5843890e14b..33c2efa316725 100644 --- a/pkgs/applications/editors/texmacs/darwin.nix +++ b/pkgs/applications/editors/texmacs/darwin.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation { GUILE_CPPFLAGS="-D_THREAD_SAFE -I${guile_1_8.dev}/include -I${guile_1_8.dev}/include/guile "; - NIX_LDFLAGS="${zlib}/lib/libz.dylib"; + env.NIX_LDFLAGS="${zlib}/lib/libz.dylib"; buildPhase = '' substituteInPlace Makefile \ diff --git a/pkgs/applications/editors/texmacs/default.nix b/pkgs/applications/editors/texmacs/default.nix index 91e2427a6c84a..c227e8c1f767e 100644 --- a/pkgs/applications/editors/texmacs/default.nix +++ b/pkgs/applications/editors/texmacs/default.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation { git python3 ]; - NIX_LDFLAGS = "-lz"; + env.NIX_LDFLAGS = "-lz"; postInstall = "wrapProgram $out/bin/texmacs --suffix PATH : " + (if ghostscriptX == null then "" else "${ghostscriptX}/bin:") + diff --git a/pkgs/applications/editors/texmaker/default.nix b/pkgs/applications/editors/texmaker/default.nix index 71043cb78fe13..20e4cd8539780 100644 --- a/pkgs/applications/editors/texmaker/default.nix +++ b/pkgs/applications/editors/texmaker/default.nix @@ -11,7 +11,7 @@ mkDerivation rec { buildInputs = [ qtbase qtscript poppler zlib ]; nativeBuildInputs = [ pkgconfig poppler qmake ]; - NIX_CFLAGS_COMPILE="-I${poppler.dev}/include/poppler"; + env.NIX_CFLAGS_COMPILE="-I${poppler.dev}/include/poppler"; qmakeFlags = [ "DESKTOPDIR=${placeholder "out"}/share/applications" diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 8734fabfdcf91..2259a29ad3848 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -85,7 +85,7 @@ stdenv.mkDerivation rec { done ''; - NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; + env.NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; postInstall = '' wrapProgram $out/bin/grass76 \ diff --git a/pkgs/applications/graphics/ahoviewer/default.nix b/pkgs/applications/graphics/ahoviewer/default.nix index 87bddf9099ee2..00a5e88f84135 100644 --- a/pkgs/applications/graphics/ahoviewer/default.nix +++ b/pkgs/applications/graphics/ahoviewer/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { gst_all_1.gst-plugins-base ] ++ stdenv.lib.optional useUnrar unrar; - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; postPatch = ''patchShebangs version.sh''; diff --git a/pkgs/applications/graphics/freepv/default.nix b/pkgs/applications/graphics/freepv/default.nix index 57321220fb144..4598aabc560fe 100644 --- a/pkgs/applications/graphics/freepv/default.nix +++ b/pkgs/applications/graphics/freepv/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation { --replace png_set_gray_1_2_4_to_8 png_set_expand_gray_1_2_4_to_8 ''; - NIX_CFLAGS_COMPILE = "-fpermissive -Wno-narrowing"; + env.NIX_CFLAGS_COMPILE = "-fpermissive -Wno-narrowing"; meta = { description = "Open source panorama viewer using GL"; diff --git a/pkgs/applications/graphics/gnuclad/default.nix b/pkgs/applications/graphics/gnuclad/default.nix index 5b6dd42e09e55..1f369fb1e35e7 100644 --- a/pkgs/applications/graphics/gnuclad/default.nix +++ b/pkgs/applications/graphics/gnuclad/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "0ka2kscpjff7gflsargv3r9fdaxhkf3nym9mfaln3pnq6q7fwdki"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=catch-value"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=catch-value"; nativeBuildInputs = [ pkgconfig ]; diff --git a/pkgs/applications/graphics/goxel/default.nix b/pkgs/applications/graphics/goxel/default.nix index e870df4bc6efb..d515c55ee1339 100644 --- a/pkgs/applications/graphics/goxel/default.nix +++ b/pkgs/applications/graphics/goxel/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ scons pkgconfig wrapGAppsHook ]; buildInputs = [ glfw3 gtk3 libpng12 ]; - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; buildPhase = '' make release diff --git a/pkgs/applications/graphics/gqview/default.nix b/pkgs/applications/graphics/gqview/default.nix index d82238f925b38..be21f06f4fec2 100644 --- a/pkgs/applications/graphics/gqview/default.nix +++ b/pkgs/applications/graphics/gqview/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation { hardeningDisable = [ "format" ]; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; meta = with stdenv.lib; { description = "A fast image viewer"; diff --git a/pkgs/applications/graphics/hugin/default.nix b/pkgs/applications/graphics/hugin/default.nix index 8f7800a7323a6..4041b43a66e7f 100644 --- a/pkgs/applications/graphics/hugin/default.nix +++ b/pkgs/applications/graphics/hugin/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR"; + env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR"; postInstall = '' for p in $out/bin/*; do diff --git a/pkgs/applications/graphics/imgcat/default.nix b/pkgs/applications/graphics/imgcat/default.nix index 1fa3ec8ccc689..320f50612c75c 100644 --- a/pkgs/applications/graphics/imgcat/default.nix +++ b/pkgs/applications/graphics/imgcat/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { sha256 = "0frz40rjwi73nx2dlqvmnn56zwr29bmnngfb11hhwr7v58yfajdi"; }; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; meta = with stdenv.lib; { description = "It's like cat, but for images"; diff --git a/pkgs/applications/graphics/k3d/default.nix b/pkgs/applications/graphics/k3d/default.nix index 31085cd8023dc..99ed39ce95339 100644 --- a/pkgs/applications/graphics/k3d/default.nix +++ b/pkgs/applications/graphics/k3d/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { #doCheck = false; - NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations"; + env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations"; meta = with stdenv.lib; { description = "A 3D editor with support for procedural editing"; diff --git a/pkgs/applications/graphics/krita/default.nix b/pkgs/applications/graphics/krita/default.nix index 52397ac33c4f9..096b0314da3ab 100644 --- a/pkgs/applications/graphics/krita/default.nix +++ b/pkgs/applications/graphics/krita/default.nix @@ -28,7 +28,7 @@ mkDerivation rec { python3Packages.pyqt5 ] ++ lib.optional (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) vc; - NIX_CFLAGS_COMPILE = [ "-I${ilmbase.dev}/include/OpenEXR" ]; + env.NIX_CFLAGS_COMPILE = [ "-I${ilmbase.dev}/include/OpenEXR" ]; cmakeFlags = [ "-DPYQT5_SIP_DIR=${python3Packages.pyqt5}/share/sip/PyQt5" diff --git a/pkgs/applications/graphics/luminance-hdr/default.nix b/pkgs/applications/graphics/luminance-hdr/default.nix index 94899c937a86b..11a4a8b793449 100644 --- a/pkgs/applications/graphics/luminance-hdr/default.nix +++ b/pkgs/applications/graphics/luminance-hdr/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { sha256 = "1izmgjjp8mgyxv57sjjr05z7g7059ykb5wchlcn4wrnnb6aslnvn"; }; - NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR"; + env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR"; buildInputs = [ qtbase qtdeclarative qttools qtwebengine eigen diff --git a/pkgs/applications/graphics/xournal/default.nix b/pkgs/applications/graphics/xournal/default.nix index 6d10a7cae231c..cf3db5882881f 100644 --- a/pkgs/applications/graphics/xournal/default.nix +++ b/pkgs/applications/graphics/xournal/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoconf automake libtool pkgconfig ]; - NIX_LDFLAGS = "-lz" + env.NIX_LDFLAGS = "-lz" + stdenv.lib.optionalString (!isGdkQuartzBackend) " -lX11"; desktopItem = makeDesktopItem { diff --git a/pkgs/applications/misc/apvlv/default.nix b/pkgs/applications/misc/apvlv/default.nix index b5af1af91f36c..8afc6cf818517 100644 --- a/pkgs/applications/misc/apvlv/default.nix +++ b/pkgs/applications/misc/apvlv/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { sha256 = "1n4xiic8lqnv3mqi7wpdv866gyyakax71gffv3n9427rmcld465i"; }; - NIX_CFLAGS_COMPILE = "-I${poppler.dev}/include/poppler"; + env.NIX_CFLAGS_COMPILE = "-I${poppler.dev}/include/poppler"; nativeBuildInputs = [ pkgconfig diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index 0af78852204d6..a5eed422a3b31 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -66,11 +66,11 @@ stdenv.mkDerivation rec { ++ optional cudaSupport "-DWITH_CYCLES_CUDA_BINARIES=ON" ++ optional colladaSupport "-DWITH_OPENCOLLADA=ON"; - NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}"; + env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}"; # Since some dependencies are built with gcc 6, we need gcc 6's # libstdc++ in our RPATH. Sigh. - NIX_LDFLAGS = optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib"; + env.NIX_LDFLAGS = optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib"; enableParallelBuilding = true; diff --git a/pkgs/applications/misc/cgminer/default.nix b/pkgs/applications/misc/cgminer/default.nix index c05c7423d9a56..fca1fd90c3cc3 100644 --- a/pkgs/applications/misc/cgminer/default.nix +++ b/pkgs/applications/misc/cgminer/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation { ]; configureScript = "./autogen.sh"; configureFlags = [ "--enable-scrypt" "--enable-opencl" ]; - NIX_LDFLAGS = "-lgcc_s -lX11 -lXext -lXinerama"; + env.NIX_LDFLAGS = "-lgcc_s -lX11 -lXext -lXinerama"; postBuild = '' gcc api-example.c -o cgminer-api diff --git a/pkgs/applications/misc/doomseeker/default.nix b/pkgs/applications/misc/doomseeker/default.nix index fbe21dd9a5b2d..07abb21bddeb9 100644 --- a/pkgs/applications/misc/doomseeker/default.nix +++ b/pkgs/applications/misc/doomseeker/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=format-security"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=format-security"; meta = with stdenv.lib; { homepage = http://doomseeker.drdteam.org/; diff --git a/pkgs/applications/misc/fbreader/default.nix b/pkgs/applications/misc/fbreader/default.nix index 857ef9ac27bb6..7e6230a6fe9d8 100644 --- a/pkgs/applications/misc/fbreader/default.nix +++ b/pkgs/applications/misc/fbreader/default.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation { makeFlags = [ "INSTALLDIR=$(out)" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=narrowing"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=narrowing"; meta = with stdenv.lib; { description = "An e-book reader for Linux"; diff --git a/pkgs/applications/misc/getxbook/default.nix b/pkgs/applications/misc/getxbook/default.nix index aa901a7ba513a..3698688ca66dc 100644 --- a/pkgs/applications/misc/getxbook/default.nix +++ b/pkgs/applications/misc/getxbook/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "0ihwrx4gspj8l7fc8vxch6dpjrw1lvv9z3c19f0wxnmnxhv1cjvs"; }; - NIX_CFLAGS_COMPILE = builtins.toString [ + env.NIX_CFLAGS_COMPILE = builtins.toString [ "-Wno-error=format-truncation" "-Wno-error=deprecated-declarations" "-Wno-error=stringop-overflow" diff --git a/pkgs/applications/misc/gnome-recipes/default.nix b/pkgs/applications/misc/gnome-recipes/default.nix index 01f5af339ff08..32ec77e9f373a 100644 --- a/pkgs/applications/misc/gnome-recipes/default.nix +++ b/pkgs/applications/misc/gnome-recipes/default.nix @@ -55,7 +55,7 @@ in stdenv.mkDerivation rec { # https://github.com/NixOS/nixpkgs/issues/36468 # https://gitlab.gnome.org/GNOME/recipes/issues/76 - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; postPatch = '' chmod +x src/list_to_c.py diff --git a/pkgs/applications/misc/golden-cheetah/default.nix b/pkgs/applications/misc/golden-cheetah/default.nix index 3dffc5c77c2ad..178bd8f51d4ed 100644 --- a/pkgs/applications/misc/golden-cheetah/default.nix +++ b/pkgs/applications/misc/golden-cheetah/default.nix @@ -31,7 +31,7 @@ in mkDerivation rec { ]; nativeBuildInputs = [ flex makeWrapper qmake yacc ]; - NIX_LDFLAGS = "-lz"; + env.NIX_LDFLAGS = "-lz"; qtWrapperArgs = [ "--set LD_LIBRARY_PATH ${zlib.out}/lib" ]; diff --git a/pkgs/applications/misc/grip/default.nix b/pkgs/applications/misc/grip/default.nix index 4416e1e62c2d3..6398aba96cd2c 100644 --- a/pkgs/applications/misc/grip/default.nix +++ b/pkgs/applications/misc/grip/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; meta = { description = "GTK-based audio CD player/ripper"; diff --git a/pkgs/applications/misc/gxneur/default.nix b/pkgs/applications/misc/gxneur/default.nix index c44523a8b751e..6dc7aa99a4c05 100644 --- a/pkgs/applications/misc/gxneur/default.nix +++ b/pkgs/applications/misc/gxneur/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation { }; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; nativeBuildInputs = [ pkgconfig intltool ]; buildInputs = [ diff --git a/pkgs/applications/misc/k2pdfopt/default.nix b/pkgs/applications/misc/k2pdfopt/default.nix index 69d78575e2a36..249d645cc23dd 100644 --- a/pkgs/applications/misc/k2pdfopt/default.nix +++ b/pkgs/applications/misc/k2pdfopt/default.nix @@ -65,7 +65,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DCMAKE_C_FLAGS=-I${src}/include_mod" ]; - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; installPhase = '' install -D -m 755 k2pdfopt $out/bin/k2pdfopt diff --git a/pkgs/applications/misc/keepassx/community.nix b/pkgs/applications/misc/keepassx/community.nix index 06fc04ba8fb46..389ccba46fb63 100644 --- a/pkgs/applications/misc/keepassx/community.nix +++ b/pkgs/applications/misc/keepassx/community.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { sha256 = "0dkya9smx81c5cgcwk2gi2m1pabfff1v9gd3ngl42sdvyb63wgdq"; }; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang [ + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang [ "-Wno-old-style-cast" "-Wno-error" "-D__BIG_ENDIAN__=${if stdenv.isBigEndian then "1" else "0"}" @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { --replace "/usr/local/bin" "../bin" \ --replace "/usr/local/share/man" "../share/man" ''; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-rpath ${libargon2}/lib"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-rpath ${libargon2}/lib"; patches = [ ./darwin.patch diff --git a/pkgs/applications/misc/merkaartor/default.nix b/pkgs/applications/misc/merkaartor/default.nix index 08643577b49e1..ab29d5b87bbbd 100644 --- a/pkgs/applications/misc/merkaartor/default.nix +++ b/pkgs/applications/misc/merkaartor/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"; + env.NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"; postInstall = '' wrapProgram $out/bin/merkaartor \ diff --git a/pkgs/applications/misc/mlterm/default.nix b/pkgs/applications/misc/mlterm/default.nix index b2012801e1702..9b16a92721993 100644 --- a/pkgs/applications/misc/mlterm/default.nix +++ b/pkgs/applications/misc/mlterm/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { --replace "-m 2755 -g utmp" " " \ --replace "-m 4755 -o root" " " ''; - NIX_LDFLAGS = " + env.NIX_LDFLAGS = " -L${stdenv.cc.cc.lib}/lib -lX11 -lgdk_pixbuf-2.0 -lcairo -lfontconfig -lfreetype -lXft -lvte-2.91 -lgtk-3 -lharfbuzz -lfribidi -lm17n diff --git a/pkgs/applications/misc/mysql-workbench/default.nix b/pkgs/applications/misc/mysql-workbench/default.nix index 531f8d851f1c8..50c9026f72dd3 100644 --- a/pkgs/applications/misc/mysql-workbench/default.nix +++ b/pkgs/applications/misc/mysql-workbench/default.nix @@ -63,7 +63,7 @@ in stdenv.mkDerivation rec { ''; # error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; cmakeFlags = [ "-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config" diff --git a/pkgs/applications/misc/navit/default.nix b/pkgs/applications/misc/navit/default.nix index 2263dfc1fbc06..00e3f26903a15 100644 --- a/pkgs/applications/misc/navit/default.nix +++ b/pkgs/applications/misc/navit/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { patches = [ ./CMakeLists.txt.patch ]; - NIX_CFLAGS_COMPILE = toString (optional sdlSupport "-I${SDL.dev}/include/SDL" + env.NIX_CFLAGS_COMPILE = toString (optional sdlSupport "-I${SDL.dev}/include/SDL" ++ optional speechdSupport "-I${speechd}/include/speech-dispatcher"); # we choose only cmdline and speech-dispatcher speech options. diff --git a/pkgs/applications/misc/netsurf/libcss/default.nix b/pkgs/applications/misc/netsurf/libcss/default.nix index ed0b7b12e9848..92c60708fb977 100644 --- a/pkgs/applications/misc/netsurf/libcss/default.nix +++ b/pkgs/applications/misc/netsurf/libcss/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { "NSSHARED=${buildsystem}/share/netsurf-buildsystem" ]; - NIX_CFLAGS_COMPILE= "-Wno-error=implicit-fallthrough"; + env.NIX_CFLAGS_COMPILE= "-Wno-error=implicit-fallthrough"; meta = with stdenv.lib; { homepage = http://www.netsurf-browser.org/; diff --git a/pkgs/applications/misc/netsurf/libwapcaplet/default.nix b/pkgs/applications/misc/netsurf/libwapcaplet/default.nix index ad59b1be10e0e..2a82385a898f1 100644 --- a/pkgs/applications/misc/netsurf/libwapcaplet/default.nix +++ b/pkgs/applications/misc/netsurf/libwapcaplet/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { "NSSHARED=${buildsystem}/share/netsurf-buildsystem" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type"; meta = with stdenv.lib; { homepage = http://www.netsurf-browser.org/; diff --git a/pkgs/applications/misc/osm2xmap/default.nix b/pkgs/applications/misc/osm2xmap/default.nix index e5838dc1bbe62..1c6e6093a24ea 100644 --- a/pkgs/applications/misc/osm2xmap/default.nix +++ b/pkgs/applications/misc/osm2xmap/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { "INSTALL_MANDIR=${placeholder ''out''}/share/man/man1" ]; - NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"; + env.NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"; buildInputs = [ libroxml proj libyamlcpp boost ]; diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index caf4f270a1512..d01bad577ceed 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { # Disable compiler warnings that clutter the build log # It seems to be a known issue for Eigen: # http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221 - NIX_CFLAGS_COMPILE = "-Wno-ignored-attributes"; + env.NIX_CFLAGS_COMPILE = "-Wno-ignored-attributes"; prePatch = '' # In nix ioctls.h isn't available from the standard kernel-headers package diff --git a/pkgs/applications/misc/sdcv/default.nix b/pkgs/applications/misc/sdcv/default.nix index 3cebcc0101f87..82fb0a86185c5 100644 --- a/pkgs/applications/misc/sdcv/default.nix +++ b/pkgs/applications/misc/sdcv/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { mkdir locale ''; - NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__"; + env.NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__"; meta = with stdenv.lib; { homepage = https://dushistov.github.io/sdcv/; diff --git a/pkgs/applications/misc/tangogps/default.nix b/pkgs/applications/misc/tangogps/default.nix index 10b487828ea54..4d4a8adfcda5d 100644 --- a/pkgs/applications/misc/tangogps/default.nix +++ b/pkgs/applications/misc/tangogps/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ gettext gtk2 gconf curl libexif sqlite libxml2 ]; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; # bogus includes fail with newer library version postPatch = '' diff --git a/pkgs/applications/misc/vp/default.nix b/pkgs/applications/misc/vp/default.nix index a59a25a144e92..36dd60d80dc90 100644 --- a/pkgs/applications/misc/vp/default.nix +++ b/pkgs/applications/misc/vp/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ SDL SDL_image ]; - NIX_CFLAGS_COMPILE="-I${SDL}/include/SDL -I${SDL_image}/include/SDL"; + env.NIX_CFLAGS_COMPILE="-I${SDL}/include/SDL -I${SDL_image}/include/SDL"; meta = with stdenv.lib; { homepage = http://brlcad.org/~erik/; diff --git a/pkgs/applications/misc/xfontsel/default.nix b/pkgs/applications/misc/xfontsel/default.nix index 5d2b70a80ee41..e4e03fde712fa 100644 --- a/pkgs/applications/misc/xfontsel/default.nix +++ b/pkgs/applications/misc/xfontsel/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [libX11 makeWrapper libXaw]; # Without this, it gets Xmu as a dependency, but without rpath entry - NIX_LDFLAGS = "-lXmu"; + env.NIX_LDFLAGS = "-lXmu"; # This will not make xfontsel find its app-defaults, but at least the $out # directory will contain them. diff --git a/pkgs/applications/misc/xmr-stak/default.nix b/pkgs/applications/misc/xmr-stak/default.nix index b6f05ea3094a3..412e843f0eadd 100644 --- a/pkgs/applications/misc/xmr-stak/default.nix +++ b/pkgs/applications/misc/xmr-stak/default.nix @@ -21,7 +21,7 @@ stdenv'.mkDerivation rec { sha256 = "0ilx5mhh91ks7dwvykfyynh53l6vkkignjpwkkss8ss6b2k8gdbj"; }; - NIX_CFLAGS_COMPILE = "-O3"; + env.NIX_CFLAGS_COMPILE = "-O3"; cmakeFlags = lib.optional (!cudaSupport) "-DCUDA_ENABLE=OFF" ++ lib.optional (!openclSupport) "-DOpenCL_ENABLE=OFF"; diff --git a/pkgs/applications/misc/xsw/default.nix b/pkgs/applications/misc/xsw/default.nix index c7c10254c0ca0..40a51987a6ae2 100644 --- a/pkgs/applications/misc/xsw/default.nix +++ b/pkgs/applications/misc/xsw/default.nix @@ -18,7 +18,7 @@ in stdenv.mkDerivation rec { buildInputs = [ SDL SDL_image SDL_ttf SDL_gfx ]; - NIX_CFLAGS_COMPILE = toString (makeSDLFlags [ SDL SDL_image SDL_ttf SDL_gfx ]); + env.NIX_CFLAGS_COMPILE = toString (makeSDLFlags [ SDL SDL_image SDL_ttf SDL_gfx ]); patches = [ ./parse.patch # Fixes compilation error by avoiding redundant definitions. diff --git a/pkgs/applications/misc/xterm/default.nix b/pkgs/applications/misc/xterm/default.nix index 83ba28bfce37d..053b0e774f2bb 100644 --- a/pkgs/applications/misc/xterm/default.nix +++ b/pkgs/applications/misc/xterm/default.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { ] ++ stdenv.lib.optional enableDecLocator "--enable-dec-locator"; # Work around broken "plink.sh". - NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig"; + env.NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig"; # Hack to get xterm built with the feature of releasing a possible setgid of 'utmp', # decided by the sysadmin to allow the xterm reporting to /var/run/utmp diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 66d499e779e7f..b5c4d6fd362f6 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -156,7 +156,7 @@ stdenv.mkDerivation rec { AVFoundation MediaToolbox CoreLocation Foundation libobjc AddressBook cups ]; - NIX_CFLAGS_COMPILE = toString ([ + env.NIX_CFLAGS_COMPILE = toString ([ "-I${glib.dev}/include/gio-unix-2.0" ] ++ lib.optionals (!isTorBrowserLike) [ diff --git a/pkgs/applications/networking/cluster/mesos/default.nix b/pkgs/applications/networking/cluster/mesos/default.nix index 1ad30335b94d6..8db704223c5ee 100644 --- a/pkgs/applications/networking/cluster/mesos/default.nix +++ b/pkgs/applications/networking/cluster/mesos/default.nix @@ -62,7 +62,7 @@ in stdenv.mkDerivation rec { pythonProtobuf ]; - NIX_CFLAGS_COMPILE = "-Wno-error=format-overflow -Wno-error=class-memaccess"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-overflow -Wno-error=class-memaccess"; preConfigure = '' # https://issues.apache.org/jira/browse/MESOS-6616 diff --git a/pkgs/applications/networking/feedreaders/newsboat/default.nix b/pkgs/applications/networking/feedreaders/newsboat/default.nix index e01e4c4fc44fd..2f46430fda0c2 100644 --- a/pkgs/applications/networking/feedreaders/newsboat/default.nix +++ b/pkgs/applications/networking/feedreaders/newsboat/default.nix @@ -31,7 +31,7 @@ rustPlatform.buildRustPackage rec { make ''; - NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare" + env.NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare" + stdenv.lib.optionalString stdenv.isDarwin " -Wno-error=format-security"; doCheck = true; diff --git a/pkgs/applications/networking/gopher/gopherclient/default.nix b/pkgs/applications/networking/gopher/gopherclient/default.nix index 45d9235afc98d..6271d501ab227 100644 --- a/pkgs/applications/networking/gopher/gopherclient/default.nix +++ b/pkgs/applications/networking/gopher/gopherclient/default.nix @@ -24,7 +24,7 @@ buildGoPackage rec { PATH="$(pwd):$PATH" go generate ${goPackagePath} ''; - NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = [ # go-qml needs private Qt headers. "-I${qtbase.dev}/include/QtCore/${qtbase.version}" ]; diff --git a/pkgs/applications/networking/instant-messengers/baresip/default.nix b/pkgs/applications/networking/instant-messengers/baresip/default.nix index a3497df1716cd..1fdbffa693b6e 100644 --- a/pkgs/applications/networking/instant-messengers/baresip/default.nix +++ b/pkgs/applications/networking/instant-messengers/baresip/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.cc.libc}" ; - NIX_CFLAGS_COMPILE='' -I${librem}/include/rem -I${gsm}/include/gsm + env.NIX_CFLAGS_COMPILE='' -I${librem}/include/rem -I${gsm}/include/gsm -DHAVE_INTTYPES_H -D__GLIBC__ -D__need_timeval -D__need_timespec -D__need_time_t ''; meta = { diff --git a/pkgs/applications/networking/instant-messengers/linphone/default.nix b/pkgs/applications/networking/instant-messengers/linphone/default.nix index b155f31296421..7128fe21777d6 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/default.nix +++ b/pkgs/applications/networking/instant-messengers/linphone/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { (python.withPackages (ps: [ ps.pystache ps.six ])) ]; - NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = [ "-Wno-error" "-I${glib.dev}/include/glib-2.0" "-I${glib.out}/lib/glib-2.0/include" diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-matrix/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-matrix/default.nix index e9a0812e925b1..e43329869793c 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-matrix/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-matrix/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "1gjm0z4wa5vi9x1xk43rany5pffrwg958n180ahdj9a7sa8a4hpm"; }; - NIX_CFLAGS_COMPILE = builtins.toString [ + env.NIX_CFLAGS_COMPILE = builtins.toString [ # glib-2.62 deprecations "-DGLIB_DISABLE_DEPRECATION_WARNINGS" # override "-O0 -Werror" set by build system diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix index 6657ff96b11fd..49cf7df105b20 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "116jfh5ravaixivqx4a4bz0lbb9c49d5r83nwmripja56zdbpgr0"; }; - NIX_CFLAGS_COMPILE = "-I${libnotify}/include/libnotify"; + env.NIX_CFLAGS_COMPILE = "-I${libnotify}/include/libnotify"; patchPhase = '' sed -i -e 's/ [^ ]*-gcc/ gcc/' -e 's/-march[^ ]*//' \ diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/telegram-purple/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/telegram-purple/default.nix index c38ff8f454e9d..8b169d2d98ab2 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/telegram-purple/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/telegram-purple/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { sha256 = "0p93jpjpx7hszwffzgixw04zkrpsiyzz4za3gfr4j07krc4771fp"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type"; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ pidgin libwebp libgcrypt gettext ]; diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix index 41f205514e763..2cb347f3744d1 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "0ms367l2f7x83k407c93bmhpyc820f1css61fh2gx4jq13cxqq3p"; }; - NIX_LDFLAGS = "-lssp -lsodium"; + env.NIX_LDFLAGS = "-lssp -lsodium"; postInstall = "mv $out/lib/purple-2 $out/lib/pidgin"; diff --git a/pkgs/applications/networking/instant-messengers/pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/default.nix index 71168e1a692c2..755d2db9d418f 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin/default.nix @@ -26,7 +26,7 @@ let unwrapped = stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; - NIX_CFLAGS_COMPILE = "-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0"; + env.NIX_CFLAGS_COMPILE = "-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0"; buildInputs = [ gtkspell2 aspell startupnotification diff --git a/pkgs/applications/networking/instant-messengers/psi/default.nix b/pkgs/applications/networking/instant-messengers/psi/default.nix index e895b3cc00d1a..4b878476c8fd3 100644 --- a/pkgs/applications/networking/instant-messengers/psi/default.nix +++ b/pkgs/applications/networking/instant-messengers/psi/default.nix @@ -16,9 +16,9 @@ stdenv.mkDerivation rec { qca2 pkgconfig which glib libXScrnSaver ]; - NIX_CFLAGS_COMPILE="-I${qca2}/include/QtCrypto"; + env.NIX_CFLAGS_COMPILE="-I${qca2}/include/QtCrypto"; - NIX_LDFLAGS="-lqca"; + env.NIX_LDFLAGS="-lqca"; enableParallelBuilding = true; diff --git a/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix b/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix index 8093f91feb3e4..74eb73965cd57 100644 --- a/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix +++ b/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation { patches = [ ./conference.patch ]; buildInputs = [ cmake lame id3lib libvorbis qt4 libogg ]; - NIX_LDFLAGS = "-lvorbis"; + env.NIX_LDFLAGS = "-lvorbis"; meta = { homepage = http://atdot.ch/scr/; diff --git a/pkgs/applications/networking/instant-messengers/swift-im/default.nix b/pkgs/applications/networking/instant-messengers/swift-im/default.nix index d47b7d00af92d..c568c7c2c45de 100644 --- a/pkgs/applications/networking/instant-messengers/swift-im/default.nix +++ b/pkgs/applications/networking/instant-messengers/swift-im/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { propagatedUserEnvPkgs = [ GConf ]; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-I${libxml2.dev}/include/libxml2" "-I${miniupnpc}/include/miniupnpc" "-I${qtwebkit.dev}/include/QtWebKit" diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix index e57ff881af34c..076af032fc66e 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix @@ -70,7 +70,7 @@ mkDerivation rec { "TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" ]; - NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = [ "-DTDESKTOP_DISABLE_CRASH_REPORTS" "-DTDESKTOP_DISABLE_AUTOUPDATE" "-DTDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" diff --git a/pkgs/applications/networking/instant-messengers/vacuum/default.nix b/pkgs/applications/networking/instant-messengers/vacuum/default.nix index 923ce3737532b..c7b464c2b8ce1 100644 --- a/pkgs/applications/networking/instant-messengers/vacuum/default.nix +++ b/pkgs/applications/networking/instant-messengers/vacuum/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation { # hack: needed to fix build issues in # http://hydra.nixos.org/build/38322959/nixlog/1 # should be an upstream issue but it's easy to fix - NIX_LDFLAGS = "-lz"; + env.NIX_LDFLAGS = "-lz"; nativeBuildInputs = [ qmake4Hook ]; diff --git a/pkgs/applications/networking/irc/bip/default.nix b/pkgs/applications/networking/irc/bip/default.nix index 43ec0910cc2b8..2c7182c1c4936 100644 --- a/pkgs/applications/networking/irc/bip/default.nix +++ b/pkgs/applications/networking/irc/bip/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { }) ]; - NIX_CFLAGS_COMPILE = "-Wno-error=unused-result -Wno-error=duplicate-decl-specifier"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-result -Wno-error=duplicate-decl-specifier"; meta = { description = "An IRC proxy (bouncer)"; diff --git a/pkgs/applications/networking/irc/quassel/default.nix b/pkgs/applications/networking/irc/quassel/default.nix index f78053bdc37b3..630197be73fc2 100644 --- a/pkgs/applications/networking/irc/quassel/default.nix +++ b/pkgs/applications/networking/irc/quassel/default.nix @@ -46,7 +46,7 @@ in (if !buildClient then stdenv.mkDerivation else mkDerivation) rec { enableParallelBuilding = true; # Prevent ``undefined reference to `qt_version_tag''' in SSL check - NIX_CFLAGS_COMPILE = "-DQT_NO_VERSION_TAGGING=1"; + env.NIX_CFLAGS_COMPILE = "-DQT_NO_VERSION_TAGGING=1"; buildInputs = [ cmake makeWrapper qtbase ] diff --git a/pkgs/applications/networking/mailreaders/balsa/default.nix b/pkgs/applications/networking/mailreaders/balsa/default.nix index e7c9d50cb9be1..a20c7f0b787eb 100644 --- a/pkgs/applications/networking/mailreaders/balsa/default.nix +++ b/pkgs/applications/networking/mailreaders/balsa/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { "--with-spell-checker=gtkspell" ]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; enableParallelBuilding = true; diff --git a/pkgs/applications/networking/mailreaders/neomutt/default.nix b/pkgs/applications/networking/mailreaders/neomutt/default.nix index 274d9d4718e2a..f75275d8b0a14 100644 --- a/pkgs/applications/networking/mailreaders/neomutt/default.nix +++ b/pkgs/applications/networking/mailreaders/neomutt/default.nix @@ -66,7 +66,7 @@ stdenv.mkDerivation rec { # Fix missing libidn in mutt; # this fix is ugly since it links all binaries in mutt against libidn # like pgpring, pgpewrap, ... - NIX_LDFLAGS = "-lidn"; + env.NIX_LDFLAGS = "-lidn"; postInstall = '' wrapProgram "$out/bin/neomutt" --prefix PATH : "$out/libexec/neomutt" diff --git a/pkgs/applications/networking/p2p/transgui/default.nix b/pkgs/applications/networking/p2p/transgui/default.nix index 51d591995b768..07a4d661238af 100644 --- a/pkgs/applications/networking/p2p/transgui/default.nix +++ b/pkgs/applications/networking/p2p/transgui/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { libX11 glib gtk2 gdk-pixbuf pango atk cairo openssl ]; - NIX_LDFLAGS = " + env.NIX_LDFLAGS = " -L${stdenv.cc.cc.lib}/lib -lX11 -lglib-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpango-1.0 -latk-1.0 -lcairo -lc -lcrypto diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix index 25996953e11ac..9c75804ed7bfe 100644 --- a/pkgs/applications/networking/p2p/transmission/default.nix +++ b/pkgs/applications/networking/p2p/transmission/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { ++ optional enableSystemd "--with-systemd-daemon" ++ optional enableGTK3 "--with-gtk"; - NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation"; + env.NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation"; meta = with stdenv.lib; { description = "A fast, easy and free BitTorrent client"; diff --git a/pkgs/applications/networking/remote/putty/default.nix b/pkgs/applications/networking/remote/putty/default.nix index 49182ec182fef..d6a6bfb016058 100644 --- a/pkgs/applications/networking/remote/putty/default.nix +++ b/pkgs/applications/networking/remote/putty/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { }; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; preConfigure = lib.optionalString stdenv.hostPlatform.isUnix '' perl mkfiles.pl diff --git a/pkgs/applications/office/calligra/default.nix b/pkgs/applications/office/calligra/default.nix index 4855fbc63c3e4..317317caff4e7 100644 --- a/pkgs/applications/office/calligra/default.nix +++ b/pkgs/applications/office/calligra/default.nix @@ -41,7 +41,7 @@ mkDerivation rec { propagatedUserEnvPkgs = [ kproperty ]; - NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR"; + env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR"; postInstall = '' for i in $out/bin/*; do diff --git a/pkgs/applications/office/gnucash/default.nix b/pkgs/applications/office/gnucash/default.nix index 4373278adab07..990c456fa5740 100644 --- a/pkgs/applications/office/gnucash/default.nix +++ b/pkgs/applications/office/gnucash/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { propagatedUserEnvPkgs = [ dconf ]; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; patches = [ ./cmake_check_symbol_exists.patch ]; diff --git a/pkgs/applications/office/kmymoney/default.nix b/pkgs/applications/office/kmymoney/default.nix index c7b4377c3dcbd..d04bb0862654b 100644 --- a/pkgs/applications/office/kmymoney/default.nix +++ b/pkgs/applications/office/kmymoney/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { }; # Hidden dependency that wasn't included in CMakeLists.txt: - NIX_CFLAGS_COMPILE = "-I${kitemmodels.dev}/include/KF5"; + env.NIX_CFLAGS_COMPILE = "-I${kitemmodels.dev}/include/KF5"; enableParallelBuilding = true; diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix index c8bb58d29213c..46f4868120d53 100644 --- a/pkgs/applications/office/libreoffice/default.nix +++ b/pkgs/applications/office/libreoffice/default.nix @@ -57,7 +57,7 @@ in (stdenv.mkDerivation rec { # For some reason librdf_redland sometimes refers to rasqal.h instead # of rasqal/rasqal.h - NIX_CFLAGS_COMPILE = "-I${librdf_rasqal}/include/rasqal"; + env.NIX_CFLAGS_COMPILE = "-I${librdf_rasqal}/include/rasqal"; patches = [ ./xdg-open-brief.patch diff --git a/pkgs/applications/office/libreoffice/src-fresh/override.nix b/pkgs/applications/office/libreoffice/src-fresh/override.nix index 464965121d97a..17ee0d1b8a06f 100644 --- a/pkgs/applications/office/libreoffice/src-fresh/override.nix +++ b/pkgs/applications/office/libreoffice/src-fresh/override.nix @@ -1,4 +1,6 @@ { stdenv, ... }: attrs: { - NIX_CFLAGS_COMPILE = attrs.NIX_CFLAGS_COMPILE + stdenv.lib.optionalString stdenv.isx86_64 " -mno-fma"; + env = attrs.env // { + NIX_CFLAGS_COMPILE = attrs.env.NIX_CFLAGS_COMPILE + stdenv.lib.optionalString stdenv.isx86_64 " -mno-fma"; + }; } diff --git a/pkgs/applications/office/planner/default.nix b/pkgs/applications/office/planner/default.nix index 6189132d0f949..ff4880c702893 100644 --- a/pkgs/applications/office/planner/default.nix +++ b/pkgs/applications/office/planner/default.nix @@ -46,7 +46,7 @@ in stdenv.mkDerivation { ]; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; preConfigure = ''./autogen.sh''; configureFlags = [ diff --git a/pkgs/applications/office/wordgrinder/default.nix b/pkgs/applications/office/wordgrinder/default.nix index 199f17afda799..3f36e3229e538 100644 --- a/pkgs/applications/office/wordgrinder/default.nix +++ b/pkgs/applications/office/wordgrinder/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { ]; # To be able to find - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isLinux "-I${libXft.dev}/include/X11"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isLinux "-I${libXft.dev}/include/X11"; # Binaries look for LuaFileSystem library (lfs.so) at runtime postInstall = '' diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index f5c89ae51cef8..68871f2e411cd 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { Mako cheetah numpy scipy matplotlib pyqt4 pygtk wxPython pyopengl ]; - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; enableParallelBuilding = true; diff --git a/pkgs/applications/radio/xlog/default.nix b/pkgs/applications/radio/xlog/default.nix index 2268cdf725dbb..c0ddea73fd060 100644 --- a/pkgs/applications/radio/xlog/default.nix +++ b/pkgs/applications/radio/xlog/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { }; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; buildInputs = [ glib pkgconfig gtk2 hamlib ]; diff --git a/pkgs/applications/science/astronomy/gildas/default.nix b/pkgs/applications/science/astronomy/gildas/default.nix index 4bb3c7b34fe82..e264253ab7cc7 100644 --- a/pkgs/applications/science/astronomy/gildas/default.nix +++ b/pkgs/applications/science/astronomy/gildas/default.nix @@ -28,9 +28,9 @@ stdenv.mkDerivation rec { patches = [ ./wrapper.patch ./clang.patch ./aarch64.patch ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument"; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks"); + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks"); configurePhase='' substituteInPlace admin/wrapper.sh --replace '%%OUT%%' $out diff --git a/pkgs/applications/science/astronomy/xplanet/default.nix b/pkgs/applications/science/astronomy/xplanet/default.nix index f306f9265abad..d3d1891184d01 100644 --- a/pkgs/applications/science/astronomy/xplanet/default.nix +++ b/pkgs/applications/science/astronomy/xplanet/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { }) ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; meta = with stdenv.lib; { description = "Renders an image of the earth or other planets into the X root window"; diff --git a/pkgs/applications/science/biology/cmtk/default.nix b/pkgs/applications/science/biology/cmtk/default.nix index 1ebfa2fca57a1..ef0d83eec95bf 100644 --- a/pkgs/applications/science/biology/cmtk/default.nix +++ b/pkgs/applications/science/biology/cmtk/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation { buildInputs = [cmake]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; meta = with stdenv.lib; { description = "Computational Morphometry Toolkit "; diff --git a/pkgs/applications/science/chemistry/avogadro/default.nix b/pkgs/applications/science/chemistry/avogadro/default.nix index 6aca678480dae..7d52b43a2d4e8 100644 --- a/pkgs/applications/science/chemistry/avogadro/default.nix +++ b/pkgs/applications/science/chemistry/avogadro/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkgconfig doxygen ]; - NIX_CFLAGS_COMPILE = "-include ${libGLU.dev}/include/GL/glu.h"; + env.NIX_CFLAGS_COMPILE = "-include ${libGLU.dev}/include/GL/glu.h"; patches = [ (fetchurl { diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix index b1bd01fb2f7fe..8fe855c3281b0 100644 --- a/pkgs/applications/science/chemistry/pymol/default.nix +++ b/pkgs/applications/science/chemistry/pymol/default.nix @@ -30,7 +30,7 @@ python3Packages.buildPythonApplication { }; buildInputs = [ python3Packages.numpy glew freeglut libpng libxml2 tk freetype msgpack ]; - NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2"; + env.NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2"; installPhase = '' python setup.py install --home=$out diff --git a/pkgs/applications/science/logic/avy/default.nix b/pkgs/applications/science/logic/avy/default.nix index b43e0c6fbf1a6..4a4d74ea43eea 100644 --- a/pkgs/applications/science/logic/avy/default.nix +++ b/pkgs/applications/science/logic/avy/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { }; buildInputs = [ cmake zlib boost.out boost.dev ]; - NIX_CFLAGS_COMPILE = toString ([ "-Wno-narrowing" ] + env.NIX_CFLAGS_COMPILE = toString ([ "-Wno-narrowing" ] # Squelch endless stream of warnings on same few things ++ stdenv.lib.optionals stdenv.cc.isClang [ "-Wno-empty-body" diff --git a/pkgs/applications/science/math/calculix/default.nix b/pkgs/applications/science/math/calculix/default.nix index 6f2d61cd80f00..848c554c77543 100644 --- a/pkgs/applications/science/math/calculix/default.nix +++ b/pkgs/applications/science/math/calculix/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ arpack spooles openblas ]; - NIX_CFLAGS_COMPILE = "-I${spooles}/include/spooles"; + env.NIX_CFLAGS_COMPILE = "-I${spooles}/include/spooles"; patches = [ ./calculix.patch diff --git a/pkgs/applications/science/math/giac/default.nix b/pkgs/applications/science/math/giac/default.nix index b3777528ecda1..ea88acc335f7e 100644 --- a/pkgs/applications/science/math/giac/default.nix +++ b/pkgs/applications/science/math/giac/default.nix @@ -51,7 +51,7 @@ stdenv.mkDerivation rec { configure:16230: g++ -o conftest -g -O2 conftest.cpp -lntl -llapack -lblas -lgfortran -ldl -lpng16 -lm -lmpfi -lmpfr -lgmp >&5 /nix/store/y9c1v4x7y39j2rfbg17agjwqdzxpsn18-ntl-11.3.2/lib/libntl.so: undefined reference to `pthread_key_create' */ - NIX_CFLAGS_LINK="-lpthread"; + env.NIX_CFLAGS_LINK="-lpthread"; # xcas Phys and Turtle menus are broken with split outputs # and interactive use is likely to need docs diff --git a/pkgs/applications/science/misc/boinc/default.nix b/pkgs/applications/science/misc/boinc/default.nix index 38b9b8ec66d1a..afb5abfe413eb 100644 --- a/pkgs/applications/science/misc/boinc/default.nix +++ b/pkgs/applications/science/misc/boinc/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { libnotify patchelf libX11 libxcb xcbutil ]; - NIX_LDFLAGS = "-lX11"; + env.NIX_LDFLAGS = "-lX11"; preConfigure = '' ./_autosetup diff --git a/pkgs/applications/science/misc/golly/beta.nix b/pkgs/applications/science/misc/golly/beta.nix index 36de6a1d4c503..828509595b12c 100644 --- a/pkgs/applications/science/misc/golly/beta.nix +++ b/pkgs/applications/science/misc/golly/beta.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { makeFlags=[ "AM_LDFLAGS=" ]; - NIX_LDFLAGS="-l${python2.libPrefix} -lperl -ldl -lGL"; + env.NIX_LDFLAGS="-l${python2.libPrefix} -lperl -ldl -lGL"; preConfigure='' export NIX_LDFLAGS="$NIX_LDFLAGS -L$(dirname "$(find ${perl} -name libperl.so)")" export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE diff --git a/pkgs/applications/science/misc/golly/default.nix b/pkgs/applications/science/misc/golly/default.nix index 1478bb643181b..5c5fc25155786 100644 --- a/pkgs/applications/science/misc/golly/default.nix +++ b/pkgs/applications/science/misc/golly/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { makeFlags=[ "AM_LDFLAGS=" ]; - NIX_LDFLAGS="-l${python2.libPrefix} -lperl"; + env.NIX_LDFLAGS="-l${python2.libPrefix} -lperl"; preConfigure='' export NIX_LDFLAGS="$NIX_LDFLAGS -L$(dirname "$(find ${perl} -name libperl.so)")" export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE diff --git a/pkgs/applications/science/misc/vite/default.nix b/pkgs/applications/science/misc/vite/default.nix index 3e7c7a42eb826..c00637e398441 100644 --- a/pkgs/applications/science/misc/vite/default.nix +++ b/pkgs/applications/science/misc/vite/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation { buildInputs = [ cmake qt4 libGLU libGL ]; - NIX_LDFLAGS = "-lGLU"; + env.NIX_LDFLAGS = "-lGLU"; meta = { description = "Visual Trace Explorer (ViTE), a tool to visualize execution traces"; diff --git a/pkgs/applications/version-management/git-and-tools/svn-all-fast-export/default.nix b/pkgs/applications/version-management/git-and-tools/svn-all-fast-export/default.nix index 45b427341a214..643dd044adca5 100644 --- a/pkgs/applications/version-management/git-and-tools/svn-all-fast-export/default.nix +++ b/pkgs/applications/version-management/git-and-tools/svn-all-fast-export/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation { "SVN_INCLUDE=${subversion.dev}/include/subversion-1" ]; - NIX_LDFLAGS = "-lsvn_fs-1"; + env.NIX_LDFLAGS = "-lsvn_fs-1"; meta = with stdenv.lib; { homepage = https://github.com/svn-all-fast-export/svn2git; diff --git a/pkgs/applications/version-management/rcs/default.nix b/pkgs/applications/version-management/rcs/default.nix index 3283a3c046a4e..254058c760e7d 100644 --- a/pkgs/applications/version-management/rcs/default.nix +++ b/pkgs/applications/version-management/rcs/default.nix @@ -51,7 +51,7 @@ stdenv.mkDerivation rec { make $checkFlags check || print_logs_and_fail ''; - NIX_CFLAGS_COMPILE = "-std=c99"; + env.NIX_CFLAGS_COMPILE = "-std=c99"; hardeningDisable = stdenv.lib.optional stdenv.cc.isClang "format"; diff --git a/pkgs/applications/video/aegisub/default.nix b/pkgs/applications/video/aegisub/default.nix index 123308babeae3..88b3949dccaf9 100644 --- a/pkgs/applications/video/aegisub/default.nix +++ b/pkgs/applications/video/aegisub/default.nix @@ -108,7 +108,7 @@ stdenv.mkDerivation # this is fixed upstream though not yet in an officially released version, # should be fine remove on next release (if one ever happens) - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; postInstall = "ln -s $out/bin/aegisub-* $out/bin/aegisub"; diff --git a/pkgs/applications/video/byzanz/default.nix b/pkgs/applications/video/byzanz/default.nix index 10685a72f1098..78b43d52f077f 100644 --- a/pkgs/applications/video/byzanz/default.nix +++ b/pkgs/applications/video/byzanz/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation { ./autogen.sh --prefix=$out ''; - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ which gnome3.gnome-common glib intltool libtool cairo gtk3 xorg.xwininfo ] diff --git a/pkgs/applications/video/handbrake/default.nix b/pkgs/applications/video/handbrake/default.nix index 59a8c2377ce9d..3ddf275e43e9b 100644 --- a/pkgs/applications/video/handbrake/default.nix +++ b/pkgs/applications/video/handbrake/default.nix @@ -100,7 +100,7 @@ stdenv.mkDerivation rec { ]; # NOTE: 2018-12-27: Check NixOS HandBrake test if changing - NIX_LDFLAGS = toString [ + env.NIX_LDFLAGS = toString [ "-lx265" # NOTE: The -ldl flag was fixed upstream for a release after 1.3.0 "-ldl" diff --git a/pkgs/applications/video/kino/default.nix b/pkgs/applications/video/kino/default.nix index 2a0af3ed59e4c..bee5e110ebf96 100644 --- a/pkgs/applications/video/kino/default.nix +++ b/pkgs/applications/video/kino/default.nix @@ -71,7 +71,7 @@ stdenv.mkDerivation { hardeningDisable = [ "format" ]; - NIX_LDFLAGS = "-lavcodec -lavutil"; + env.NIX_LDFLAGS = "-lavcodec -lavutil"; patches = [ ./kino-1.3.4-v4l1.patch ./kino-1.3.4-libav-0.7.patch ./kino-1.3.4-libav-0.8.patch ]; #./kino-1.3.4-libavcodec-pkg-config.patch ]; diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index f5559e3fb6c00..07c01c5bb1b73 100644 --- a/pkgs/applications/video/mplayer/default.nix +++ b/pkgs/applications/video/mplayer/default.nix @@ -195,7 +195,7 @@ stdenv.mkDerivation rec { echo CONFIG_MPEGAUDIODSP=yes >> config.mak ''; - NIX_LDFLAGS = with stdenv.lib; toString ( + env.NIX_LDFLAGS = with stdenv.lib; toString ( optional fontconfigSupport "-lfontconfig" ++ optional fribidiSupport "-lfribidi" ++ optionals x11Support [ "-lX11" "-lXext" ] diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index c333790d6a670..36bb396e055a6 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -118,7 +118,7 @@ in stdenv.mkDerivation rec { patchShebangs ./TOOLS/ ''; - NIX_LDFLAGS = optionalString x11Support "-lX11 -lXext " + env.NIX_LDFLAGS = optionalString x11Support "-lX11 -lXext " + optionalString stdenv.isDarwin "-framework CoreFoundation"; configureFlags = [ diff --git a/pkgs/applications/video/shotcut/default.nix b/pkgs/applications/video/shotcut/default.nix index 4636ce48b1a5b..9225133c1ba9e 100644 --- a/pkgs/applications/video/shotcut/default.nix +++ b/pkgs/applications/video/shotcut/default.nix @@ -39,7 +39,7 @@ mkDerivation rec { qtgraphicaleffects ]; - NIX_CFLAGS_COMPILE = "-I${libmlt}/include/mlt++ -I${libmlt}/include/mlt"; + env.NIX_CFLAGS_COMPILE = "-I${libmlt}/include/mlt++ -I${libmlt}/include/mlt"; qmakeFlags = [ "QMAKE_LRELEASE=${stdenv.lib.getDev qttools}/bin/lrelease" "SHOTCUT_VERSION=${version}" ]; prePatch = '' diff --git a/pkgs/applications/video/wxcam/default.nix b/pkgs/applications/video/wxcam/default.nix index 176d9a87aed0d..cb5d6e5ae1d95 100644 --- a/pkgs/applications/video/wxcam/default.nix +++ b/pkgs/applications/video/wxcam/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { buildInputs = with stdenv.lib; [ pkgconfig intltool libX11 libXv libSM gtk libglade wxGTK perlPackages.XMLParser xvidcore mjpegtools alsaLib libv4l cimg ]; - NIX_CFLAGS_COMPILE="-I ${cimg}/include/cimg"; + env.NIX_CFLAGS_COMPILE="-I ${cimg}/include/cimg"; postUnpack = '' sed -ie 's|/usr/share/|'"$out/share/"'|g' $sourceRoot/Makefile.in diff --git a/pkgs/applications/video/xvidcap/default.nix b/pkgs/applications/video/xvidcap/default.nix index 6e07fbb105b63..9f92d973e6d4e 100644 --- a/pkgs/applications/video/xvidcap/default.nix +++ b/pkgs/applications/video/xvidcap/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { ] ++ (with perlPackages; [ perl XMLParser ]); # !!! don't know why this is necessary - NIX_LDFLAGS = "-lXext -lX11 -lz -lgcc_s"; + env.NIX_LDFLAGS = "-lXext -lX11 -lz -lgcc_s"; meta = with stdenv.lib; { description = "Screencast video catpuring tool"; diff --git a/pkgs/applications/virtualization/bochs/default.nix b/pkgs/applications/virtualization/bochs/default.nix index 48ff2d3cf4926..891f09b994c56 100644 --- a/pkgs/applications/virtualization/bochs/default.nix +++ b/pkgs/applications/virtualization/bochs/default.nix @@ -104,8 +104,8 @@ stdenv.mkDerivation rec { "--enable-es1370" "--enable-busmouse" ]; - NIX_CFLAGS_COMPILE="-I${gtk2.dev}/include/gtk-2.0/ -I${libtool}/include/"; - NIX_LDFLAGS="-L${libtool.lib}/lib"; + env.NIX_CFLAGS_COMPILE="-I${gtk2.dev}/include/gtk-2.0/ -I${libtool}/include/"; + env.NIX_LDFLAGS="-L${libtool.lib}/lib"; hardeningDisable = [ "format" ]; diff --git a/pkgs/applications/virtualization/open-vm-tools/default.nix b/pkgs/applications/virtualization/open-vm-tools/default.nix index cf160d8af53ea..f9abf8d370af4 100644 --- a/pkgs/applications/virtualization/open-vm-tools/default.nix +++ b/pkgs/applications/virtualization/open-vm-tools/default.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = builtins.toString [ + env.NIX_CFLAGS_COMPILE = builtins.toString [ # igrone glib-2.62 deprecations # Drop in next stable release. "-DGLIB_DISABLE_DEPRECATION_WARNINGS" diff --git a/pkgs/applications/virtualization/tini/default.nix b/pkgs/applications/virtualization/tini/default.nix index fcc599b451f0e..8aaf6ee18378c 100644 --- a/pkgs/applications/virtualization/tini/default.nix +++ b/pkgs/applications/virtualization/tini/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { patchPhase = "sed -i /tini-static/d CMakeLists.txt"; - NIX_CFLAGS_COMPILE = "-DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"; + env.NIX_CFLAGS_COMPILE = "-DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"; buildInputs = [ cmake glibc glibc.static ]; diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix index 690b72f3eeb01..ca0c6c937e2c1 100644 --- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix +++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix @@ -34,7 +34,7 @@ in stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types -Wno-error=implicit-function-declaration"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types -Wno-error=implicit-function-declaration"; nativeBuildInputs = [ patchelf makeWrapper ]; buildInputs = [ cdrkit ] ++ kernel.moduleBuildDependencies; diff --git a/pkgs/applications/virtualization/xen/4.10.nix b/pkgs/applications/virtualization/xen/4.10.nix index f15a7ef0f9d41..3a0324ff4a317 100644 --- a/pkgs/applications/virtualization/xen/4.10.nix +++ b/pkgs/applications/virtualization/xen/4.10.nix @@ -148,7 +148,7 @@ callPackage (import ./generic.nix (rec { ++ optional (withOVMF) "--with-system-ovmf=${OVMF.fd}/FV/OVMF.fd" ++ optional (withInternalOVMF) "--enable-ovmf"; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ # Fix build on Glibc 2.24. "-Wno-error=deprecated-declarations" # Fix build with GCC 8 diff --git a/pkgs/applications/virtualization/xen/4.5.nix b/pkgs/applications/virtualization/xen/4.5.nix index af4721516eca5..49b36ebfaf878 100644 --- a/pkgs/applications/virtualization/xen/4.5.nix +++ b/pkgs/applications/virtualization/xen/4.5.nix @@ -243,7 +243,7 @@ callPackage (import ./generic.nix (rec { ]; # Fix build on Glibc 2.24. - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; postPatch = '' # Avoid a glibc >= 2.25 deprecation warnings that get fatal via -Werror. diff --git a/pkgs/applications/virtualization/xen/4.8.nix b/pkgs/applications/virtualization/xen/4.8.nix index 1d0e01fcb8222..c29d68829216f 100644 --- a/pkgs/applications/virtualization/xen/4.8.nix +++ b/pkgs/applications/virtualization/xen/4.8.nix @@ -167,7 +167,7 @@ callPackage (import ./generic.nix (rec { xenpmdpatch ]; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ # Fix build on Glibc 2.24 "-Wno-error=deprecated-declarations" # Fix build with GCC8 diff --git a/pkgs/applications/window-managers/compton/default.nix b/pkgs/applications/window-managers/compton/default.nix index 3f7cfd4864d66..97b76497e172b 100644 --- a/pkgs/applications/window-managers/compton/default.nix +++ b/pkgs/applications/window-managers/compton/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { libxdg_basedir ]; - NIX_CFLAGS_COMPILE = "-fno-strict-aliasing"; + env.NIX_CFLAGS_COMPILE = "-fno-strict-aliasing"; mesonFlags = [ "-Dbuild_docs=true" diff --git a/pkgs/applications/window-managers/fbpanel/default.nix b/pkgs/applications/window-managers/fbpanel/default.nix index cf45dfa86407f..34073ff7922dd 100644 --- a/pkgs/applications/window-managers/fbpanel/default.nix +++ b/pkgs/applications/window-managers/fbpanel/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { preConfigure = "patchShebangs ."; - NIX_LDFLAGS="-lX11"; + env.NIX_LDFLAGS="-lX11"; meta = with stdenv.lib; { description = "A stand-alone panel"; diff --git a/pkgs/applications/window-managers/matchbox/default.nix b/pkgs/applications/window-managers/matchbox/default.nix index 3c537d6c931b3..8a1200ae26450 100644 --- a/pkgs/applications/window-managers/matchbox/default.nix +++ b/pkgs/applications/window-managers/matchbox/default.nix @@ -6,7 +6,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libmatchbox ]; - NIX_LDFLAGS = "-lX11 -L${libX11}/lib -lXext -L${libXext}/lib"; + env.NIX_LDFLAGS = "-lX11 -L${libX11}/lib -lXext -L${libXext}/lib"; src = fetchurl { url = "https://downloads.yoctoproject.org/releases/matchbox/matchbox-window-manager/${version}/matchbox-window-manager-${version}.tar.bz2"; diff --git a/pkgs/applications/window-managers/windowmaker/dockapps/wmsm.app.nix b/pkgs/applications/window-managers/windowmaker/dockapps/wmsm.app.nix index 3e8b3f7f1584d..17910ffdab538 100644 --- a/pkgs/applications/window-managers/windowmaker/dockapps/wmsm.app.nix +++ b/pkgs/applications/window-managers/windowmaker/dockapps/wmsm.app.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { postUnpack = "sourceRoot=\${sourceRoot}/wmsm"; - NIX_CFLAGS_COMPILE = "-std=gnu89"; + env.NIX_CFLAGS_COMPILE = "-std=gnu89"; installPhase = '' substituteInPlace Makefile --replace "PREFIX = /usr/X11R6/bin" "" --replace "/usr/bin/install" "install" diff --git a/pkgs/data/misc/scowl/default.nix b/pkgs/data/misc/scowl/default.nix index f15a7534e267e..8ce60a11817aa 100644 --- a/pkgs/data/misc/scowl/default.nix +++ b/pkgs/data/misc/scowl/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip zip perl aspell dos2unix ]; buildInputs = stdenv.lib.optional (!stdenv.isLinux) libiconv; - NIX_CFLAGS_COMPILE = "-Wno-narrowing"; + env.NIX_CFLAGS_COMPILE = "-Wno-narrowing"; preConfigure = '' patchShebangs . diff --git a/pkgs/desktops/deepin/dde-kwin/default.nix b/pkgs/desktops/deepin/dde-kwin/default.nix index 850186953f635..348ef95709ec8 100644 --- a/pkgs/desktops/deepin/dde-kwin/default.nix +++ b/pkgs/desktops/deepin/dde-kwin/default.nix @@ -74,7 +74,7 @@ mkDerivation rec { # Need to add kwayland around: # * https://github.com/linuxdeepin/dde-kwin/blob/5226bb984c844129f9fa589da56e77decb7b39a1/plugins/kwineffects/blur/CMakeLists.txt#L14 - NIX_CFLAGS_COMPILE = "-I${kwayland.dev}/include/KF5"; + env.NIX_CFLAGS_COMPILE = "-I${kwayland.dev}/include/KF5"; cmakeFlags = [ "-DKWIN_VERSION=${(builtins.parseDrvName kwin.name).version}" diff --git a/pkgs/desktops/deepin/deepin-movie-reborn/default.nix b/pkgs/desktops/deepin/deepin-movie-reborn/default.nix index b3930c8e399ee..31ac4b33f65df 100644 --- a/pkgs/desktops/deepin/deepin-movie-reborn/default.nix +++ b/pkgs/desktops/deepin/deepin-movie-reborn/default.nix @@ -46,7 +46,7 @@ mkDerivation rec { }) ]; - NIX_LDFLAGS = "-ldvdnav"; + env.NIX_LDFLAGS = "-ldvdnav"; postPatch = '' diff --git a/pkgs/desktops/enlightenment/efl.nix b/pkgs/desktops/enlightenment/efl.nix index 183e72565d3d9..2393ff54b9d33 100644 --- a/pkgs/desktops/enlightenment/efl.nix +++ b/pkgs/desktops/enlightenment/efl.nix @@ -128,7 +128,7 @@ stdenv.mkDerivation rec { source "$setupHook" ''; - NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 + env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 postInstall = '' # fix use of $out variable diff --git a/pkgs/desktops/gnome-2/desktop/mail-notification/default.nix b/pkgs/desktops/gnome-2/desktop/mail-notification/default.nix index c12d50d792f2c..8aeca2a4e620d 100644 --- a/pkgs/desktops/gnome-2/desktop/mail-notification/default.nix +++ b/pkgs/desktops/gnome-2/desktop/mail-notification/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { ]; patchFlags = [ "-p0" ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; preConfigure = "./jb configure prefix=$out"; diff --git a/pkgs/desktops/gnome-2/platform/gtkhtml/default.nix b/pkgs/desktops/gnome-2/platform/gtkhtml/default.nix index 3c89f9ff0fccb..fd228f74b1a8f 100644 --- a/pkgs/desktops/gnome-2/platform/gtkhtml/default.nix +++ b/pkgs/desktops/gnome-2/platform/gtkhtml/default.nix @@ -16,5 +16,5 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ gtk2 intltool GConf enchant isocodes gnome_icon_theme ]; - NIX_LDFLAGS = "-lgthread-2.0"; + env.NIX_LDFLAGS = "-lgthread-2.0"; } diff --git a/pkgs/desktops/gnome-2/platform/libglade/default.nix b/pkgs/desktops/gnome-2/platform/libglade/default.nix index d51cccf790664..a3a012f5d8226 100644 --- a/pkgs/desktops/gnome-2/platform/libglade/default.nix +++ b/pkgs/desktops/gnome-2/platform/libglade/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation { buildInputs = [ gtk2 gettext ] ++ stdenv.lib.optional withLibgladeConvert python2; - NIX_LDFLAGS = "-lgmodule-2.0"; + env.NIX_LDFLAGS = "-lgmodule-2.0"; propagatedBuildInputs = [ libxml2 ]; } diff --git a/pkgs/desktops/gnome-3/apps/vinagre/default.nix b/pkgs/desktops/gnome-3/apps/vinagre/default.nix index c5377157ef0c9..223bb98bcf708 100644 --- a/pkgs/desktops/gnome-3/apps/vinagre/default.nix +++ b/pkgs/desktops/gnome-3/apps/vinagre/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { gtk3 vte libxml2 gtk-vnc libsecret gnome3.adwaita-icon-theme librsvg ]; - NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral"; + env.NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral"; passthru = { updateScript = gnome3.updateScript { diff --git a/pkgs/desktops/gnome-3/core/evince/default.nix b/pkgs/desktops/gnome-3/core/evince/default.nix index bab84eeb78cea..b887a7f7c4352 100644 --- a/pkgs/desktops/gnome-3/core/evince/default.nix +++ b/pkgs/desktops/gnome-3/core/evince/default.nix @@ -103,7 +103,7 @@ stdenv.mkDerivation rec { "-Dps=enabled" ]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; preFixup = '' gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "${shared-mime-info}/share") diff --git a/pkgs/desktops/gnome-3/core/gnome-contacts/default.nix b/pkgs/desktops/gnome-3/core/gnome-contacts/default.nix index 01127853a86f0..cd0fdc938557b 100644 --- a/pkgs/desktops/gnome-3/core/gnome-contacts/default.nix +++ b/pkgs/desktops/gnome-3/core/gnome-contacts/default.nix @@ -44,7 +44,7 @@ in stdenv.mkDerivation rec { # /nix/store/*-cheese-3.28.0/include/cheese/cheese-widget.h:26:10: fatal error: clutter-gtk/clutter-gtk.h: No such file or directory # #include # ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - NIX_CFLAGS_COMPILE = "-I${stdenv.lib.getDev clutter-gtk}/include/clutter-gtk-1.0"; + env.NIX_CFLAGS_COMPILE = "-I${stdenv.lib.getDev clutter-gtk}/include/clutter-gtk-1.0"; doCheck = true; diff --git a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix index c388c4f7211b4..430d59c812065 100644 --- a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix +++ b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix @@ -101,7 +101,7 @@ stdenv.mkDerivation rec { # Default for release buildtype but passed manually because # we're using plain - NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS"; + env.NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS"; # So the polkit policy can reference /run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper postFixup = '' diff --git a/pkgs/desktops/mate/atril/default.nix b/pkgs/desktops/mate/atril/default.nix index ecb9ea2e377ec..5f9ea4d6d2572 100644 --- a/pkgs/desktops/mate/atril/default.nix +++ b/pkgs/desktops/mate/atril/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { hicolor-icon-theme ]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; makeFlags = [ "cajaextensiondir=$$out/lib/caja/extensions-2.0" ]; diff --git a/pkgs/desktops/mate/mate-applets/default.nix b/pkgs/desktops/mate/mate-applets/default.nix index 3b5a4ccf2a2b2..49c7d8d922a1e 100644 --- a/pkgs/desktops/mate/mate-applets/default.nix +++ b/pkgs/desktops/mate/mate-applets/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-suid=no" ]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; meta = with stdenv.lib; { description = "Applets for use with the MATE panel"; diff --git a/pkgs/desktops/mate/mate-notification-daemon/default.nix b/pkgs/desktops/mate/mate-notification-daemon/default.nix index a83bbcb3ffbf1..48bc71bf85987 100644 --- a/pkgs/desktops/mate/mate-notification-daemon/default.nix +++ b/pkgs/desktops/mate/mate-notification-daemon/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { gtk3 ]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; meta = with stdenv.lib; { description = "Notification daemon for MATE"; diff --git a/pkgs/desktops/mate/mate-panel/default.nix b/pkgs/desktops/mate/mate-panel/default.nix index 06e9b386adb4b..7c5d8ac7d72c9 100644 --- a/pkgs/desktops/mate/mate-panel/default.nix +++ b/pkgs/desktops/mate/mate-panel/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { hicolor-icon-theme ]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; makeFlags = [ "INTROSPECTION_GIRDIR=$(out)/share/gir-1.0/" diff --git a/pkgs/desktops/mate/mate-settings-daemon/default.nix b/pkgs/desktops/mate/mate-settings-daemon/default.nix index f126918afca8f..21d91e11f14f3 100644 --- a/pkgs/desktops/mate/mate-settings-daemon/default.nix +++ b/pkgs/desktops/mate/mate-settings-daemon/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { configureFlags = stdenv.lib.optional pulseaudioSupport "--enable-pulse"; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; meta = with stdenv.lib; { description = "MATE settings daemon"; diff --git a/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix b/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix index 582793ff5906f..67ef209e35edc 100644 --- a/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix +++ b/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix @@ -150,7 +150,7 @@ stdenv.mkDerivation rec { # Default for release buildtype but passed manually because # we're using plain - NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS"; + env.NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS"; passthru = { updateScript = gnome3.updateScript { diff --git a/pkgs/desktops/rox/rox-filer/default.nix b/pkgs/desktops/rox/rox-filer/default.nix index b7c4015320913..e4a63ddbc39c5 100644 --- a/pkgs/desktops/rox/rox-filer/default.nix +++ b/pkgs/desktops/rox/rox-filer/default.nix @@ -13,7 +13,7 @@ in stdenv.mkDerivation { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libxml2 gtk shared-mime-info libSM ]; - NIX_LDFLAGS = "-ldl -lm"; + env.NIX_LDFLAGS = "-ldl -lm"; patches = [ ./rox-filer-2.11-in-source-build.patch diff --git a/pkgs/desktops/xfce/applications/mousepad/default.nix b/pkgs/desktops/xfce/applications/mousepad/default.nix index 6f841958c7959..03cad2982eeaa 100644 --- a/pkgs/desktops/xfce/applications/mousepad/default.nix +++ b/pkgs/desktops/xfce/applications/mousepad/default.nix @@ -11,7 +11,7 @@ mkXfceDerivation { buildInputs = [ glib gtk3 gtksourceview3 xfconf ]; # See https://github.com/NixOS/nixpkgs/issues/36468 - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; meta = { description = "A simple text editor for Xfce"; diff --git a/pkgs/desktops/xfce/core/exo/default.nix b/pkgs/desktops/xfce/core/exo/default.nix index 59ab5823314ee..30b6a3a841997 100644 --- a/pkgs/desktops/xfce/core/exo/default.nix +++ b/pkgs/desktops/xfce/core/exo/default.nix @@ -12,7 +12,7 @@ mkXfceDerivation { buildInputs = [ gtk3 glib libxfce4ui libxfce4util ]; # Workaround https://bugzilla.xfce.org/show_bug.cgi?id=15825 - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; meta = { description = "Application library for Xfce"; diff --git a/pkgs/desktops/xfce/core/xfce4-session/default.nix b/pkgs/desktops/xfce/core/xfce4-session/default.nix index 0ab362aa21d07..f8e8342eed88c 100644 --- a/pkgs/desktops/xfce/core/xfce4-session/default.nix +++ b/pkgs/desktops/xfce/core/xfce4-session/default.nix @@ -12,7 +12,7 @@ mkXfceDerivation { configureFlags = [ "--with-xsession-prefix=${placeholder "out"}" ]; # See https://github.com/NixOS/nixpkgs/issues/36468 - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; passthru.xinitrc = "${xfce4-session}/etc/xdg/xfce4/xinitrc"; diff --git a/pkgs/desktops/xfce/panel-plugins/xfce4-pulseaudio-plugin/default.nix b/pkgs/desktops/xfce/panel-plugins/xfce4-pulseaudio-plugin/default.nix index 83778aa8fffd9..28556091bfda9 100644 --- a/pkgs/desktops/xfce/panel-plugins/xfce4-pulseaudio-plugin/default.nix +++ b/pkgs/desktops/xfce/panel-plugins/xfce4-pulseaudio-plugin/default.nix @@ -9,7 +9,7 @@ mkXfceDerivation { nativeBuildInputs = [ automakeAddFlags ]; - NIX_CFLAGS_COMPILE = "-I${dbus-glib.dev}/include/dbus-1.0 -I${dbus.dev}/include/dbus-1.0"; + env.NIX_CFLAGS_COMPILE = "-I${dbus-glib.dev}/include/dbus-1.0 -I${dbus.dev}/include/dbus-1.0"; postPatch = '' substituteInPlace configure.ac.in --replace gio-2.0 gio-unix-2.0 diff --git a/pkgs/development/compilers/avian/default.nix b/pkgs/development/compilers/avian/default.nix index 34d1e64c484f2..fe62114c054cd 100644 --- a/pkgs/development/compilers/avian/default.nix +++ b/pkgs/development/compilers/avian/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { buildInputs = [ zlib jdk ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Foundation ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; postPatch = '' substituteInPlace makefile \ diff --git a/pkgs/development/compilers/chez/default.nix b/pkgs/development/compilers/chez/default.nix index c0fd742082f3b..97999d91a96dd 100644 --- a/pkgs/development/compilers/chez/default.nix +++ b/pkgs/development/compilers/chez/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation"; /* ** We patch out a very annoying 'feature' in ./configure, which diff --git a/pkgs/development/compilers/clasp/default.nix b/pkgs/development/compilers/clasp/default.nix index 664d849211350..01349ff4e28ae 100644 --- a/pkgs/development/compilers/clasp/default.nix +++ b/pkgs/development/compilers/clasp/default.nix @@ -83,7 +83,7 @@ stdenv.mkDerivation rec { (x: {configureFlags = (x.configureFlags or []) ++ ["--enable-static"];})) ]; - NIX_CXXSTDLIB_COMPILE = " -frtti "; + env.NIX_CXXSTDLIB_COMPILE = " -frtti "; postPatch = '' echo " diff --git a/pkgs/development/compilers/edk2/default.nix b/pkgs/development/compilers/edk2/default.nix index 97af433d60676..81d8607ab1bbe 100644 --- a/pkgs/development/compilers/edk2/default.nix +++ b/pkgs/development/compilers/edk2/default.nix @@ -26,7 +26,7 @@ edk2 = stdenv.mkDerivation { buildInputs = [ libuuid pythonEnv ]; makeFlags = [ "-C BaseTools" ]; - NIX_CFLAGS_COMPILE = "-Wno-return-type -Wno-error=stringop-truncation"; + env.NIX_CFLAGS_COMPILE = "-Wno-return-type -Wno-error=stringop-truncation"; hardeningDisable = [ "format" "fortify" ]; diff --git a/pkgs/development/compilers/eql/default.nix b/pkgs/development/compilers/eql/default.nix index aac619126896c..a8822237dde95 100644 --- a/pkgs/development/compilers/eql/default.nix +++ b/pkgs/development/compilers/eql/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { buildInputs = [ ecl qt4 xorgserver xkbcomp xkeyboard_config ]; - NIX_CFLAGS_COMPILE = "-fPIC"; + env.NIX_CFLAGS_COMPILE = "-fPIC"; postPatch = '' sed -re 's@[(]in-home "gui/.command-history"[)]@(concatenate '"'"'string (ext:getenv "HOME") "/.eql-gui-command-history")@' -i gui/gui.lisp diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index ef697b74bbe3e..6ac1c6941af32 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -127,7 +127,7 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - NIX_NO_SELF_RPATH = true; + env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 2f85fc4b7e8cb..ff2726d872cca 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -133,7 +133,7 @@ stdenv.mkDerivation ({ outputs = if langJava || langGo then ["out" "man" "info"] else [ "out" "lib" "man" "info" ]; setOutputFlags = false; - NIX_NO_SELF_RPATH = true; + env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index f68ddc81f81f0..abb654b9fdbfd 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -121,7 +121,7 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - NIX_NO_SELF_RPATH = true; + env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -196,7 +196,7 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + env.NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index b1a981cfdf7f9..41cbc29229a53 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -124,7 +124,7 @@ stdenv.mkDerivation ({ outputs = if langJava || langGo then ["out" "man" "info"] else [ "out" "lib" "man" "info" ]; setOutputFlags = false; - NIX_NO_SELF_RPATH = true; + env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -204,7 +204,7 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + env.NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index c41ac280cd743..dfc265dc34962 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -92,7 +92,7 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - NIX_NO_SELF_RPATH = true; + env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -173,8 +173,8 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument"; - NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument"; + env.NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index 7ff8d7529ca37..5cb19c44f83b0 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -83,7 +83,7 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - NIX_NO_SELF_RPATH = true; + env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -164,7 +164,7 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + env.NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 0441296ef179a..fc0452c4ae0ae 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -80,7 +80,7 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - NIX_NO_SELF_RPATH = true; + env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -131,7 +131,7 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + env.NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; @@ -173,7 +173,7 @@ stdenv.mkDerivation ({ (if profiledCompiler then "profiledbootstrap" else "bootstrap"); dontStrip = !stripped; - NIX_STRIP_DEBUG = !stripped; + env.NIX_STRIP_DEBUG = !stripped; installTargets = if stripped diff --git a/pkgs/development/compilers/gcl/default.nix b/pkgs/development/compilers/gcl/default.nix index e3c2d0e09de3c..fb8c140350a6e 100644 --- a/pkgs/development/compilers/gcl/default.nix +++ b/pkgs/development/compilers/gcl/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" "bindnow" ]; - NIX_CFLAGS_COMPILE = "-fgnu89-inline"; + env.NIX_CFLAGS_COMPILE = "-fgnu89-inline"; meta = with stdenv.lib; { description = "GNU Common Lisp compiler working via GCC"; diff --git a/pkgs/development/compilers/gerbil/build.nix b/pkgs/development/compilers/gerbil/build.nix index e2ab09764827a..afe224dad8e10 100644 --- a/pkgs/development/compilers/gerbil/build.nix +++ b/pkgs/development/compilers/gerbil/build.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { buildInputs = [ gambit rsync bash ] ++ buildInputs_libraries ++ buildInputs_staticLibraries; - NIX_CFLAGS_COMPILE = "-I${libmysqlclient}/include/mysql -L${libmysqlclient}/lib/mysql"; + env.NIX_CFLAGS_COMPILE = "-I${libmysqlclient}/include/mysql -L${libmysqlclient}/lib/mysql"; postPatch = '' echo '(define (gerbil-version-string) "v${git-version}")' > src/gerbil/runtime/gx-version.scm diff --git a/pkgs/development/compilers/hhvm/default.nix b/pkgs/development/compilers/hhvm/default.nix index 08ba9e4681475..5e6d38d344826 100644 --- a/pkgs/development/compilers/hhvm/default.nix +++ b/pkgs/development/compilers/hhvm/default.nix @@ -33,10 +33,10 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; dontUseCmakeBuildDir = true; - NIX_LDFLAGS = "-lpam -L${pam}/lib"; + env.NIX_LDFLAGS = "-lpam -L${pam}/lib"; # work around broken build system - NIX_CFLAGS_COMPILE = "-I${freetype.dev}/include/freetype2"; + env.NIX_CFLAGS_COMPILE = "-I${freetype.dev}/include/freetype2"; # the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly # (setting it to an absolute path causes include files to go to $out/$out/include, diff --git a/pkgs/development/compilers/iasl/default.nix b/pkgs/development/compilers/iasl/default.nix index e98d7cc27dbf2..adcc4616980fe 100644 --- a/pkgs/development/compilers/iasl/default.nix +++ b/pkgs/development/compilers/iasl/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "1ip684is3dplf7snkn024vv6bg3dv5msx8v7pz6x9lrnk3gk0j9h"; }; - NIX_CFLAGS_COMPILE = "-O3"; + env.NIX_CFLAGS_COMPILE = "-O3"; buildFlags = [ "iasl" ]; diff --git a/pkgs/development/compilers/llvm/7/lldb.nix b/pkgs/development/compilers/llvm/7/lldb.nix index 44687ead4d1c3..3658014d4d1b2 100644 --- a/pkgs/development/compilers/llvm/7/lldb.nix +++ b/pkgs/development/compilers/llvm/7/lldb.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation { CXXFLAGS = "-fno-rtti"; hardeningDisable = [ "format" ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-I${libxml2.dev}/include/libxml2"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-I${libxml2.dev}/include/libxml2"; enableParallelBuilding = true; diff --git a/pkgs/development/compilers/mono/generic.nix b/pkgs/development/compilers/mono/generic.nix index e0cfe247b23a9..16c84b93a4927 100644 --- a/pkgs/development/compilers/mono/generic.nix +++ b/pkgs/development/compilers/mono/generic.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [glib]; - NIX_LDFLAGS = if stdenv.isDarwin then "" else "-lgcc_s" ; + env.NIX_LDFLAGS = if stdenv.isDarwin then "" else "-lgcc_s" ; # To overcome the bug https://bugzilla.novell.com/show_bug.cgi?id=644723 dontDisableStatic = true; diff --git a/pkgs/development/compilers/nim/default.nix b/pkgs/development/compilers/nim/default.nix index bdb16c9220719..a96972e58fe01 100644 --- a/pkgs/development/compilers/nim/default.nix +++ b/pkgs/development/compilers/nim/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_LDFLAGS = "-lcrypto -lpcre -lreadline -lgc -lsqlite3"; + env.NIX_LDFLAGS = "-lcrypto -lpcre -lreadline -lgc -lsqlite3"; # we could create a separate derivation for the "written in c" version of nim # used for bootstrapping, but koch insists on moving the nim compiler around diff --git a/pkgs/development/compilers/ocaml/3.11.2.nix b/pkgs/development/compilers/ocaml/3.11.2.nix index f582ef9834a62..2229a1bf0a082 100644 --- a/pkgs/development/compilers/ocaml/3.11.2.nix +++ b/pkgs/development/compilers/ocaml/3.11.2.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { }; # Needed to avoid a SIGBUS on the final executable on mips - NIX_CFLAGS_COMPILE = if stdenv.isMips then "-fPIC" else ""; + env.NIX_CFLAGS_COMPILE = if stdenv.isMips then "-fPIC" else ""; patches = optionals stdenv.isDarwin [ ./gnused-on-osx-fix.patch ] ++ [ (fetchurl { diff --git a/pkgs/development/compilers/opa/default.nix b/pkgs/development/compilers/opa/default.nix index da1df6f30bbd8..402ac9e3ccc3f 100644 --- a/pkgs/development/compilers/opa/default.nix +++ b/pkgs/development/compilers/opa/default.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { ocaml findlib ssl cryptokit camlzip ulex ocamlgraph camlp4 ]); - NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; + env.NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; postInstall = '' # Have compiler use same tools for code generation as used to build it. diff --git a/pkgs/development/compilers/openjdk/openjfx/11.nix b/pkgs/development/compilers/openjdk/openjfx/11.nix index c6bff3961088e..cfa43badb896f 100644 --- a/pkgs/development/compilers/openjdk/openjfx/11.nix +++ b/pkgs/development/compilers/openjdk/openjfx/11.nix @@ -84,7 +84,7 @@ in makePackage { ''; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; stripDebugList = [ "." ]; diff --git a/pkgs/development/compilers/openjdk/openjfx/12.nix b/pkgs/development/compilers/openjdk/openjfx/12.nix index 30c8d36fdfca9..332aac816966e 100644 --- a/pkgs/development/compilers/openjdk/openjfx/12.nix +++ b/pkgs/development/compilers/openjdk/openjfx/12.nix @@ -84,7 +84,7 @@ in makePackage { ''; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; stripDebugList = [ "." ]; diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index e5c8a709a900f..716319b399b17 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -41,7 +41,7 @@ in stdenv.mkDerivation rec { # See: https://github.com/NixOS/nixpkgs/pull/56540#issuecomment-471624656 stripDebugList = [ "bin" ]; - NIX_LDFLAGS = toString ( + env.NIX_LDFLAGS = toString ( # when linking stage1 libstd: cc: undefined reference to `__cxa_begin_catch' optional (stdenv.isLinux && !withBundledLLVM) "--push-state --as-needed -lstdc++ --pop-state" ++ optional (stdenv.isDarwin && !withBundledLLVM) "-lc++" diff --git a/pkgs/development/compilers/yap/default.nix b/pkgs/development/compilers/yap/default.nix index e6fdd03bb6781..75ada17aee0e2 100644 --- a/pkgs/development/compilers/yap/default.nix +++ b/pkgs/development/compilers/yap/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-tabling=yes" ]; - NIX_CFLAGS_COMPILE = "-fpermissive"; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; meta = { homepage = http://www.dcc.fc.up.pt/~vsc/Yap/; diff --git a/pkgs/development/compilers/z88dk/default.nix b/pkgs/development/compilers/z88dk/default.nix index 2d62bfede093d..e77e5c47dd292 100644 --- a/pkgs/development/compilers/z88dk/default.nix +++ b/pkgs/development/compilers/z88dk/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { doCheck = stdenv.hostPlatform.system != "aarch64-linux"; #_FORTIFY_SOURCE requires compiling with optimization (-O) - NIX_CFLAGS_COMPILE = "-O"; + env.NIX_CFLAGS_COMPILE = "-O"; short_rev = builtins.substring 0 7 src.rev; makeFlags = [ diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix index 5dcfa42c92fc8..6d3ad8fbd8ff7 100644 --- a/pkgs/development/interpreters/clisp/default.nix +++ b/pkgs/development/interpreters/clisp/default.nix @@ -87,7 +87,7 @@ stdenv.mkDerivation rec { (''./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full'' + stdenv.lib.concatMapStrings (x: " " + x) withModules); - NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}"; + env.NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}"; # TODO : make mod-check fails doCheck = false; diff --git a/pkgs/development/interpreters/clisp/hg.nix b/pkgs/development/interpreters/clisp/hg.nix index 550535f30aeed..7d150d17bce4a 100644 --- a/pkgs/development/interpreters/clisp/hg.nix +++ b/pkgs/development/interpreters/clisp/hg.nix @@ -83,7 +83,7 @@ stdenv.mkDerivation rec { (''./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full'' + stdenv.lib.concatMapStrings (x: " " + x) withModules); - NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}"; + env.NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}"; # TODO : make mod-check fails doCheck = false; diff --git a/pkgs/development/interpreters/gnu-apl/default.nix b/pkgs/development/interpreters/gnu-apl/default.nix index c2a3556cfea25..aba9034bfef64 100644 --- a/pkgs/development/interpreters/gnu-apl/default.nix +++ b/pkgs/development/interpreters/gnu-apl/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { buildInputs = [ readline gettext ncurses ]; # Needed with GCC 8 - NIX_CFLAGS_COMPILE = with stdenv.lib; toString ((optionals stdenv.cc.isGNU [ + env.NIX_CFLAGS_COMPILE = with stdenv.lib; toString ((optionals stdenv.cc.isGNU [ "-Wno-error=int-in-bool-context" "-Wno-error=class-memaccess" "-Wno-error=restrict" diff --git a/pkgs/development/interpreters/io/default.nix b/pkgs/development/interpreters/io/default.nix index f763274c15d74..e22c4a01ba4db 100644 --- a/pkgs/development/interpreters/io/default.nix +++ b/pkgs/development/interpreters/io/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation { ''; # for gcc5; c11 inline semantics breaks the build - NIX_CFLAGS_COMPILE = "-fgnu89-inline"; + env.NIX_CFLAGS_COMPILE = "-fgnu89-inline"; meta = with stdenv.lib; { description = "Io programming language"; diff --git a/pkgs/development/interpreters/jimtcl/default.nix b/pkgs/development/interpreters/jimtcl/default.nix index d803fe43fd7ad..a7ca3523d20c5 100644 --- a/pkgs/development/interpreters/jimtcl/default.nix +++ b/pkgs/development/interpreters/jimtcl/default.nix @@ -35,7 +35,7 @@ in stdenv.mkDerivation rec { "--ipv6" ]; - NIX_CFLAGS_COMPILE = toString (makeSDLFlags [ SDL SDL_gfx ]); + env.NIX_CFLAGS_COMPILE = toString (makeSDLFlags [ SDL SDL_gfx ]); enableParallelBuilding = true; diff --git a/pkgs/development/interpreters/love/0.10.nix b/pkgs/development/interpreters/love/0.10.nix index e1ca3ded20833..a325ea0c2f3fe 100644 --- a/pkgs/development/interpreters/love/0.10.nix +++ b/pkgs/development/interpreters/love/0.10.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation { "--with-lua=luajit" ]; - NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 + env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 meta = { homepage = http://love2d.org; diff --git a/pkgs/development/interpreters/love/0.7.nix b/pkgs/development/interpreters/love/0.7.nix index 3bf8aee0d07b2..0b8d1e09775a5 100644 --- a/pkgs/development/interpreters/love/0.7.nix +++ b/pkgs/development/interpreters/love/0.7.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { } || true ''; - NIX_CFLAGS_COMPILE = '' + env.NIX_CFLAGS_COMPILE = '' -I${SDL.dev}/include/SDL -I${freetype.dev}include/freetype2 ''; diff --git a/pkgs/development/interpreters/love/0.8.nix b/pkgs/development/interpreters/love/0.8.nix index 3a6c385ee5fc6..27f9c13e74493 100644 --- a/pkgs/development/interpreters/love/0.8.nix +++ b/pkgs/development/interpreters/love/0.8.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { } || true ''; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-I${SDL.dev}/include/SDL" "-I${freetype.dev}include/freetype2" "-DGL_GLEXT_PROTOTYPES" # https://community.khronos.org/t/glgenbuffers-was-not-declared-in-this-scope/59283/2 diff --git a/pkgs/development/interpreters/love/0.9.nix b/pkgs/development/interpreters/love/0.9.nix index a2182f4543616..e6a537913197e 100644 --- a/pkgs/development/interpreters/love/0.9.nix +++ b/pkgs/development/interpreters/love/0.9.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { "--with-lua=luajit" ]; - NIX_CFLAGS_COMPILE = [ "-DluaL_reg=luaL_Reg" ]; # needed since luajit-2.1.0-beta3 + env.NIX_CFLAGS_COMPILE = [ "-DluaL_reg=luaL_Reg" ]; # needed since luajit-2.1.0-beta3 meta = { homepage = http://love2d.org; diff --git a/pkgs/development/interpreters/love/11.1.nix b/pkgs/development/interpreters/love/11.1.nix index 3629345baf6ae..84e62d859c0c5 100644 --- a/pkgs/development/interpreters/love/11.1.nix +++ b/pkgs/development/interpreters/love/11.1.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation { "--with-lua=luajit" ]; - NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 + env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 meta = { homepage = http://love2d.org; diff --git a/pkgs/development/interpreters/lush/default.nix b/pkgs/development/interpreters/lush/default.nix index a8db08e87a2cd..a569edcb2bae4 100644 --- a/pkgs/development/interpreters/lush/default.nix +++ b/pkgs/development/interpreters/lush/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - NIX_LDFLAGS=" -lz "; + env.NIX_LDFLAGS=" -lz "; meta = { description = "Lisp Universal SHell"; diff --git a/pkgs/development/interpreters/nix-exec/default.nix b/pkgs/development/interpreters/nix-exec/default.nix index bde2f5d9fa968..0d7885441a962 100644 --- a/pkgs/development/interpreters/nix-exec/default.nix +++ b/pkgs/development/interpreters/nix-exec/default.nix @@ -12,7 +12,7 @@ in stdenv.mkDerivation { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ nix git ]; - NIX_CFLAGS_COMPILE = "-std=c++1y"; + env.NIX_CFLAGS_COMPILE = "-std=c++1y"; meta = { description = "Run programs defined in nix expressions"; diff --git a/pkgs/development/interpreters/pixie/default.nix b/pkgs/development/interpreters/pixie/default.nix index 02f6d34a0305d..220cd7a2631b3 100644 --- a/pkgs/development/interpreters/pixie/default.nix +++ b/pkgs/development/interpreters/pixie/default.nix @@ -58,19 +58,21 @@ let $PYTHON $RPYTHON ${common-flags} ${target} find pixie -name "*.pxi" -exec ./pixie-vm -c {} \; )''; - LD_LIBRARY_PATH = library-path; - C_INCLUDE_PATH = include-path; - LIBRARY_PATH = library-path; - PATH = bin-path; + env = { + LD_LIBRARY_PATH = library-path; + C_INCLUDE_PATH = include-path; + LIBRARY_PATH = library-path; + PATH = bin-path; + }; installPhase = '' mkdir -p $out/share $out/bin cp pixie-src/pixie-vm $out/share/pixie-vm cp -R pixie-src/pixie $out/share/pixie makeWrapper $out/share/pixie-vm $out/bin/pixie \ - --prefix LD_LIBRARY_PATH : ${LD_LIBRARY_PATH} \ - --prefix C_INCLUDE_PATH : ${C_INCLUDE_PATH} \ - --prefix LIBRARY_PATH : ${LIBRARY_PATH} \ - --prefix PATH : ${PATH} + --prefix LD_LIBRARY_PATH : ${env.LD_LIBRARY_PATH} \ + --prefix C_INCLUDE_PATH : ${env.C_INCLUDE_PATH} \ + --prefix LIBRARY_PATH : ${env.LIBRARY_PATH} \ + --prefix PATH : ${env.PATH} ''; doCheck = true; checkPhase = '' diff --git a/pkgs/development/interpreters/pure/default.nix b/pkgs/development/interpreters/pure/default.nix index 9c35fc3549765..8571df2116b54 100644 --- a/pkgs/development/interpreters/pure/default.nix +++ b/pkgs/development/interpreters/pure/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ bison flex makeWrapper ]; propagatedBuildInputs = [ llvm gmp mpfr readline ]; - NIX_LDFLAGS = "-lLLVMJIT"; + env.NIX_LDFLAGS = "-lLLVMJIT"; postPatch = '' for f in expr.cc matcher.cc printer.cc symtable.cc parserdefs.hh; do diff --git a/pkgs/development/interpreters/python/cpython/2.7/boot.nix b/pkgs/development/interpreters/python/cpython/2.7/boot.nix index 0b9ddc0bb3457..b2761cca60002 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/boot.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/boot.nix @@ -21,10 +21,12 @@ stdenv.mkDerivation rec { sha256 = "0y7rl603vmwlxm6ilkhc51rx2mfj14ckcz40xxgs0ljnvlhp30yp"; }; - inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH; + env = { + inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH; + LDFLAGS = optionalString (!stdenv.isDarwin) "-lgcc_s"; + NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"; + }; - LDFLAGS = optionalString (!stdenv.isDarwin) "-lgcc_s"; - NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"; buildInputs = optionals stdenv.isDarwin [ CF configd ]; diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index b220bfa0f9345..cdbc07c628883 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -51,9 +51,11 @@ in with passthru; stdenv.mkDerivation rec { hardeningDisable = optional stdenv.isi686 "pic"; - C_INCLUDE_PATH = makeSearchPathOutput "dev" "include" buildInputs; - LIBRARY_PATH = makeLibraryPath buildInputs; - LD_LIBRARY_PATH = makeLibraryPath (filter (x : x.outPath != stdenv.cc.libc.outPath or "") buildInputs); + env = { + C_INCLUDE_PATH = makeSearchPathOutput "dev" "include" buildInputs; + LIBRARY_PATH = makeLibraryPath buildInputs; + LD_LIBRARY_PATH = makeLibraryPath (filter (x : x.outPath != stdenv.cc.libc.outPath or "") buildInputs); + }; patches = [ (substituteAll { diff --git a/pkgs/development/interpreters/racket/default.nix b/pkgs/development/interpreters/racket/default.nix index 3b3b91afd6f03..fe2b0f7d649db 100644 --- a/pkgs/development/interpreters/racket/default.nix +++ b/pkgs/development/interpreters/racket/default.nix @@ -60,7 +60,7 @@ stdenv.mkDerivation rec { FONTCONFIG_FILE = fontsConf; LD_LIBRARY_PATH = libPath; - NIX_LDFLAGS = stdenv.lib.concatStringsSep " " [ + env.NIX_LDFLAGS = stdenv.lib.concatStringsSep " " [ (stdenv.lib.optionalString (stdenv.cc.isGNU && ! stdenv.isDarwin) "-lgcc_s") (stdenv.lib.optionalString stdenv.isDarwin "-framework CoreFoundation") ]; diff --git a/pkgs/development/interpreters/renpy/default.nix b/pkgs/development/interpreters/renpy/default.nix index 759a44b5760fc..5431298f38cb3 100644 --- a/pkgs/development/interpreters/renpy/default.nix +++ b/pkgs/development/interpreters/renpy/default.nix @@ -58,5 +58,5 @@ stdenv.mkDerivation rec { --add-flags "-O $out/share/renpy/renpy.py" ''; - NIX_CFLAGS_COMPILE = "-I${pygame_sdl2}/include/${python.libPrefix}"; + env.NIX_CFLAGS_COMPILE = "-I${pygame_sdl2}/include/${python.libPrefix}"; } diff --git a/pkgs/development/libraries/bamf/default.nix b/pkgs/development/libraries/bamf/default.nix index 60322f530166c..6e0b6365decf4 100644 --- a/pkgs/development/libraries/bamf/default.nix +++ b/pkgs/development/libraries/bamf/default.nix @@ -88,7 +88,7 @@ stdenv.mkDerivation rec { doCheck = false; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; meta = with stdenv.lib; { description = "Application matching framework"; diff --git a/pkgs/development/libraries/belle-sip/default.nix b/pkgs/development/libraries/belle-sip/default.nix index 0d3df37d8e097..ea9ec4a19df59 100644 --- a/pkgs/development/libraries/belle-sip/default.nix +++ b/pkgs/development/libraries/belle-sip/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { buildInputs = [ zlib ]; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=deprecated-declarations" "-Wno-error=format-truncation" "-Wno-error=cast-function-type" diff --git a/pkgs/development/libraries/boringssl/default.nix b/pkgs/development/libraries/boringssl/default.nix index 67e2794c8a293..f38e83b559262 100644 --- a/pkgs/development/libraries/boringssl/default.nix +++ b/pkgs/development/libraries/boringssl/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { buildInputs = [ cmake perl go ]; enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; makeFlags = [ "GOCACHE=$(TMPDIR)/go-cache" ]; diff --git a/pkgs/development/libraries/buddy/default.nix b/pkgs/development/libraries/buddy/default.nix index 9b722602a65c3..5c9741382f647 100644 --- a/pkgs/development/libraries/buddy/default.nix +++ b/pkgs/development/libraries/buddy/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { buildInputs = [ bison ]; patches = [ ./gcc-4.3.3-fixes.patch ]; configureFlags = [ "CFLAGS=-O3" "CXXFLAGS=-O3" ]; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; doCheck = true; meta = { diff --git a/pkgs/development/libraries/bullet/default.nix b/pkgs/development/libraries/bullet/default.nix index 5b4e37eff9f60..0b048c929cb19 100644 --- a/pkgs/development/libraries/bullet/default.nix +++ b/pkgs/development/libraries/bullet/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=argument-outside-range -Wno-error=c++11-narrowing"; meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/bzrtp/default.nix b/pkgs/development/libraries/bzrtp/default.nix index b2dc295db5b7c..114c067e400c4 100644 --- a/pkgs/development/libraries/bzrtp/default.nix +++ b/pkgs/development/libraries/bzrtp/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ bctoolbox sqlite ]; nativeBuildInputs = [ cmake ]; - NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type"; meta = with stdenv.lib; { description = "BZRTP is an opensource implementation of ZRTP keys exchange protocol"; diff --git a/pkgs/development/libraries/clucene-core/2.x.nix b/pkgs/development/libraries/clucene-core/2.x.nix index 91347813a24f5..120782160f93c 100644 --- a/pkgs/development/libraries/clucene-core/2.x.nix +++ b/pkgs/development/libraries/clucene-core/2.x.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { # /build/clucene-core-2.3.3.4/build/bin/cl_test" doCheck = false; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; meta = with stdenv.lib; { description = "Core library for full-featured text search engine"; diff --git a/pkgs/development/libraries/cpp-hocon/default.nix b/pkgs/development/libraries/cpp-hocon/default.nix index dc742a5c051ae..57386dcacf06c 100644 --- a/pkgs/development/libraries/cpp-hocon/default.nix +++ b/pkgs/development/libraries/cpp-hocon/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { owner = "puppetlabs"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=catch-value"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=catch-value"; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/cppdb/default.nix b/pkgs/development/libraries/cppdb/default.nix index bb521ba3ec0c9..aec2b7b2fe59e 100644 --- a/pkgs/development/libraries/cppdb/default.nix +++ b/pkgs/development/libraries/cppdb/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { buildInputs = [ cmake sqlite libmysqlclient postgresql unixODBC ]; cmakeFlags = [ "--no-warn-unused-cli" ]; - NIX_CFLAGS_COMPILE = "-I${libmysqlclient}/include/mysql -L${libmysqlclient}/lib/mysql"; + env.NIX_CFLAGS_COMPILE = "-I${libmysqlclient}/include/mysql -L${libmysqlclient}/lib/mysql"; meta = with stdenv.lib; { homepage = http://cppcms.com/sql/cppdb/; diff --git a/pkgs/development/libraries/crc32c/default.nix b/pkgs/development/libraries/crc32c/default.nix index a7313c2055367..fa3e8b1085f00 100644 --- a/pkgs/development/libraries/crc32c/default.nix +++ b/pkgs/development/libraries/crc32c/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ gflags ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isAarch64 "-march=armv8-a+crc"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isAarch64 "-march=armv8-a+crc"; meta = with stdenv.lib; { homepage = https://github.com/google/crc32c; diff --git a/pkgs/development/libraries/cre2/default.nix b/pkgs/development/libraries/cre2/default.nix index a4313fa94d367..feee15ccaf990 100644 --- a/pkgs/development/libraries/cre2/default.nix +++ b/pkgs/development/libraries/cre2/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ re2 texinfo ]; - NIX_LDFLAGS="-lre2 -lpthread"; + env.NIX_LDFLAGS="-lre2 -lpthread"; configureFlags = [ "--enable-maintainer-mode" diff --git a/pkgs/development/libraries/cwiid/default.nix b/pkgs/development/libraries/cwiid/default.nix index d9a17aff9418c..095d9478bdd98 100644 --- a/pkgs/development/libraries/cwiid/default.nix +++ b/pkgs/development/libraries/cwiid/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkgconfig ]; - NIX_LDFLAGS = "-lbluetooth"; + env.NIX_LDFLAGS = "-lbluetooth"; postInstall = '' # Some programs (for example, cabal-install) have problems with the double 0 diff --git a/pkgs/development/libraries/directfb/default.nix b/pkgs/development/libraries/directfb/default.nix index f7545bb03d56c..7e12c98589101 100644 --- a/pkgs/development/libraries/directfb/default.nix +++ b/pkgs/development/libraries/directfb/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { libXrender ]); - NIX_LDFLAGS = "-lgcc_s"; + env.NIX_LDFLAGS = "-lgcc_s"; configureFlags = [ "--enable-sdl" diff --git a/pkgs/development/libraries/easyloggingpp/default.nix b/pkgs/development/libraries/easyloggingpp/default.nix index 028cd221614bc..3ec67b1620141 100644 --- a/pkgs/development/libraries/easyloggingpp/default.nix +++ b/pkgs/development/libraries/easyloggingpp/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [cmake]; buildInputs = [gtest]; cmakeFlags = [ "-Dtest=ON" ]; - NIX_CFLAGS_COMPILE = "-std=c++11" + + env.NIX_CFLAGS_COMPILE = "-std=c++11" + stdenv.lib.optionalString stdenv.isLinux " -pthread"; postInstall = '' mkdir -p $out/include diff --git a/pkgs/development/libraries/epoxy/default.nix b/pkgs/development/libraries/epoxy/default.nix index 362607eed181d..0af12d82ab91f 100644 --- a/pkgs/development/libraries/epoxy/default.nix +++ b/pkgs/development/libraries/epoxy/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { patches = [ ./libgl-path.patch ]; - NIX_CFLAGS_COMPILE = ''-DLIBGL_PATH="${getLib libGL}/lib"''; + env.NIX_CFLAGS_COMPILE = ''-DLIBGL_PATH="${getLib libGL}/lib"''; doCheck = false; # needs X11 diff --git a/pkgs/development/libraries/ffms/default.nix b/pkgs/development/libraries/ffms/default.nix index 30fb94aa24835..4293833ec3057 100644 --- a/pkgs/development/libraries/ffms/default.nix +++ b/pkgs/development/libraries/ffms/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "0dkz5b3gxq5p4xz0qqg6l2sigszrlsinz3skyf0ln4wf3zrvf8m5"; }; - NIX_CFLAGS_COMPILE = "-fPIC"; + env.NIX_CFLAGS_COMPILE = "-fPIC"; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ zlib ffmpeg ]; diff --git a/pkgs/development/libraries/flatpak/default.nix b/pkgs/development/libraries/flatpak/default.nix index c0a3d3718f345..d90919815b412 100644 --- a/pkgs/development/libraries/flatpak/default.nix +++ b/pkgs/development/libraries/flatpak/default.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation rec { doCheck = false; # TODO: some issues with temporary files - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/flint/default.nix b/pkgs/development/libraries/flint/default.nix index 462d186c72df6..7589404e7e01e 100644 --- a/pkgs/development/libraries/flint/default.nix +++ b/pkgs/development/libraries/flint/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { ]; # issues with ntl -- https://github.com/wbhart/flint2/issues/487 - NIX_CXXSTDLIB_COMPILE = "-std=c++11"; + env.NIX_CXXSTDLIB_COMPILE = "-std=c++11"; patches = [ (fetchpatch { diff --git a/pkgs/development/libraries/gdal/gdal-1_11.nix b/pkgs/development/libraries/gdal/gdal-1_11.nix index 6a086d9c998de..a1427651f4b22 100644 --- a/pkgs/development/libraries/gdal/gdal-1_11.nix +++ b/pkgs/development/libraries/gdal/gdal-1_11.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { ]; # Allow use of old proj_api.h - NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; + env.NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; # Prevent this: # diff --git a/pkgs/development/libraries/gegl/4.0.nix b/pkgs/development/libraries/gegl/4.0.nix index 75897b036bfa2..999fec2268842 100644 --- a/pkgs/development/libraries/gegl/4.0.nix +++ b/pkgs/development/libraries/gegl/4.0.nix @@ -118,7 +118,7 @@ stdenv.mkDerivation rec { # TODO: Fix missing math symbols in gegl seamless clone. # It only appears when we use packaged poly2tri-c instead of vendored one. - NIX_CFLAGS_COMPILE = "-lm"; + env.NIX_CFLAGS_COMPILE = "-lm"; postPatch = '' chmod +x tests/opencl/opencl_test.sh tests/buffer/buffer-tests-run.sh diff --git a/pkgs/development/libraries/geis/default.nix b/pkgs/development/libraries/geis/default.nix index 1b3d5ba4b7c06..72d4376eb8f4e 100644 --- a/pkgs/development/libraries/geis/default.nix +++ b/pkgs/development/libraries/geis/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { sha256 = "1svhbjibm448ybq6gnjjzj0ak42srhihssafj0w402aj71lgaq4a"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=misleading-indentation -Wno-error=pointer-compare"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=misleading-indentation -Wno-error=pointer-compare"; hardeningDisable = [ "format" ]; diff --git a/pkgs/development/libraries/glm/default.nix b/pkgs/development/libraries/glm/default.nix index d39d6f0d7a36a..309302e798bf1 100644 --- a/pkgs/development/libraries/glm/default.nix +++ b/pkgs/development/libraries/glm/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { cp ${gcc7PlatformPatch} glm/simd/platform.h ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-DGLM_COMPILER=0"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-DGLM_COMPILER=0"; postInstall = '' mkdir -p $doc/share/doc/glm diff --git a/pkgs/development/libraries/gnome-online-accounts/default.nix b/pkgs/development/libraries/gnome-online-accounts/default.nix index adbb714c7b29f..807a1aa437eb7 100644 --- a/pkgs/development/libraries/gnome-online-accounts/default.nix +++ b/pkgs/development/libraries/gnome-online-accounts/default.nix @@ -82,7 +82,7 @@ stdenv.mkDerivation rec { webkitgtk ]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; postPatch = '' chmod +x meson_post_install.py diff --git a/pkgs/development/libraries/gperftools/default.nix b/pkgs/development/libraries/gperftools/default.nix index 0e98575498500..d77e842db50b5 100644 --- a/pkgs/development/libraries/gperftools/default.nix +++ b/pkgs/development/libraries/gperftools/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { substituteInPlace libtool --replace stdc++ c++ ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-D_XOPEN_SOURCE -Wno-aligned-allocation-unavailable"; # some packages want to link to the static tcmalloc_minimal diff --git a/pkgs/development/libraries/gsl/default.nix b/pkgs/development/libraries/gsl/default.nix index 966d6a8ffd5de..8af4e991dc4d9 100644 --- a/pkgs/development/libraries/gsl/default.nix +++ b/pkgs/development/libraries/gsl/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { }; # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html) - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma"; # https://lists.gnu.org/archive/html/bug-gsl/2015-11/msg00012.html doCheck = stdenv.hostPlatform.system != "i686-linux" && stdenv.hostPlatform.system != "aarch64-linux"; diff --git a/pkgs/development/libraries/gsl/gsl-1_16.nix b/pkgs/development/libraries/gsl/gsl-1_16.nix index ae102ac60307c..842a59fdbabbb 100644 --- a/pkgs/development/libraries/gsl/gsl-1_16.nix +++ b/pkgs/development/libraries/gsl/gsl-1_16.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { }; # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html) - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma"; patches = [ (fetchpatch { diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix index 60432614433bf..67c3e7da2ab0e 100644 --- a/pkgs/development/libraries/gtk/3.x.nix +++ b/pkgs/development/libraries/gtk/3.x.nix @@ -88,7 +88,7 @@ stdenv.mkDerivation rec { # These are the defines that'd you'd get with --enable-debug=minimum (default). # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options - NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"; + env.NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"; postPatch = '' files=( diff --git a/pkgs/development/libraries/java/swt/default.nix b/pkgs/development/libraries/java/swt/default.nix index b0fdca1121867..6c14f283e33ce 100644 --- a/pkgs/development/libraries/java/swt/default.nix +++ b/pkgs/development/libraries/java/swt/default.nix @@ -38,7 +38,7 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ unzip pkgconfig ]; buildInputs = [ jdk gtk2 libXt libXtst libXi libGLU libGL webkitgtk libsoup ]; - NIX_LFLAGS = toString (map (x: "-L${lib.getLib x}/lib") [ xorg.libX11 pango gdk-pixbuf glib ]) + + env.NIX_LFLAGS = toString (map (x: "-L${lib.getLib x}/lib") [ xorg.libX11 pango gdk-pixbuf glib ]) + " -lX11 -lpango-1.0 -lgdk_pixbuf-2.0 -lglib-2.0"; buildPhase = '' diff --git a/pkgs/development/libraries/leatherman/default.nix b/pkgs/development/libraries/leatherman/default.nix index b7b9b019b639c..9dab53c3d528d 100644 --- a/pkgs/development/libraries/leatherman/default.nix +++ b/pkgs/development/libraries/leatherman/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { owner = "puppetlabs"; }; - NIX_CFLAGS_COMPILE = builtins.toString [ + env.NIX_CFLAGS_COMPILE = builtins.toString [ "-Wno-error=ignored-qualifiers" "-Wno-error=class-memaccess" "-Wno-error=catch-value" diff --git a/pkgs/development/libraries/libbluray/default.nix b/pkgs/development/libraries/libbluray/default.nix index daa349ca63096..50410d5be0126 100644 --- a/pkgs/development/libraries/libbluray/default.nix +++ b/pkgs/development/libraries/libbluray/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = optional withAACS libaacs; - NIX_LDFLAGS = toString [ + env.NIX_LDFLAGS = toString [ (optionalString withAACS "-L${libaacs}/lib -laacs") (optionalString withBDplus "-L${libbdplus}/lib -lbdplus") ]; diff --git a/pkgs/development/libraries/libcbor/default.nix b/pkgs/development/libraries/libcbor/default.nix index 4949d657669b2..2fa5d2aca0b34 100644 --- a/pkgs/development/libraries/libcbor/default.nix +++ b/pkgs/development/libraries/libcbor/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { doCheck = false; # needs "-DWITH_TESTS=ON", but fails w/compilation error - NIX_CFLAGS_COMPILE = "-fno-lto"; + env.NIX_CFLAGS_COMPILE = "-fno-lto"; meta = with stdenv.lib; { description = "CBOR protocol implementation for C and others"; diff --git a/pkgs/development/libraries/libclxclient/default.nix b/pkgs/development/libraries/libclxclient/default.nix index d6e2ad398d778..be0f0f7057436 100644 --- a/pkgs/development/libraries/libclxclient/default.nix +++ b/pkgs/development/libraries/libclxclient/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; - NIX_CFLAGS_COMPILE = "-I${xorg.xorgproto}/include -I${libXft.dev}/include"; + env.NIX_CFLAGS_COMPILE = "-I${xorg.xorgproto}/include -I${libXft.dev}/include"; patchPhase = '' cd source diff --git a/pkgs/development/libraries/libdiscid/default.nix b/pkgs/development/libraries/libdiscid/default.nix index d7d88b3838659..39d9f23fd9962 100644 --- a/pkgs/development/libraries/libdiscid/default.nix +++ b/pkgs/development/libraries/libdiscid/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { sha256 = "1f9irlj3dpb5gyfdnb1m4skbjvx4d4hwiz2152f83m0d9jn47r7r"; }; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-framework CoreFoundation -framework IOKit"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-framework CoreFoundation -framework IOKit"; meta = with stdenv.lib; { description = "A C library for creating MusicBrainz DiscIDs from audio CDs"; diff --git a/pkgs/development/libraries/libdvdread/4.9.9.nix b/pkgs/development/libraries/libdvdread/4.9.9.nix index fbe56023a91c4..592cbd238c62a 100644 --- a/pkgs/development/libraries/libdvdread/4.9.9.nix +++ b/pkgs/development/libraries/libdvdread/4.9.9.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { buildInputs = [libdvdcss]; - NIX_LDFLAGS = "-ldvdcss"; + env.NIX_LDFLAGS = "-ldvdcss"; postInstall = '' ln -s dvdread $out/include/libdvdread diff --git a/pkgs/development/libraries/libdvdread/default.nix b/pkgs/development/libraries/libdvdread/default.nix index c133c0ba6f926..131f9f5b28b2e 100644 --- a/pkgs/development/libraries/libdvdread/default.nix +++ b/pkgs/development/libraries/libdvdread/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { buildInputs = [libdvdcss]; - NIX_LDFLAGS = "-ldvdcss"; + env.NIX_LDFLAGS = "-ldvdcss"; postInstall = '' ln -s dvdread $out/include/libdvdread diff --git a/pkgs/development/libraries/libdynd/default.nix b/pkgs/development/libraries/libdynd/default.nix index c02a6f9a50252..06610d34a5508 100644 --- a/pkgs/development/libraries/libdynd/default.nix +++ b/pkgs/development/libraries/libdynd/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { ]; # added to fix build with gcc7+ - NIX_CFLAGS_COMPILE = builtins.toString [ + env.NIX_CFLAGS_COMPILE = builtins.toString [ "-Wno-error=implicit-fallthrough" "-Wno-error=nonnull" "-Wno-error=tautological-compare" diff --git a/pkgs/development/libraries/libe-book/default.nix b/pkgs/development/libraries/libe-book/default.nix index 805b1869ac38c..c8147f0292638 100644 --- a/pkgs/development/libraries/libe-book/default.nix +++ b/pkgs/development/libraries/libe-book/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation { src = fetchurl { inherit (s) url sha256; }; - NIX_CFLAGS_COMPILE = "-Wno-error=unused-function"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-function"; meta = { inherit (s) version; description = ''Library for import of reflowable e-book formats''; diff --git a/pkgs/development/libraries/libfakekey/default.nix b/pkgs/development/libraries/libfakekey/default.nix index 3c24319154331..d649ed81b7db0 100644 --- a/pkgs/development/libraries/libfakekey/default.nix +++ b/pkgs/development/libraries/libfakekey/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libX11 libXi libXtst xorgproto ]; - NIX_LDFLAGS = "-lX11"; + env.NIX_LDFLAGS = "-lX11"; meta = with stdenv.lib; { description = "X virtual keyboard library"; diff --git a/pkgs/development/libraries/libfaketime/default.nix b/pkgs/development/libraries/libfaketime/default.nix index 10cc5cace7b57..e57ea7b5b8263 100644 --- a/pkgs/development/libraries/libfaketime/default.nix +++ b/pkgs/development/libraries/libfaketime/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { PREFIX = placeholder "out"; LIBDIRNAME = "/lib"; - NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type -Wno-error=format-truncation"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type -Wno-error=format-truncation"; checkInputs = [ perl ]; diff --git a/pkgs/development/libraries/libfpx/default.nix b/pkgs/development/libraries/libfpx/default.nix index 97df5107409a6..326aa0b359932 100644 --- a/pkgs/development/libraries/libfpx/default.nix +++ b/pkgs/development/libraries/libfpx/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { }; # Darwin gets misdetected as Windows without this - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-D__unix"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-D__unix"; patches = [ (fetchpatch { diff --git a/pkgs/development/libraries/libgdiplus/default.nix b/pkgs/development/libraries/libgdiplus/default.nix index 54bf091e5ea90..e9c4da496d028 100644 --- a/pkgs/development/libraries/libgdiplus/default.nix +++ b/pkgs/development/libraries/libgdiplus/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { sha256 = "1pf3yhwq9qk0w3yv9bb8qlwwqkffg7xb4sgc8yqdnn6pa56i3vmn"; }; - NIX_LDFLAGS = "-lgif"; + env.NIX_LDFLAGS = "-lgif"; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/libraries/libguestfs/default.nix b/pkgs/development/libraries/libguestfs/default.nix index 8d480c2d88297..dab8403c64a21 100644 --- a/pkgs/development/libraries/libguestfs/default.nix +++ b/pkgs/development/libraries/libguestfs/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-appliance" "--disable-daemon" "--with-distro=NixOS" ] ++ stdenv.lib.optionals (!javaSupport) [ "--disable-java" "--without-java" ]; patches = [ ./libguestfs-syms.patch ]; - NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/"; + env.NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/"; installFlags = [ "REALLY_INSTALL=yes" ]; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/libjson-rpc-cpp/default.nix b/pkgs/development/libraries/libjson-rpc-cpp/default.nix index a7c9427080d87..c7511cf4ee392 100644 --- a/pkgs/development/libraries/libjson-rpc-cpp/default.nix +++ b/pkgs/development/libraries/libjson-rpc-cpp/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { rev = "v${version}"; }; - NIX_CFLAGS_COMPILE = "-I${catch}/include/catch"; + env.NIX_CFLAGS_COMPILE = "-I${catch}/include/catch"; postPatch = '' for f in cmake/FindArgtable.cmake \ diff --git a/pkgs/development/libraries/libmatchbox/default.nix b/pkgs/development/libraries/libmatchbox/default.nix index 98875e48f57f6..e23fcb1eea770 100644 --- a/pkgs/development/libraries/libmatchbox/default.nix +++ b/pkgs/development/libraries/libmatchbox/default.nix @@ -6,7 +6,7 @@ stdenv.mkDerivation rec { buildInputs = [ libXft libICE pango libjpeg ]; propagatedBuildInputs = [ libX11 libXext libpng ]; - NIX_LDFLAGS = "-lX11"; + env.NIX_LDFLAGS = "-lX11"; src = fetchurl { url = "https://downloads.yoctoproject.org/releases/matchbox/libmatchbox/${version}/libmatchbox-${version}.tar.bz2"; diff --git a/pkgs/development/libraries/libmemcached/default.nix b/pkgs/development/libraries/libmemcached/default.nix index 5655bfe968b9d..e785ba09dea7f 100644 --- a/pkgs/development/libraries/libmemcached/default.nix +++ b/pkgs/development/libraries/libmemcached/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation { buildInputs = [ libevent ]; propagatedBuildInputs = [ cyrus_sasl ]; - NIX_CFLAGS_COMPILE = "-fpermissive"; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; meta = with stdenv.lib; { homepage = https://libmemcached.org; diff --git a/pkgs/development/libraries/libmikmod/default.nix b/pkgs/development/libraries/libmikmod/default.nix index 284d415454deb..381a30e83cc23 100644 --- a/pkgs/development/libraries/libmikmod/default.nix +++ b/pkgs/development/libraries/libmikmod/default.nix @@ -16,7 +16,7 @@ in stdenv.mkDerivation rec { propagatedBuildInputs = optional stdenv.isLinux libpulseaudio; - NIX_LDFLAGS = optionalString stdenv.isLinux "-lasound"; + env.NIX_LDFLAGS = optionalString stdenv.isLinux "-lasound"; meta = with stdenv.lib; { description = "A library for playing tracker music module files"; diff --git a/pkgs/development/libraries/libnfs/default.nix b/pkgs/development/libraries/libnfs/default.nix index d2848d9a1e9bb..54892b3f46f39 100644 --- a/pkgs/development/libraries/libnfs/default.nix +++ b/pkgs/development/libraries/libnfs/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=tautological-compare"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=tautological-compare"; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/liboping/default.nix b/pkgs/development/libraries/liboping/default.nix index b2594d7c1d700..7fbe8fa10710c 100644 --- a/pkgs/development/libraries/liboping/default.nix +++ b/pkgs/development/libraries/liboping/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "1n2wkmvw6n80ybdwkjq8ka43z2x8mvxq49byv61b52iyz69slf7b"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation"; buildInputs = [ ncurses perl ]; diff --git a/pkgs/development/libraries/libqtav/default.nix b/pkgs/development/libraries/libqtav/default.nix index dd6318444e78f..b0417815e9bb7 100644 --- a/pkgs/development/libraries/libqtav/default.nix +++ b/pkgs/development/libraries/libqtav/default.nix @@ -30,7 +30,7 @@ mkDerivation rec { # Make sure libqtav finds its libGL dependency at both link and run time # by adding libGL to rpath. Not sure why it wasn't done automatically like # the other libraries as `libGL` is part of our `buildInputs`. - NIX_CFLAGS_LINK = "-Wl,-rpath,${libGL}/lib"; + env.NIX_CFLAGS_LINK = "-Wl,-rpath,${libGL}/lib"; preFixup = '' mkdir -p "$out/bin" diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix index 8835490187d1d..f4fc83acdbcfd 100644 --- a/pkgs/development/libraries/librdf/redland.nix +++ b/pkgs/development/libraries/librdf/redland.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { ]; # Fix broken DT_NEEDED in lib/redland/librdf_storage_sqlite.so. - NIX_CFLAGS_LINK = "-lraptor2"; + env.NIX_CFLAGS_LINK = "-lraptor2"; doCheck = false; # fails 1 out of 17 tests with a segmentation fault diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix index 11c7f3fed84ec..42fa208c0e442 100644 --- a/pkgs/development/libraries/librsvg/default.nix +++ b/pkgs/development/libraries/librsvg/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { "installed_testdir=$(installedTests)/libexec/installed-tests/RSVG" ]; - NIX_CFLAGS_COMPILE + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${cairo.dev}/include/cairo"; # It wants to add loaders and update the loaders.cache in gdk-pixbuf diff --git a/pkgs/development/libraries/libsoundio/default.nix b/pkgs/development/libraries/libsoundio/default.nix index 62e5601b73c46..96660f25d4936 100644 --- a/pkgs/development/libraries/libsoundio/default.nix +++ b/pkgs/development/libraries/libsoundio/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional stdenv.isLinux alsaLib ++ stdenv.lib.optional stdenv.isDarwin AudioUnit; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-Wno-strict-prototypes"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-Wno-strict-prototypes"; meta = with stdenv.lib; { description = "Cross platform audio input and output"; diff --git a/pkgs/development/libraries/libtoxcore/new-api.nix b/pkgs/development/libraries/libtoxcore/new-api.nix index 6cd5f9122a4f7..80a67c7044017 100644 --- a/pkgs/development/libraries/libtoxcore/new-api.nix +++ b/pkgs/development/libraries/libtoxcore/new-api.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation { sha256 = "0ap1gvlyihnfivv235dbrgsxsiiz70bhlmlr5gn1027w3h5kqz8w"; }; - NIX_LDFLAGS = "-lgcc_s"; + env.NIX_LDFLAGS = "-lgcc_s"; postPatch = '' # within Nix chroot builds, localhost is unresolvable diff --git a/pkgs/development/libraries/libunique/default.nix b/pkgs/development/libraries/libunique/default.nix index d6566978a6bbb..39b268109fb98 100644 --- a/pkgs/development/libraries/libunique/default.nix +++ b/pkgs/development/libraries/libunique/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { }; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; # Patches from Gentoo portage patches = [ diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix index 0556e311736a3..460344cb35abc 100644 --- a/pkgs/development/libraries/libvirt/default.nix +++ b/pkgs/development/libraries/libvirt/default.nix @@ -146,7 +146,7 @@ in stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-fno-stack-protector"; + env.NIX_CFLAGS_COMPILE = "-fno-stack-protector"; meta = { homepage = http://libvirt.org/; diff --git a/pkgs/development/libraries/libwhereami/default.nix b/pkgs/development/libraries/libwhereami/default.nix index 8e190f998d56f..36e7c0942aca0 100644 --- a/pkgs/development/libraries/libwhereami/default.nix +++ b/pkgs/development/libraries/libwhereami/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { owner = "puppetlabs"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=catch-value"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=catch-value"; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/libwps/default.nix b/pkgs/development/libraries/libwps/default.nix index 61b777a524339..eaa1c09b90041 100644 --- a/pkgs/development/libraries/libwps/default.nix +++ b/pkgs/development/libraries/libwps/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ boost librevenge zlib ]; - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough"; meta = with stdenv.lib; { homepage = http://libwps.sourceforge.net/; diff --git a/pkgs/development/libraries/mediastreamer/default.nix b/pkgs/development/libraries/mediastreamer/default.nix index 0204223d127cd..05331b2414c61 100644 --- a/pkgs/development/libraries/mediastreamer/default.nix +++ b/pkgs/development/libraries/mediastreamer/default.nix @@ -32,14 +32,14 @@ stdenv.mkDerivation rec { ortp libv4l libpcap srtp bctoolbox libXext libmatroska ]; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-DGIT_VERSION=\"v${version}\"" "-Wno-error=deprecated-declarations" "-Wno-error=cast-function-type" "-Wno-error=stringop-truncation" "-Wno-error=stringop-overflow" ]; - NIX_LDFLAGS = "-lXext"; + env.NIX_LDFLAGS = "-lXext"; meta = with stdenv.lib; { description = "A powerful and lightweight streaming engine specialized for voice/video telephony applications"; diff --git a/pkgs/development/libraries/mlt/qt-5.nix b/pkgs/development/libraries/mlt/qt-5.nix index 0e3750df415af..3fc8ae3c2286f 100644 --- a/pkgs/development/libraries/mlt/qt-5.nix +++ b/pkgs/development/libraries/mlt/qt-5.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { # mlt is unable to cope with our multi-prefix Qt build # because it does not use CMake or qmake. - NIX_CFLAGS_COMPILE = "-I${getDev qtsvg}/include/QtSvg"; + env.NIX_CFLAGS_COMPILE = "-I${getDev qtsvg}/include/QtSvg"; CXXFLAGS = "-std=c++11"; diff --git a/pkgs/development/libraries/mps/default.nix b/pkgs/development/libraries/mps/default.nix index 8c1f3aea46679..b2d3404af0c0f 100644 --- a/pkgs/development/libraries/mps/default.nix +++ b/pkgs/development/libraries/mps/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ sqlite ]; # needed for 1.116.0 to build with gcc7 - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-Wno-implicit-fallthrough" "-Wno-error=clobbered" "-Wno-error=cast-function-type" diff --git a/pkgs/development/libraries/newt/default.nix b/pkgs/development/libraries/newt/default.nix index 60dc00a335d9e..1bfea0dc5be52 100644 --- a/pkgs/development/libraries/newt/default.nix +++ b/pkgs/development/libraries/newt/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ slang popt ]; - NIX_LDFLAGS = "-lncurses"; + env.NIX_LDFLAGS = "-lncurses"; preConfigure = '' # If CPP is set explicitly, configure and make will not agree about which diff --git a/pkgs/development/libraries/ntrack/default.nix b/pkgs/development/libraries/ntrack/default.nix index 803906b134376..bd0ec3fbd0af8 100644 --- a/pkgs/development/libraries/ntrack/default.nix +++ b/pkgs/development/libraries/ntrack/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig python ]; # error: ISO C does not support '__FUNCTION__' predefined identifier [-Werror=pedantic] - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; configureFlags = [ "--without-gobject" "CFLAGS=--std=gnu99" ]; diff --git a/pkgs/development/libraries/openal-soft/default.nix b/pkgs/development/libraries/openal-soft/default.nix index 20528ac9284f8..cd29e1e2a8688 100644 --- a/pkgs/development/libraries/openal-soft/default.nix +++ b/pkgs/development/libraries/openal-soft/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { ++ optional pulseSupport libpulseaudio ++ optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ]; - NIX_LDFLAGS = toString ([] + env.NIX_LDFLAGS = toString ([] ++ optional alsaSupport "-lasound" ++ optional pulseSupport "-lpulse"); diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index 642facf166a6b..98547b9da9262 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -208,7 +208,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake pkgconfig unzip ]; - NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR"; + env.NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR"; # Configure can't find the library without this. OpenBLAS_HOME = lib.optionalString enableOpenblas openblas; diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix index 9fffd3d94770b..0f0e1194b8f5e 100644 --- a/pkgs/development/libraries/opencv/4.x.nix +++ b/pkgs/development/libraries/opencv/4.x.nix @@ -221,7 +221,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake pkgconfig unzip ]; - NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR"; + env.NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR"; # Configure can't find the library without this. OpenBLAS_HOME = lib.optionalString enableOpenblas openblas; diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix index ad27742d0b4cd..91ac4f3dd66f8 100644 --- a/pkgs/development/libraries/opencv/default.nix +++ b/pkgs/development/libraries/opencv/default.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkgconfig unzip ]; - NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR"; + env.NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR"; cmakeFlags = [ (opencvFlag "TIFF" enableTIFF) diff --git a/pkgs/development/libraries/openexrid-unstable/default.nix b/pkgs/development/libraries/openexrid-unstable/default.nix index 92cd343cf6a1e..6009b09f35fdb 100644 --- a/pkgs/development/libraries/openexrid-unstable/default.nix +++ b/pkgs/development/libraries/openexrid-unstable/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation { --replace g++ c++ ''; - NIX_CFLAGS_COMPILE=''-I${ilmbase.dev}/include/OpenEXR + env.NIX_CFLAGS_COMPILE=''-I${ilmbase.dev}/include/OpenEXR -I${openexr.dev}/include/OpenEXR -I${openfx.dev}/include/OpenFX ''; diff --git a/pkgs/development/libraries/openvdb/default.nix b/pkgs/development/libraries/openvdb/default.nix index 840da0461706a..1d2eb2ce920b6 100644 --- a/pkgs/development/libraries/openvdb/default.nix +++ b/pkgs/development/libraries/openvdb/default.nix @@ -37,8 +37,8 @@ stdenv.mkDerivation rec installFlags = [ "DESTDIR=$(out)" ]; - NIX_CFLAGS_COMPILE="-I${openexr.dev}/include/OpenEXR -I${ilmbase.dev}/include/OpenEXR/"; - NIX_LDFLAGS="-lboost_iostreams"; + env.NIX_CFLAGS_COMPILE="-I${openexr.dev}/include/OpenEXR -I${ilmbase.dev}/include/OpenEXR/"; + env.NIX_LDFLAGS="-lboost_iostreams"; meta = with stdenv.lib; { description = "An open framework for voxel"; diff --git a/pkgs/development/libraries/phonon/backends/gstreamer.nix b/pkgs/development/libraries/phonon/backends/gstreamer.nix index d79078c283692..f0f783d12b330 100644 --- a/pkgs/development/libraries/phonon/backends/gstreamer.nix +++ b/pkgs/development/libraries/phonon/backends/gstreamer.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { # on system paths being set. patches = [ ./gst-plugin-paths.patch ]; - NIX_CFLAGS_COMPILE = + env.NIX_CFLAGS_COMPILE = let gstPluginPaths = lib.makeSearchPathOutput "lib" "/lib/gstreamer-1.0" (with gst_all_1; [ diff --git a/pkgs/development/libraries/phonon/default.nix b/pkgs/development/libraries/phonon/default.nix index 86e3caaa1486c..d32c3a0113440 100644 --- a/pkgs/development/libraries/phonon/default.nix +++ b/pkgs/development/libraries/phonon/default.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - NIX_CFLAGS_COMPILE = "-fPIC"; + env.NIX_CFLAGS_COMPILE = "-fPIC"; cmakeFlags = [ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" diff --git a/pkgs/development/libraries/poly2tri-c/default.nix b/pkgs/development/libraries/poly2tri-c/default.nix index a3e42b3ae4b2d..bd1afe3b5a3a9 100644 --- a/pkgs/development/libraries/poly2tri-c/default.nix +++ b/pkgs/development/libraries/poly2tri-c/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { glib ]; - NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = [ "--std=gnu99" "-Wno-error" ]; diff --git a/pkgs/development/libraries/portaudio/default.nix b/pkgs/development/libraries/portaudio/default.nix index 68daece490fa9..efbdf9fe0eab5 100644 --- a/pkgs/development/libraries/portaudio/default.nix +++ b/pkgs/development/libraries/portaudio/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation { configureFlags = [ "--disable-mac-universal" "--enable-cxx" ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=nullability-inferred-on-nested-type -Wno-error=nullability-completeness-on-arrays"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=nullability-inferred-on-nested-type -Wno-error=nullability-completeness-on-arrays"; propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ]; diff --git a/pkgs/development/libraries/prometheus-cpp/default.nix b/pkgs/development/libraries/prometheus-cpp/default.nix index 0403c7ad10c91..f18a0ffdd5b12 100644 --- a/pkgs/development/libraries/prometheus-cpp/default.nix +++ b/pkgs/development/libraries/prometheus-cpp/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { "-DCIVETWEB_CXX_LIBRARY=${civetweb}/lib/libcivetweb${stdenv.targetPlatform.extensions.sharedLibrary}" ]; - NIX_LDFLAGS = "-ldl"; + env.NIX_LDFLAGS = "-ldl"; meta = { description = "Prometheus Client Library for Modern C++"; diff --git a/pkgs/development/libraries/qoauth/default.nix b/pkgs/development/libraries/qoauth/default.nix index 83e904e53eb2f..c6779143ae5dc 100644 --- a/pkgs/development/libraries/qoauth/default.nix +++ b/pkgs/development/libraries/qoauth/default.nix @@ -18,8 +18,8 @@ stdenv.mkDerivation { buildInputs = [ qt5.qtbase qca2-qt5 ]; nativeBuildInputs = [ qt5.qmake ]; - NIX_CFLAGS_COMPILE = "-I${qca2-qt5}/include/Qca-qt5/QtCrypto"; - NIX_LDFLAGS = "-lqca-qt5"; + env.NIX_CFLAGS_COMPILE = "-I${qca2-qt5}/include/Qca-qt5/QtCrypto"; + env.NIX_LDFLAGS = "-lqca-qt5"; meta = with stdenv.lib; { description = "Qt library for OAuth authentication"; diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index 25953949eb76a..d859884fb16b2 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -206,7 +206,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = toString ( + env.NIX_CFLAGS_COMPILE = toString ( # with gcc7 the warnings blow the log over Hydra's limit [ "-Wno-expansion-to-defined" "-Wno-unused-local-typedefs" ] ++ lib.optional stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin @@ -214,13 +214,13 @@ stdenv.mkDerivation rec { [ "-I${glib.dev}/include/glib-2.0" "-I${glib.out}/lib/glib-2.0/include" ] ++ lib.optional stdenv.isDarwin "-I${libcxx}/include/c++/v1"); - NIX_LDFLAGS = lib.optionalString (stdenv.isFreeBSD || stdenv.isDarwin) "-lglib-2.0"; + env.NIX_LDFLAGS = lib.optionalString (stdenv.isFreeBSD || stdenv.isDarwin) "-lglib-2.0"; preBuild = lib.optionalString stdenv.isDarwin '' # resolve "extra qualification on member" error sed -i 's/struct ::TabletProximityRec;/struct TabletProximityRec;/' \ src/gui/kernel/qt_cocoa_helpers_mac_p.h - find . -name "Makefile*" | xargs sed -i 's/^\(LINK[[:space:]]* = clang++\)/\1 ${NIX_LDFLAGS}/' + find . -name "Makefile*" | xargs sed -i 's/^\(LINK[[:space:]]* = clang++\)/\1 ${env.NIX_LDFLAGS}/' sed -i 's/^\(LIBS[[:space:]]*=.*$\)/\1 -lobjc/' ./src/corelib/Makefile.Release ''; diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index bc23d0f9cafe1..25d935913e821 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -195,7 +195,7 @@ stdenv.mkDerivation { done ''; - NIX_CFLAGS_COMPILE = toString ([ + env.NIX_CFLAGS_COMPILE = toString ([ "-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' ''-D${if compareVersion "5.11.0" >= 0 then "LIBRESOLV_SO" else "NIXPKGS_LIBRESOLV"}="${stdenv.cc.libc.out}/lib/libresolv"'' diff --git a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix index d0bab88b2f214..35a2d036b23dc 100644 --- a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix +++ b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix @@ -12,5 +12,5 @@ qtModule { ++ optional (stdenv.isLinux) alsaLib; outputs = [ "bin" "dev" "out" ]; qmakeFlags = [ "GST_VERSION=1.0" ]; - NIX_LDFLAGS = optionalString (stdenv.isDarwin) "-lobjc"; + env.NIX_LDFLAGS = optionalString (stdenv.isDarwin) "-lobjc"; } diff --git a/pkgs/development/libraries/qt-5/modules/qtserialport.nix b/pkgs/development/libraries/qt-5/modules/qtserialport.nix index 516d38340dc53..c339ee200885f 100644 --- a/pkgs/development/libraries/qt-5/modules/qtserialport.nix +++ b/pkgs/development/libraries/qt-5/modules/qtserialport.nix @@ -5,7 +5,7 @@ let inherit (lib) getLib optional; in qtModule { name = "qtserialport"; qtInputs = [ qtbase ]; - NIX_CFLAGS_COMPILE = + env.NIX_CFLAGS_COMPILE = optional stdenv.isLinux ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"''; } diff --git a/pkgs/development/libraries/qt-5/modules/qttools.nix b/pkgs/development/libraries/qt-5/modules/qttools.nix index 573472a8b5ab0..ae1c47ae00d30 100644 --- a/pkgs/development/libraries/qt-5/modules/qttools.nix +++ b/pkgs/development/libraries/qt-5/modules/qttools.nix @@ -32,7 +32,7 @@ qtModule { "bin/macdeployqt" ]; - NIX_CFLAGS_COMPILE = + env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"''; setupHook = ../hooks/qttools-setup-hook.sh; diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index df444eee2eb56..86a2f6e4c111a 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -103,7 +103,7 @@ EOF --replace 'libs = [ "sandbox" ]' 'libs = [ "/usr/lib/libsandbox.1.dylib" ]' ''); - NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ + env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit "-Wno-class-memaccess" ] ++ lib.optionals (stdenv.hostPlatform.platform.gcc.arch or "" == "sandybridge") [ diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix index 542afdd55da02..6ed9a426c4ad0 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix @@ -50,7 +50,7 @@ qtModule { export qmakeFlags="$qmakeFlags CONFIG+=silent" ''; - NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = [ # with gcc7 this warning blows the log over Hydra's limit "-Wno-expansion-to-defined" ] diff --git a/pkgs/development/libraries/qt-5/modules/qtwebview.nix b/pkgs/development/libraries/qt-5/modules/qtwebview.nix index 906d750c5d3f8..cb68cc70b2449 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebview.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebview.nix @@ -10,5 +10,5 @@ qtModule { darwin.apple_sdk.frameworks.WebKit ]; outputs = [ "out" "dev" "bin" ]; - NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation -framework WebKit"; + env.NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation -framework WebKit"; } diff --git a/pkgs/development/libraries/qt-mobility/default.nix b/pkgs/development/libraries/qt-mobility/default.nix index b7857372d1cd8..d64e6cdd27521 100644 --- a/pkgs/development/libraries/qt-mobility/default.nix +++ b/pkgs/development/libraries/qt-mobility/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "14713pbscysd6d0b9rgm7gg145jzwvgdn22778pf2v13qzvfmy1i"; }; - NIX_CFLAGS_COMPILE="-fpermissive"; + env.NIX_CFLAGS_COMPILE="-fpermissive"; configurePhase = '' ./configure -prefix $out diff --git a/pkgs/development/libraries/qtinstaller/default.nix b/pkgs/development/libraries/qtinstaller/default.nix index 3c4c192bd4b9e..bfc92ae5fc0cb 100644 --- a/pkgs/development/libraries/qtinstaller/default.nix +++ b/pkgs/development/libraries/qtinstaller/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { setOutputFlags = false; enableParallelBuilding = true; - NIX_QT_SUBMODULE = true; + env.NIX_QT_SUBMODULE = true; installPhase = '' mkdir -p $out/{bin,lib,share/qt-installer-framework} diff --git a/pkgs/development/libraries/rdkafka/default.nix b/pkgs/development/libraries/rdkafka/default.nix index cb1b176ce3537..b3140ee2faa9d 100644 --- a/pkgs/development/libraries/rdkafka/default.nix +++ b/pkgs/development/libraries/rdkafka/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ zlib perl python openssl ]; - NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow"; postPatch = '' patchShebangs . diff --git a/pkgs/development/libraries/science/benchmark/papi/default.nix b/pkgs/development/libraries/science/benchmark/papi/default.nix index 53ae70f5bf8a3..84a0a276756e1 100644 --- a/pkgs/development/libraries/science/benchmark/papi/default.nix +++ b/pkgs/development/libraries/science/benchmark/papi/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation { sha256 = "13mngf9kl0y2wfxqvkad0smdaag7k8fvw82b4312gx62nwhc1i6r"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation"; preConfigure = '' cd src diff --git a/pkgs/development/libraries/science/math/nccl/default.nix b/pkgs/development/libraries/science/math/nccl/default.nix index c9aeb83c46941..fd434f2d1cd1a 100644 --- a/pkgs/development/libraries/science/math/nccl/default.nix +++ b/pkgs/development/libraries/science/math/nccl/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { addOpenGLRunpath $out/lib/lib*.so ''; - NIX_CFLAGS_COMPILE = [ "-Wno-unused-function" ]; + env.NIX_CFLAGS_COMPILE = [ "-Wno-unused-function" ]; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/science/math/osi/default.nix b/pkgs/development/libraries/science/math/osi/default.nix index 6dc7e746fd35a..0fed28d569af7 100644 --- a/pkgs/development/libraries/science/math/osi/default.nix +++ b/pkgs/development/libraries/science/math/osi/default.nix @@ -21,11 +21,11 @@ stdenv.mkDerivation rec { lib.optionals withGurobi [ "--with-gurobi-incdir=${gurobi}/include" "--with-gurobi-lib=-lgurobi${gurobi.libSuffix}" ] ++ lib.optionals withCplex [ "--with-cplex-incdir=${cplex}/cplex/include/ilcplex" "--with-cplex-lib=-lcplex${cplex.libSuffix}" ]; - NIX_LDFLAGS = + env.NIX_LDFLAGS = lib.optionalString withCplex "-L${cplex}/cplex/bin/${cplex.libArch}"; # Compile errors - NIX_CFLAGS_COMPILE = "-Wno-cast-qual"; + env.NIX_CFLAGS_COMPILE = "-Wno-cast-qual"; hardeningDisable = [ "format" ]; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/science/math/suitesparse/4.4.nix b/pkgs/development/libraries/science/math/suitesparse/4.4.nix index 1ce56d1e49f7f..b29aab9cfed40 100644 --- a/pkgs/development/libraries/science/math/suitesparse/4.4.nix +++ b/pkgs/development/libraries/science/math/suitesparse/4.4.nix @@ -55,7 +55,7 @@ stdenv.mkDerivation { "LAPACK=" ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER"; postInstall = '' # Build and install shared library diff --git a/pkgs/development/libraries/science/math/suitesparse/default.nix b/pkgs/development/libraries/science/math/suitesparse/default.nix index a6c803be260a5..76a5ee6d67b72 100644 --- a/pkgs/development/libraries/science/math/suitesparse/default.nix +++ b/pkgs/development/libraries/science/math/suitesparse/default.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation rec { -e 's|^[[:space:]]*\(NVCCFLAGS =\)|NVCCFLAGS = $(NV20) -O3 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_60,code=sm_60|' ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER"; buildPhase = '' runHook preBuild diff --git a/pkgs/development/libraries/silgraphite/default.nix b/pkgs/development/libraries/silgraphite/default.nix index 9d0aca0ab14ba..3777d40d017aa 100644 --- a/pkgs/development/libraries/silgraphite/default.nix +++ b/pkgs/development/libraries/silgraphite/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ freetype libXft pango fontconfig]; - NIX_CFLAGS_COMPILE = "-I${freetype.dev}/include/freetype2"; + env.NIX_CFLAGS_COMPILE = "-I${freetype.dev}/include/freetype2"; meta = { description = "An advanced font engine"; diff --git a/pkgs/development/libraries/smpeg/default.nix b/pkgs/development/libraries/smpeg/default.nix index 4d74ee7ca063d..69e64232dc98f 100644 --- a/pkgs/development/libraries/smpeg/default.nix +++ b/pkgs/development/libraries/smpeg/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { --prefix PKG_CONFIG_PATH ":" "${SDL.dev}/lib/pkgconfig" ''; - NIX_LDFLAGS = "-lX11"; + env.NIX_LDFLAGS = "-lX11"; meta = { homepage = http://icculus.org/smpeg/; diff --git a/pkgs/development/libraries/spatialite-tools/default.nix b/pkgs/development/libraries/spatialite-tools/default.nix index 83eef355f2db8..2142575e3a488 100644 --- a/pkgs/development/libraries/spatialite-tools/default.nix +++ b/pkgs/development/libraries/spatialite-tools/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_LDFLAGS = "-lsqlite3"; + env.NIX_LDFLAGS = "-lsqlite3"; meta = { description = "A complete sqlite3-compatible CLI front-end for libspatialite"; diff --git a/pkgs/development/libraries/spdk/default.nix b/pkgs/development/libraries/spdk/default.nix index f9f5beb5b65b4..9abe15f59c58c 100644 --- a/pkgs/development/libraries/spdk/default.nix +++ b/pkgs/development/libraries/spdk/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-dpdk=${dpdk}" ]; - NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile. + env.NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile. enableParallelBuilding = true; diff --git a/pkgs/development/libraries/spice/default.nix b/pkgs/development/libraries/spice/default.nix index d2c4ddb8631e3..819b66afa3370 100644 --- a/pkgs/development/libraries/spice/default.nix +++ b/pkgs/development/libraries/spice/default.nix @@ -74,7 +74,7 @@ stdenv.mkDerivation rec { zlib ]; - NIX_CFLAGS_COMPILE = "-fno-stack-protector"; + env.NIX_CFLAGS_COMPILE = "-fno-stack-protector"; mesonFlags = [ "-Dgstreamer=1.0" diff --git a/pkgs/development/libraries/tinyxml/2.6.2.nix b/pkgs/development/libraries/tinyxml/2.6.2.nix index 0cc4038b64e72..39950f95ebf73 100644 --- a/pkgs/development/libraries/tinyxml/2.6.2.nix +++ b/pkgs/development/libraries/tinyxml/2.6.2.nix @@ -27,7 +27,7 @@ in stdenv.mkDerivation { hardeningDisable = [ "format" ]; - NIX_CFLAGS_COMPILE = + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9"; buildInputs = [ unzip ]; diff --git a/pkgs/development/libraries/ucl/default.nix b/pkgs/development/libraries/ucl/default.nix index 933a3afef35b5..9de9c7999b486 100644 --- a/pkgs/development/libraries/ucl/default.nix +++ b/pkgs/development/libraries/ucl/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation { }; # needed to successfully compile with gcc 6 - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-std=c90"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-std=c90"; meta = { homepage = http://www.oberhumer.com/opensource/ucl/; diff --git a/pkgs/development/libraries/uri/default.nix b/pkgs/development/libraries/uri/default.nix index 5e5f4c9e8ca61..c88c89b8a7c31 100644 --- a/pkgs/development/libraries/uri/default.nix +++ b/pkgs/development/libraries/uri/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "148361pixrm94q6v04k13s1msa04bx9yc3djb0lxpa7dlw19vhcd"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=parentheses"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=parentheses"; nativeBuildInputs = [ cmake doxygen ]; diff --git a/pkgs/development/libraries/usbredir/default.nix b/pkgs/development/libraries/usbredir/default.nix index 8e43135196c90..f9aa0d501fd94 100644 --- a/pkgs/development/libraries/usbredir/default.nix +++ b/pkgs/development/libraries/usbredir/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "002yik1x7kn0427xahvnhjby2np14a6xqw7c3dx530n9h5d9rg47"; }; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libusb ]; diff --git a/pkgs/development/libraries/ustr/default.nix b/pkgs/development/libraries/ustr/default.nix index 18eae87e11c6c..6a019128854e1 100644 --- a/pkgs/development/libraries/ustr/default.nix +++ b/pkgs/development/libraries/ustr/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { patches = [ ./va_args.patch ]; # Work around gcc5 switch to gnu11 - NIX_CFLAGS_COMPILE = "-std=gnu89"; + env.NIX_CFLAGS_COMPILE = "-std=gnu89"; # Fix detection of stdint.h postPatch = '' diff --git a/pkgs/development/libraries/v8/3.14.nix b/pkgs/development/libraries/v8/3.14.nix index febadc2d6ac88..409909457a655 100644 --- a/pkgs/development/libraries/v8/3.14.nix +++ b/pkgs/development/libraries/v8/3.14.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation { buildInputs = [ readline python icu ]; # http://code.google.com/p/v8/issues/detail?id=2149 - NIX_CFLAGS_COMPILE = concatStringsSep " " [ + env.NIX_CFLAGS_COMPILE = concatStringsSep " " [ "-Wno-error=strict-overflow" "-Wno-unused-local-typedefs" "-Wno-aggressive-loop-optimizations" diff --git a/pkgs/development/libraries/v8/5_x.nix b/pkgs/development/libraries/v8/5_x.nix index 050abe9e81bfc..117623f1887ed 100644 --- a/pkgs/development/libraries/v8/5_x.nix +++ b/pkgs/development/libraries/v8/5_x.nix @@ -154,7 +154,7 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional stdenv.isDarwin xcbuild ++ stdenv.lib.optional stdenv.isLinux patchelf; - NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow -Wno-error=unused-function -Wno-error=attributes" + env.NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow -Wno-error=unused-function -Wno-error=attributes" + stdenv.lib.optionalString stdenv.cc.isClang " -Wno-error=unused-lambda-capture"; buildFlags = [ diff --git a/pkgs/development/libraries/vigra/default.nix b/pkgs/development/libraries/vigra/default.nix index 625ec2cee3890..c05064c10a9f5 100644 --- a/pkgs/development/libraries/vigra/default.nix +++ b/pkgs/development/libraries/vigra/default.nix @@ -13,7 +13,7 @@ in stdenv.mkDerivation rec { sha256 = "03i5wfscv83jb8vnwwhfmm8yfiniwkvk13myzhr1kbwbs9884wdj"; }; - NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR"; + env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR"; # Fixes compilation with clang (on darwin) see https://github.com/ukoethe/vigra/issues/414 patches = diff --git a/pkgs/development/libraries/wxwidgets/2.8/default.nix b/pkgs/development/libraries/wxwidgets/2.8/default.nix index 73dac47307a97..a49fadc593618 100644 --- a/pkgs/development/libraries/wxwidgets/2.8/default.nix +++ b/pkgs/development/libraries/wxwidgets/2.8/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { + optionalString withMesa "${libGLU.out}/lib ${libGL.out}/lib "; # Work around a bug in configure. - NIX_CFLAGS_COMPILE = "-DHAVE_X11_XLIB_H=1 -lX11 -lcairo -Wno-narrowing"; + env.NIX_CFLAGS_COMPILE = "-DHAVE_X11_XLIB_H=1 -lX11 -lcairo -Wno-narrowing"; preConfigure = " substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE=' diff --git a/pkgs/development/libraries/wxwidgets/3.0/mac.nix b/pkgs/development/libraries/wxwidgets/3.0/mac.nix index 5236996199d6b..8a3205d35f130 100644 --- a/pkgs/development/libraries/wxwidgets/3.0/mac.nix +++ b/pkgs/development/libraries/wxwidgets/3.0/mac.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation rec { ./wx-config --libs ''; - NIX_CFLAGS_COMPILE = "-Wno-undef"; + env.NIX_CFLAGS_COMPILE = "-Wno-undef"; doCheck = true; diff --git a/pkgs/development/libraries/xine-lib/default.nix b/pkgs/development/libraries/xine-lib/default.nix index adcb2e74b0bbd..6c0287ab5a687 100644 --- a/pkgs/development/libraries/xine-lib/default.nix +++ b/pkgs/development/libraries/xine-lib/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { }) ]; - NIX_LDFLAGS = "-lxcb-shm"; + env.NIX_LDFLAGS = "-lxcb-shm"; propagatedBuildInputs = [zlib]; diff --git a/pkgs/development/libraries/xmlsec/default.nix b/pkgs/development/libraries/xmlsec/default.nix index a8c751330b7c5..eb0d6bdf9ef24 100644 --- a/pkgs/development/libraries/xmlsec/default.nix +++ b/pkgs/development/libraries/xmlsec/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation { configureFlags = [ "--enable-soap" ]; # otherwise libxmlsec1-gnutls.so won't find libgcrypt.so, after #909 - NIX_LDFLAGS = "-lgcrypt"; + env.NIX_LDFLAGS = "-lgcrypt"; postInstall = '' moveToOutput "bin/xmlsec1-config" "$dev" diff --git a/pkgs/development/libraries/zeroc-ice/default.nix b/pkgs/development/libraries/zeroc-ice/default.nix index 3a5b1690f2d02..359a9bfac9bca 100644 --- a/pkgs/development/libraries/zeroc-ice/default.nix +++ b/pkgs/development/libraries/zeroc-ice/default.nix @@ -32,7 +32,7 @@ in stdenv.mkDerivation rec { buildInputs = [ zeroc_mcpp bzip2 expat openssl lmdb ] ++ lib.optionals stdenv.isDarwin [ darwin.cctools libiconv Security ]; - NIX_CFLAGS_COMPILE = "-Wno-error=class-memaccess -Wno-error=deprecated-copy"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=class-memaccess -Wno-error=deprecated-copy"; prePatch = lib.optional stdenv.isDarwin '' substituteInPlace Make.rules.Darwin \ diff --git a/pkgs/development/libraries/zookeeper_mt/default.nix b/pkgs/development/libraries/zookeeper_mt/default.nix index 127ea4f7162bd..5f16d693406a3 100644 --- a/pkgs/development/libraries/zookeeper_mt/default.nix +++ b/pkgs/development/libraries/zookeeper_mt/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation rec { setSourceRoot = "export sourceRoot=${zookeeper.name}/src/c"; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.isDarwin) "-Wno-error=format-overflow -Wno-error=stringop-truncation"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.isDarwin) "-Wno-error=format-overflow -Wno-error=stringop-truncation"; buildInputs = [ zookeeper bash ]; diff --git a/pkgs/development/misc/amdapp-sdk/default.nix b/pkgs/development/misc/amdapp-sdk/default.nix index a3a4573c0aede..ce0a95c4ec21e 100644 --- a/pkgs/development/misc/amdapp-sdk/default.nix +++ b/pkgs/development/misc/amdapp-sdk/default.nix @@ -49,7 +49,7 @@ in stdenv.mkDerivation { patchFlags = [ "-p0" ]; buildInputs = [ makeWrapper perl libGLU libGL xorg.libX11 xorg.libXext xorg.libXaw xorg.libXi xorg.libXxf86vm ]; propagatedBuildInputs = [ stdenv.cc ]; - NIX_LDFLAGS = "-lX11 -lXext -lXmu -lXi -lXxf86vm"; + env.NIX_LDFLAGS = "-lX11 -lXext -lXmu -lXi -lXxf86vm"; doCheck = false; unpackPhase = '' diff --git a/pkgs/development/misc/qmk_firmware/default.nix b/pkgs/development/misc/qmk_firmware/default.nix index 38b1df3ca3b58..1c9c5a972cf04 100644 --- a/pkgs/development/misc/qmk_firmware/default.nix +++ b/pkgs/development/misc/qmk_firmware/default.nix @@ -26,7 +26,7 @@ in stdenv.mkDerivation { installPhase = '' mkdir $out ''; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; nativeBuildInputs = [ avrgcc avrbinutils diff --git a/pkgs/development/ocaml-modules/curses/default.nix b/pkgs/development/ocaml-modules/curses/default.nix index 9bcf4fc411ffc..15cccdb4c221d 100644 --- a/pkgs/development/ocaml-modules/curses/default.nix +++ b/pkgs/development/ocaml-modules/curses/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { buildInputs = [ ocaml findlib ]; # Fix build for recent ncurses versions - NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS=1"; + env.NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS=1"; createFindlibDestdir = true; diff --git a/pkgs/development/python-modules/cld2-cffi/default.nix b/pkgs/development/python-modules/cld2-cffi/default.nix index 7775fee5ba0d9..651801acba1c3 100644 --- a/pkgs/development/python-modules/cld2-cffi/default.nix +++ b/pkgs/development/python-modules/cld2-cffi/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { checkInputs = [ nose ]; # gcc doesn't approve of this code, so disable -Werror - NIX_CFLAGS_COMPILE = "-w" + stdenv.lib.optionalString stdenv.cc.isClang " -Wno-error=c++11-narrowing"; + env.NIX_CFLAGS_COMPILE = "-w" + stdenv.lib.optionalString stdenv.cc.isClang " -Wno-error=c++11-narrowing"; checkPhase = "nosetests -v"; diff --git a/pkgs/development/python-modules/kiwisolver/default.nix b/pkgs/development/python-modules/kiwisolver/default.nix index e41c4bbeee055..899bb14d3d441 100644 --- a/pkgs/development/python-modules/kiwisolver/default.nix +++ b/pkgs/development/python-modules/kiwisolver/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { sha256 = "53eaed412477c836e1b9522c19858a8557d6e595077830146182225613b11a75"; }; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; # Does not include tests doCheck = false; diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix index 8ea530489e249..bb340c41fc32e 100644 --- a/pkgs/development/python-modules/matplotlib/2.nix +++ b/pkgs/development/python-modules/matplotlib/2.nix @@ -29,7 +29,7 @@ buildPythonPackage rec { sha256 = "7355bf757ecacd5f0ac9dd9523c8e1a1103faadf8d33c22664178e17533f8ce5"; }; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; XDG_RUNTIME_DIR = "/tmp"; diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 44d2bf6724702..d7a34cdf79a65 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -30,7 +30,7 @@ buildPythonPackage rec { sha256 = "8e8e2c2fe3d873108735c6ee9884e6f36f467df4a143136209cff303b183bada"; }; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; XDG_RUNTIME_DIR = "/tmp"; diff --git a/pkgs/development/python-modules/numba/default.nix b/pkgs/development/python-modules/numba/default.nix index f452b7fae7381..a6318d64df18e 100644 --- a/pkgs/development/python-modules/numba/default.nix +++ b/pkgs/development/python-modules/numba/default.nix @@ -21,7 +21,7 @@ buildPythonPackage rec { sha256 = "c2cbaeae60f80805290fff50175028726fae12692404a36babd3326730fbceee"; }; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; propagatedBuildInputs = [numpy llvmlite] ++ stdenv.lib.optional (!isPy3k) funcsigs ++ stdenv.lib.optional (isPy27 || isPy33) singledispatch; diff --git a/pkgs/development/python-modules/pivy/default.nix b/pkgs/development/python-modules/pivy/default.nix index f7ec55bba05ef..de130c5dd9924 100644 --- a/pkgs/development/python-modules/pivy/default.nix +++ b/pkgs/development/python-modules/pivy/default.nix @@ -21,7 +21,7 @@ buildPythonPackage rec { libXi libXext libSM libICE libX11 ]; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-I${pkgs.qt5.qtbase.dev}/include/QtCore" "-I${pkgs.qt5.qtbase.dev}/include/QtGui" "-I${pkgs.qt5.qtbase.dev}/include/QtOpenGL" diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix index e414dff8aa172..f28aef130604a 100644 --- a/pkgs/development/python-modules/protobuf/default.nix +++ b/pkgs/development/python-modules/protobuf/default.nix @@ -9,7 +9,7 @@ buildPythonPackage { inherit disabled; doCheck = doCheck && !isPy27; # setuptools>=41.4 no longer collects correctly on python2 - NIX_CFLAGS_COMPILE = toString ( + env.NIX_CFLAGS_COMPILE = toString ( # work around python distutils compiling C++ with $CC optional stdenv.isDarwin "-I${libcxx}/include/c++/v1" ++ optional (versionOlder protobuf.version "2.7.0") "-std=c++98" diff --git a/pkgs/development/python-modules/py3exiv2/default.nix b/pkgs/development/python-modules/py3exiv2/default.nix index fe0827c4f8f63..dd30fb3d5640e 100644 --- a/pkgs/development/python-modules/py3exiv2/default.nix +++ b/pkgs/development/python-modules/py3exiv2/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { buildInputs = [ exiv2 boost ]; # work around python distutils compiling C++ with $CC (see issue #26709) - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; # fix broken libboost_python3 detection patches = [ diff --git a/pkgs/development/python-modules/pyezminc/default.nix b/pkgs/development/python-modules/pyezminc/default.nix index 614a1555cbeff..6c80016df7681 100644 --- a/pkgs/development/python-modules/pyezminc/default.nix +++ b/pkgs/development/python-modules/pyezminc/default.nix @@ -20,7 +20,7 @@ buildPythonPackage rec { buildInputs = [ netcdf hdf5 libminc ezminc ]; propagatedBuildInputs = [ numpy scipy ]; - NIX_CFLAGS_COMPILE = "-fpermissive"; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; doCheck = false; # e.g., expects test data in /opt diff --git a/pkgs/development/python-modules/pygtk/default.nix b/pkgs/development/python-modules/pygtk/default.nix index 4779f76aed462..f8c6ac21bb93f 100644 --- a/pkgs/development/python-modules/pygtk/default.nix +++ b/pkgs/development/python-modules/pygtk/default.nix @@ -35,7 +35,7 @@ buildPythonPackage rec { buildPhase = "buildPhase"; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-ObjC"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-ObjC"; installPhase = "installPhase"; diff --git a/pkgs/development/python-modules/pypoppler/default.nix b/pkgs/development/python-modules/pypoppler/default.nix index ccda4f2631d20..ef90b8836ca31 100644 --- a/pkgs/development/python-modules/pypoppler/default.nix +++ b/pkgs/development/python-modules/pypoppler/default.nix @@ -16,7 +16,7 @@ buildPythonPackage rec { sha256 = "47e6ac99e5b114b9abf2d1dd1bca06f22c028d025432512989f659142470810f"; }; - NIX_CFLAGS_COMPILE="-I${pkgs.poppler.dev}/include/poppler/"; + env.NIX_CFLAGS_COMPILE="-I${pkgs.poppler.dev}/include/poppler/"; nativeBuildInputs = [ pkgs.pkgconfig ]; buildInputs = [ pkgs.poppler.dev ]; propagatedBuildInputs = [ pycairo pygobject2 ]; diff --git a/pkgs/development/python-modules/pyscard/default.nix b/pkgs/development/python-modules/pyscard/default.nix index ddd8b0ce29545..8fda7c1ff43ec 100644 --- a/pkgs/development/python-modules/pyscard/default.nix +++ b/pkgs/development/python-modules/pyscard/default.nix @@ -27,7 +27,7 @@ buildPythonPackage rec { "${getLib pcsclite}/lib/libpcsclite${sharedLibrary}" ''; - NIX_CFLAGS_COMPILE = optionalString (! withApplePCSC) + env.NIX_CFLAGS_COMPILE = optionalString (! withApplePCSC) "-I ${getDev pcsclite}/include/PCSC"; propagatedBuildInputs = if withApplePCSC then [ PCSC ] else [ pcsclite ]; diff --git a/pkgs/development/python-modules/pysvn/default.nix b/pkgs/development/python-modules/pysvn/default.nix index c1c765f1adc99..0e4858cc70dcd 100644 --- a/pkgs/development/python-modules/pysvn/default.nix +++ b/pkgs/development/python-modules/pysvn/default.nix @@ -21,7 +21,7 @@ buildPythonPackage rec { ++ (if stdenv.isLinux then [pkgs.e2fsprogs] else []); # There seems to be no way to pass that path to configure. - NIX_CFLAGS_COMPILE="-I${pkgs.aprutil.dev}/include/apr-1"; + env.NIX_CFLAGS_COMPILE="-I${pkgs.aprutil.dev}/include/apr-1"; preConfigure = '' cd Source diff --git a/pkgs/development/python-modules/python-uinput/default.nix b/pkgs/development/python-modules/python-uinput/default.nix index 8f6c7c54cb2e6..5b4003c04510e 100644 --- a/pkgs/development/python-modules/python-uinput/default.nix +++ b/pkgs/development/python-modules/python-uinput/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { buildInputs = [ udev ]; - NIX_CFLAGS_LINK = "-ludev"; + env.NIX_CFLAGS_LINK = "-ludev"; meta = with stdenv.lib; { description = "Pythonic API to Linux uinput kernel module"; diff --git a/pkgs/development/python-modules/pytorch/default.nix b/pkgs/development/python-modules/pytorch/default.nix index d55be70ae490b..ca2d5b1b3a74b 100644 --- a/pkgs/development/python-modules/pytorch/default.nix +++ b/pkgs/development/python-modules/pytorch/default.nix @@ -165,7 +165,7 @@ in buildPythonPackage rec { # # Also of interest: pytorch ignores CXXFLAGS uses CFLAGS for both C and C++: # https://github.com/pytorch/pytorch/blob/v1.2.0/setup.py#L17 - NIX_CFLAGS_COMPILE = lib.optionals (numpy.blas == mkl) [ "-Wno-error=array-bounds" ]; + env.NIX_CFLAGS_COMPILE = lib.optionals (numpy.blas == mkl) [ "-Wno-error=array-bounds" ]; nativeBuildInputs = [ cmake diff --git a/pkgs/development/python-modules/roboschool/default.nix b/pkgs/development/python-modules/roboschool/default.nix index a86e17e921b68..d73afadd752ff 100644 --- a/pkgs/development/python-modules/roboschool/default.nix +++ b/pkgs/development/python-modules/roboschool/default.nix @@ -44,7 +44,7 @@ buildPythonPackage rec { boost ]; - NIX_CFLAGS_COMPILE="-I ${python}/include/${python.libPrefix}"; + env.NIX_CFLAGS_COMPILE="-I ${python}/include/${python.libPrefix}"; patches = [ # Remove kwarg that was removed in upstream gym diff --git a/pkgs/development/r-modules/generic-builder.nix b/pkgs/development/r-modules/generic-builder.nix index 76bf29abc17c6..86b097b335dfa 100644 --- a/pkgs/development/r-modules/generic-builder.nix +++ b/pkgs/development/r-modules/generic-builder.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation ({ stdenv.lib.optionals requireX [utillinux xvfb_run] ++ stdenv.lib.optionals stdenv.isDarwin [Cocoa Foundation gfortran]; - NIX_CFLAGS_COMPILE = + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; configurePhase = '' diff --git a/pkgs/development/tools/analysis/rr/default.nix b/pkgs/development/tools/analysis/rr/default.nix index a8d95eb05deb2..f7661694d966d 100644 --- a/pkgs/development/tools/analysis/rr/default.nix +++ b/pkgs/development/tools/analysis/rr/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { ]; # we turn on additional warnings due to hardening - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; hardeningDisable = [ "fortify" ]; diff --git a/pkgs/development/tools/database/sqlitebrowser/default.nix b/pkgs/development/tools/database/sqlitebrowser/default.nix index 0ec4b1510e915..4f16c1f18c40d 100644 --- a/pkgs/development/tools/database/sqlitebrowser/default.nix +++ b/pkgs/development/tools/database/sqlitebrowser/default.nix @@ -16,7 +16,7 @@ mkDerivation rec { nativeBuildInputs = [ cmake qttools ]; - NIX_LDFLAGS = "-lQt5PrintSupport"; + env.NIX_LDFLAGS = "-lQt5PrintSupport"; enableParallelBuilding = true; diff --git a/pkgs/development/tools/diesel-cli/default.nix b/pkgs/development/tools/diesel-cli/default.nix index e5f7a50476e6e..2cf66d3f128c3 100644 --- a/pkgs/development/tools/diesel-cli/default.nix +++ b/pkgs/development/tools/diesel-cli/default.nix @@ -65,7 +65,7 @@ rustPlatform.buildRustPackage rec { # Fix the build with mariadb, which otherwise shows "error adding symbols: # DSO missing from command line" errors for libz and libssl. - NIX_LDFLAGS = lib.optionalString mysqlSupport "-lz -lssl -lcrypto"; + env.NIX_LDFLAGS = lib.optionalString mysqlSupport "-lz -lssl -lcrypto"; meta = with lib; { description = "Database tool for working with Rust projects that use Diesel"; diff --git a/pkgs/development/tools/misc/bossa/default.nix b/pkgs/development/tools/misc/bossa/default.nix index 6548e9643971a..f5406647cbabb 100644 --- a/pkgs/development/tools/misc/bossa/default.nix +++ b/pkgs/development/tools/misc/bossa/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation { # Explicitly specify targets so they don't get stripped. makeFlags = [ "bin/bossac" "bin/bossash" "bin/bossa" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/development/tools/misc/hydra/default.nix b/pkgs/development/tools/misc/hydra/default.nix index 3e5c12e183aa9..e3bdbbfc0d388 100644 --- a/pkgs/development/tools/misc/hydra/default.nix +++ b/pkgs/development/tools/misc/hydra/default.nix @@ -102,7 +102,7 @@ in stdenv.mkDerivation rec { configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ]; - NIX_CFLAGS_COMPILE = "-pthread"; + env.NIX_CFLAGS_COMPILE = "-pthread"; shellHook = '' PATH=$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$(pwd)/src/hydra-evaluator:$PATH diff --git a/pkgs/development/tools/misc/indent/default.nix b/pkgs/development/tools/misc/indent/default.nix index c4b5fecca7411..d32689c5939c6 100644 --- a/pkgs/development/tools/misc/indent/default.nix +++ b/pkgs/development/tools/misc/indent/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { buildInputs = [ texinfo ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-implicit-function-declaration"; hardeningDisable = [ "format" ]; diff --git a/pkgs/development/tools/misc/kconfig-frontends/default.nix b/pkgs/development/tools/misc/kconfig-frontends/default.nix index e33259b416fa6..c61c52b9e9263 100644 --- a/pkgs/development/tools/misc/kconfig-frontends/default.nix +++ b/pkgs/development/tools/misc/kconfig-frontends/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { wrapPythonPrograms ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=format-security"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=format-security"; meta = with stdenv.lib; { description = "Out of Linux tree packaging of the kconfig infrastructure"; diff --git a/pkgs/development/tools/misc/openocd/default.nix b/pkgs/development/tools/misc/openocd/default.nix index 88f75a3081b97..97c58decd7bbe 100644 --- a/pkgs/development/tools/misc/openocd/default.nix +++ b/pkgs/development/tools/misc/openocd/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { "--enable-remote-bitbang" ]; - NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [ + env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [ "-Wno-implicit-fallthrough" "-Wno-format-truncation" "-Wno-format-overflow" diff --git a/pkgs/development/tools/misc/tcptrack/default.nix b/pkgs/development/tools/misc/tcptrack/default.nix index 9872c91ac4ba2..6893438c729cd 100644 --- a/pkgs/development/tools/misc/tcptrack/default.nix +++ b/pkgs/development/tools/misc/tcptrack/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses libpcap ]; - NIX_CFLAGS_COMPILE = "-Wno-error=cpp"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=cpp"; meta = with stdenv.lib; { inherit (src.meta) homepage; diff --git a/pkgs/development/tools/misc/uisp/default.nix b/pkgs/development/tools/misc/uisp/default.nix index 1727f772006e4..af483ecdb33bd 100644 --- a/pkgs/development/tools/misc/uisp/default.nix +++ b/pkgs/development/tools/misc/uisp/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation { sha256 = "1bncxp5yxh9r1yrp04vvhfiva8livi1pwic7v8xj99q09zrwahvw"; }; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; meta = { description = "Tool for AVR microcontrollers which can interface to many hardware in-system programmers"; diff --git a/pkgs/development/tools/misc/xxdiff/default.nix b/pkgs/development/tools/misc/xxdiff/default.nix index c187ad42c0e98..42665a00b1478 100644 --- a/pkgs/development/tools/misc/xxdiff/default.nix +++ b/pkgs/development/tools/misc/xxdiff/default.nix @@ -20,7 +20,7 @@ mkDerivation rec { dontUseQmakeConfigure = true; # c++11 and above is needed for building with Qt 5.9+ - NIX_CFLAGS_COMPILE = [ "-std=c++14" ]; + env.NIX_CFLAGS_COMPILE = [ "-std=c++14" ]; sourceRoot = "source/src"; diff --git a/pkgs/development/tools/nrpl/default.nix b/pkgs/development/tools/nrpl/default.nix index d8dab6b035878..99cbdc4d10257 100644 --- a/pkgs/development/tools/nrpl/default.nix +++ b/pkgs/development/tools/nrpl/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation { }) ]; - NIX_LDFLAGS = "-lpcre"; + env.NIX_LDFLAGS = "-lpcre"; buildPhase = '' HOME=$TMPDIR diff --git a/pkgs/development/tools/tora/default.nix b/pkgs/development/tools/tora/default.nix index 213c926521fea..a87bb00980072 100644 --- a/pkgs/development/tools/tora/default.nix +++ b/pkgs/development/tools/tora/default.nix @@ -40,9 +40,9 @@ mkDerivation { ]; # these libraries are only searched for at runtime so we need to force-link them - NIX_LDFLAGS = "-lgvc -lmysqlclient -lecpg -lssl"; + env.NIX_LDFLAGS = "-lgvc -lmysqlclient -lecpg -lssl"; - NIX_CFLAGS_COMPILE = "-L${libmysqlclient}/lib/mysql -I${libmysqlclient}/include/mysql"; + env.NIX_CFLAGS_COMPILE = "-L${libmysqlclient}/lib/mysql -I${libmysqlclient}/include/mysql"; qtWrapperArgs = [ ''--prefix PATH : ${lib.getBin graphviz}/bin'' diff --git a/pkgs/development/tools/xcbuild/default.nix b/pkgs/development/tools/xcbuild/default.nix index 8090aca5ff303..e2840ea9b912f 100644 --- a/pkgs/development/tools/xcbuild/default.nix +++ b/pkgs/development/tools/xcbuild/default.nix @@ -55,7 +55,7 @@ in stdenv.mkDerivation { rmdir $out/usr ''; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; cmakeFlags = [ "-GNinja" ]; diff --git a/pkgs/development/web/kore/default.nix b/pkgs/development/web/kore/default.nix index a59db6d4d1ae1..61c339706eccd 100644 --- a/pkgs/development/web/kore/default.nix +++ b/pkgs/development/web/kore/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=${placeholder "out"}" ]; # added to fix build w/gcc7 and clang5 - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=pointer-compare" + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=pointer-compare" + stdenv.lib.optionalString stdenv.cc.isClang " -Wno-error=unknown-warning-option"; enableParallelBuilding = true; diff --git a/pkgs/games/0ad/game.nix b/pkgs/games/0ad/game.nix index 42464f71ae33d..e0735e617bed4 100644 --- a/pkgs/games/0ad/game.nix +++ b/pkgs/games/0ad/game.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { nvidia-texture-tools libsodium ] ++ lib.optional withEditor wxGTK; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-I${xorgproto}/include/X11" "-I${libX11.dev}/include/X11" "-I${libXcursor.dev}/include/X11" diff --git a/pkgs/games/airstrike/default.nix b/pkgs/games/airstrike/default.nix index 408f2817854a3..aa0a361cc5f9b 100644 --- a/pkgs/games/airstrike/default.nix +++ b/pkgs/games/airstrike/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { buildInputs = [ makeWrapper SDL SDL_image ]; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; installPhase = '' ls -l diff --git a/pkgs/games/armagetronad/default.nix b/pkgs/games/armagetronad/default.nix index 57373d39b54cd..8f1e689825f8f 100644 --- a/pkgs/games/armagetronad/default.nix +++ b/pkgs/games/armagetronad/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation { sha256 = "157pp84wf0q3bdb72rnbm3ck0czwx2ply6lyhj8z7kfdc7csdbr3"; }; - NIX_LDFLAGS = "-lSDL_image"; + env.NIX_LDFLAGS = "-lSDL_image"; enableParallelBuilding = true; diff --git a/pkgs/games/asc/default.nix b/pkgs/games/asc/default.nix index c8f5deef92406..5e41316697bb5 100644 --- a/pkgs/games/asc/default.nix +++ b/pkgs/games/asc/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-paragui" "--disable-paraguitest" ]; - NIX_CFLAGS_COMPILE = "-fpermissive"; # I'm too lazy to catch all gcc47-related problems + env.NIX_CFLAGS_COMPILE = "-fpermissive"; # I'm too lazy to catch all gcc47-related problems hardeningDisable = [ "format" ]; buildInputs = [ diff --git a/pkgs/games/beret/default.nix b/pkgs/games/beret/default.nix index 81bdbed46e94f..e12f42f3167a8 100644 --- a/pkgs/games/beret/default.nix +++ b/pkgs/games/beret/default.nix @@ -5,9 +5,9 @@ stdenv.mkDerivation { buildInputs = [ SDL SDL_image SDL_ttf SDL_mixer ]; - NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL"; - NIX_CFLAGS_LINK = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin + env.NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL"; + env.NIX_CFLAGS_LINK = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-framework CoreFoundation -framework OpenGL -framework Cocoa"; patches = [ ./use-home-dir.patch ]; diff --git a/pkgs/games/bitsnbots/default.nix b/pkgs/games/bitsnbots/default.nix index c6c5176ecdf8b..76e452bad8adf 100644 --- a/pkgs/games/bitsnbots/default.nix +++ b/pkgs/games/bitsnbots/default.nix @@ -14,9 +14,9 @@ stdenv.mkDerivation rec { makefile = "Makefile.linux"; - NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL"; + env.NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL"; - NIX_LDFLAGS = "-lGL"; + env.NIX_LDFLAGS = "-lGL"; installPhase = '' mkdir -p $out/share/${name} diff --git a/pkgs/games/blackshades/default.nix b/pkgs/games/blackshades/default.nix index 608b32764bb95..89d39b605c76a 100644 --- a/pkgs/games/blackshades/default.nix +++ b/pkgs/games/blackshades/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation { sha256 = "0kbrh1dympk8scjxr6av24qs2bffz44l8qmw2m5gyqf4g3rxf6ra"; }; - NIX_LDFLAGS = "-lSDL_image"; + env.NIX_LDFLAGS = "-lSDL_image"; buildInputs = [ SDL SDL_image libGLU libGL openal libvorbis freealut ]; diff --git a/pkgs/games/btanks/default.nix b/pkgs/games/btanks/default.nix index 5bb7cfa215bcf..b48040fffd079 100644 --- a/pkgs/games/btanks/default.nix +++ b/pkgs/games/btanks/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-I${SDL_image}/include/SDL"; + env.NIX_CFLAGS_COMPILE = "-I${SDL_image}/include/SDL"; patches = [ (fetchpatch { diff --git a/pkgs/games/devilutionx/default.nix b/pkgs/games/devilutionx/default.nix index 3241e6dd387f7..356015585beee 100644 --- a/pkgs/games/devilutionx/default.nix +++ b/pkgs/games/devilutionx/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "010hxj129zmsynvizk89vm2y29dcxsfi585czh3f03wfr38rxa6b"; }; - NIX_CFLAGS_COMPILE = "-I${SDL2_ttf}/include/SDL2"; + env.NIX_CFLAGS_COMPILE = "-I${SDL2_ttf}/include/SDL2"; nativeBuildInputs = [ pkg-config cmake ]; buildInputs = [ libsodium SDL2 SDL2_mixer SDL2_ttf ]; diff --git a/pkgs/games/dxx-rebirth/default.nix b/pkgs/games/dxx-rebirth/default.nix index b7eb2f02568dd..a09ac5d0a3da0 100644 --- a/pkgs/games/dxx-rebirth/default.nix +++ b/pkgs/games/dxx-rebirth/default.nix @@ -37,7 +37,7 @@ in gcc6Stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral"; + env.NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral"; postInstall = '' install -Dm644 ${music} $out/share/games/dxx-rebirth/d2xr-sc55-music.dxa diff --git a/pkgs/games/eboard/default.nix b/pkgs/games/eboard/default.nix index af6bc4be39361..ae997f976b866 100644 --- a/pkgs/games/eboard/default.nix +++ b/pkgs/games/eboard/default.nix @@ -19,8 +19,8 @@ stdenv.mkDerivation { patchShebangs ./configure ''; - NIX_CFLAGS_COMPILE = "-fpermissive"; - NIX_LDFLAGS = "-ldl"; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; + env.NIX_LDFLAGS = "-ldl"; meta = { homepage = http://www.bergo.eng.br/eboard/; diff --git a/pkgs/games/eduke32/default.nix b/pkgs/games/eduke32/default.nix index 242e0930db3be..0de2cd025285e 100644 --- a/pkgs/games/eduke32/default.nix +++ b/pkgs/games/eduke32/default.nix @@ -41,7 +41,7 @@ in stdenv.mkDerivation { done ''; - NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2 -I${SDL2_mixer}/include/SDL2"; + env.NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2 -I${SDL2_mixer}/include/SDL2"; makeFlags = [ "SDLCONFIG=${SDL2}/bin/sdl2-config" diff --git a/pkgs/games/egoboo/default.nix b/pkgs/games/egoboo/default.nix index c8a5f380900a0..56afa06c5f037 100644 --- a/pkgs/games/egoboo/default.nix +++ b/pkgs/games/egoboo/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { ''; */ - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; meta = { description = "3D dungeon crawling adventure"; diff --git a/pkgs/games/exult/default.nix b/pkgs/games/exult/default.nix index 07f84d7a151af..01a873d0bc883 100644 --- a/pkgs/games/exult/default.nix +++ b/pkgs/games/exult/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { makeFlags = [ "DESTDIR=$(out)" ]; - NIX_LDFLAGS = "-lX11"; + env.NIX_LDFLAGS = "-lX11"; postInstall = '' diff --git a/pkgs/games/globulation/default.nix b/pkgs/games/globulation/default.nix index 45c5013705f3f..fae87423b18af 100644 --- a/pkgs/games/globulation/default.nix +++ b/pkgs/games/globulation/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { sconsFlags+=" DATADIR=$out/share/globulation2/glob2" ''; - NIX_LDFLAGS = "-lboost_system"; + env.NIX_LDFLAGS = "-lboost_system"; meta = with stdenv.lib; { description = "RTS without micromanagement"; diff --git a/pkgs/games/gnujump/default.nix b/pkgs/games/gnujump/default.nix index af2e924960a1e..3af72a0b3464d 100644 --- a/pkgs/games/gnujump/default.nix +++ b/pkgs/games/gnujump/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { }; buildInputs = [ SDL SDL_image SDL_mixer ]; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; meta = with stdenv.lib; { homepage = https://jump.gnu.sinusoid.es/index.php?title=Main_Page; diff --git a/pkgs/games/gzdoom/default.nix b/pkgs/games/gzdoom/default.nix index 5cafe045fa6aa..1111ef6f1e751 100644 --- a/pkgs/games/gzdoom/default.nix +++ b/pkgs/games/gzdoom/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_LINK = "-lopenal -lfluidsynth"; + env.NIX_CFLAGS_LINK = "-lopenal -lfluidsynth"; preConfigure = '' sed -i \ diff --git a/pkgs/games/hedgewars/default.nix b/pkgs/games/hedgewars/default.nix index dffeb2ac556d7..951b159dd7b5f 100644 --- a/pkgs/games/hedgewars/default.nix +++ b/pkgs/games/hedgewars/default.nix @@ -40,7 +40,7 @@ mkDerivation rec { "-DNOSERVER=${if withServer then "OFF" else "ON"}" ]; - NIX_LDFLAGS = lib.concatMapStringsSep " " (e: "-rpath ${e}/lib") [ + env.NIX_LDFLAGS = lib.concatMapStringsSep " " (e: "-rpath ${e}/lib") [ SDL2.out SDL2_image SDL2_mixer diff --git a/pkgs/games/instead/default.nix b/pkgs/games/instead/default.nix index fff15b5c5b0c1..429ed039d8ea0 100644 --- a/pkgs/games/instead/default.nix +++ b/pkgs/games/instead/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation { sha256 = "10bppcdjnd0all71l5akdvy7fx0c8s8x0za9qxszs8cjmlv9z1q0"; }; - NIX_LDFLAGS = "-llua -lgcc_s"; + env.NIX_LDFLAGS = "-llua -lgcc_s"; nativeBuildInputs = [ pkgconfig unzip ]; buildInputs = [ SDL2 SDL2_ttf SDL2_image SDL2_mixer lua zlib ]; diff --git a/pkgs/games/ivan/default.nix b/pkgs/games/ivan/default.nix index 0a7474e0f51fa..2c3503de3d297 100644 --- a/pkgs/games/ivan/default.nix +++ b/pkgs/games/ivan/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { cmakeFlags = ["-DCMAKE_CXX_FLAGS=-DWIZARD"]; # Help CMake find SDL_mixer.h - NIX_CFLAGS_COMPILE = "-I${SDL2_mixer}/include/SDL2"; + env.NIX_CFLAGS_COMPILE = "-I${SDL2_mixer}/include/SDL2"; meta = with stdenv.lib; { description = "Graphical roguelike game"; diff --git a/pkgs/games/liquidwar/5.nix b/pkgs/games/liquidwar/5.nix index 5c42b8ecaab27..d9eddf4479971 100644 --- a/pkgs/games/liquidwar/5.nix +++ b/pkgs/games/liquidwar/5.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - NIX_CFLAGS_COMPILE = [ "-lm" ]; + env.NIX_CFLAGS_COMPILE = [ "-lm" ]; meta = with stdenv.lib; { description = ''The classic version of a quick tactics game LiquidWar''; diff --git a/pkgs/games/liquidwar/default.nix b/pkgs/games/liquidwar/default.nix index 800ac0fc4c7a7..6fd87175c2235 100644 --- a/pkgs/games/liquidwar/default.nix +++ b/pkgs/games/liquidwar/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - NIX_CFLAGS_COMPILE = + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations" + # Avoid GL_GLEXT_VERSION double definition " -DNO_SDL_GLEXT" diff --git a/pkgs/games/macopix/default.nix b/pkgs/games/macopix/default.nix index 7879b68c857db..550d93494874b 100644 --- a/pkgs/games/macopix/default.nix +++ b/pkgs/games/macopix/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_LDFLAGS = "-lX11"; + env.NIX_LDFLAGS = "-lX11"; meta = { description = "Mascot Constructive Pilot for X"; diff --git a/pkgs/games/naev/default.nix b/pkgs/games/naev/default.nix index a1b525ff093b9..486b4657a5dec 100644 --- a/pkgs/games/naev/default.nix +++ b/pkgs/games/naev/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ pkgconfig makeWrapper ]; - NIX_CFLAGS_COMPILE="-include ${zlib.dev}/include/zlib.h"; + env.NIX_CFLAGS_COMPILE="-include ${zlib.dev}/include/zlib.h"; postInstall = '' mkdir -p $out/share/naev diff --git a/pkgs/games/nexuiz/default.nix b/pkgs/games/nexuiz/default.nix index 9f8d228e71677..6e74ecd8006d7 100644 --- a/pkgs/games/nexuiz/default.nix +++ b/pkgs/games/nexuiz/default.nix @@ -36,7 +36,7 @@ in stdenv.mkDerivation { cd ../../ ''; - NIX_LDFLAGS = '' + env.NIX_LDFLAGS = '' -rpath ${zlib.out}/lib -rpath ${curl.out}/lib -rpath ${libjpeg.out}/lib diff --git a/pkgs/games/onscripter-en/default.nix b/pkgs/games/onscripter-en/default.nix index 2ad23a72368b5..2d1049eabfc9f 100644 --- a/pkgs/games/onscripter-en/default.nix +++ b/pkgs/games/onscripter-en/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { configureFlags = [ "--no-werror" ]; # Without this libvorbisfile.so is not getting linked properly for some reason. - NIX_CFLAGS_LINK = "-lvorbisfile"; + env.NIX_CFLAGS_LINK = "-lvorbisfile"; preBuild = '' sed -i 's/.dll//g' Makefile diff --git a/pkgs/games/opendungeons/default.nix b/pkgs/games/opendungeons/default.nix index f6841abb1d07a..b7823e14e4019 100644 --- a/pkgs/games/opendungeons/default.nix +++ b/pkgs/games/opendungeons/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ cmake ogre cegui boost sfml openal ois ]; - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; meta = with stdenv.lib; { description = "An open source, real time strategy game sharing game elements with the Dungeon Keeper series and Evil Genius."; diff --git a/pkgs/games/openlierox/default.nix b/pkgs/games/openlierox/default.nix index 4b1385f3e10d1..aad50127b9acc 100644 --- a/pkgs/games/openlierox/default.nix +++ b/pkgs/games/openlierox/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation { sha256 = "1k35xppfqi3qfysv81xq3hj4qdy9j2ciinbkfdcmwclcsf3nh94z"; }; - NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2 -std=c++98 -Wno-error"; + env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2 -std=c++98 -Wno-error"; # The breakpad fails to build on x86_64, and it's only to report bugs upstream cmakeFlags = [ "-DBREAKPAD=0" ]; diff --git a/pkgs/games/openspades/default.nix b/pkgs/games/openspades/default.nix index b00524461a493..1d2e05d90aafe 100644 --- a/pkgs/games/openspades/default.nix +++ b/pkgs/games/openspades/default.nix @@ -57,7 +57,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_LINK = "-lopenal"; + env.NIX_CFLAGS_LINK = "-lopenal"; meta = with stdenv.lib; { description = "A compatible client of Ace of Spades 0.75"; diff --git a/pkgs/games/pokerth/default.nix b/pkgs/games/pokerth/default.nix index 2e4ce270b8281..5059a00a043a7 100644 --- a/pkgs/games/pokerth/default.nix +++ b/pkgs/games/pokerth/default.nix @@ -60,7 +60,7 @@ stdenv.mkDerivation rec { "pokerth.pro" ]; - NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL"; + env.NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL"; enableParallelBuilding = true; diff --git a/pkgs/games/rogue/default.nix b/pkgs/games/rogue/default.nix index 1e27d67eb03e5..019e76fceb3cc 100644 --- a/pkgs/games/rogue/default.nix +++ b/pkgs/games/rogue/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation { buildInputs = [ ncurses ]; # Fix build for recent ncurses versions - NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS=1"; + env.NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS=1"; meta = with stdenv.lib; { homepage = http://rogue.rogueforge.net/rogue-5-4/; diff --git a/pkgs/games/scorched3d/default.nix b/pkgs/games/scorched3d/default.nix index c86df396ff159..78aa42e7a2198 100644 --- a/pkgs/games/scorched3d/default.nix +++ b/pkgs/games/scorched3d/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-fftw=${fftwSinglePrec.dev}" ]; - NIX_LDFLAGS = "-lopenal"; + env.NIX_LDFLAGS = "-lopenal"; meta = with stdenv.lib; { homepage = http://scorched3d.co.uk/; diff --git a/pkgs/games/spring/default.nix b/pkgs/games/spring/default.nix index 8f43a6d84b1ae..36057189d6c6e 100644 --- a/pkgs/games/spring/default.nix +++ b/pkgs/games/spring/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-fpermissive"; # GL header minor incompatibility + env.NIX_CFLAGS_COMPILE = "-fpermissive"; # GL header minor incompatibility postInstall = '' wrapProgram "$out/bin/spring" \ diff --git a/pkgs/games/stuntrally/default.nix b/pkgs/games/stuntrally/default.nix index 6b3da08b70c7f..8161360d156e7 100644 --- a/pkgs/games/stuntrally/default.nix +++ b/pkgs/games/stuntrally/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { # include/OGRE/OgreException.h:265:126: error: invalid conversion from # 'int' to 'Ogre::Exception::ExceptionCodes' [-fpermissive] - NIX_CFLAGS_COMPILE="-fpermissive"; + env.NIX_CFLAGS_COMPILE="-fpermissive"; preConfigure = '' pushd data diff --git a/pkgs/games/tdm/default.nix b/pkgs/games/tdm/default.nix index 949f5a3e2ab94..9668510d1bdcf 100644 --- a/pkgs/games/tdm/default.nix +++ b/pkgs/games/tdm/default.nix @@ -91,7 +91,7 @@ EOF enableParallelBuilding = true; sconsFlags = [ "BUILD=release" "TARGET_ARCH=x64" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=format-security"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-security"; meta = with stdenv.lib; { description = "The Dark Mod - stealth FPS inspired by the Thief series"; homepage = "http://www.thedarkmod.com"; diff --git a/pkgs/games/tome4/default.nix b/pkgs/games/tome4/default.nix index b31b53922ffee..ade363b47c070 100644 --- a/pkgs/games/tome4/default.nix +++ b/pkgs/games/tome4/default.nix @@ -41,7 +41,7 @@ in stdenv.mkDerivation rec { # disable parallel building as it caused sporadic build failures enableParallelBuilding = false; - NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2 -I${SDL2_image}/include/SDL2 -I${SDL2_ttf}/include/SDL2"; + env.NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2 -I${SDL2_image}/include/SDL2 -I${SDL2_ttf}/include/SDL2"; makeFlags = [ "config=release" ]; diff --git a/pkgs/games/tremulous/default.nix b/pkgs/games/tremulous/default.nix index 7ea83f80fefa5..1f4919e2c0714 100644 --- a/pkgs/games/tremulous/default.nix +++ b/pkgs/games/tremulous/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { ''; patches = [ ./parse.patch ]; patchFlags = [ "-p" "0" ]; - NIX_LD_FLAGS = '' + env.NIX_LD_FLAGS = '' -rpath ${stdenv.cc}/lib -rpath ${stdenv.cc}/lib64 ''; diff --git a/pkgs/games/ufoai/default.nix b/pkgs/games/ufoai/default.nix index beff8ada96b40..1ba29f35f789f 100644 --- a/pkgs/games/ufoai/default.nix +++ b/pkgs/games/ufoai/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { curl libjpeg libpng gettext cunit ]; - NIX_CFLAGS_LINK = "-lgcc_s"; # to avoid occasional runtime error in finding libgcc_s.so.1 + env.NIX_CFLAGS_LINK = "-lgcc_s"; # to avoid occasional runtime error in finding libgcc_s.so.1 meta = { homepage = http://ufoai.org; diff --git a/pkgs/games/xbill/default.nix b/pkgs/games/xbill/default.nix index 8a6d4cf14cdce..0d7e63749986d 100644 --- a/pkgs/games/xbill/default.nix +++ b/pkgs/games/xbill/default.nix @@ -6,7 +6,7 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 libXpm libXt motif ]; - NIX_CFLAGS_LINK = "-lXpm"; + env.NIX_CFLAGS_LINK = "-lXpm"; configureFlags = [ "--with-x" diff --git a/pkgs/games/xpilot/bloodspilot-client.nix b/pkgs/games/xpilot/bloodspilot-client.nix index 4a1c25ee12e0c..ef4ae3a08aeea 100644 --- a/pkgs/games/xpilot/bloodspilot-client.nix +++ b/pkgs/games/xpilot/bloodspilot-client.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { libX11 SDL SDL_ttf SDL_image libGLU libGL expat zlib ]; - NIX_LDFLAGS = "-lX11"; + env.NIX_LDFLAGS = "-lX11"; meta = { description = ''A multiplayer space combat game (client part)''; diff --git a/pkgs/games/xsok/default.nix b/pkgs/games/xsok/default.nix index 62cdaccc29750..768b89fbce6c8 100644 --- a/pkgs/games/xsok/default.nix +++ b/pkgs/games/xsok/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { buildInputs = [libX11 libXt libXaw libXpm libXext]; nativeBuildInputs = [imake]; - NIX_CFLAGS_COMPILE=" -isystem ${libXpm.dev}/include/X11 "; + env.NIX_CFLAGS_COMPILE=" -isystem ${libXpm.dev}/include/X11 "; preConfigure = '' sed -e "s@/usr/@$out/share/@g" -i src/Imakefile diff --git a/pkgs/games/xsokoban/default.nix b/pkgs/games/xsokoban/default.nix index 3f6062c4f6862..ca0e633623b58 100644 --- a/pkgs/games/xsokoban/default.nix +++ b/pkgs/games/xsokoban/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 xorgproto libXpm libXt ]; - NIX_CFLAGS_COMPILE = "-I${libXpm.dev}/include/X11"; + env.NIX_CFLAGS_COMPILE = "-I${libXpm.dev}/include/X11"; hardeningDisable = [ "format" ]; diff --git a/pkgs/games/zaz/default.nix b/pkgs/games/zaz/default.nix index 9d42cfd6896dc..88fbde0dceb93 100644 --- a/pkgs/games/zaz/default.nix +++ b/pkgs/games/zaz/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { ]; # Fix SDL include problems - NIX_CFLAGS_COMPILE="-I${SDL.dev}/include/SDL -I${SDL_image}/include/SDL"; + env.NIX_CFLAGS_COMPILE="-I${SDL.dev}/include/SDL -I${SDL_image}/include/SDL"; # Fix linking errors makeFlags = [ "ZAZ_LIBS+=-lSDL" diff --git a/pkgs/games/zdoom/default.nix b/pkgs/games/zdoom/default.nix index f6fde241129b1..14f357a743d21 100644 --- a/pkgs/games/zdoom/default.nix +++ b/pkgs/games/zdoom/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_LINK = [ "-lopenal" "-lfluidsynth" ]; + env.NIX_CFLAGS_LINK = [ "-lopenal" "-lfluidsynth" ]; preConfigure = '' sed -i \ diff --git a/pkgs/games/zod/default.nix b/pkgs/games/zod/default.nix index 888b7bd3d6aab..d478d754785b4 100644 --- a/pkgs/games/zod/default.nix +++ b/pkgs/games/zod/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation { buildInputs = [ unrar unzip SDL SDL_image SDL_ttf SDL_mixer libmysqlclient makeWrapper ]; - NIX_LDFLAGS = "-L${libmysqlclient}/lib/mysql"; + env.NIX_LDFLAGS = "-L${libmysqlclient}/lib/mysql"; installPhase = '' mkdir -p $out/bin $out/share/zod diff --git a/pkgs/games/zoom/default.nix b/pkgs/games/zoom/default.nix index 827fb351f1de2..3973711324de7 100644 --- a/pkgs/games/zoom/default.nix +++ b/pkgs/games/zoom/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { buildInputs = [ perl expat xlibsWrapper freetype ]; - NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype2 -fgnu89-inline"; + env.NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype2 -fgnu89-inline"; meta = with stdenv.lib; { description = "Player for Z-Code, TADS and HUGO stories or games"; diff --git a/pkgs/misc/cups/drivers/cups-bjnp/default.nix b/pkgs/misc/cups/drivers/cups-bjnp/default.nix index 0c91b782117dd..4b5f71436f9ff 100644 --- a/pkgs/misc/cups/drivers/cups-bjnp/default.nix +++ b/pkgs/misc/cups/drivers/cups-bjnp/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { preConfigure = ''configureFlags="--with-cupsbackenddir=$out/lib/cups/backend"''; buildInputs = [cups]; - NIX_CFLAGS_COMPILE = [ "-include stdio.h" "-Wno-error=stringop-truncation" ]; + env.NIX_CFLAGS_COMPILE = "-include stdio.h -Wno-error=stringop-truncation"; meta = { description = "CUPS back-end for Canon printers"; diff --git a/pkgs/misc/drivers/utsushi/default.nix b/pkgs/misc/drivers/utsushi/default.nix index ad7659d060a36..565b6a9c1daf9 100644 --- a/pkgs/misc/drivers/utsushi/default.nix +++ b/pkgs/misc/drivers/utsushi/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { libusb.dev ]; - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations -Wno-error=parentheses -Wno-error=unused-variable"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations -Wno-error=parentheses -Wno-error=unused-variable"; postPatch = '' # remove vendored dependencies diff --git a/pkgs/misc/emulators/fakenes/default.nix b/pkgs/misc/emulators/fakenes/default.nix index 704cef52e5e44..bddcb1db63ae1 100644 --- a/pkgs/misc/emulators/fakenes/default.nix +++ b/pkgs/misc/emulators/fakenes/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation { cp fakenes $out/bin ''; - NIX_LDFLAGS = "-lX11 -lXxf86vm -lXcursor -lXpm"; + env.NIX_LDFLAGS = "-lX11 -lXxf86vm -lXcursor -lXpm"; patches = [ ./build.patch ]; diff --git a/pkgs/misc/emulators/gens-gs/default.nix b/pkgs/misc/emulators/gens-gs/default.nix index 4120ec7ba6aa1..5212b41e0e19f 100644 --- a/pkgs/misc/emulators/gens-gs/default.nix +++ b/pkgs/misc/emulators/gens-gs/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { # Work around build failures on recent GTK. # See http://ubuntuforums.org/showthread.php?p=10535837 - NIX_CFLAGS_COMPILE = "-UGTK_DISABLE_DEPRECATED -UGSEAL_ENABLE"; + env.NIX_CFLAGS_COMPILE = "-UGTK_DISABLE_DEPRECATED -UGSEAL_ENABLE"; meta = with stdenv.lib; { homepage = https://segaretro.org/Gens/GS; diff --git a/pkgs/misc/emulators/mame/default.nix b/pkgs/misc/emulators/mame/default.nix index 3c205a703759a..31d0ae3dbaecc 100644 --- a/pkgs/misc/emulators/mame/default.nix +++ b/pkgs/misc/emulators/mame/default.nix @@ -27,7 +27,7 @@ in mkDerivation { }; hardeningDisable = [ "fortify" ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=maybe-uninitialized" ]; + env.NIX_CFLAGS_COMPILE = [ "-Wno-error=maybe-uninitialized" ]; makeFlags = [ "TOOLS=1" ]; diff --git a/pkgs/misc/emulators/wine/base.nix b/pkgs/misc/emulators/wine/base.nix index 0b6eab70263f8..42d0b6b6ac901 100644 --- a/pkgs/misc/emulators/wine/base.nix +++ b/pkgs/misc/emulators/wine/base.nix @@ -71,7 +71,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { # Wine locates a lot of libraries dynamically through dlopen(). Add # them to the RPATH so that the user doesn't have to set them in # LD_LIBRARY_PATH. - NIX_LDFLAGS = toString (map (path: "-rpath " + path) ( + env.NIX_LDFLAGS = toString (map (path: "-rpath " + path) ( map (x: "${lib.getLib x}/lib") ([ stdenv.cc.cc ] ++ buildInputs) # libpulsecommon.so is linked but not found otherwise ++ lib.optionals supportFlags.pulseaudioSupport (map (x: "${lib.getLib x}/lib/pulseaudio") diff --git a/pkgs/misc/emulators/wxmupen64plus/default.nix b/pkgs/misc/emulators/wxmupen64plus/default.nix index 2416ddd65b7ae..685718d8e1559 100644 --- a/pkgs/misc/emulators/wxmupen64plus/default.nix +++ b/pkgs/misc/emulators/wxmupen64plus/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation { wafConfigureFlagsArray+=("--mupenapi=$APIDIR" "--wxconfig=`type -P wx-config`") ''; - NIX_CFLAGS_COMPILE = "-fpermissive"; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; meta = { description = "GUI for the Mupen64Plus 2.0 emulator"; diff --git a/pkgs/misc/screensavers/rss-glx/default.nix b/pkgs/misc/screensavers/rss-glx/default.nix index 467f762de86ca..edc07972f68f4 100644 --- a/pkgs/misc/screensavers/rss-glx/default.nix +++ b/pkgs/misc/screensavers/rss-glx/default.nix @@ -12,8 +12,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libGLU libGL xlibsWrapper imagemagick libtiff bzip2 ]; - NIX_CFLAGS_COMPILE = "-I${imagemagick.dev}/include/ImageMagick"; - NIX_LDFLAGS= "-rpath ${libXext}/lib"; + env.NIX_CFLAGS_COMPILE = "-I${imagemagick.dev}/include/ImageMagick"; + env.NIX_LDFLAGS= "-rpath ${libXext}/lib"; meta = { description = "Really Slick Screensavers Port to GLX"; diff --git a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix index 6d3bd103811d8..8aae973a03c05 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix @@ -5,8 +5,8 @@ appleDerivation { nativeBuildInputs = [ xcbuildHook ]; buildInputs = [ libutil ]; - NIX_CFLAGS_COMPILE = "-I."; - NIX_LDFLAGS = "-lutil"; + env.NIX_CFLAGS_COMPILE = "-I."; + env.NIX_LDFLAGS = "-lutil"; patchPhase = '' # ugly hacks for missing headers # most are bsd related - probably should make this a drv diff --git a/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix b/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix index 3e7e89642c26f..fa4261d94cfd1 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix @@ -4,8 +4,8 @@ appleDerivation { nativeBuildInputs = [ xcbuildHook flex bison fixDarwinDylibNames ]; buildInputs = [ CoreSymbolication darling xnu ]; - NIX_CFLAGS_COMPILE = "-DCTF_OLD_VERSIONS -DPRIVATE -DYYDEBUG=1 -I${xnu}/Library/Frameworks/System.framework/Headers -Wno-error=implicit-function-declaration"; - NIX_LDFLAGS = "-L./Products/Release"; + env.NIX_CFLAGS_COMPILE = "-DCTF_OLD_VERSIONS -DPRIVATE -DYYDEBUG=1 -I${xnu}/Library/Frameworks/System.framework/Headers -Wno-error=implicit-function-declaration"; + env.NIX_LDFLAGS = "-L./Products/Release"; xcbuildFlags = [ "-target" "dtrace_frameworks" "-target" "dtrace" ]; doCheck = false; diff --git a/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix index 82be7dc860eca..c89db3c71dc82 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix @@ -5,7 +5,7 @@ appleDerivation { nativeBuildInputs = [ xcbuildHook ]; buildInputs = [ openssl_1_0_2 xnu Librpcsvc libpcap developer_cmds ]; - NIX_CFLAGS_COMPILE = " -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/"; + env.NIX_CFLAGS_COMPILE = " -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/"; # "spray" requires some files that aren't compiling correctly in xcbuild. # "rtadvd" seems to fail with some missing constants. diff --git a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix index 16454cbc1a5f3..79dffbe3fcd9a 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix @@ -12,7 +12,7 @@ appleDerivation { # NIX_CFLAGS_COMPILE = lib.optionalString hostPlatform.isi686 "-D__i386__" # + lib.optionalString hostPlatform.isx86_64 "-D__x86_64__" # + lib.optionalString hostPlatform.isAarch32 "-D__arm__"; - NIX_CFLAGS_COMPILE = [ "-DDAEMON_UID=1" + env.NIX_CFLAGS_COMPILE = [ "-DDAEMON_UID=1" "-DDAEMON_GID=1" "-DDEFAULT_AT_QUEUE='a'" "-DDEFAULT_BATCH_QUEUE='b'" diff --git a/pkgs/os-specific/darwin/apple-source-releases/top/default.nix b/pkgs/os-specific/darwin/apple-source-releases/top/default.nix index a2f912ca5782c..f6b00c85648c0 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/top/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/top/default.nix @@ -3,7 +3,7 @@ appleDerivation { nativeBuildInputs = [ xcbuildHook ]; buildInputs = [ apple_sdk.frameworks.IOKit ncurses libutil ]; - NIX_LDFLAGS = "-lutil"; + env.NIX_LDFLAGS = "-lutil"; installPhase = '' install -D Products/Release/libtop.a $out/lib/libtop.a install -D Products/Release/libtop.h $out/include/libtop.h diff --git a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix index afa5dc1c08cb4..3c781cee338ae 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix @@ -58,7 +58,7 @@ appleDerivation ({ MIGCC = "cc"; ARCHS = "x86_64"; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; preBuild = '' # This is a bit of a hack... diff --git a/pkgs/os-specific/darwin/maloader/default.nix b/pkgs/os-specific/darwin/maloader/default.nix index d1df820615df1..216dac62266d8 100644 --- a/pkgs/os-specific/darwin/maloader/default.nix +++ b/pkgs/os-specific/darwin/maloader/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation { ld-mac.cc ''; - NIX_CFLAGS_COMPILE = "-I${libcxx}/include/c++/v1"; + env.NIX_CFLAGS_COMPILE = "-I${libcxx}/include/c++/v1"; buildInputs = [ clang libcxx ]; buildFlags = [ "USE_LIBCXX=1" "release" ]; diff --git a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix index 4f2f84b3c0a5d..2dcc793f9792d 100644 --- a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix +++ b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix @@ -57,12 +57,15 @@ stdenv.mkDerivation { --replace '#if U_ICU_VERSION_MAJOR_NUM' '#if 0 //' ''; - BUILD_DIR = "./Build"; - CFLAGS = "-DINCLUDE_OBJC -I${libxml2.dev}/include/libxml2"; # They seem to assume we include objc in some places and not in others, make a PR; also not sure why but libxml2 include path isn't getting picked up from buildInputs - - # I'm guessing at the version here. https://github.com/apple/swift-corelibs-foundation/commit/df3ec55fe6c162d590a7653d89ad669c2b9716b1 imported "high sierra" - # and this version is a version from there. No idea how accurate it is. - LDFLAGS = "-current_version 1454.90.0 -compatibility_version 150.0.0 -init ___CFInitialize"; + env = { + BUILD_DIR = "./Build"; + # They seem to assume we include objc in some places and not in others, make a PR; also not sure why but libxml2 include path isn't getting picked up from buildInputs + CFLAGS = "-DINCLUDE_OBJC -I${libxml2.dev}/include/libxml2"; + + # I'm guessing at the version here. https://github.com/apple/swift-corelibs-foundation/commit/df3ec55fe6c162d590a7653d89ad669c2b9716b1 imported "high sierra" + # and this version is a version from there. No idea how accurate it is. + LDFLAGS = "-current_version 1454.90.0 -compatibility_version 150.0.0 -init ___CFInitialize"; + }; configurePhase = '' ../configure release --sysroot UNUSED diff --git a/pkgs/os-specific/linux/amdgpu-pro/default.nix b/pkgs/os-specific/linux/amdgpu-pro/default.nix index 18b7f047538af..3e70b29de8c63 100644 --- a/pkgs/os-specific/linux/amdgpu-pro/default.nix +++ b/pkgs/os-specific/linux/amdgpu-pro/default.nix @@ -94,7 +94,7 @@ in stdenv.mkDerivation rec { postBuild = optionalString (!libsOnly) (concatMapStrings (m: "xz usr/src/amdgpu-${build}/${m}\n") modules); - NIX_CFLAGS_COMPILE = "-Werror"; + env.NIX_CFLAGS_COMPILE = "-Werror"; makeFlags = optional (!libsOnly) "-C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build modules"; diff --git a/pkgs/os-specific/linux/anbox/default.nix b/pkgs/os-specific/linux/anbox/default.nix index 0012c3de98971..05fc052f7f109 100644 --- a/pkgs/os-specific/linux/anbox/default.nix +++ b/pkgs/os-specific/linux/anbox/default.nix @@ -64,7 +64,7 @@ stdenv.mkDerivation rec { libGL ]; - NIX_CFLAGS_COMPILE = "-Wno-error=missing-field-initializers"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=missing-field-initializers"; patchPhase = '' patchShebangs scripts diff --git a/pkgs/os-specific/linux/conky/default.nix b/pkgs/os-specific/linux/conky/default.nix index f826ddd423d8e..28f23706a4977 100644 --- a/pkgs/os-specific/linux/conky/default.nix +++ b/pkgs/os-specific/linux/conky/default.nix @@ -87,7 +87,7 @@ stdenv.mkDerivation rec { substituteInPlace cmake/Conky.cmake --replace "# set(RELEASE true)" "set(RELEASE true)" ''; - NIX_LDFLAGS = "-lgcc_s"; + env.NIX_LDFLAGS = "-lgcc_s"; nativeBuildInputs = [ cmake pkgconfig ]; buildInputs = [ glib libXinerama ] diff --git a/pkgs/os-specific/linux/crda/default.nix b/pkgs/os-specific/linux/crda/default.nix index 84c113c648cd4..6b8c09537bf20 100644 --- a/pkgs/os-specific/linux/crda/default.nix +++ b/pkgs/os-specific/linux/crda/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { "REG_BIN=${wireless-regdb}/lib/crda/regulatory.bin" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=unused-const-variable"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-const-variable"; buildFlags = [ "all_noverify" ]; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/cryptsetup/default.nix b/pkgs/os-specific/linux/cryptsetup/default.nix index 9c621d28ed290..b2712e69c99cc 100644 --- a/pkgs/os-specific/linux/cryptsetup/default.nix +++ b/pkgs/os-specific/linux/cryptsetup/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { substituteInPlace tests/unit-utils-io.c --replace "| O_DIRECT" "" ''; - NIX_LDFLAGS = "-lgcc_s"; + env.NIX_LDFLAGS = "-lgcc_s"; configureFlags = [ "--enable-cryptsetup-reencrypt" diff --git a/pkgs/os-specific/linux/disk-indicator/default.nix b/pkgs/os-specific/linux/disk-indicator/default.nix index 46ebc923e3b27..a34e9473a456b 100644 --- a/pkgs/os-specific/linux/disk-indicator/default.nix +++ b/pkgs/os-specific/linux/disk-indicator/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation { buildPhase = "make -f makefile"; - NIX_CFLAGS_COMPILE = "-Wno-error=cpp"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=cpp"; hardeningDisable = [ "fortify" ]; diff --git a/pkgs/os-specific/linux/dropwatch/default.nix b/pkgs/os-specific/linux/dropwatch/default.nix index 69acfa9682b6a..4527f28e8eefe 100644 --- a/pkgs/os-specific/linux/dropwatch/default.nix +++ b/pkgs/os-specific/linux/dropwatch/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { buildInputs = [ libbfd libnl ncurses readline zlib ]; # To avoid running into https://sourceware.org/bugzilla/show_bug.cgi?id=14243 we need to define: - NIX_CFLAGS_COMPILE = "-DPACKAGE=${pname} -DPACKAGE_VERSION=${version}"; + env.NIX_CFLAGS_COMPILE = "-DPACKAGE=${pname} -DPACKAGE_VERSION=${version}"; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/ebtables/default.nix b/pkgs/os-specific/linux/ebtables/default.nix index 3f025ca75045d..960850b3e859d 100644 --- a/pkgs/os-specific/linux/ebtables/default.nix +++ b/pkgs/os-specific/linux/ebtables/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { "LOCALSTATEDIR=/var" ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; preInstall = "mkdir -p $out/etc/sysconfig"; diff --git a/pkgs/os-specific/linux/ena/default.nix b/pkgs/os-specific/linux/ena/default.nix index 9b5d82b9f7b36..a58cd952318d2 100644 --- a/pkgs/os-specific/linux/ena/default.nix +++ b/pkgs/os-specific/linux/ena/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; # linux 3.12 - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; configurePhase = '' cd kernel/linux/ena diff --git a/pkgs/os-specific/linux/firmware/fwupdate/default.nix b/pkgs/os-specific/linux/firmware/fwupdate/default.nix index c14e04dc3440e..c44e3d5f50846 100644 --- a/pkgs/os-specific/linux/firmware/fwupdate/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupdate/default.nix @@ -13,7 +13,7 @@ in stdenv.mkDerivation { ./do-not-create-sharedstatedir.patch ]; - NIX_CFLAGS_COMPILE = "-I${gnu-efi}/include/efi -Wno-error=address-of-packed-member"; + env.NIX_CFLAGS_COMPILE = "-I${gnu-efi}/include/efi -Wno-error=address-of-packed-member"; # TODO: Just apply the disable to the efi subdir hardeningDisable = [ "stackprotector" ]; diff --git a/pkgs/os-specific/linux/kernel/perf.nix b/pkgs/os-specific/linux/kernel/perf.nix index 9f32e3e37ddbd..94de4904b0602 100644 --- a/pkgs/os-specific/linux/kernel/perf.nix +++ b/pkgs/os-specific/linux/kernel/perf.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation { # Note: we don't add elfutils to buildInputs, since it provides a # bad `ld' and other stuff. - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=cpp" "-Wno-error=bool-compare" "-Wno-error=deprecated-declarations" diff --git a/pkgs/os-specific/linux/lttng-modules/default.nix b/pkgs/os-specific/linux/lttng-modules/default.nix index 46c8dec8889fd..024632b04591a 100644 --- a/pkgs/os-specific/linux/lttng-modules/default.nix +++ b/pkgs/os-specific/linux/lttng-modules/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; preConfigure = '' export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" diff --git a/pkgs/os-specific/linux/open-iscsi/default.nix b/pkgs/os-specific/linux/open-iscsi/default.nix index 34e2591d44abd..dc3674635e338 100644 --- a/pkgs/os-specific/linux/open-iscsi/default.nix +++ b/pkgs/os-specific/linux/open-iscsi/default.nix @@ -18,8 +18,8 @@ stdenv.mkDerivation rec { DESTDIR = "$(out)"; - NIX_LDFLAGS = "-lkmod -lsystemd"; - NIX_CFLAGS_COMPILE = "-DUSE_KMOD"; + env.NIX_LDFLAGS = "-lkmod -lsystemd"; + env.NIX_CFLAGS_COMPILE = "-DUSE_KMOD"; preConfigure = '' sed -i 's|/usr|/|' Makefile diff --git a/pkgs/os-specific/linux/pktgen/default.nix b/pkgs/os-specific/linux/pktgen/default.nix index aec347ff37514..ac5bd1a4faa55 100644 --- a/pkgs/os-specific/linux/pktgen/default.nix +++ b/pkgs/os-specific/linux/pktgen/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { RTE_TARGET = "x86_64-native-linuxapp-gcc"; GUI = stdenv.lib.optionalString withGtk "true"; - NIX_CFLAGS_COMPILE = "-msse3"; + env.NIX_CFLAGS_COMPILE = "-msse3"; postPatch = let dpdkMajor = lib.versions.major dpdk.version; in '' substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${utillinux}/bin/lscpu diff --git a/pkgs/os-specific/linux/rtkit/default.nix b/pkgs/os-specific/linux/rtkit/default.nix index 4ad454437f577..1d777bcd73b46 100644 --- a/pkgs/os-specific/linux/rtkit/default.nix +++ b/pkgs/os-specific/linux/rtkit/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ dbus libcap ]; - NIX_LDFLAGS = "-lrt"; + env.NIX_LDFLAGS = "-lrt"; meta = with stdenv.lib; { homepage = http://0pointer.de/blog/projects/rtkit; diff --git a/pkgs/os-specific/linux/rtl8814au/default.nix b/pkgs/os-specific/linux/rtl8814au/default.nix index c54d45773428c..f9434f011842e 100644 --- a/pkgs/os-specific/linux/rtl8814au/default.nix +++ b/pkgs/os-specific/linux/rtl8814au/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - NIX_CFLAGS_COMPILE="-Wno-error=incompatible-pointer-types"; + env.NIX_CFLAGS_COMPILE="-Wno-error=incompatible-pointer-types"; prePatch = '' substituteInPlace ./Makefile \ diff --git a/pkgs/os-specific/linux/rtl8821au/default.nix b/pkgs/os-specific/linux/rtl8821au/default.nix index 1829bd6763f0f..12d23b038150c 100644 --- a/pkgs/os-specific/linux/rtl8821au/default.nix +++ b/pkgs/os-specific/linux/rtl8821au/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" "format" ]; - NIX_CFLAGS_COMPILE="-Wno-error=incompatible-pointer-types"; + env.NIX_CFLAGS_COMPILE="-Wno-error=incompatible-pointer-types"; prePatch = '' substituteInPlace ./Makefile \ diff --git a/pkgs/os-specific/linux/sssd/default.nix b/pkgs/os-specific/linux/sssd/default.nix index 3dbdb99549a15..37a661f626743 100644 --- a/pkgs/os-specific/linux/sssd/default.nix +++ b/pkgs/os-specific/linux/sssd/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { }; # Something is looking for instead of - NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; + env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; preConfigure = '' export SGML_CATALOG_FILES="${docbookFiles}" diff --git a/pkgs/os-specific/linux/sysdig/default.nix b/pkgs/os-specific/linux/sysdig/default.nix index 61a51afa3a75e..0eae3b4e645a1 100644 --- a/pkgs/os-specific/linux/sysdig/default.nix +++ b/pkgs/os-specific/linux/sysdig/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { ] ++ optional (kernel == null) "-DBUILD_DRIVER=OFF"; # needed since luajit-2.1.0-beta3 - NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg -DluaL_getn(L,i)=((int)lua_objlen(L,i))"; + env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg -DluaL_getn(L,i)=((int)lua_objlen(L,i))"; preConfigure = '' cmakeFlagsArray+=(-DCMAKE_EXE_LINKER_FLAGS="-ltbb -lcurl") diff --git a/pkgs/os-specific/linux/sysklogd/default.nix b/pkgs/os-specific/linux/sysklogd/default.nix index 213394e5eccf4..517d6ba6607a2 100644 --- a/pkgs/os-specific/linux/sysklogd/default.nix +++ b/pkgs/os-specific/linux/sysklogd/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { patches = [ ./systemd.patch ./union-wait.patch ]; - NIX_CFLAGS_COMPILE = "-DSYSV"; + env.NIX_CFLAGS_COMPILE = "-DSYSV"; installFlags = [ "BINDIR=$(out)/sbin" "MANDIR=$(out)/share/man" "INSTALL=install" ]; diff --git a/pkgs/os-specific/linux/tiptop/default.nix b/pkgs/os-specific/linux/tiptop/default.nix index bfcf58a35307a..a4b5b62c67587 100644 --- a/pkgs/os-specific/linux/tiptop/default.nix +++ b/pkgs/os-specific/linux/tiptop/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ flex bison ]; buildInputs = [ libxml2 ncurses ]; - NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; + env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; meta = with stdenv.lib; { description = "Performance monitoring tool for Linux"; diff --git a/pkgs/os-specific/linux/tmon/default.nix b/pkgs/os-specific/linux/tmon/default.nix index 690eb8b2eabb9..0739f931c4edc 100644 --- a/pkgs/os-specific/linux/tmon/default.nix +++ b/pkgs/os-specific/linux/tmon/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { ''; makeFlags = kernel.makeFlags ++ [ "INSTALL_ROOT=\"$(out)\"" "BINDIR=bin" ]; - NIX_CFLAGS_LINK = "-lgcc_s"; + env.NIX_CFLAGS_LINK = "-lgcc_s"; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/usermount/default.nix b/pkgs/os-specific/linux/usermount/default.nix index ec58d513b0958..5208752670d7a 100644 --- a/pkgs/os-specific/linux/usermount/default.nix +++ b/pkgs/os-specific/linux/usermount/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ dbus libnotify udisks2 gdk-pixbuf ]; - NIX_CFLAGS_COMPILE = "-DENABLE_NOTIFICATIONS"; + env.NIX_CFLAGS_COMPILE = "-DENABLE_NOTIFICATIONS"; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/os-specific/linux/wireguard/default.nix b/pkgs/os-specific/linux/wireguard/default.nix index eefa03d91cd88..a70e13ff94f91 100644 --- a/pkgs/os-specific/linux/wireguard/default.nix +++ b/pkgs/os-specific/linux/wireguard/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; INSTALL_MOD_PATH = "\${out}"; - NIX_CFLAGS = ["-Wno-error=cpp"]; + env.NIX_CFLAGS = ["-Wno-error=cpp"]; nativeBuildInputs = [ perl ] ++ kernel.moduleBuildDependencies; diff --git a/pkgs/servers/computing/torque/default.nix b/pkgs/servers/computing/torque/default.nix index 8eb12a1b81124..ec37306984079 100644 --- a/pkgs/servers/computing/torque/default.nix +++ b/pkgs/servers/computing/torque/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; # added to fix build with gcc7 - NIX_CFLAGS_COMPILE = "-Wno-error -fpermissive"; + env.NIX_CFLAGS_COMPILE = "-Wno-error -fpermissive"; postPatch = '' substituteInPlace Makefile.am \ diff --git a/pkgs/servers/dict/libmaa.nix b/pkgs/servers/dict/libmaa.nix index 4ac4328c35fcf..b1bee1c46eb91 100644 --- a/pkgs/servers/dict/libmaa.nix +++ b/pkgs/servers/dict/libmaa.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { buildInputs = [ libtool ]; # configureFlags = [ "--datadir=/run/current-system/share/dictd" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation"; meta = with stdenv.lib; { description = "Dict protocol server and client"; diff --git a/pkgs/servers/fcgiwrap/default.nix b/pkgs/servers/fcgiwrap/default.nix index c8ddcf438f7b7..7808019ffaf87 100644 --- a/pkgs/servers/fcgiwrap/default.nix +++ b/pkgs/servers/fcgiwrap/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "07y6s4mm86cv7p1ljz94sxnqa89y9amn3vzwsnbq5hrl4vdy0zac"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough"; configureFlags = [ "--with-systemd" "--with-systemdsystemunitdir=$(out)/etc/systemd/system" ]; nativeBuildInputs = [ autoreconfHook pkgconfig ]; diff --git a/pkgs/servers/fingerd/bsd-fingerd/default.nix b/pkgs/servers/fingerd/bsd-fingerd/default.nix index 999718160215e..f16053c764f32 100644 --- a/pkgs/servers/fingerd/bsd-fingerd/default.nix +++ b/pkgs/servers/fingerd/bsd-fingerd/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { sha256 = "1yhkiv0in588il7f84k2xiy78g9lv12ll0y7047gazhiimk5v244"; }; - NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; + env.NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; patches = [ ./ubuntu-0.17-9.patch ]; diff --git a/pkgs/servers/ftp/vsftpd/default.nix b/pkgs/servers/ftp/vsftpd/default.nix index 1ef624f2a41ed..63f8b9af43823 100644 --- a/pkgs/servers/ftp/vsftpd/default.nix +++ b/pkgs/servers/ftp/vsftpd/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { mkdir -p $out/sbin $out/man/man{5,8} ''; - NIX_LDFLAGS = "-lcrypt -lssl -lcrypto -lpam -lcap"; + env.NIX_LDFLAGS = "-lcrypt -lssl -lcrypto -lpam -lcap"; enableParallelBuilding = true; diff --git a/pkgs/servers/http/apache-httpd/2.4.nix b/pkgs/servers/http/apache-httpd/2.4.nix index d5da6df8d689b..7f0caab283ea9 100644 --- a/pkgs/servers/http/apache-httpd/2.4.nix +++ b/pkgs/servers/http/apache-httpd/2.4.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { ''; # Required for ‘pthread_cancel’. - NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; + env.NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; configureFlags = [ "--with-apr=${apr.dev}" diff --git a/pkgs/servers/http/nginx/generic.nix b/pkgs/servers/http/nginx/generic.nix index 990d7c5cf1348..b5c396490808a 100644 --- a/pkgs/servers/http/nginx/generic.nix +++ b/pkgs/servers/http/nginx/generic.nix @@ -73,7 +73,7 @@ stdenv.mkDerivation { ++ optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" ++ map (mod: "--add-module=${mod.src}") modules; - NIX_CFLAGS_COMPILE = toString ([ + env.NIX_CFLAGS_COMPILE = toString ([ "-I${libxml2.dev}/include/libxml2" "-Wno-error=implicit-fallthrough" ] ++ optional stdenv.isDarwin "-Wno-error=deprecated-declarations"); diff --git a/pkgs/servers/http/openresty/default.nix b/pkgs/servers/http/openresty/default.nix index 328db9ec98614..25b8cfbebd84f 100644 --- a/pkgs/servers/http/openresty/default.nix +++ b/pkgs/servers/http/openresty/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ openssl zlib pcre libxml2 libxslt gd geoip postgresql ]; nativeBuildInputs = [ perl ]; - NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; + env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; preConfigure = '' patchShebangs . diff --git a/pkgs/servers/http/tengine/default.nix b/pkgs/servers/http/tengine/default.nix index 1eeb5a8c4dd8d..898070d091143 100644 --- a/pkgs/servers/http/tengine/default.nix +++ b/pkgs/servers/http/tengine/default.nix @@ -84,7 +84,7 @@ stdenv.mkDerivation rec { ++ optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" ++ map (mod: "--add-module=${mod.src}") modules; - NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2 -Wno-error=implicit-fallthrough" + env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2 -Wno-error=implicit-fallthrough" + optionalString stdenv.isDarwin " -Wno-error=deprecated-declarations"; preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules); diff --git a/pkgs/servers/mail/archiveopteryx/default.nix b/pkgs/servers/mail/archiveopteryx/default.nix index 55cc4c121f0f5..307fd82977a91 100644 --- a/pkgs/servers/mail/archiveopteryx/default.nix +++ b/pkgs/servers/mail/archiveopteryx/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { ''; # fix build on gcc7+ - NIX_CFLAGS_COMPILE = builtins.toString [ + env.NIX_CFLAGS_COMPILE = builtins.toString [ "-Wno-error=builtin-declaration-mismatch" "-Wno-error=implicit-fallthrough" "-Wno-error=deprecated-copy" diff --git a/pkgs/servers/mail/opensmtpd/extras.nix b/pkgs/servers/mail/opensmtpd/extras.nix index 14d36ad65549c..733d120df7a47 100644 --- a/pkgs/servers/mail/opensmtpd/extras.nix +++ b/pkgs/servers/mail/opensmtpd/extras.nix @@ -76,7 +76,7 @@ stdenv.mkDerivation rec { "--with-table-redis" ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString enableRedis + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString enableRedis "-I${hiredis}/include/hiredis -lhiredis" + stdenv.lib.optionalString enableMysql " -L${libmysqlclient}/lib/mysql"; diff --git a/pkgs/servers/mail/postfix/default.nix b/pkgs/servers/mail/postfix/default.nix index c0e6252a5518c..2714c44bad2eb 100644 --- a/pkgs/servers/mail/postfix/default.nix +++ b/pkgs/servers/mail/postfix/default.nix @@ -79,7 +79,7 @@ in stdenv.mkDerivation rec { make makefiles CCARGS='${ccargs}' AUXLIBS='${auxlibs}' ''; - NIX_LDFLAGS = lib.optionalString withLDAP "-llber"; + env.NIX_LDFLAGS = lib.optionalString withLDAP "-llber"; installTargets = [ "non-interactive-package" ]; diff --git a/pkgs/servers/mail/postfix/pfixtools.nix b/pkgs/servers/mail/postfix/pfixtools.nix index 9fb441a92de3c..f5d4519f04a6d 100644 --- a/pkgs/servers/mail/postfix/pfixtools.nix +++ b/pkgs/servers/mail/postfix/pfixtools.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation { --replace /bin/bash ${bash}/bin/bash; ''; - NIX_CFLAGS_COMPILE = "-Wno-error=unused-result -Wno-error=nonnull-compare -Wno-error=format-truncation"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-result -Wno-error=nonnull-compare -Wno-error=format-truncation"; makeFlags = [ "DESTDIR=$(out)" "prefix=" ]; diff --git a/pkgs/servers/memcached/default.nix b/pkgs/servers/memcached/default.nix index dfb3ac2cfa202..3e09e77f14f94 100644 --- a/pkgs/servers/memcached/default.nix +++ b/pkgs/servers/memcached/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { hardeningEnable = [ "pie" ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-Wno-error"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-Wno-error"; meta = with stdenv.lib; { description = "A distributed memory object caching system"; diff --git a/pkgs/servers/nosql/aerospike/default.nix b/pkgs/servers/nosql/aerospike/default.nix index b7b43edc1cd9d..d49bd8a364d45 100644 --- a/pkgs/servers/nosql/aerospike/default.nix +++ b/pkgs/servers/nosql/aerospike/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoconf automake libtool ]; buildInputs = [ openssl zlib ]; - NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = builtins.toString [ "-Wno-error=format-truncation" "-Wno-error=address-of-packed-member" "-Wno-error=format-overflow" diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix index c2ae83f3e8af0..4b06bd4ddfb42 100644 --- a/pkgs/servers/nosql/mongodb/default.nix +++ b/pkgs/servers/nosql/mongodb/default.nix @@ -66,7 +66,7 @@ in stdenv.mkDerivation { --replace 'engine("wiredTiger")' 'engine("mmapv1")' ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument"; sconsFlags = [ "--release" diff --git a/pkgs/servers/prayer/default.nix b/pkgs/servers/prayer/default.nix index d1351afa0b301..dd12319ed031e 100644 --- a/pkgs/servers/prayer/default.nix +++ b/pkgs/servers/prayer/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { buildInputs = [ openssl db zlib uwimap html-tidy pam ]; nativeBuildInputs = [ perl ]; - NIX_LDFLAGS = "-lpam"; + env.NIX_LDFLAGS = "-lpam"; meta = { homepage = http://www-uxsup.csx.cam.ac.uk/~dpc22/prayer/; diff --git a/pkgs/servers/shishi/default.nix b/pkgs/servers/shishi/default.nix index 060b58d18b1b6..45b8737b2be6f 100644 --- a/pkgs/servers/shishi/default.nix +++ b/pkgs/servers/shishi/default.nix @@ -51,7 +51,7 @@ stdenv.mkDerivation rec { (mkEnable true "arcfour" null) ]; - NIX_CFLAGS_COMPILE + env.NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-DBIND_8_COMPAT"; doCheck = true; diff --git a/pkgs/servers/sip/freeswitch/default.nix b/pkgs/servers/sip/freeswitch/default.nix index a55d1cf14cda4..2c95327b46dbc 100644 --- a/pkgs/servers/sip/freeswitch/default.nix +++ b/pkgs/servers/sip/freeswitch/default.nix @@ -108,7 +108,7 @@ stdenv.mkDerivation rec { ++ lib.optionals enablePostgres [ postgresql ] ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; hardeningDisable = [ "format" ]; diff --git a/pkgs/servers/sql/mysql/5.7.x.nix b/pkgs/servers/sql/mysql/5.7.x.nix index 6636c099e8324..acfa2e7045ddc 100644 --- a/pkgs/servers/sql/mysql/5.7.x.nix +++ b/pkgs/servers/sql/mysql/5.7.x.nix @@ -54,9 +54,11 @@ self = stdenv.mkDerivation rec { "-DINSTALL_DOCDIR=share/mysql/docs" "-DINSTALL_SHAREDIR=share/mysql" ]; - - CXXFLAGS = "-fpermissive -std=c++11"; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; + + env = { + CXXFLAGS = "-fpermissive -std=c++11"; + NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; + }; prePatch = '' sed -i -e "s|/usr/bin/libtool|libtool|" cmake/merge_archives.cmake.in diff --git a/pkgs/servers/sql/percona/5.6.x.nix b/pkgs/servers/sql/percona/5.6.x.nix index 860c1f8e94f79..2c3c2fbca7385 100644 --- a/pkgs/servers/sql/percona/5.6.x.nix +++ b/pkgs/servers/sql/percona/5.6.x.nix @@ -38,8 +38,8 @@ stdenv.mkDerivation rec { "-DINSTALL_SHAREDIR=share/mysql" ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ]; - NIX_LDFLAGS = "-lgcc_s"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=address-of-packed-member"; + env.NIX_LDFLAGS = "-lgcc_s"; prePatch = '' sed -i -e "s|/usr/bin/libtool|libtool|" cmake/libutils.cmake diff --git a/pkgs/servers/sql/postgresql/ext/postgis.nix b/pkgs/servers/sql/postgresql/ext/postgis.nix index c7bceb232f661..d3689a5e8e062 100644 --- a/pkgs/servers/sql/postgresql/ext/postgis.nix +++ b/pkgs/servers/sql/postgresql/ext/postgis.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { dontDisableStatic = true; # postgis config directory assumes /include /lib from the same root for json-c library - NIX_LDFLAGS = "-L${stdenv.lib.getLib json_c}/lib"; + env.NIX_LDFLAGS = "-L${stdenv.lib.getLib json_c}/lib"; preConfigure = '' sed -i 's@/usr/bin/file@${file}/bin/file@' configure diff --git a/pkgs/servers/tvheadend/default.nix b/pkgs/servers/tvheadend/default.nix index 9a01bf3eed634..600ac86c69aac 100644 --- a/pkgs/servers/tvheadend/default.nix +++ b/pkgs/servers/tvheadend/default.nix @@ -25,7 +25,7 @@ in stdenv.mkDerivation { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = [ "-Wno-error=format-truncation" "-Wno-error=stringop-truncation" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation -Wno-error=stringop-truncation"; # disable dvbscan, as having it enabled causes a network download which # cannot happen during build. diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index 7669053d22943..0d42ccd677c36 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -89,7 +89,7 @@ stdenv.mkDerivation rec { ${lib.concatMapStringsSep "\n" (x: x.install or "") needed} ''; - NIX_CFLAGS_LINK = toString (lib.optional withSystemd "-lsystemd" ++ lib.concatMap (x: x.NIX_CFLAGS_LINK or []) needed); + env.NIX_CFLAGS_LINK = toString (lib.optional withSystemd "-lsystemd" ++ lib.concatMap (x: x.NIX_CFLAGS_LINK or []) needed); meta = with stdenv.lib; { homepage = https://uwsgi-docs.readthedocs.org/en/latest/; diff --git a/pkgs/servers/varnish/digest.nix b/pkgs/servers/varnish/digest.nix index f11c577288f71..4165dfdc21d0d 100644 --- a/pkgs/servers/varnish/digest.nix +++ b/pkgs/servers/varnish/digest.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { configureFlags = [ "VMOD_DIR=$(out)/lib/varnish/vmods" ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=deprecated-declarations" ]; + env.NIX_CFLAGS_COMPILE = [ "-Wno-error=deprecated-declarations" ]; doCheck = true; diff --git a/pkgs/servers/web-apps/fileshelter/default.nix b/pkgs/servers/web-apps/fileshelter/default.nix index 928d80b1297af..19d0e18e5a11d 100644 --- a/pkgs/servers/web-apps/fileshelter/default.nix +++ b/pkgs/servers/web-apps/fileshelter/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkgconfig ]; buildInputs = [ libzip boost wt4 libconfig ]; - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; postInstall = '' ln -s ${wt4}/share/Wt/resources $out/share/fileshelter/docroot/resources diff --git a/pkgs/shells/bash/5.0.nix b/pkgs/shells/bash/5.0.nix index a06b08a5599cc..b099796e1e517 100644 --- a/pkgs/shells/bash/5.0.nix +++ b/pkgs/shells/bash/5.0.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "man" "doc" "info" ]; - NIX_CFLAGS_COMPILE = '' + env.NIX_CFLAGS_COMPILE = '' -DSYS_BASHRC="/etc/bashrc" -DSYS_BASH_LOGOUT="/etc/bash_logout" -DDEFAULT_PATH_VALUE="/no-such-path" diff --git a/pkgs/tools/X11/x11spice/default.nix b/pkgs/tools/X11/x11spice/default.nix index 513149049faf3..8f65626c57469 100644 --- a/pkgs/tools/X11/x11spice/default.nix +++ b/pkgs/tools/X11/x11spice/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { gtk2 spice spice-protocol ]; - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; meta = with stdenv.lib; { description = '' diff --git a/pkgs/tools/X11/xpra/default.nix b/pkgs/tools/X11/xpra/default.nix index da7bfb445a975..5e42c67e376fa 100644 --- a/pkgs/tools/X11/xpra/default.nix +++ b/pkgs/tools/X11/xpra/default.nix @@ -61,7 +61,7 @@ in buildPythonApplication rec { ]; # error: 'import_cairo' defined but not used - NIX_CFLAGS_COMPILE = "-Wno-error=unused-function"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-function"; setupPyBuildFlags = [ "--with-Xdummy" diff --git a/pkgs/tools/archivers/p7zip/default.nix b/pkgs/tools/archivers/p7zip/default.nix index 465bc474a9e52..1edec8ca9d6f0 100644 --- a/pkgs/tools/archivers/p7zip/default.nix +++ b/pkgs/tools/archivers/p7zip/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { setupHook = ./setup-hook.sh; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; meta = { homepage = http://p7zip.sourceforge.net/; diff --git a/pkgs/tools/audio/darkice/default.nix b/pkgs/tools/audio/darkice/default.nix index c5f7bcd5a71d8..27bec880a2071 100644 --- a/pkgs/tools/audio/darkice/default.nix +++ b/pkgs/tools/audio/darkice/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { libopus libvorbis libogg libpulseaudio alsaLib libsamplerate libjack2 lame ]; - NIX_CFLAGS_COMPILE = "-fpermissive"; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; configureFlags = [ "--with-faac-prefix=${faac}" diff --git a/pkgs/tools/audio/gvolicon/default.nix b/pkgs/tools/audio/gvolicon/default.nix index 9029eb38b06fe..aba921b626846 100644 --- a/pkgs/tools/audio/gvolicon/default.nix +++ b/pkgs/tools/audio/gvolicon/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation { makeFlags = [ "PREFIX=$(out)" ]; - NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE"; + env.NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE"; meta = { description = "A simple and lightweight volume icon that sits in your system tray"; diff --git a/pkgs/tools/audio/pa-applet/default.nix b/pkgs/tools/audio/pa-applet/default.nix index 69e5976e6d5ea..d464910cd2c76 100644 --- a/pkgs/tools/audio/pa-applet/default.nix +++ b/pkgs/tools/audio/pa-applet/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { ''; # work around a problem related to gtk3 updates - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; postInstall = '' ''; diff --git a/pkgs/tools/backup/chunksync/default.nix b/pkgs/tools/backup/chunksync/default.nix index 736a3122a6f0a..7c922b10d6dfc 100644 --- a/pkgs/tools/backup/chunksync/default.nix +++ b/pkgs/tools/backup/chunksync/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { buildInputs = [openssl perl]; - NIX_LDFLAGS = "-lgcc_s"; + env.NIX_LDFLAGS = "-lgcc_s"; makeFlags = [ "DESTDIR=$(out)" diff --git a/pkgs/tools/cd-dvd/cdrdao/default.nix b/pkgs/tools/cd-dvd/cdrdao/default.nix index 908808b79f3c6..2813d3c4c1f06 100644 --- a/pkgs/tools/cd-dvd/cdrdao/default.nix +++ b/pkgs/tools/cd-dvd/cdrdao/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation { ''; # Needed on gcc >= 6. - NIX_CFLAGS_COMPILE = "-Wno-narrowing"; + env.NIX_CFLAGS_COMPILE = "-Wno-narrowing"; meta = with stdenv.lib; { description = "A tool for recording audio or data CD-Rs in disk-at-once (DAO) mode"; diff --git a/pkgs/tools/compression/pbzip2/default.nix b/pkgs/tools/compression/pbzip2/default.nix index 3314544084f87..8241f3b3d7bef 100644 --- a/pkgs/tools/compression/pbzip2/default.nix +++ b/pkgs/tools/compression/pbzip2/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { installFlags = [ "PREFIX=$(out)" ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=reserved-user-defined-literal"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=reserved-user-defined-literal"; meta = with stdenv.lib; { homepage = http://compression.ca/pbzip2/; diff --git a/pkgs/tools/filesystems/blobfuse/default.nix b/pkgs/tools/filesystems/blobfuse/default.nix index 3c6f622832935..987d351a65715 100644 --- a/pkgs/tools/filesystems/blobfuse/default.nix +++ b/pkgs/tools/filesystems/blobfuse/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "1qh04z1fsj1l6l12sz9yl2sy9hwlrnzac54hwrr7wvsgv90n9gbp"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=catch-value"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=catch-value"; buildInputs = [ curl gnutls libgcrypt libuuid fuse ]; nativeBuildInputs = [ cmake pkgconfig ]; diff --git a/pkgs/tools/filesystems/reiserfsprogs/default.nix b/pkgs/tools/filesystems/reiserfsprogs/default.nix index a89ea0657500b..4769c3255a783 100644 --- a/pkgs/tools/filesystems/reiserfsprogs/default.nix +++ b/pkgs/tools/filesystems/reiserfsprogs/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ libuuid ]; - NIX_CFLAGS_COMPILE = "-std=gnu90"; + env.NIX_CFLAGS_COMPILE = "-std=gnu90"; meta = { inherit version; diff --git a/pkgs/tools/filesystems/sshfs-fuse/default.nix b/pkgs/tools/filesystems/sshfs-fuse/default.nix index af7ef8b8215b8..191bf00038a99 100644 --- a/pkgs/tools/filesystems/sshfs-fuse/default.nix +++ b/pkgs/tools/filesystems/sshfs-fuse/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { buildInputs = [ fuse3 glib ]; checkInputs = [ which python3Packages.pytest ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.hostPlatform.system == "i686-linux") "-D_FILE_OFFSET_BITS=64"; diff --git a/pkgs/tools/filesystems/svnfs/default.nix b/pkgs/tools/filesystems/svnfs/default.nix index ebfb211732e8d..3949b8fa019ae 100644 --- a/pkgs/tools/filesystems/svnfs/default.nix +++ b/pkgs/tools/filesystems/svnfs/default.nix @@ -15,8 +15,8 @@ stdenv.mkDerivation { export LD_LIBRARY_PATH=${subversion.out}/lib ''; - NIX_CFLAGS_COMPILE="-I ${subversion.dev}/include/subversion-1"; - NIX_LDFLAGS="-lsvn_client-1 -lsvn_subr-1"; + env.NIX_CFLAGS_COMPILE="-I ${subversion.dev}/include/subversion-1"; + env.NIX_LDFLAGS="-lsvn_client-1 -lsvn_subr-1"; meta = { description = "FUSE filesystem for accessing Subversion repositories"; diff --git a/pkgs/tools/filesystems/udftools/default.nix b/pkgs/tools/filesystems/udftools/default.nix index 9efaf96182d7f..5414efe5a79e8 100644 --- a/pkgs/tools/filesystems/udftools/default.nix +++ b/pkgs/tools/filesystems/udftools/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "fortify" ]; - NIX_CFLAGS_COMPILE = "-std=gnu90"; + env.NIX_CFLAGS_COMPILE = "-std=gnu90"; preConfigure = '' sed -e '1i#include ' -i cdrwtool/cdrwtool.c -i pktsetup/pktsetup.c diff --git a/pkgs/tools/graphics/appleseed/default.nix b/pkgs/tools/graphics/appleseed/default.nix index cafe0bb7b11a2..ffb3bec4f02e6 100644 --- a/pkgs/tools/graphics/appleseed/default.nix +++ b/pkgs/tools/graphics/appleseed/default.nix @@ -24,7 +24,7 @@ in stdenv.mkDerivation rec { osl seexpr makeWrapper ]; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-I${openexr.dev}/include/OpenEXR" "-I${ilmbase.dev}/include/OpenEXR" "-I${openimageio.dev}/include/OpenImageIO" diff --git a/pkgs/tools/graphics/asymptote/default.nix b/pkgs/tools/graphics/asymptote/default.nix index 31bdba26783ee..d3fb792729669 100644 --- a/pkgs/tools/graphics/asymptote/default.nix +++ b/pkgs/tools/graphics/asymptote/default.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { "--with-context=$out/share/texmf/tex/context/third" ]; - NIX_CFLAGS_COMPILE = "-I${boehmgc.dev}/include/gc"; + env.NIX_CFLAGS_COMPILE = "-I${boehmgc.dev}/include/gc"; postInstall = '' mv $out/share/info/asymptote/*.info $out/share/info/ diff --git a/pkgs/tools/graphics/fim/default.nix b/pkgs/tools/graphics/fim/default.nix index 3fc82a9c72a04..10cf400e4d2a9 100644 --- a/pkgs/tools/graphics/fim/default.nix +++ b/pkgs/tools/graphics/fim/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { ++ optional jpegSupport libjpeg ++ optional pngSupport libpng; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString x11Support "-lSDL"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString x11Support "-lSDL"; meta = with stdenv.lib; { description = "A lightweight, highly customizable and scriptable image viewer"; diff --git a/pkgs/tools/graphics/qrcode/default.nix b/pkgs/tools/graphics/qrcode/default.nix index 909f0e3972680..38cd617575fe0 100644 --- a/pkgs/tools/graphics/qrcode/default.nix +++ b/pkgs/tools/graphics/qrcode/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation { sha256 = "0v81745nx5gny2g05946k8j553j18a29ikmlyh6c3syq6c15k8cf"; }; - NIX_CFLAGS_COMPILE = "-Wno-error=unused-result"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-result"; installPhase = '' mkdir -p "$out"/{bin,share/doc/qrcode} diff --git a/pkgs/tools/graphics/quirc/default.nix b/pkgs/tools/graphics/quirc/default.nix index 4b610ebbfef23..e9ed5a8f1e2da 100644 --- a/pkgs/tools/graphics/quirc/default.nix +++ b/pkgs/tools/graphics/quirc/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation { src = fetchgit { inherit (s) url sha256 rev; }; - NIX_CFLAGS_COMPILE="-I${SDL.dev}/include/SDL -I${SDL_gfx}/include/SDL"; + env.NIX_CFLAGS_COMPILE="-I${SDL.dev}/include/SDL -I${SDL_gfx}/include/SDL"; configurePhase = '' sed -e 's/-[og] root//g' -i Makefile ''; diff --git a/pkgs/tools/graphics/zbar/default.nix b/pkgs/tools/graphics/zbar/default.nix index 7610b4e56fb01..61f82857a1163 100644 --- a/pkgs/tools/graphics/zbar/default.nix +++ b/pkgs/tools/graphics/zbar/default.nix @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { ]; # Disable assertions which include -dev QtBase file paths. - NIX_CFLAGS_COMPILE = "-DQT_NO_DEBUG"; + env.NIX_CFLAGS_COMPILE = "-DQT_NO_DEBUG"; configureFlags = [ "--without-python" diff --git a/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix b/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix index 1deff93e2016e..aa49c65fce593 100644 --- a/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix +++ b/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ cmake fcitx gettext ]; - NIX_CFLAGS_COMPILE = "-Wno-narrowing"; + env.NIX_CFLAGS_COMPILE = "-Wno-narrowing"; preInstall = '' substituteInPlace src/cmake_install.cmake \ diff --git a/pkgs/tools/misc/aescrypt/default.nix b/pkgs/tools/misc/aescrypt/default.nix index 75d8d71b89524..ba785fcb50542 100644 --- a/pkgs/tools/misc/aescrypt/default.nix +++ b/pkgs/tools/misc/aescrypt/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "1iziymcbpc64d44djgqfifpblsly4sr5bxsp5g29jgxz552kjlah"; }; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-liconv"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-liconv"; preBuild = '' substituteInPlace src/Makefile --replace "CC=gcc" "CC?=gcc" diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index 3f5485718dc5b..556960a81ef6f 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "all" ]; # Work around a bug in the generated flex lexer (upstream flex bug?) - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; preConfigure = '' for i in "tests/util/"*.in diff --git a/pkgs/tools/misc/grub/trusted.nix b/pkgs/tools/misc/grub/trusted.nix index 1033a489c7670..782efd0a5c875 100644 --- a/pkgs/tools/misc/grub/trusted.nix +++ b/pkgs/tools/misc/grub/trusted.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "stackprotector" "pic" ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; # generated code redefines yyfree + env.NIX_CFLAGS_COMPILE = "-Wno-error"; # generated code redefines yyfree preConfigure = '' for i in "tests/util/"*.in diff --git a/pkgs/tools/misc/ipxe/default.nix b/pkgs/tools/misc/ipxe/default.nix index 219c03f263c77..b025a30ada0a3 100644 --- a/pkgs/tools/misc/ipxe/default.nix +++ b/pkgs/tools/misc/ipxe/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation { # not possible due to assembler code hardeningDisable = [ "pic" "stackprotector" ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; makeFlags = [ "ECHO_E_BIN_ECHO=echo" "ECHO_E_BIN_ECHO_E=echo" # No /bin/echo here. diff --git a/pkgs/tools/misc/memtest86+/default.nix b/pkgs/tools/misc/memtest86+/default.nix index 57cf5bb97e2ea..266c13ab051e8 100644 --- a/pkgs/tools/misc/memtest86+/default.nix +++ b/pkgs/tools/misc/memtest86+/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { sha256 = "0cwx20yja24bfknqh1rjb5rl2c0kwnppzsisg1dibbak0l8mxchk"; }; - NIX_CFLAGS_COMPILE = "-I. -std=gnu90"; + env.NIX_CFLAGS_COMPILE = "-I. -std=gnu90"; hardeningDisable = [ "all" ]; diff --git a/pkgs/tools/misc/osm2pgsql/default.nix b/pkgs/tools/misc/osm2pgsql/default.nix index 54da1a1640110..c2126ab44bae5 100644 --- a/pkgs/tools/misc/osm2pgsql/default.nix +++ b/pkgs/tools/misc/osm2pgsql/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ expat proj bzip2 zlib boost postgresql lua ]; - NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"; + env.NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"; meta = with stdenv.lib; { description = "OpenStreetMap data to PostgreSQL converter"; diff --git a/pkgs/tools/misc/parcellite/default.nix b/pkgs/tools/misc/parcellite/default.nix index 46606e3b43be3..54942a3f356d9 100644 --- a/pkgs/tools/misc/parcellite/default.nix +++ b/pkgs/tools/misc/parcellite/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook intltool pkgconfig wrapGAppsHook ]; buildInputs = [ gtk2 hicolor-icon-theme ]; - NIX_LDFLAGS = "-lgio-2.0"; + env.NIX_LDFLAGS = "-lgio-2.0"; preFixup = '' # Need which and xdotool on path to fix auto-pasting. diff --git a/pkgs/tools/misc/qjoypad/default.nix b/pkgs/tools/misc/qjoypad/default.nix index 3e7e3870959b4..af7e9d2c4a386 100644 --- a/pkgs/tools/misc/qjoypad/default.nix +++ b/pkgs/tools/misc/qjoypad/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libX11 libXtst qt4 ]; - NIX_LDFLAGS = "-lX11"; + env.NIX_LDFLAGS = "-lX11"; patchPhase = '' cd src substituteInPlace config --replace /bin/bash ${stdenv.shell} diff --git a/pkgs/tools/misc/snapper/default.nix b/pkgs/tools/misc/snapper/default.nix index 466a5f3faf1cf..46ea4a03ca97b 100644 --- a/pkgs/tools/misc/snapper/default.nix +++ b/pkgs/tools/misc/snapper/default.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; + env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; postInstall = '' rm -r $out/etc/cron.* diff --git a/pkgs/tools/misc/tealdeer/default.nix b/pkgs/tools/misc/tealdeer/default.nix index 547cb2d10759a..3e7bc7f82c47a 100644 --- a/pkgs/tools/misc/tealdeer/default.nix +++ b/pkgs/tools/misc/tealdeer/default.nix @@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkgconfig ]; - NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + env.NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; # disable tests for now since one needs network # what is unavailable in sandbox build diff --git a/pkgs/tools/misc/timidity/default.nix b/pkgs/tools/misc/timidity/default.nix index c307c96199f20..363efee89da37 100644 --- a/pkgs/tools/misc/timidity/default.nix +++ b/pkgs/tools/misc/timidity/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { configureFlags = [ "--enable-audio=oss,alsa,jack" "--enable-alsaseq" "--with-default-output=alsa" "--enable-ncurses" ]; - NIX_LDFLAGS = "-ljack -L${libjack2}/lib"; + env.NIX_LDFLAGS = "-ljack -L${libjack2}/lib"; instruments = fetchurl { url = http://www.csee.umbc.edu/pub/midia/instruments.tar.gz; diff --git a/pkgs/tools/misc/toybox/default.nix b/pkgs/tools/misc/toybox/default.nix index b863786145c63..7d80867c54b35 100644 --- a/pkgs/tools/misc/toybox/default.nix +++ b/pkgs/tools/misc/toybox/default.nix @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { checkInputs = [ which ]; # used for tests with checkFlags = [ "DEBUG=true" ]; checkTarget = "tests"; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; meta = with stdenv.lib; { description = "Lightweight implementation of some Unix command line utilities"; diff --git a/pkgs/tools/misc/wv2/default.nix b/pkgs/tools/misc/wv2/default.nix index b9a8f70ff71a7..4d9fd69ec7c39 100644 --- a/pkgs/tools/misc/wv2/default.nix +++ b/pkgs/tools/misc/wv2/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ cmake libgsf glib libxml2 ]; - NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; + env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; meta = { description = "Excellent MS Word filter lib, used in most Office suites"; diff --git a/pkgs/tools/misc/wyrd/default.nix b/pkgs/tools/misc/wyrd/default.nix index 6a5ec86722243..c2c351d0aca32 100644 --- a/pkgs/tools/misc/wyrd/default.nix +++ b/pkgs/tools/misc/wyrd/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "0zlrg602q781q8dij62lwdprpfliyy9j1rqfqcz8p2wgndpivddj"; }; - NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS=1"; + env.NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS=1"; preConfigure = '' substituteInPlace curses/curses.ml --replace 'pp gcc' "pp $CC" diff --git a/pkgs/tools/networking/altermime/default.nix b/pkgs/tools/networking/altermime/default.nix index b1481b2208c6d..13cb26429eea4 100644 --- a/pkgs/tools/networking/altermime/default.nix +++ b/pkgs/tools/networking/altermime/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "15zxg6spcmd35r6xbidq2fgcg2nzyv1sbbqds08lzll70mqx4pj7"; }; - NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=format" "-Wno-error=format-truncation" "-Wno-error=pointer-compare" diff --git a/pkgs/tools/networking/atftp/default.nix b/pkgs/tools/networking/atftp/default.nix index 7fcd677044fee..6d32c8fd0a714 100644 --- a/pkgs/tools/networking/atftp/default.nix +++ b/pkgs/tools/networking/atftp/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { buildInputs = [ readline tcp_wrappers pcre makeWrapper gcc ]; # Expects pre-GCC5 inline semantics - NIX_CFLAGS_COMPILE = "-std=gnu89"; + env.NIX_CFLAGS_COMPILE = "-std=gnu89"; doCheck = false; # fails diff --git a/pkgs/tools/networking/atinout/default.nix b/pkgs/tools/networking/atinout/default.nix index 16b3ee668da62..1919221ef3663 100644 --- a/pkgs/tools/networking/atinout/default.nix +++ b/pkgs/tools/networking/atinout/default.nix @@ -4,7 +4,7 @@ stdenv.mkDerivation rec { name = "atinout-${version}"; version = "0.9.2-alpha"; - NIX_CFLAGS_COMPILE = "-Werror=implicit-fallthrough=0"; + env.NIX_CFLAGS_COMPILE = "-Werror=implicit-fallthrough=0"; LANG = "C.UTF-8"; nativeBuildInputs = [ ronn mount ]; diff --git a/pkgs/tools/networking/bsd-finger/default.nix b/pkgs/tools/networking/bsd-finger/default.nix index d011665a492bc..724abf76b9456 100644 --- a/pkgs/tools/networking/bsd-finger/default.nix +++ b/pkgs/tools/networking/bsd-finger/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "1yhkiv0in588il7f84k2xiy78g9lv12ll0y7047gazhiimk5v244"; }; - NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; + env.NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; patches = [ ./ubuntu-0.17-9.patch ]; diff --git a/pkgs/tools/networking/bwm-ng/default.nix b/pkgs/tools/networking/bwm-ng/default.nix index 8e766cdeeb5c1..2bce1ee9c478a 100644 --- a/pkgs/tools/networking/bwm-ng/default.nix +++ b/pkgs/tools/networking/bwm-ng/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { # This code uses inline in the gnu89 sense: see http://clang.llvm.org/compatibility.html#inline - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-std=gnu89"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-std=gnu89"; meta = with stdenv.lib; { description = "A small and simple console-based live network and disk io bandwidth monitor"; diff --git a/pkgs/tools/networking/connman/connman-ncurses/default.nix b/pkgs/tools/networking/connman/connman-ncurses/default.nix index 140105c247549..d875d736a0424 100644 --- a/pkgs/tools/networking/connman/connman-ncurses/default.nix +++ b/pkgs/tools/networking/connman/connman-ncurses/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation { buildInputs = [ dbus ncurses json_c connman ]; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; installPhase = '' mkdir -p "$out/bin" diff --git a/pkgs/tools/networking/dhcp/default.nix b/pkgs/tools/networking/dhcp/default.nix index c5d650f52bbd0..73d02d775e259 100644 --- a/pkgs/tools/networking/dhcp/default.nix +++ b/pkgs/tools/networking/dhcp/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { ] ++ lib.optional stdenv.isLinux "--with-randomdev=/dev/random" ++ stdenv.lib.optionals (openldap != null) [ "--with-ldap" "--with-ldapcrypto" ]; - NIX_CFLAGS_COMPILE = builtins.toString [ + env.NIX_CFLAGS_COMPILE = builtins.toString [ "-Wno-error=pointer-compare" "-Wno-error=format-truncation" "-Wno-error=stringop-truncation" diff --git a/pkgs/tools/networking/dibbler/default.nix b/pkgs/tools/networking/dibbler/default.nix index 43c9455712db0..b8f9f27d60cc6 100644 --- a/pkgs/tools/networking/dibbler/default.nix +++ b/pkgs/tools/networking/dibbler/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { "--enable-resolvconf" ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-D__APPLE_USE_RFC_2292=1"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-D__APPLE_USE_RFC_2292=1"; meta = with stdenv.lib; { description = "Portable DHCPv6 implementation"; diff --git a/pkgs/tools/networking/dnstracer/default.nix b/pkgs/tools/networking/dnstracer/default.nix index 5261fdb18960b..7a4b5fd40115a 100644 --- a/pkgs/tools/networking/dnstracer/default.nix +++ b/pkgs/tools/networking/dnstracer/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { buildInputs = [] ++ stdenv.lib.optionals stdenv.isDarwin [ libresolv ]; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lresolv"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lresolv"; meta = with stdenv.lib; { description = "Dnstracer determines where a given Domain Name Server (DNS) gets its information from, and follows the chain of DNS servers back to the servers which know the data."; diff --git a/pkgs/tools/networking/dsniff/default.nix b/pkgs/tools/networking/dsniff/default.nix index 9ddc1a35ce372..6014c22da22cc 100644 --- a/pkgs/tools/networking/dsniff/default.nix +++ b/pkgs/tools/networking/dsniff/default.nix @@ -54,7 +54,7 @@ in stdenv.mkDerivation { nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ glib pcap ]; - NIX_CFLAGS_LINK = "-lglib-2.0 -lpthread"; + env.NIX_CFLAGS_LINK = "-lglib-2.0 -lpthread"; postPatch = '' for patch in debian/patches/*.patch; do patch < $patch diff --git a/pkgs/tools/networking/iodine/default.nix b/pkgs/tools/networking/iodine/default.nix index 44bf52c9933fc..f380c643f5d86 100644 --- a/pkgs/tools/networking/iodine/default.nix +++ b/pkgs/tools/networking/iodine/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { patchPhase = ''sed -i "s,/sbin/route,${nettools}/bin/route," src/tun.c''; - NIX_CFLAGS_COMPILE = "-DIFCONFIGPATH=\"${nettools}/bin/\""; + env.NIX_CFLAGS_COMPILE = "-DIFCONFIGPATH=\"${nettools}/bin/\""; installFlags = [ "prefix=\${out}" ]; diff --git a/pkgs/tools/networking/libnids/default.nix b/pkgs/tools/networking/libnids/default.nix index ef753127c67ec..39a31e4f1a664 100644 --- a/pkgs/tools/networking/libnids/default.nix +++ b/pkgs/tools/networking/libnids/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation { this is necessary for dsniff to compile; otherwise g_thread_init is a missing symbol when linking (?!?) */ - NIX_CFLAGS_COMPILE="-Dg_thread_init= "; + env.NIX_CFLAGS_COMPILE="-Dg_thread_init= "; meta = with stdenv.lib; { description = "An E-component of Network Intrusion Detection System which emulates the IP stack of Linux 2.0.x"; diff --git a/pkgs/tools/networking/libreswan/default.nix b/pkgs/tools/networking/libreswan/default.nix index 4c8b926b58273..10ba600d37e61 100644 --- a/pkgs/tools/networking/libreswan/default.nix +++ b/pkgs/tools/networking/libreswan/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation { }; # These flags were added to compile v3.18. Try to lift them when updating. - NIX_CFLAGS_COMPILE = toString [ "-Wno-error=redundant-decls" "-Wno-error=format-nonliteral" + env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=redundant-decls" "-Wno-error=format-nonliteral" # these flags were added to build with gcc7 "-Wno-error=implicit-fallthrough" "-Wno-error=format-truncation" diff --git a/pkgs/tools/networking/lsh/default.nix b/pkgs/tools/networking/lsh/default.nix index 5d788af1682e6..08f651e0c83d1 100644 --- a/pkgs/tools/networking/lsh/default.nix +++ b/pkgs/tools/networking/lsh/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { export lsh_cv_sys_unix98_ptys=yes ''; - NIX_CFLAGS_COMPILE = "-std=gnu90"; + env.NIX_CFLAGS_COMPILE = "-std=gnu90"; buildInputs = [ gperf guile gmp zlib liboop readline gnum4 pam ]; diff --git a/pkgs/tools/networking/mailutils/default.nix b/pkgs/tools/networking/mailutils/default.nix index dcf377ca0c04c..2d9f0c2c1c265 100644 --- a/pkgs/tools/networking/mailutils/default.nix +++ b/pkgs/tools/networking/mailutils/default.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { (fetchurl { url = "${p}/weed.at"; sha256 = "1101xakhc99f5gb9cs3mmydn43ayli7b270pzbvh7f9rbvh0d0nh"; }) ]; - NIX_CFLAGS_COMPILE = "-L${libmysqlclient}/lib/mysql -I${libmysqlclient}/include/mysql"; + env.NIX_CFLAGS_COMPILE = "-L${libmysqlclient}/lib/mysql -I${libmysqlclient}/include/mysql"; checkInputs = [ dejagnu ]; doCheck = false; # fails 1 out of a bunch of tests, looks like a bug diff --git a/pkgs/tools/networking/nbd/default.nix b/pkgs/tools/networking/nbd/default.nix index 9c443696eda68..23370834f1fca 100644 --- a/pkgs/tools/networking/nbd/default.nix +++ b/pkgs/tools/networking/nbd/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { # Glib calls `clock_gettime', which is in librt. Linking that library # here ensures that a proper rpath is added to the executable so that # it can be loaded at run-time. - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lrt -lpthread"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lrt -lpthread"; meta = { homepage = http://nbd.sourceforge.net; diff --git a/pkgs/tools/networking/network-manager/iodine/default.nix b/pkgs/tools/networking/network-manager/iodine/default.nix index 29c0d550fe2fb..b531664b23dce 100644 --- a/pkgs/tools/networking/network-manager/iodine/default.nix +++ b/pkgs/tools/networking/network-manager/iodine/default.nix @@ -30,7 +30,7 @@ in stdenv.mkDerivation { nativeBuildInputs = [ intltool pkgconfig ]; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; configureFlags = [ "--without-libnm-glib" diff --git a/pkgs/tools/networking/network-manager/strongswan.nix b/pkgs/tools/networking/network-manager/strongswan.nix index 843985bfa3e45..f9bb60c3c4780 100644 --- a/pkgs/tools/networking/network-manager/strongswan.nix +++ b/pkgs/tools/networking/network-manager/strongswan.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ intltool pkgconfig ]; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; configureFlags = [ "--without-libnm-glib" diff --git a/pkgs/tools/networking/nfstrace/default.nix b/pkgs/tools/networking/nfstrace/default.nix index 72a0ea3682b75..63e4cd5b11096 100644 --- a/pkgs/tools/networking/nfstrace/default.nix +++ b/pkgs/tools/networking/nfstrace/default.nix @@ -22,9 +22,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; # To build with GCC 8+ it needs: - CXXFLAGS = "-Wno-class-memaccess -Wno-ignored-qualifiers"; + env.CXXFLAGS = "-Wno-class-memaccess -Wno-ignored-qualifiers"; # CMake can't find json_c without: - NIX_CFLAGS_COMPILE = "-I${json_c.dev}/include/json-c"; + env.NIX_CFLAGS_COMPILE = "-I${json_c.dev}/include/json-c"; doCheck = false; # requires network access diff --git a/pkgs/tools/networking/ntopng/default.nix b/pkgs/tools/networking/ntopng/default.nix index 68f801060310f..1572079c979f9 100644 --- a/pkgs/tools/networking/ntopng/default.nix +++ b/pkgs/tools/networking/ntopng/default.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { sed 's|LIBS += -lstdc++.6||' -i Makefile ''; - NIX_CFLAGS_COMPILE = "-fpermissive" + env.NIX_CFLAGS_COMPILE = "-fpermissive" + stdenv.lib.optionalString stdenv.cc.isClang " -Wno-error=reserved-user-defined-literal"; meta = with stdenv.lib; { diff --git a/pkgs/tools/networking/openfortivpn/default.nix b/pkgs/tools/networking/openfortivpn/default.nix index d1a73f1c148b3..32682dd3bafa7 100644 --- a/pkgs/tools/networking/openfortivpn/default.nix +++ b/pkgs/tools/networking/openfortivpn/default.nix @@ -18,7 +18,7 @@ in stdenv.mkDerivation { nativeBuildInputs = [ autoreconfHook pkgconfig ]; buildInputs = [ openssl ppp ]; - NIX_CFLAGS_COMPILE = "-Wno-error=unused-function"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-function"; configureFlags = [ "--with-pppd=${ppp}/bin/pppd" ]; diff --git a/pkgs/tools/networking/packetdrill/default.nix b/pkgs/tools/networking/packetdrill/default.nix index 623645efc0cab..2200d7ffeb032 100644 --- a/pkgs/tools/networking/packetdrill/default.nix +++ b/pkgs/tools/networking/packetdrill/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation { setSourceRoot = '' export sourceRoot=$(realpath */gtests/net/packetdrill) ''; - NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = builtins.toString [ "-Wno-error=unused-result" "-Wno-error=stringop-truncation" "-Wno-error=address-of-packed-member" diff --git a/pkgs/tools/networking/ripmime/default.nix b/pkgs/tools/networking/ripmime/default.nix index ae84d9662aa0b..efbabc43f1b1d 100644 --- a/pkgs/tools/networking/ripmime/default.nix +++ b/pkgs/tools/networking/ripmime/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { mkdir -p "$out/bin" "$out/share/man/man1" ''; - NIX_CFLAGS_COMPILE=" -Wno-error "; + env.NIX_CFLAGS_COMPILE=" -Wno-error "; meta = with stdenv.lib; { description = "Attachment extractor for MIME messages"; diff --git a/pkgs/tools/networking/siege/default.nix b/pkgs/tools/networking/siege/default.nix index a0a6599741487..1a6d02062dff4 100644 --- a/pkgs/tools/networking/siege/default.nix +++ b/pkgs/tools/networking/siege/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "0vzaj5nzb0fir2a4l7ghv3wa5d1nk2ss8gmwjb6bjavjplccyzcg"; }; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; buildInputs = [ openssl zlib ]; diff --git a/pkgs/tools/networking/sipsak/default.nix b/pkgs/tools/networking/sipsak/default.nix index c1a2451328df0..5bd0d7ee090e7 100644 --- a/pkgs/tools/networking/sipsak/default.nix +++ b/pkgs/tools/networking/sipsak/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { c-ares ]; - NIX_CFLAGS_COMPILE = "--std=gnu89"; + env.NIX_CFLAGS_COMPILE = "--std=gnu89"; src = fetchurl { url = "https://github.com/sipwise/sipsak/archive/mr${version}.tar.gz"; diff --git a/pkgs/tools/networking/ssmtp/default.nix b/pkgs/tools/networking/ssmtp/default.nix index 81da427a52cfa..e16d00b895cc3 100644 --- a/pkgs/tools/networking/ssmtp/default.nix +++ b/pkgs/tools/networking/ssmtp/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation { buildInputs = stdenv.lib.optional tlsSupport openssl; - NIX_LDFLAGS = stdenv.lib.optionalString tlsSupport "-lcrypto"; + env.NIX_LDFLAGS = stdenv.lib.optionalString tlsSupport "-lcrypto"; meta = with stdenv.lib; { platforms = platforms.linux; diff --git a/pkgs/tools/networking/strongswan/default.nix b/pkgs/tools/networking/strongswan/default.nix index 27453083d5919..9a5cbf03a44a2 100644 --- a/pkgs/tools/networking/strongswan/default.nix +++ b/pkgs/tools/networking/strongswan/default.nix @@ -103,7 +103,7 @@ stdenv.mkDerivation rec { echo "include /etc/ipsec.secrets" >> $out/etc/ipsec.secrets ''; - NIX_LDFLAGS = optionalString stdenv.cc.isGNU "-lgcc_s" ; + env.NIX_LDFLAGS = optionalString stdenv.cc.isGNU "-lgcc_s" ; meta = { description = "OpenSource IPsec-based VPN Solution"; diff --git a/pkgs/tools/networking/tracebox/default.nix b/pkgs/tools/networking/tracebox/default.nix index 1d3c4190e3884..5a8229c570940 100644 --- a/pkgs/tools/networking/tracebox/default.nix +++ b/pkgs/tools/networking/tracebox/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-lua=yes" ]; - NIX_LDFLAGS = "${libpcap}/lib/libpcap.so ${libcrafter}/lib/libcrafter.so"; + env.NIX_LDFLAGS = "${libpcap}/lib/libpcap.so ${libcrafter}/lib/libcrafter.so"; preAutoreconf = '' substituteInPlace Makefile.am --replace "noinst" "" diff --git a/pkgs/tools/networking/uwimap/default.nix b/pkgs/tools/networking/uwimap/default.nix index b687f1db01709..581da3feb2144 100644 --- a/pkgs/tools/networking/uwimap/default.nix +++ b/pkgs/tools/networking/uwimap/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation ({ sed -i src/osdep/unix/Makefile -e 's,^SSLLIB=.*,SSLLIB=${openssl.out}/lib,' ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${openssl.dev}/include/openssl"; installPhase = '' diff --git a/pkgs/tools/networking/wrk/default.nix b/pkgs/tools/networking/wrk/default.nix index 98705430c2f0a..b940d2e1106fd 100644 --- a/pkgs/tools/networking/wrk/default.nix +++ b/pkgs/tools/networking/wrk/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { done ''; - NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 + env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 installPhase = '' mkdir -p $out/bin diff --git a/pkgs/tools/package-management/rpm/default.nix b/pkgs/tools/package-management/rpm/default.nix index ae0259e65fcd1..b7df0f57da00f 100644 --- a/pkgs/tools/package-management/rpm/default.nix +++ b/pkgs/tools/package-management/rpm/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ popt nss db bzip2 libarchive libbfd ] ++ stdenv.lib.optional stdenv.isLinux elfutils; - NIX_CFLAGS_COMPILE = "-I${nspr.dev}/include/nspr -I${nss.dev}/include/nss"; + env.NIX_CFLAGS_COMPILE = "-I${nspr.dev}/include/nspr -I${nss.dev}/include/nss"; configureFlags = [ "--with-external-db" diff --git a/pkgs/tools/package-management/xbps/default.nix b/pkgs/tools/package-management/xbps/default.nix index 7ff079c0116c6..feb64bb46e66d 100644 --- a/pkgs/tools/package-management/xbps/default.nix +++ b/pkgs/tools/package-management/xbps/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { patches = [ ./cert-paths.patch ]; - NIX_CFLAGS_COMPILE = "-Wno-error=unused-result"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-result"; postPatch = '' # fix unprefixed ranlib (needed on cross) diff --git a/pkgs/tools/security/chaps/default.nix b/pkgs/tools/security/chaps/default.nix index c8ee95069682e..17ffafbebfdc2 100644 --- a/pkgs/tools/security/chaps/default.nix +++ b/pkgs/tools/security/chaps/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { sha256 = "0chk6pnn365d5kcz6vfqx1d0383ksk97icc0lzg0vvb0kvyj0ff1"; }; - NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = [ # readdir_r(3) is deprecated in glibc >= 2.24 "-Wno-error=deprecated-declarations" # gcc8 catching polymorphic type error diff --git a/pkgs/tools/security/gpgstats/default.nix b/pkgs/tools/security/gpgstats/default.nix index c3a14f62c7664..60e45df1e1c48 100644 --- a/pkgs/tools/security/gpgstats/default.nix +++ b/pkgs/tools/security/gpgstats/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { cp gpgstats $out/bin ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.is64bit) + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.is64bit) "-D_FILE_OFFSET_BITS=64 -DLARGEFILE_SOURCE=1"; meta = with stdenv.lib; { diff --git a/pkgs/tools/security/haka/default.nix b/pkgs/tools/security/haka/default.nix index bfac54d2d8601..dc3c918b1741f 100644 --- a/pkgs/tools/security/haka/default.nix +++ b/pkgs/tools/security/haka/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { sha256 = "0dm39g3k77sa70zrjsqadidg27a6iqq61jzfdxazpllnrw4mjy4w"; }; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; preConfigure = '' sed -i 's,/etc,'$out'/etc,' src/haka/haka.c diff --git a/pkgs/tools/security/opensc/default.nix b/pkgs/tools/security/opensc/default.nix index 4f220ee7717e5..194f753371077 100644 --- a/pkgs/tools/security/opensc/default.nix +++ b/pkgs/tools/security/opensc/default.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional stdenv.isDarwin Carbon ++ (if withApplePCSC then [ PCSC ] else [ pcsclite ]); - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; configureFlags = [ "--enable-zlib" diff --git a/pkgs/tools/security/super/default.nix b/pkgs/tools/security/super/default.nix index 716973a3e2e71..944170c5efa00 100644 --- a/pkgs/tools/security/super/default.nix +++ b/pkgs/tools/security/super/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { }) ]; - NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; + env.NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; configureFlags = [ "--sysconfdir=/etc" diff --git a/pkgs/tools/security/tor/default.nix b/pkgs/tools/security/tor/default.nix index 527c8064bac51..e1533ddedea33 100644 --- a/pkgs/tools/security/tor/default.nix +++ b/pkgs/tools/security/tor/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { buildInputs = [ libevent openssl zlib lzma zstd scrypt ] ++ stdenv.lib.optionals stdenv.isLinux [ libseccomp systemd libcap ]; - NIX_CFLAGS_LINK = stdenv.lib.optionalString stdenv.cc.isGNU "-lgcc_s"; + env.NIX_CFLAGS_LINK = stdenv.lib.optionalString stdenv.cc.isGNU "-lgcc_s"; postPatch = '' substituteInPlace contrib/client-tools/torify \ diff --git a/pkgs/tools/security/trousers/default.nix b/pkgs/tools/security/trousers/default.nix index a38c011d7a49f..e1938b65fcfc1 100644 --- a/pkgs/tools/security/trousers/default.nix +++ b/pkgs/tools/security/trousers/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-usercheck" ]; - NIX_CFLAGS_COMPILE = [ "-DALLOW_NON_TSS_CONFIG_FILE" ]; + env.NIX_CFLAGS_COMPILE = [ "-DALLOW_NON_TSS_CONFIG_FILE" ]; enableParallelBuilding = true; meta = with stdenv.lib; { diff --git a/pkgs/tools/system/acpica-tools/default.nix b/pkgs/tools/system/acpica-tools/default.nix index 269b6a82bbcad..6ee0f45a90269 100644 --- a/pkgs/tools/system/acpica-tools/default.nix +++ b/pkgs/tools/system/acpica-tools/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "0pz95fb1zvsj9238bg7a4vxl1svn5mnjg10sn5qvgr008q0v9782"; }; - NIX_CFLAGS_COMPILE = "-O3"; + env.NIX_CFLAGS_COMPILE = "-O3"; enableParallelBuilding = true; diff --git a/pkgs/tools/system/ddrescueview/default.nix b/pkgs/tools/system/ddrescueview/default.nix index 466232e2bf779..c55b339fcfb22 100644 --- a/pkgs/tools/system/ddrescueview/default.nix +++ b/pkgs/tools/system/ddrescueview/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { sourceRoot = "source"; - NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; + env.NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; buildPhase = '' lazbuild --lazarusdir=${lazarus}/share/lazarus ddrescueview.lpi diff --git a/pkgs/tools/system/facter/default.nix b/pkgs/tools/system/facter/default.nix index 86aa5adb6f8f2..68276cccd676f 100644 --- a/pkgs/tools/system/facter/default.nix +++ b/pkgs/tools/system/facter/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { }; CXXFLAGS = "-fpermissive -Wno-error=catch-value"; - NIX_LDFLAGS = "-lblkid"; + env.NIX_LDFLAGS = "-lblkid"; cmakeFlags = [ "-DFACTER_RUBY=${ruby}/lib/libruby.so" diff --git a/pkgs/tools/system/gdmap/default.nix b/pkgs/tools/system/gdmap/default.nix index 4adc81608293a..fd47f973d5683 100644 --- a/pkgs/tools/system/gdmap/default.nix +++ b/pkgs/tools/system/gdmap/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; meta = with stdenv.lib; { homepage = http://gdmap.sourceforge.net; diff --git a/pkgs/tools/system/hardinfo/default.nix b/pkgs/tools/system/hardinfo/default.nix index 6c5019847ff3c..53bd37fd97781 100644 --- a/pkgs/tools/system/hardinfo/default.nix +++ b/pkgs/tools/system/hardinfo/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "all" ]; # Ignore undefined references to a bunch of libsoup symbols - NIX_LDFLAGS = "--unresolved-symbol=ignore-all"; + env.NIX_LDFLAGS = "--unresolved-symbol=ignore-all"; preConfigure = '' patchShebangs configure diff --git a/pkgs/tools/system/hardlink/default.nix b/pkgs/tools/system/hardlink/default.nix index d1d2b7a3e7698..7531cceac85db 100644 --- a/pkgs/tools/system/hardlink/default.nix +++ b/pkgs/tools/system/hardlink/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation { }; buildInputs = [ pcre2 ]; - NIX_CFLAGS_LINK = "-lpcre2-8"; + env.NIX_CFLAGS_LINK = "-lpcre2-8"; buildPhase = '' $CC -O2 hardlink.c -o hardlink $NIX_CFLAGS_LINK diff --git a/pkgs/tools/system/ipmiutil/default.nix b/pkgs/tools/system/ipmiutil/default.nix index 0d2a78efba125..ac0488963af73 100644 --- a/pkgs/tools/system/ipmiutil/default.nix +++ b/pkgs/tools/system/ipmiutil/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { sed -e "s@/var@$out/var@g" -i Makefile */Makefile */*/Makefile ''; - NIX_CFLAGS_COMPILE = "-fno-stack-protector"; + env.NIX_CFLAGS_COMPILE = "-fno-stack-protector"; meta = with stdenv.lib; { description = "An easy-to-use IPMI server management utility"; diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index 487d6541b5f6a..9e685ea25afe4 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { ./no-files-in-etc-and-var.patch ]; - NIX_CFLAGS_COMPILE = optionalString withDebug "-O1 -ggdb -DNETDATA_INTERNAL_CHECKS=1"; + env.NIX_CFLAGS_COMPILE = optionalString withDebug "-O1 -ggdb -DNETDATA_INTERNAL_CHECKS=1"; postInstall = optionalString (!stdenv.isDarwin) '' # rename this plugin so netdata will look for setuid wrapper diff --git a/pkgs/tools/system/opencl-info/default.nix b/pkgs/tools/system/opencl-info/default.nix index d1c3d0ec6c0c0..a762ea0428e82 100644 --- a/pkgs/tools/system/opencl-info/default.nix +++ b/pkgs/tools/system/opencl-info/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { buildInputs = [ opencl-clhpp ocl-icd ]; - NIX_LDFLAGS = "-lOpenCL"; + env.NIX_LDFLAGS = "-lOpenCL"; installPhase = '' install -Dm755 opencl-info $out/bin/opencl-info diff --git a/pkgs/tools/system/rowhammer-test/default.nix b/pkgs/tools/system/rowhammer-test/default.nix index 64c184a612295..511ce5d4f5057 100644 --- a/pkgs/tools/system/rowhammer-test/default.nix +++ b/pkgs/tools/system/rowhammer-test/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { sha256 = "1fbfcnm5gjish47wdvikcsgzlb5vnlfqlzzm6mwiw2j5qkq0914i"; }; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-Wno-error=format"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-Wno-error=format"; buildPhase = "sh -e make.sh"; diff --git a/pkgs/tools/system/stress-ng/default.nix b/pkgs/tools/system/stress-ng/default.nix index 7d3e62d7beb52..25ce6a9f68901 100644 --- a/pkgs/tools/system/stress-ng/default.nix +++ b/pkgs/tools/system/stress-ng/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { "BASHDIR=${placeholder "out"}/share/bash-completion/completions" ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.hostPlatform.isMusl "-D_LINUX_SYSINFO_H=1"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.hostPlatform.isMusl "-D_LINUX_SYSINFO_H=1"; # Won't build on i686 because the binary will be linked again in the # install phase without checking the dependencies. This will prevent diff --git a/pkgs/tools/system/testdisk/default.nix b/pkgs/tools/system/testdisk/default.nix index ad11cd2e3b65c..8380d45ec713e 100644 --- a/pkgs/tools/system/testdisk/default.nix +++ b/pkgs/tools/system/testdisk/default.nix @@ -41,7 +41,7 @@ assert enableQt -> qwt != null; nativeBuildInputs = [ pkgconfig ]; - NIX_CFLAGS_COMPILE="-Wno-unused"; + env.NIX_CFLAGS_COMPILE="-Wno-unused"; meta = with stdenv.lib; { homepage = https://www.cgsecurity.org/wiki/Main_Page; diff --git a/pkgs/tools/text/kytea/default.nix b/pkgs/tools/text/kytea/default.nix index 621408866e8ca..e9dea14fe4d79 100644 --- a/pkgs/tools/text/kytea/default.nix +++ b/pkgs/tools/text/kytea/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { patches = [ ./gcc-O3.patch ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; meta = with stdenv.lib; { homepage = http://www.phontron.com/kytea/; diff --git a/pkgs/tools/text/multitran/libmtquery/default.nix b/pkgs/tools/text/multitran/libmtquery/default.nix index baccdfdedba5a..ea7b43b314487 100644 --- a/pkgs/tools/text/multitran/libmtquery/default.nix +++ b/pkgs/tools/text/multitran/libmtquery/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation { buildInputs = [ libmtsupport libfacet libbtree multitrandata ]; - NIX_LDFLAGS = "-lbtree"; + env.NIX_LDFLAGS = "-lbtree"; patchPhase = '' sed -i -e 's@\$(DESTDIR)/usr@'$out'@' \ diff --git a/pkgs/tools/text/sgml/jade/default.nix b/pkgs/tools/text/sgml/jade/default.nix index 2cc40510121ba..6728c0cb0c5fe 100644 --- a/pkgs/tools/text/sgml/jade/default.nix +++ b/pkgs/tools/text/sgml/jade/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { buildInputs = [ gnum4 ]; - NIX_CFLAGS_COMPILE = "-Wno-deprecated"; + env.NIX_CFLAGS_COMPILE = "-Wno-deprecated"; preInstall = '' install -d -m755 "$out"/lib diff --git a/pkgs/tools/text/silver-searcher/default.nix b/pkgs/tools/text/silver-searcher/default.nix index 2c28f9ea5a565..1d13f03f9367e 100644 --- a/pkgs/tools/text/silver-searcher/default.nix +++ b/pkgs/tools/text/silver-searcher/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { patches = [ ./bash-completion.patch ]; - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; + env.NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; nativeBuildInputs = [ autoreconfHook pkgconfig ]; buildInputs = [ pcre zlib lzma ]; diff --git a/pkgs/tools/typesetting/sile/default.nix b/pkgs/tools/typesetting/sile/default.nix index 3b6ec809869d4..5efbd2b0fa58d 100644 --- a/pkgs/tools/typesetting/sile/default.nix +++ b/pkgs/tools/typesetting/sile/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { sed -i -e 's|@import AppKit;|#import |' src/macfonts.m ''; - NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework AppKit"; + env.NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework AppKit"; FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ diff --git a/pkgs/tools/video/mjpegtools/default.nix b/pkgs/tools/video/mjpegtools/default.nix index 3e72d8b8af592..ed832c794ba7d 100644 --- a/pkgs/tools/video/mjpegtools/default.nix +++ b/pkgs/tools/video/mjpegtools/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { buildInputs = [ libdv libjpeg libpng ] ++ lib.optionals (!withMinimal) [ gtk2 libX11 SDL SDL_gfx ]; - NIX_CFLAGS_COMPILE = lib.optionalString (!withMinimal) "-I${SDL.dev}/include/SDL"; + env.NIX_CFLAGS_COMPILE = lib.optionalString (!withMinimal) "-I${SDL.dev}/include/SDL"; postPatch = '' sed -i -e '/ARCHFLAGS=/s:=.*:=:' configure diff --git a/pkgs/tools/video/swfmill/default.nix b/pkgs/tools/video/swfmill/default.nix index 3832f3c3be0c8..161f67760b7d5 100644 --- a/pkgs/tools/video/swfmill/default.nix +++ b/pkgs/tools/video/swfmill/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { }; # Fixes build with GCC 6 - NIX_CFLAGS_COMPILE = "-std=c++03"; + env.NIX_CFLAGS_COMPILE = "-std=c++03"; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libxslt freetype libpng libxml2 ]; diff --git a/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix b/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix index 0daa01f85bb39..73299a52f4e40 100644 --- a/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix +++ b/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix @@ -27,8 +27,8 @@ stdenv.mkDerivation rec { buildInputs = [ curl.dev pam ]; - NIX_CFLAGS_COMPILE="-I${json_c.dev}/include/json-c"; - NIX_CFLAGS_LINK="-L${json_c}/lib"; + env.NIX_CFLAGS_COMPILE="-I${json_c.dev}/include/json-c"; + env.NIX_CFLAGS_LINK="-L${json_c}/lib"; installPhase = '' mkdir -p $out/{bin,lib} From c492beebc9938a713dda040f645cdbbf458f7d1d Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 9 Nov 2019 17:26:41 +0000 Subject: [PATCH 053/323] perlPackages: Use `env` for many for `NIX_*` env vars --- pkgs/top-level/perl-packages.nix | 64 ++++++++++++++++---------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 94ef32249981f..f2ea9544fb711 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -707,8 +707,8 @@ let sha256 = "0jk3djnk6yf0jsjh8qk3mj8bkx4avp6i4czcpr5xrbf7f41744l3"; }; buildInputs = [ pkgs.zlib TestWarn ]; - NIX_CFLAGS_COMPILE = "-I${pkgs.zlib.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.zlib.out}/lib -lz"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.zlib.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.zlib.out}/lib -lz"; meta = { description = "Fast C metadata and tag reader for all common audio file formats"; license = stdenv.lib.licenses.gpl2; @@ -3416,8 +3416,8 @@ let sha256 = "0f5gdprcql4kwzgxl2s6ngcfg1jl45lzcqh7dkv5bkwlwmxa9rsi"; }; buildInputs = [ pkgs.gmp DevelChecklib TestRequires ]; - NIX_CFLAGS_COMPILE = "-I${pkgs.gmp.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.gmp.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp"; }; CryptECB = buildPerlPackage { @@ -3585,8 +3585,8 @@ let url = mirror://cpan/authors/id/T/TT/TTAR/Crypt-OpenSSL-AES-0.02.tar.gz; sha256 = "b66fab514edf97fc32f58da257582704a210c2b35e297d5c31b7fa2ffd08e908"; }; - NIX_CFLAGS_COMPILE = "-I${pkgs.openssl_1_0_2.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.openssl_1_0_2.out}/lib -lcrypto"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.openssl_1_0_2.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.openssl_1_0_2.out}/lib -lcrypto"; meta = with stdenv.lib; { description = "Perl wrapper around OpenSSL's AES library"; license = with licenses; [ artistic1 gpl1Plus ]; @@ -3600,8 +3600,8 @@ let url = mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-0.09.tar.gz; sha256 = "1p22znbajq91lbk2k3yg12ig7hy5b4vy8igxwqkmbm4nhgxp4ki3"; }; - NIX_CFLAGS_COMPILE = "-I${pkgs.openssl_1_0_2.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.openssl_1_0_2.out}/lib -lcrypto"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.openssl_1_0_2.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.openssl_1_0_2.out}/lib -lcrypto"; }; CryptOpenSSLGuess = buildPerlPackage { @@ -3625,8 +3625,8 @@ let url = mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-0.15.tar.gz; sha256 = "1x6ffps8q7mnawmcfq740llzy7i10g3319vap0wiw4d33fm6z1zh"; }; - NIX_CFLAGS_COMPILE = "-I${pkgs.openssl.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.openssl.out}/lib -lcrypto"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.openssl.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.openssl.out}/lib -lcrypto"; buildInputs = [ CryptOpenSSLGuess ]; }; @@ -3638,8 +3638,8 @@ let sha256 = "4173403ad4cf76732192099f833fbfbf3cd8104e0246b3844187ae384d2c5436"; }; propagatedBuildInputs = [ CryptOpenSSLRandom ]; - NIX_CFLAGS_COMPILE = "-I${pkgs.openssl_1_0_2.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.openssl_1_0_2.out}/lib -lcrypto"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.openssl_1_0_2.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.openssl_1_0_2.out}/lib -lcrypto"; buildInputs = [ CryptOpenSSLGuess ]; }; @@ -3650,8 +3650,8 @@ let url = "mirror://cpan/authors/id/J/JO/JONASBN/Crypt-OpenSSL-X509-1.813.tar.gz"; sha256 = "684bd888d2ed4c748f8f6dd8e87c14afa2974b12ee01faa082ad9cfa1e321e62"; }; - NIX_CFLAGS_COMPILE = "-I${pkgs.openssl.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.openssl.out}/lib -lcrypto"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.openssl.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.openssl.out}/lib -lcrypto"; meta = { homepage = "https://github.com/dsully/perl-crypt-openssl-x509"; description = "Perl extension to OpenSSL's X509 API"; @@ -3753,7 +3753,7 @@ let sha256 = "0r6xd9wr0c25rr28zixhqipak575zqsfb7r7f2693i9il1dpj554"; }; propagatedBuildInputs = [ pkgs.ncurses ]; - NIX_CFLAGS_LINK = "-lncurses"; + env.NIX_CFLAGS_LINK = "-lncurses"; meta = { description = "Perl bindings to ncurses"; license = stdenv.lib.licenses.artistic1; @@ -9938,7 +9938,7 @@ let sha256 = "312940c1f60f47c4fc93fa0a9d2a626425faa837040c8c2f1ad58ee09f62f371"; }; buildInputs = [ pkgs.acl ]; - NIX_CFLAGS_LINK = "-L${pkgs.acl.out}/lib -lacl"; + env.NIX_CFLAGS_LINK = "-L${pkgs.acl.out}/lib -lacl"; meta = { maintainers = [ maintainers.limeytexan ]; description = "Perl extension for reading and setting Access Control Lists for files by libacl linux library"; @@ -10910,8 +10910,8 @@ let }; buildInputs = [ pkgs.gmp ]; doCheck = false; - NIX_CFLAGS_COMPILE = "-I${pkgs.gmp.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.gmp.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp"; propagatedBuildInputs = [ MathBigInt ]; }; @@ -10969,8 +10969,8 @@ let sha256 = "1c07521m4d38hy2yx21hkwz22n2672bvrc4i21ldc68h85qy1q8i"; }; buildInputs = [ pkgs.gmp AlienGMP ]; - NIX_CFLAGS_COMPILE = "-I${pkgs.gmp.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.gmp.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp"; meta = { description = "High speed arbitrary size integer math"; license = with stdenv.lib.licenses; [ lgpl21Plus ]; @@ -12892,7 +12892,7 @@ let }; buildInputs = [ DevelPPPort ModuleBuildXSUtil TestException TestFatal TestLeakTrace TestOutput TestRequires TryTiny ]; perlPreHook = "export LD=$CC"; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-fno-stack-protector"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-fno-stack-protector"; hardeningDisable = stdenv.lib.optional stdenv.isi686 "stackprotector"; }; @@ -13840,8 +13840,8 @@ let buildInputs = [ pkgs.zookeeper_mt ]; # fix "error: format not a string literal and no format arguments [-Werror=format-security]" hardeningDisable = [ "format" ]; - NIX_CFLAGS_COMPILE = "-I${pkgs.zookeeper_mt}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.zookeeper_mt.out}/lib -lzookeeper_mt"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.zookeeper_mt}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.zookeeper_mt.out}/lib -lzookeeper_mt"; meta = { maintainers = [ maintainers.limeytexan ]; homepage = https://github.com/mark-5/p5-net-zookeeper; @@ -14241,7 +14241,7 @@ let }; buildInputs = [ pkgs.pcsclite ]; nativeBuildInputs = [ pkgs.pkgconfig ]; - NIX_CFLAGS_LINK = "-L${stdenv.lib.getLib pkgs.pcsclite}/lib -lpcsclite"; + env.NIX_CFLAGS_LINK = "-L${stdenv.lib.getLib pkgs.pcsclite}/lib -lpcsclite"; # tests fail; look unfinished doCheck = false; meta = { @@ -17182,7 +17182,7 @@ let sha256 = "9a08f7a4013c9b865541c10dbba1210779eb9128b961250b746d26702bab6925"; }; buildInputs = [ pkgs.readline pkgs.ncurses ]; - NIX_CFLAGS_LINK = "-lreadline -lncursesw"; + env.NIX_CFLAGS_LINK = "-lreadline -lncursesw"; # For some crazy reason Makefile.PL doesn't generate a Makefile if # AUTOMATED_TESTING is set. @@ -18749,8 +18749,8 @@ let }; propagatedBuildInputs = [ pkgs.aspell ]; ASPELL_CONF = "dict-dir ${pkgs.aspellDicts.en}/lib/aspell"; - NIX_CFLAGS_COMPILE = "-I${pkgs.aspell}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.aspell}/lib -laspell"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.aspell}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.aspell}/lib -laspell"; }; TextAutoformat = buildPerlPackage { @@ -19245,7 +19245,7 @@ let sha256 = "0avk50kia78kxryh2whmaj5l18q2wvmkdyqyjsf6kwr4kgy6x3i7"; }; # https://rt.cpan.org/Public/Bug/Display.html?id=124815 - NIX_CFLAGS_COMPILE = "-DHAS_VPRINTF"; + env.NIX_CFLAGS_COMPILE = "-DHAS_VPRINTF"; }; TextUnidecode = buildPerlPackage { @@ -20138,7 +20138,7 @@ let substituteInPlace Makefile.PL --replace '"cpp"' '"gcc -E"' substituteInPlace Makefile.PL --replace '_LASTENTRY\z' '_LASTENTRY\z|CURL_DID_MEMORY_FUNC_TYPEDEFS\z' ''; - NIX_CFLAGS_COMPILE = "-DCURL_STRICTER"; + env.NIX_CFLAGS_COMPILE = "-DCURL_STRICTER"; doCheck = false; # performs network access meta.broken = stdenv.lib.versionAtLeast (stdenv.lib.getVersion pkgs.curl) "7.66"; # broken since "curl: 7.65.3 -> 7.66.0" }; @@ -20290,7 +20290,7 @@ let sha256 = "1dq89bh6fqv7l5mbffqcismcljpq5f869bx7g8lg698zgindv5ny"; }; buildInputs = [ pkgs.xlibsWrapper ]; - NIX_CFLAGS_LINK = "-lX11"; + env.NIX_CFLAGS_LINK = "-lX11"; doCheck = false; # requires an X server }; @@ -20318,7 +20318,7 @@ let sha256 = "0jznws68skdzkhgkgcgjlj40qdyh9i75r7fw8bqzy406f19xxvnw"; }; buildInputs = [ pkgs.xlibsWrapper pkgs.xorg.libXtst pkgs.xorg.libXi ]; - NIX_CFLAGS_LINK = "-lX11 -lXext -lXtst"; + env.NIX_CFLAGS_LINK = "-lX11 -lXext -lXtst"; doCheck = false; # requires an X server }; @@ -20332,7 +20332,7 @@ let AUTOMATED_TESTING = false; buildInputs = [ pkgs.xorg.libxcb pkgs.xorg.xcbproto pkgs.xorg.xcbutil pkgs.xorg.xcbutilwm ExtUtilsDepends ExtUtilsPkgConfig TestDeep TestException XSObjectMagic ]; propagatedBuildInputs = [ DataDump MouseXNativeTraits XMLDescent XMLSimple ]; - NIX_CFLAGS_LINK = "-lxcb -lxcb-util -lxcb-xinerama -lxcb-icccm"; + env.NIX_CFLAGS_LINK = "-lxcb -lxcb-util -lxcb-xinerama -lxcb-icccm"; doCheck = false; # requires an X server meta = { description = "XCB bindings for X"; From 4c4e1b33e61ac0e4b824af25388c943ade647dad Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 9 Nov 2019 17:27:13 +0000 Subject: [PATCH 054/323] tdesktop: Fix evl --- .../telegram/tdesktop/default.nix | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix index 076af032fc66e..2a42c93eebbfa 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix @@ -70,22 +70,24 @@ mkDerivation rec { "TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" ]; - env.NIX_CFLAGS_COMPILE = [ - "-DTDESKTOP_DISABLE_CRASH_REPORTS" - "-DTDESKTOP_DISABLE_AUTOUPDATE" - "-DTDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" - "-I${minizip}/include/minizip" - # See Telegram/gyp/qt.gypi - "-I${getDev qtbase}/mkspecs/linux-g++" - ] ++ concatMap (x: [ - "-I${getDev qtbase}/include/${x}" - "-I${getDev qtbase}/include/${x}/${qtbase.version}" - "-I${getDev qtbase}/include/${x}/${qtbase.version}/${x}" - "-I${getDev libopus}/include/opus" - "-I${getDev alsaLib}/include/alsa" - "-I${getDev libpulseaudio}/include/pulse" - ]) [ "QtCore" "QtGui" "QtDBus" ]; - CPPFLAGS = NIX_CFLAGS_COMPILE; + env = rec { + NIX_CFLAGS_COMPILE = builtins.toString ([ + "-DTDESKTOP_DISABLE_CRASH_REPORTS" + "-DTDESKTOP_DISABLE_AUTOUPDATE" + "-DTDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" + "-I${minizip}/include/minizip" + # See Telegram/gyp/qt.gypi + "-I${getDev qtbase}/mkspecs/linux-g++" + ] ++ concatMap (x: [ + "-I${getDev qtbase}/include/${x}" + "-I${getDev qtbase}/include/${x}/${qtbase.version}" + "-I${getDev qtbase}/include/${x}/${qtbase.version}/${x}" + "-I${getDev libopus}/include/opus" + "-I${getDev alsaLib}/include/alsa" + "-I${getDev libpulseaudio}/include/pulse" + ]) [ "QtCore" "QtGui" "QtDBus" ]); + CPPFLAGS = NIX_CFLAGS_COMPILE; + }; preConfigure = '' # Patches to revert: From d01d6a1002f5616e3024a83403224365ed2eb04c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 8 Nov 2019 15:52:42 +0100 Subject: [PATCH 055/323] buildRubyGem: fix for structured attrs --- pkgs/development/ruby-modules/gem/default.nix | 2 +- pkgs/development/ruby-modules/gem/gem-post-build.rb | 2 +- pkgs/development/ruby-modules/gem/nix-bundle-install.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix index af38160a5fa20..7b231f470298e 100644 --- a/pkgs/development/ruby-modules/gem/default.nix +++ b/pkgs/development/ruby-modules/gem/default.nix @@ -77,7 +77,6 @@ let in stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // { - inherit ruby; inherit dontBuild; inherit dontStrip; inherit type; @@ -94,6 +93,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // { inherit src; + env.RUBY = toString ruby; unpackPhase = attrs.unpackPhase or '' runHook preUnpack diff --git a/pkgs/development/ruby-modules/gem/gem-post-build.rb b/pkgs/development/ruby-modules/gem/gem-post-build.rb index b754f94598614..05c3f8331f733 100644 --- a/pkgs/development/ruby-modules/gem/gem-post-build.rb +++ b/pkgs/development/ruby-modules/gem/gem-post-build.rb @@ -3,7 +3,7 @@ require 'rubygems/specification' require 'fileutils' -ruby = File.join(ENV["ruby"], "bin", RbConfig::CONFIG['ruby_install_name']) +ruby = File.join(ENV["RUBY"], "bin", RbConfig::CONFIG['ruby_install_name']) out = ENV["out"] bin_path = File.join(ENV["out"], "bin") gem_home = ENV["GEM_HOME"] diff --git a/pkgs/development/ruby-modules/gem/nix-bundle-install.rb b/pkgs/development/ruby-modules/gem/nix-bundle-install.rb index 0d501bd9add73..d25ba9736a39a 100644 --- a/pkgs/development/ruby-modules/gem/nix-bundle-install.rb +++ b/pkgs/development/ruby-modules/gem/nix-bundle-install.rb @@ -25,7 +25,7 @@ # repo - path to local checkout # ref - the commit hash -ruby = File.join(ENV["ruby"], "bin", RbConfig::CONFIG['ruby_install_name']) +ruby = File.join(ENV["RUBY"], "bin", RbConfig::CONFIG['ruby_install_name']) out = ENV["out"] bin_dir = File.join(ENV["out"], "bin") From f7471e3cef7e649d9714f0717c7938f1952574b0 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 9 Nov 2019 20:12:50 +0100 Subject: [PATCH 056/323] wireguard: fix eval --- pkgs/os-specific/linux/wireguard/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/wireguard/default.nix b/pkgs/os-specific/linux/wireguard/default.nix index a70e13ff94f91..33b0adb75aa88 100644 --- a/pkgs/os-specific/linux/wireguard/default.nix +++ b/pkgs/os-specific/linux/wireguard/default.nix @@ -21,10 +21,11 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; - INSTALL_MOD_PATH = "\${out}"; - - env.NIX_CFLAGS = ["-Wno-error=cpp"]; + env = { + NIX_CFLAGS = "-Wno-error=cpp"; + KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; + INSTALL_MOD_PATH = "\${out}"; + }; nativeBuildInputs = [ perl ] ++ kernel.moduleBuildDependencies; From 906c4fab8460ee65a76db387c1c11d61ba235e21 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 9 Nov 2019 20:36:34 +0100 Subject: [PATCH 057/323] openjdk{8,11,12}: fix eval --- pkgs/development/compilers/openjdk/11.nix | 4 ++-- pkgs/development/compilers/openjdk/8.nix | 4 ++-- pkgs/development/compilers/openjdk/default.nix | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/openjdk/11.nix b/pkgs/development/compilers/openjdk/11.nix index b8381feef0954..4c4bf727e230b 100644 --- a/pkgs/development/compilers/openjdk/11.nix +++ b/pkgs/development/compilers/openjdk/11.nix @@ -61,9 +61,9 @@ let separateDebugInfo = true; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; - NIX_LDFLAGS = toString (lib.optionals (!headless) [ + env.NIX_LDFLAGS = toString (lib.optionals (!headless) [ "-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic" ] ++ lib.optionals (!headless && enableGnome2) [ "-lgtk-3" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2" diff --git a/pkgs/development/compilers/openjdk/8.nix b/pkgs/development/compilers/openjdk/8.nix index c6b3644feccab..44e9e2b26b991 100644 --- a/pkgs/development/compilers/openjdk/8.nix +++ b/pkgs/development/compilers/openjdk/8.nix @@ -140,7 +140,7 @@ let separateDebugInfo = true; - NIX_CFLAGS_COMPILE = toString ([ + env.NIX_CFLAGS_COMPILE = toString ([ # glibc 2.24 deprecated readdir_r so we need this # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html "-Wno-error=deprecated-declarations" @@ -153,7 +153,7 @@ let "-Wno-error" ]); - NIX_LDFLAGS= toString (lib.optionals (!headless) [ + env.NIX_LDFLAGS= toString (lib.optionals (!headless) [ "-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic" ] ++ lib.optionals (!headless && enableGnome2) [ "-lgtk-x11-2.0" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2" diff --git a/pkgs/development/compilers/openjdk/default.nix b/pkgs/development/compilers/openjdk/default.nix index b2d511173c45a..84d6216d2d2d5 100644 --- a/pkgs/development/compilers/openjdk/default.nix +++ b/pkgs/development/compilers/openjdk/default.nix @@ -69,9 +69,9 @@ let separateDebugInfo = true; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; - NIX_LDFLAGS = toString (lib.optionals (!headless) [ + env.NIX_LDFLAGS = toString (lib.optionals (!headless) [ "-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic" ] ++ lib.optionals (!headless && enableGnome2) [ "-lgtk-3" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2" From 3bcd39af4b747f839c7690432e54a1c2c72ada91 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 9 Nov 2019 20:47:13 +0100 Subject: [PATCH 058/323] ronn: fix eval --- pkgs/development/tools/ronn/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/ronn/default.nix b/pkgs/development/tools/ronn/default.nix index e4762796c18a8..d6be51a252b5f 100644 --- a/pkgs/development/tools/ronn/default.nix +++ b/pkgs/development/tools/ronn/default.nix @@ -1,13 +1,14 @@ { stdenv, lib, bundlerEnv, bundlerUpdateScript, makeWrapper, groff }: -stdenv.mkDerivation rec { - pname = "ronn"; - version = env.gems.ronn.version; - +let env = bundlerEnv { name = "ronn-gems"; gemdir = ./.; }; +in +stdenv.mkDerivation rec { + pname = "ronn"; + version = env.gems.ronn.version; phases = ["installPhase"]; From 0f4acfdf39f5b5df45408c9d2c74b3e831a7a56c Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 9 Nov 2019 20:50:43 +0100 Subject: [PATCH 059/323] poly2tri-c: fix eval --- pkgs/development/libraries/poly2tri-c/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/poly2tri-c/default.nix b/pkgs/development/libraries/poly2tri-c/default.nix index bd1afe3b5a3a9..dc3d98f41d7d7 100644 --- a/pkgs/development/libraries/poly2tri-c/default.nix +++ b/pkgs/development/libraries/poly2tri-c/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { glib ]; - env.NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = builtins.toString [ "--std=gnu99" "-Wno-error" ]; From 2ac2c2188ded4bd0164ef0294d84866404605522 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 9 Nov 2019 20:54:23 +0100 Subject: [PATCH 060/323] zfs: fix eval --- pkgs/os-specific/linux/zfs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix index ae72aad6c0775..fa94661249616 100644 --- a/pkgs/os-specific/linux/zfs/default.nix +++ b/pkgs/os-specific/linux/zfs/default.nix @@ -74,7 +74,7 @@ let ++ optional stdenv.hostPlatform.isMusl libtirpc; # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work - NIX_CFLAGS_LINK = "-lgcc_s"; + env.NIX_CFLAGS_LINK = "-lgcc_s"; hardeningDisable = [ "fortify" "stackprotector" "pic" ]; From 0faceb49fd47b67e3bcb71878e60b0514579531e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 9 Nov 2019 21:34:46 +0100 Subject: [PATCH 061/323] darwin.system_cmds: fix eval --- .../darwin/apple-source-releases/system_cmds/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix index 79dffbe3fcd9a..1e68282af1142 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix @@ -12,7 +12,7 @@ appleDerivation { # NIX_CFLAGS_COMPILE = lib.optionalString hostPlatform.isi686 "-D__i386__" # + lib.optionalString hostPlatform.isx86_64 "-D__x86_64__" # + lib.optionalString hostPlatform.isAarch32 "-D__arm__"; - env.NIX_CFLAGS_COMPILE = [ "-DDAEMON_UID=1" + env.NIX_CFLAGS_COMPILE = builtins.toString ([ "-DDAEMON_UID=1" "-DDAEMON_GID=1" "-DDEFAULT_AT_QUEUE='a'" "-DDEFAULT_BATCH_QUEUE='b'" @@ -28,7 +28,7 @@ appleDerivation { "-DAHZV1=64 " "-DAU_SESSION_FLAG_HAS_TTY=0x4000" "-DAU_SESSION_FLAG_HAS_AUTHENTICATED=0x4000" - ] ++ lib.optional (!stdenv.isLinux) " -D__FreeBSD__ "; + ] ++ lib.optional (!stdenv.isLinux) " -D__FreeBSD__ "); patchPhase = '' substituteInPlace login.tproj/login.c \ From 081aa3f3d15f57c1030bf21f2944c3691bf0cb53 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 9 Nov 2019 22:18:05 +0100 Subject: [PATCH 062/323] stdenv: buildInputs etc. has to be a list of drvs --- pkgs/stdenv/generic/make-derivation.nix | 62 +++++++++++++++++++------ 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 794c8ff2917a8..77ec9f7fdb901 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -241,19 +241,55 @@ in rec { inherit strictDeps; - depsBuildBuild = lib.elemAt (lib.elemAt dependencies 0) 0; - nativeBuildInputs = lib.elemAt (lib.elemAt dependencies 0) 1; - depsBuildTarget = lib.elemAt (lib.elemAt dependencies 0) 2; - depsHostHost = lib.elemAt (lib.elemAt dependencies 1) 0; - buildInputs = lib.elemAt (lib.elemAt dependencies 1) 1; - depsTargetTarget = lib.elemAt (lib.elemAt dependencies 2) 0; - - depsBuildBuildPropagated = lib.elemAt (lib.elemAt propagatedDependencies 0) 0; - propagatedNativeBuildInputs = lib.elemAt (lib.elemAt propagatedDependencies 0) 1; - depsBuildTargetPropagated = lib.elemAt (lib.elemAt propagatedDependencies 0) 2; - depsHostHostPropagated = lib.elemAt (lib.elemAt propagatedDependencies 1) 0; - propagatedBuildInputs = lib.elemAt (lib.elemAt propagatedDependencies 1) 1; - depsTargetTargetPropagated = lib.elemAt (lib.elemAt propagatedDependencies 2) 0; + depsBuildBuild = + let deps = lib.elemAt (lib.elemAt dependencies 0) 0; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + nativeBuildInputs = + let deps = lib.elemAt (lib.elemAt dependencies 0) 1; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + depsBuildTarget = + let deps = lib.elemAt (lib.elemAt dependencies 0) 2; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + depsHostHost = + let deps = lib.elemAt (lib.elemAt dependencies 1) 0; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + buildInputs = + let deps = lib.elemAt (lib.elemAt dependencies 1) 1; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + depsTargetTarget = + let deps = lib.elemAt (lib.elemAt dependencies 2) 0; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + + depsBuildBuildPropagated = + let deps = lib.elemAt (lib.elemAt propagatedDependencies 0) 0; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + propagatedNativeBuildInputs = + let deps = lib.elemAt (lib.elemAt propagatedDependencies 0) 1; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + depsBuildTargetPropagated = + let deps = lib.elemAt (lib.elemAt propagatedDependencies 0) 2; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + depsHostHostPropagated = + let deps = lib.elemAt (lib.elemAt propagatedDependencies 1) 0; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + propagatedBuildInputs = + let deps = lib.elemAt (lib.elemAt propagatedDependencies 1) 1; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; + depsTargetTargetPropagated = + let deps = lib.elemAt (lib.elemAt propagatedDependencies 2) 0; in + assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + deps; # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck configureFlags = let inherit (lib) elem optional; in configureFlags From 4f56d6a45b69ace711354ade6332b0ede8c4b2b6 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 9 Nov 2019 22:56:32 +0100 Subject: [PATCH 063/323] stdenv: fix buildInputs etc. assertion logic --- pkgs/stdenv/generic/make-derivation.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 77ec9f7fdb901..e91a641e9f876 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -243,52 +243,52 @@ in rec { depsBuildBuild = let deps = lib.elemAt (lib.elemAt dependencies 0) 0; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; nativeBuildInputs = let deps = lib.elemAt (lib.elemAt dependencies 0) 1; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; depsBuildTarget = let deps = lib.elemAt (lib.elemAt dependencies 0) 2; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; depsHostHost = let deps = lib.elemAt (lib.elemAt dependencies 1) 0; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; buildInputs = let deps = lib.elemAt (lib.elemAt dependencies 1) 1; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; depsTargetTarget = let deps = lib.elemAt (lib.elemAt dependencies 2) 0; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; depsBuildBuildPropagated = let deps = lib.elemAt (lib.elemAt propagatedDependencies 0) 0; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; propagatedNativeBuildInputs = let deps = lib.elemAt (lib.elemAt propagatedDependencies 0) 1; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; depsBuildTargetPropagated = let deps = lib.elemAt (lib.elemAt propagatedDependencies 0) 2; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; depsHostHostPropagated = let deps = lib.elemAt (lib.elemAt propagatedDependencies 1) 0; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; propagatedBuildInputs = let deps = lib.elemAt (lib.elemAt propagatedDependencies 1) 1; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; depsTargetTargetPropagated = let deps = lib.elemAt (lib.elemAt propagatedDependencies 2) 0; in - assert lib.all (v: lib.isDerivation v) (lib.attrValues deps); + assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; deps; # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck From fb24d729d0e35dc6a55af62c8ff9e4be928cd5f2 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 9 Nov 2019 23:55:24 +0100 Subject: [PATCH 064/323] weechat: fix eval --- pkgs/applications/networking/irc/weechat/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/irc/weechat/default.nix b/pkgs/applications/networking/irc/weechat/default.nix index 13ac80677ee9b..75be3ab70bd9b 100644 --- a/pkgs/applications/networking/irc/weechat/default.nix +++ b/pkgs/applications/networking/irc/weechat/default.nix @@ -56,7 +56,7 @@ let ++ concatMap (p: p.buildInputs) enabledPlugins ++ extraBuildInputs; - NIX_CFLAGS_COMPILE = "-I${python}/include/${python.libPrefix}" + env.NIX_CFLAGS_COMPILE = "-I${python}/include/${python.libPrefix}" # Fix '_res_9_init: undefined symbol' error + (stdenv.lib.optionalString stdenv.isDarwin "-DBIND_8_COMPAT=1 -lresolv"); From 0de930ae8d8df4cac26676937ba3ee94302a6198 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 10 Nov 2019 00:52:53 +0100 Subject: [PATCH 065/323] treewide: *inputs are lists --- pkgs/applications/virtualization/docker/default.nix | 4 ++-- pkgs/development/compilers/graalvm/default.nix | 2 +- pkgs/development/interpreters/php/default.nix | 2 +- pkgs/servers/nosql/arangodb/default.nix | 3 ++- pkgs/servers/varnish/default.nix | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index 603aa68207a7b..9f8e95a66371f 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -39,7 +39,7 @@ rec { }; }); - docker-tini = tini.overrideAttrs (oldAttrs: { + docker-tini = tini.overrideAttrs (oldAttrs: { name = "docker-init-${version}"; inherit version; src = fetchFromGitHub { @@ -53,7 +53,7 @@ rec { patchPhase = '' ''; - NIX_CFLAGS_COMPILE = "-DMINIMAL=ON"; + env = oldAttrs.env // { NIX_CFLAGS_COMPILE = "-DMINIMAL=ON"; }; }); in stdenv.mkDerivation ((optionalAttrs (stdenv.isLinux) { diff --git a/pkgs/development/compilers/graalvm/default.nix b/pkgs/development/compilers/graalvm/default.nix index 438c899f51685..91bf80e8f6ab4 100644 --- a/pkgs/development/compilers/graalvm/default.nix +++ b/pkgs/development/compilers/graalvm/default.nix @@ -242,7 +242,7 @@ in rec { 'method->name_and_sig_as_C_string(), p2i(method->native_function()), p2i(entry)' || exit -1 ''; hardeningDisable = [ "fortify" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=format-overflow -Wno-error=nonnull"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-overflow -Wno-error=nonnull"; buildPhase = '' export MX_ALT_OUTPUT_ROOT=$NIX_BUILD_TOP/mxbuild export MX_CACHE_DIR=${makeMxCache jvmci8-mxcache} diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index 0fa605a4cac72..7cc214294f8c7 100644 --- a/pkgs/development/interpreters/php/default.nix +++ b/pkgs/development/interpreters/php/default.nix @@ -109,7 +109,7 @@ let ++ optional libzipSupport libzip ++ optional valgrindSupport valgrind; - CXXFLAGS = optionalString stdenv.cc.isClang "-std=c++11"; + env.CXXFLAGS = optionalString stdenv.cc.isClang "-std=c++11"; configureFlags = [ "--with-config-file-scan-dir=/etc/php.d" diff --git a/pkgs/servers/nosql/arangodb/default.nix b/pkgs/servers/nosql/arangodb/default.nix index e41930a2f4857..cf3e431a6561b 100644 --- a/pkgs/servers/nosql/arangodb/default.nix +++ b/pkgs/servers/nosql/arangodb/default.nix @@ -17,7 +17,6 @@ let # prevent failing with "cmake-3.13.4/nix-support/setup-hook: line 10: ./3rdParty/rocksdb/RocksDBConfig.cmake.in: No such file or directory" dontFixCmake = lib.versionAtLeast version "3.5"; - NIX_CFLAGS_COMPILE = lib.optionalString (lib.versionAtLeast version "3.5") "-Wno-error"; preConfigure = lib.optionalString (lib.versionAtLeast version "3.5") "patchShebangs utils"; postPatch = '' @@ -44,6 +43,8 @@ let enableParallelBuilding = true; + env.NIX_CFLAGS_COMPILE = lib.optionalString (lib.versionAtLeast version "3.5") "-Wno-error"; + meta = with lib; { homepage = https://www.arangodb.com; description = "A native multi-model database with flexible data models for documents, graphs, and key-values"; diff --git a/pkgs/servers/varnish/default.nix b/pkgs/servers/varnish/default.nix index 8d49846cbc042..5756239c96085 100644 --- a/pkgs/servers/varnish/default.nix +++ b/pkgs/servers/varnish/default.nix @@ -26,7 +26,7 @@ let ''; # https://github.com/varnishcache/varnish-cache/issues/1875 - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-fexcess-precision=standard"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-fexcess-precision=standard"; outputs = [ "out" "dev" "man" ]; From 9aa2d5df87d852615256ccc8af8922afeacc3073 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 10 Nov 2019 01:13:06 +0100 Subject: [PATCH 066/323] treewide: fix usage of `env` in several packages --- pkgs/applications/virtualization/virtualbox/default.nix | 2 +- pkgs/development/tools/jsduck/default.nix | 8 +++++--- pkgs/development/tools/parsing/ragel/default.nix | 2 +- pkgs/servers/amqp/qpid-cpp/default.nix | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index 6c15b2ea2ced1..274c272b8bd83 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -31,7 +31,7 @@ let url = "https://acpica.org/sites/acpica/files/acpica-unix-${version}.tar.gz"; sha256 = "0bqhr3ndchvfhxb31147z8gd81dysyz5dwkvmp56832d0js2564q"; }; - NIX_CFLAGS_COMPILE = old.NIX_CFLAGS_COMPILE + " -Wno-error=stringop-truncation"; + env = old.env // { NIX_CFLAGS_COMPILE = old.env.NIX_CFLAGS_COMPILE + " -Wno-error=stringop-truncation"; }; }); in stdenv.mkDerivation { pname = "virtualbox"; diff --git a/pkgs/development/tools/jsduck/default.nix b/pkgs/development/tools/jsduck/default.nix index 0b6098e5ee93e..c92f2d249f2d3 100644 --- a/pkgs/development/tools/jsduck/default.nix +++ b/pkgs/development/tools/jsduck/default.nix @@ -1,15 +1,17 @@ { stdenv, lib, bundlerEnv, makeWrapper, bundlerUpdateScript }: -stdenv.mkDerivation rec { +let pname = "jsduck"; - version = (import ./gemset.nix).jsduck.version; - env = bundlerEnv { name = pname; gemfile = ./Gemfile; lockfile = ./Gemfile.lock; gemset = ./gemset.nix; }; +in +stdenv.mkDerivation rec { + inherit pname; + version = (import ./gemset.nix).jsduck.version; phases = [ "installPhase" ]; diff --git a/pkgs/development/tools/parsing/ragel/default.nix b/pkgs/development/tools/parsing/ragel/default.nix index 12c9b9d57f8fc..5663acee101d7 100644 --- a/pkgs/development/tools/parsing/ragel/default.nix +++ b/pkgs/development/tools/parsing/ragel/default.nix @@ -21,7 +21,7 @@ let configureFlags = [ "--with-colm=${colm}" ]; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-std=gnu++98"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-std=gnu++98"; doCheck = true; diff --git a/pkgs/servers/amqp/qpid-cpp/default.nix b/pkgs/servers/amqp/qpid-cpp/default.nix index 02c2e03d90fad..f14640088b0f6 100644 --- a/pkgs/servers/amqp/qpid-cpp/default.nix +++ b/pkgs/servers/amqp/qpid-cpp/default.nix @@ -33,7 +33,7 @@ let sed -i '/management/d' CMakeLists.txt ''; - NIX_CFLAGS_COMPILE = toString ([ + env.NIX_CFLAGS_COMPILE = toString ([ "-Wno-error=deprecated-declarations" "-Wno-error=int-in-bool-context" "-Wno-error=maybe-uninitialized" From 18d41f1945c0cb7883554169c7a31ab6c9c2b73b Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 10 Nov 2019 02:08:01 +0100 Subject: [PATCH 067/323] treewide: use flat lists for *Inputs, fix env usage --- pkgs/applications/editors/emacs-modes/melpa-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/emacs-modes/melpa-packages.nix b/pkgs/applications/editors/emacs-modes/melpa-packages.nix index e15da80b3b1bc..7bce847df2b92 100644 --- a/pkgs/applications/editors/emacs-modes/melpa-packages.nix +++ b/pkgs/applications/editors/emacs-modes/melpa-packages.nix @@ -129,7 +129,7 @@ env NIXPKGS_ALLOW_BROKEN=1 nix-instantiate --show-trace ../../../../ -A emacsPac irony = super.irony.overrideAttrs (old: { cmakeFlags = old.cmakeFlags or [] ++ [ "-DCMAKE_INSTALL_BINDIR=bin" ]; - NIX_CFLAGS_COMPILE = "-UCLANG_RESOURCE_DIR"; + env.NIX_CFLAGS_COMPILE = "-UCLANG_RESOURCE_DIR"; preConfigure = '' cd server ''; From 0c6af8b788d45913ed55d0a26cc9374382930ec0 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 10 Nov 2019 02:13:39 +0100 Subject: [PATCH 068/323] treewide: fix types for mkDerivation params --- pkgs/applications/networking/mumble/default.nix | 2 +- pkgs/applications/science/logic/spass/default.nix | 1 + pkgs/development/lua-modules/overrides.nix | 4 ++-- pkgs/games/minetest/default.nix | 2 +- pkgs/servers/x11/xorg/overrides.nix | 2 +- pkgs/tools/filesystems/irods/default.nix | 2 +- pkgs/tools/misc/ldmtool/default.nix | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix index dfb49e14133f9..b92fa4b4741c4 100644 --- a/pkgs/applications/networking/mumble/default.nix +++ b/pkgs/applications/networking/mumble/default.nix @@ -85,7 +85,7 @@ let "CONFIG+=no-server" ]; - NIX_CFLAGS_COMPILE = optional speechdSupport "-I${speechd}/include/speech-dispatcher"; + env.NIX_CFLAGS_COMPILE = optional speechdSupport "-I${speechd}/include/speech-dispatcher"; installPhase = '' # bin stuff diff --git a/pkgs/applications/science/logic/spass/default.nix b/pkgs/applications/science/logic/spass/default.nix index ece6f0b9f6a85..d9ec4a5335a41 100644 --- a/pkgs/applications/science/logic/spass/default.nix +++ b/pkgs/applications/science/logic/spass/default.nix @@ -18,6 +18,7 @@ stdenv.mkDerivation { }; sourceRoot = "."; + dontMakeSourcesWritable = true; nativeBuildInputs = [ bison flex ]; diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index fd99a70de3a62..b4f1be6bc7344 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/pkgs/development/lua-modules/overrides.nix @@ -42,7 +42,7 @@ with super; ]; # https://github.com/wahern/cqueues/issues/227 - NIX_CFLAGS_COMPILE = with pkgs.stdenv; lib.optionalString hostPlatform.isDarwin + env.NIX_CFLAGS_COMPILE = with pkgs.stdenv; lib.optionalString hostPlatform.isDarwin "-DCLOCK_MONOTONIC -DCLOCK_REALTIME"; disabled = luaOlder "5.1" || luaAtLeast "5.4"; @@ -288,7 +288,7 @@ with super; nativeBuildInputs = [ pkgs.fixDarwinDylibNames ]; # Fixup linking libluv.dylib, for some reason it's not linked against lua correctly. - NIX_LDFLAGS = pkgs.lib.optionalString pkgs.stdenv.isDarwin + env.NIX_LDFLAGS = pkgs.lib.optionalString pkgs.stdenv.isDarwin (if isLuaJIT then "-lluajit-${lua.luaversion}" else "-llua"); }); }; diff --git a/pkgs/games/minetest/default.nix b/pkgs/games/minetest/default.nix index f286c359e6fc4..c896ac0c2665d 100644 --- a/pkgs/games/minetest/default.nix +++ b/pkgs/games/minetest/default.nix @@ -40,7 +40,7 @@ let "-DOpenGL_GL_PREFERENCE=GLVND" ]; - NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 + env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 nativeBuildInputs = [ cmake doxygen graphviz ]; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index c01bca007dc82..58e04ce22c927 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -405,7 +405,7 @@ self: super: }); xf86videoati = super.xf86videoati.overrideAttrs (attrs: { - NIX_CFLAGS_COMPILE = "-I${self.xorgserver.dev or self.xorgserver}/include/xorg"; + env.NIX_CFLAGS_COMPILE = "-I${self.xorgserver.dev or self.xorgserver}/include/xorg"; }); xf86videovmware = super.xf86videovmware.overrideAttrs (attrs: { diff --git a/pkgs/tools/filesystems/irods/default.nix b/pkgs/tools/filesystems/irods/default.nix index b6099c099f321..b82a4ad9521b9 100644 --- a/pkgs/tools/filesystems/irods/default.nix +++ b/pkgs/tools/filesystems/irods/default.nix @@ -31,7 +31,7 @@ in rec { patches = [ ./irods_root_path.patch ]; # fix build with recent llvm versions - NIX_CFLAGS_COMPILE = "-Wno-deprecated-register -Wno-deprecated-declarations"; + env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-register -Wno-deprecated-declarations"; preConfigure = common.preConfigure + '' patchShebangs ./test diff --git a/pkgs/tools/misc/ldmtool/default.nix b/pkgs/tools/misc/ldmtool/default.nix index 2ec683484958c..014e9c7d9bfbe 100644 --- a/pkgs/tools/misc/ldmtool/default.nix +++ b/pkgs/tools/misc/ldmtool/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { ''; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; configureScript = "sh autogen.sh"; From 860f0577b3adf58afd489107cb5829902b3b19f2 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 10 Nov 2019 19:57:17 +0100 Subject: [PATCH 069/323] glib: patch python3 shebangs for gdbus-codegen Fixes at least `gnome3.dconf` since `/usr/bin/env` is missing in the build sandbox. Tbh I'm not entirely sure what caused this (building `gnome3.dconf` from master works just fine), but this should fix a lot of stuff for now. --- pkgs/development/libraries/glib/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 0d98c9172df59..020fbd15f3754 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -149,6 +149,8 @@ stdenv.mkDerivation rec { # This file is *included* in gtk3 and would introduce runtime reference via __FILE__. sed '1i#line 1 "${pname}-${version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \ -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c + + patchShebangs "$dev/bin/gdbus-codegen" '' + optionalString (!stdenv.isDarwin) '' # Add gio-launch-desktop to $out so we can refer to it from $lib mkdir $out/bin From a7c1c3a7ded46eb9a52310fe02ad553f2c65ed89 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 10 Nov 2019 20:06:06 +0100 Subject: [PATCH 070/323] glib: fix all shebangs of scripts in $dev output --- pkgs/development/libraries/glib/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 020fbd15f3754..3e91688659efd 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -150,7 +150,7 @@ stdenv.mkDerivation rec { sed '1i#line 1 "${pname}-${version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \ -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c - patchShebangs "$dev/bin/gdbus-codegen" + patchShebangs "$dev/bin/" '' + optionalString (!stdenv.isDarwin) '' # Add gio-launch-desktop to $out so we can refer to it from $lib mkdir $out/bin From 4057a65a8d19e6166b8797b7911beade41a003f9 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 10 Nov 2019 20:06:23 +0100 Subject: [PATCH 071/323] treewide: mv NIX_LDFLAGS to `env.` --- pkgs/applications/graphics/gimp/plugins/default.nix | 4 ++-- pkgs/development/python-modules/tensorflow/default.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix index 0a06c42b5fc01..6a9b96d6d36c0 100644 --- a/pkgs/applications/graphics/gimp/plugins/default.nix +++ b/pkgs/applications/graphics/gimp/plugins/default.nix @@ -48,7 +48,7 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; { url = https://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2; sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql"; }; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; patchPhase = '' sed -e 's,^\(GIMP_PLUGIN_DIR=\).*,\1'"$out/${gimp.name}-plugins", \ -e 's,^\(GIMP_DATA_DIR=\).*,\1'"$out/share/${gimp.name}", -i configure @@ -141,7 +141,7 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; { Filters/Enhance/Wavelet sharpen */ name = "wavelet-sharpen-0.1.2"; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; src = fetchurl { url = http://registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz; sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw"; diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index 34282a5ec9373..6687d0d03c1b9 100644 --- a/pkgs/development/python-modules/tensorflow/default.nix +++ b/pkgs/development/python-modules/tensorflow/default.nix @@ -266,7 +266,7 @@ let ''; # FIXME: Tensorflow uses dlopen() for CUDA libraries. - NIX_LDFLAGS = lib.optionalString cudaSupport "-lcudart -lcublas -lcufft -lcurand -lcusolver -lcusparse -lcudnn"; + env.NIX_LDFLAGS = lib.optionalString cudaSupport "-lcudart -lcublas -lcufft -lcurand -lcusolver -lcusparse -lcudnn"; hardeningDisable = [ "format" ]; From 73b5b80459c1b77499a3e3abbe77f99785194e4c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 10 Nov 2019 23:09:56 +0100 Subject: [PATCH 072/323] Revert "glib: fix all shebangs of scripts in $dev output" This reverts commit 123172b656a099b2850bae6f2ab3ee62a7142cd6. --- pkgs/development/libraries/glib/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 3e91688659efd..020fbd15f3754 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -150,7 +150,7 @@ stdenv.mkDerivation rec { sed '1i#line 1 "${pname}-${version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \ -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c - patchShebangs "$dev/bin/" + patchShebangs "$dev/bin/gdbus-codegen" '' + optionalString (!stdenv.isDarwin) '' # Add gio-launch-desktop to $out so we can refer to it from $lib mkdir $out/bin From dd47dd9caa2dd3d622c5df9e5c4af5c87d56b526 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 10 Nov 2019 23:09:57 +0100 Subject: [PATCH 073/323] Revert "glib: patch python3 shebangs for gdbus-codegen" This reverts commit 326a1e0cd460cca6eec393dd6aa4bbf6bac28103. --- pkgs/development/libraries/glib/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 020fbd15f3754..0d98c9172df59 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -149,8 +149,6 @@ stdenv.mkDerivation rec { # This file is *included* in gtk3 and would introduce runtime reference via __FILE__. sed '1i#line 1 "${pname}-${version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \ -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c - - patchShebangs "$dev/bin/gdbus-codegen" '' + optionalString (!stdenv.isDarwin) '' # Add gio-launch-desktop to $out so we can refer to it from $lib mkdir $out/bin From e51ad14dd701bf1f146f34a761970a4a6591c576 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 11 Nov 2019 03:23:41 +0100 Subject: [PATCH 074/323] stdenv: fix fixupOutput hooks $output has to actually refer to the name of the output as it is used in the hooks --- pkgs/stdenv/generic/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 6e023da4b0d6c..744dd7c008bb9 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1107,8 +1107,8 @@ fixupPhase() { # Apply fixup to each output. local output - for output in ${outputs[@]}; do - prefix="${output}" runHook fixupOutput + for output in ${!outputs[@]}; do + prefix="${!output}" runHook fixupOutput done From b33a1c0f4ee9d21181c197d695108bf3549e547e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 11 Nov 2019 19:37:35 +0100 Subject: [PATCH 075/323] xorg.imake: fix build --- pkgs/servers/x11/xorg/overrides.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 58e04ce22c927..e08fc87b36742 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -63,7 +63,7 @@ self: super: x11BuildHook = ./imake.sh; patches = [./imake.patch ./imake-cc-wrapper-uberhack.patch]; setupHook = ./imake-setup-hook.sh; - CFLAGS = "-DIMAKE_COMPILETIME_CPP='\"${if stdenv.isDarwin + env.CFLAGS = "-DIMAKE_COMPILETIME_CPP='\"${if stdenv.isDarwin then "${tradcpp}/bin/cpp" else "gcc"}\"'"; From 8fb17e3285288bace98ce0290d0043eba74763ef Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 11 Nov 2019 19:47:50 +0100 Subject: [PATCH 076/323] libfaketime: fix build --- pkgs/development/libraries/libfaketime/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libfaketime/default.nix b/pkgs/development/libraries/libfaketime/default.nix index e57ea7b5b8263..ffc3410be388f 100644 --- a/pkgs/development/libraries/libfaketime/default.nix +++ b/pkgs/development/libraries/libfaketime/default.nix @@ -21,10 +21,11 @@ stdenv.mkDerivation rec { done ''; - PREFIX = placeholder "out"; - LIBDIRNAME = "/lib"; - - env.NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type -Wno-error=format-truncation"; + env = { + NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type -Wno-error=format-truncation"; + PREFIX = placeholder "out"; + LIBDIRNAME = "/lib"; + }; checkInputs = [ perl ]; From c375951e6aed2d907e74120352c062f64793339f Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 13 Nov 2019 14:17:33 +0100 Subject: [PATCH 077/323] rustc: fix build --- pkgs/development/compilers/rust/rustc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 716319b399b17..451960fcbc930 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -48,7 +48,7 @@ in stdenv.mkDerivation rec { ++ optional stdenv.isDarwin "-rpath ${llvmSharedForHost}/lib"); # Increase codegen units to introduce parallelism within the compiler. - RUSTFLAGS = "-Ccodegen-units=10"; + env.RUSTFLAGS = "-Ccodegen-units=10"; # We need rust to build rust. If we don't provide it, configure will try to download it. # Reference: https://github.com/rust-lang/rust/blob/master/src/bootstrap/configure.py From 41df050276c7eb5ea7589e6c7ef838f996d45f69 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 13 Nov 2019 18:21:14 +0100 Subject: [PATCH 078/323] make-derivation: assert that configureFlags is a flat list Otherwise, flags will be passed improperly to configure scripts (see also 62d375e3d7bbe752e24eb54a5bbef439021b9903 and https://hydra.nixos.org/build/106303610) --- pkgs/stdenv/generic/make-derivation.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index e91a641e9f876..9f70c49229582 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -292,7 +292,8 @@ in rec { deps; # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck - configureFlags = let inherit (lib) elem optional; in configureFlags + configureFlags = let inherit (lib) elem optional; in + assert (lib.all (n: !builtins.isList n && !builtins.isAttrs n) configureFlags); configureFlags ++ optional (elem "build" configurePlatforms) "--build=${stdenv.buildPlatform.config}" ++ optional (elem "host" configurePlatforms) "--host=${stdenv.hostPlatform.config}" ++ optional (elem "target" configurePlatforms) "--target=${stdenv.targetPlatform.config}"; From 79fc41ab3f2d5693e3c3d41365596f4de00b35cb Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 14 Nov 2019 00:40:34 +0100 Subject: [PATCH 079/323] go: fix build Please note that this won't fix too much leaf-pkgs, those appear to be pretty broken as those don't have an `out`-output. --- pkgs/development/compilers/go/1.12.nix | 66 +++++++++---------- pkgs/development/compilers/go/1.13.nix | 66 +++++++++---------- pkgs/development/compilers/go/1.4.nix | 20 +++--- .../go-packages/generic/default.nix | 6 +- 4 files changed, 78 insertions(+), 80 deletions(-) diff --git a/pkgs/development/compilers/go/1.12.nix b/pkgs/development/compilers/go/1.12.nix index b3b66fde2a153..16a66885d73de 100644 --- a/pkgs/development/compilers/go/1.12.nix +++ b/pkgs/development/compilers/go/1.12.nix @@ -149,36 +149,34 @@ stdenv.mkDerivation rec { find . -name '*.orig' -exec rm {} ';' ''; - GOOS = stdenv.targetPlatform.parsed.kernel.name; - GOARCH = goarch stdenv.targetPlatform; - # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. - # Go will nevertheless build a for host system that we will copy over in - # the install phase. - GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; - GOHOSTARCH = goarch stdenv.buildPlatform; - - # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those - # to be different from CC/CXX - CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc" - else - null; - CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++" - else - null; - - GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); - GO386 = 387; # from Arch: don't assume sse2 on i686 - CGO_ENABLED = 1; - # Hopefully avoids test timeouts on Hydra - GO_TEST_TIMEOUT_SCALE = 3; - - # Indicate that we are running on build infrastructure - # Some tests assume things like home directories and users exists - GO_BUILDER_NAME = "nix"; - - GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; + env = { + GOOS = stdenv.targetPlatform.parsed.kernel.name; + GOARCH = goarch stdenv.targetPlatform; + # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. + # Go will nevertheless build a for host system that we will copy over in + # the install phase. + GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; + GOHOSTARCH = goarch stdenv.buildPlatform; + + # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those + # to be different from CC/CXX + CC_FOR_TARGET = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"; + CXX_FOR_TARGET = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"; + + GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); + GO386 = 387; # from Arch: don't assume sse2 on i686 + CGO_ENABLED = 1; + # Hopefully avoids test timeouts on Hydra + GO_TEST_TIMEOUT_SCALE = 3; + + # Indicate that we are running on build infrastructure + # Some tests assume things like home directories and users exists + GO_BUILDER_NAME = "nix"; + + GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; + }; postConfigure = '' export GOCACHE=$TMPDIR/go-cache @@ -212,13 +210,13 @@ stdenv.mkDerivation rec { '' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then '' mv bin/*_*/* bin rmdir bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOHOSTOS}_${GOHOSTARCH} pkg/tool/${GOHOSTOS}_${GOHOSTARCH} + ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' + rm -rf pkg/${env.GOHOSTOS}_${env.GOHOSTARCH} pkg/tool/${env.GOHOSTOS}_${env.GOHOSTARCH} ''} '' else if (stdenv.hostPlatform != stdenv.targetPlatform) then '' rm -rf bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOOS}_${GOARCH} pkg/tool/${GOOS}_${GOARCH} + ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' + rm -rf pkg/${env.GOOS}_${env.GOARCH} pkg/tool/${env.GOOS}_${env.GOARCH} ''} '' else ""); diff --git a/pkgs/development/compilers/go/1.13.nix b/pkgs/development/compilers/go/1.13.nix index 6b7c99c074367..6b64759d6a5c1 100644 --- a/pkgs/development/compilers/go/1.13.nix +++ b/pkgs/development/compilers/go/1.13.nix @@ -146,36 +146,34 @@ stdenv.mkDerivation rec { find . -name '*.orig' -exec rm {} ';' ''; - GOOS = stdenv.targetPlatform.parsed.kernel.name; - GOARCH = goarch stdenv.targetPlatform; - # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. - # Go will nevertheless build a for host system that we will copy over in - # the install phase. - GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; - GOHOSTARCH = goarch stdenv.buildPlatform; - - # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those - # to be different from CC/CXX - CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc" - else - null; - CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++" - else - null; - - GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); - GO386 = 387; # from Arch: don't assume sse2 on i686 - CGO_ENABLED = 1; - # Hopefully avoids test timeouts on Hydra - GO_TEST_TIMEOUT_SCALE = 3; - - # Indicate that we are running on build infrastructure - # Some tests assume things like home directories and users exists - GO_BUILDER_NAME = "nix"; - - GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; + env = { + GOOS = stdenv.targetPlatform.parsed.kernel.name; + GOARCH = goarch stdenv.targetPlatform; + # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. + # Go will nevertheless build a for host system that we will copy over in + # the install phase. + GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; + GOHOSTARCH = goarch stdenv.buildPlatform; + + # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those + # to be different from CC/CXX + CC_FOR_TARGET = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"; + CXX_FOR_TARGET = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"; + + GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); + GO386 = 387; # from Arch: don't assume sse2 on i686 + CGO_ENABLED = 1; + # Hopefully avoids test timeouts on Hydra + GO_TEST_TIMEOUT_SCALE = 3; + + # Indicate that we are running on build infrastructure + # Some tests assume things like home directories and users exists + GO_BUILDER_NAME = "nix"; + + GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; + }; postConfigure = '' export GOCACHE=$TMPDIR/go-cache @@ -209,13 +207,13 @@ stdenv.mkDerivation rec { '' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then '' mv bin/*_*/* bin rmdir bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOHOSTOS}_${GOHOSTARCH} pkg/tool/${GOHOSTOS}_${GOHOSTARCH} + ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' + rm -rf pkg/${env.GOHOSTOS}_${env.GOHOSTARCH} pkg/tool/${env.GOHOSTOS}_${env.GOHOSTARCH} ''} '' else if (stdenv.hostPlatform != stdenv.targetPlatform) then '' rm -rf bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOOS}_${GOARCH} pkg/tool/${GOOS}_${GOARCH} + ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' + rm -rf pkg/${env.GOOS}_${env.GOARCH} pkg/tool/${env.GOOS}_${env.GOARCH} ''} '' else ""); diff --git a/pkgs/development/compilers/go/1.4.nix b/pkgs/development/compilers/go/1.4.nix index 0dd852a1ef168..71b84470871d6 100644 --- a/pkgs/development/compilers/go/1.4.nix +++ b/pkgs/development/compilers/go/1.4.nix @@ -128,15 +128,17 @@ stdenv.mkDerivation rec { }) ]; - GOOS = if stdenv.isDarwin then "darwin" else "linux"; - GOARCH = if stdenv.isDarwin then "amd64" - else if stdenv.hostPlatform.system == "i686-linux" then "386" - else if stdenv.hostPlatform.system == "x86_64-linux" then "amd64" - else if stdenv.isAarch32 then "arm" - else throw "Unsupported system"; - GOARM = stdenv.lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux") "5"; - GO386 = 387; # from Arch: don't assume sse2 on i686 - CGO_ENABLED = 0; + env = { + GOOS = if stdenv.isDarwin then "darwin" else "linux"; + GOARCH = if stdenv.isDarwin then "amd64" + else if stdenv.hostPlatform.system == "i686-linux" then "386" + else if stdenv.hostPlatform.system == "x86_64-linux" then "amd64" + else if stdenv.isAarch32 then "arm" + else throw "Unsupported system"; + GOARM = stdenv.lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux") "5"; + GO386 = 387; # from Arch: don't assume sse2 on i686 + CGO_ENABLED = 0; + }; # The go build actually checks for CC=*/clang and does something different, so we don't # just want the generic `cc` here. diff --git a/pkgs/development/go-packages/generic/default.nix b/pkgs/development/go-packages/generic/default.nix index 03d777d5c8801..691177d4a6f02 100644 --- a/pkgs/development/go-packages/generic/default.nix +++ b/pkgs/development/go-packages/generic/default.nix @@ -79,10 +79,10 @@ let ++ (lib.optional (!dontRenameImports) govers) ++ nativeBuildInputs; buildInputs = buildInputs; - inherit (go) GOOS GOARCH GO386 CGO_ENABLED; + inherit (go.env) GOOS GOARCH GO386 CGO_ENABLED; - GOHOSTARCH = go.GOHOSTARCH or null; - GOHOSTOS = go.GOHOSTOS or null; + GOHOSTARCH = go.env.GOHOSTARCH or null; + GOHOSTOS = go.env.GOHOSTOS or null; GO111MODULE = "off"; From e6763a26e9b82e7e3a173c82fadbfcd7afeedd8b Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 14 Nov 2019 14:56:08 +0100 Subject: [PATCH 080/323] buildGoPackage: fix builds Packages built with `buildGoPackage` provide a `bin` and an `out`-output. The first one for build artifacts, the second one for propagated build outputs. This caused a `failed to produce output-path`-error since the new implementation to determine the `propagaterOutput` used `dev` by default or the first listed output (which is `bin` for go packages), hence `$out` was never created which broke the build. However the old implementation in `multiple-outputs.sh` didn't check for `dev`, but for `$outputDev` which was either `dev` or `out`. Providing `out` as fallback if `dev` doesn't exist as propagaterOutput fixes the issue. --- pkgs/stdenv/generic/make-derivation.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 9f70c49229582..443795f7b352c 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -199,7 +199,11 @@ in rec { lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists propagatedDependencies)); - propagaterOutput = if lib.elem "dev" outputs then "dev" else lib.head outputs; + propagaterOutput = let + # mimic behavior from `multiple-outputs.sh` + find = n: default: lib.findFirst (x: n == x) default outputs; + outputDev = find "dev" (find "out" null); + in if lib.elem outputDev outputs then outputDev else lib.head outputs; propagatedBuildOutputs = attrs.propagatedBuildOutputs or (lib.filter (i: i != propagaterOutput && lib.elem i outputs) [ "out" "bin" "dev" "lib"]); From d2031a938d62c0ed45900ae2cd146513c3444181 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 14 Nov 2019 22:23:00 +0100 Subject: [PATCH 081/323] cargo: fix build --- pkgs/development/compilers/rust/cargo.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix index f639d330566de..f5f7d1126d2f7 100644 --- a/pkgs/development/compilers/rust/cargo.nix +++ b/pkgs/development/compilers/rust/cargo.nix @@ -21,10 +21,12 @@ rustPlatform.buildRustPackage { buildInputs = [ cacert file curl python3 openssl zlib libgit2 ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ]; - LIBGIT2_SYS_USE_PKG_CONFIG = 1; + env = { + LIBGIT2_SYS_USE_PKG_CONFIG = 1; - # fixes: the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel - RUSTC_BOOTSTRAP = 1; + # fixes: the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel + RUSTC_BOOTSTRAP = 1; + }; postInstall = '' # NOTE: We override the `http.cainfo` option usually specified in From 1e993f3838749bd24261a5aae91803a7d5cda1c0 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 15 Nov 2019 11:45:41 +0100 Subject: [PATCH 082/323] v8: fix build --- pkgs/development/libraries/v8/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/v8/default.nix b/pkgs/development/libraries/v8/default.nix index e85c655812896..24b2e3dc20761 100644 --- a/pkgs/development/libraries/v8/default.nix +++ b/pkgs/development/libraries/v8/default.nix @@ -70,7 +70,7 @@ stdenv.mkDerivation rec { mkdir -p $sourceRoot/${n} cp -r ${v}/* $sourceRoot/${n} '') deps)} - chmod u+w -R . + chmod u+w -R $sourceRoot/ ''; postPatch = stdenv.lib.optionalString stdenv.isAarch64 '' @@ -78,7 +78,7 @@ stdenv.mkDerivation rec { --replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""' ''; - gnFlags = [ + gnFlags = builtins.toString ([ "use_custom_libcxx=false" "is_clang=${if stdenv.cc.isClang then "true" else "false"}" "use_sysroot=false" @@ -95,7 +95,7 @@ stdenv.mkDerivation rec { # ''custom_toolchain="//build/toolchain/linux/unbundle:default"'' ''host_toolchain="//build/toolchain/linux/unbundle:default"'' ''v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"'' - ] ++ stdenv.lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"''; + ] ++ stdenv.lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"''); # with gcc8, -Wclass-memaccess became part of -Wall and causes logging limit # to be exceeded From bab34c101b44f7b5edcce7bc9464e28e810ce367 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 20 Nov 2019 09:21:30 +0100 Subject: [PATCH 083/323] treewide: configureFlags is a flat list --- .../development/go-modules/generic/default.nix | 18 ++++++++++-------- pkgs/stdenv/generic/make-derivation.nix | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 1bffb71e8f9db..0c24ae3487be6 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -49,12 +49,13 @@ let nativeBuildInputs = [ go git cacert ]; inherit (args) src; - inherit (go) GOOS GOARCH; + env = { + inherit (go.env) GOOS GOARCH; + GO111MODULE = "on"; + }; patches = args.patches or []; - GO111MODULE = "on"; - impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" ]; @@ -88,7 +89,7 @@ let ''; dontFixup = true; - }; in modArgs // ( + }; in lib.recursiveUpdate (modArgs // ( if modSha256 == null then { __noChroot = true; } else @@ -97,14 +98,15 @@ let outputHashAlgo = "sha256"; outputHash = modSha256; } - ) // overrideModAttrs modArgs); + )) // overrideModAttrs modArgs); package = go.stdenv.mkDerivation (args // { nativeBuildInputs = [ removeReferencesTo go ] ++ nativeBuildInputs; - inherit (go) GOOS GOARCH; - - GO111MODULE = "on"; + env = { + inherit (go.env) GOOS GOARCH; + GO111MODULE = "on"; + }; configurePhase = args.configurePhase or '' runHook preConfigure diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 443795f7b352c..175d93e3304db 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -297,7 +297,7 @@ in rec { # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck configureFlags = let inherit (lib) elem optional; in - assert (lib.all (n: !builtins.isList n && !builtins.isAttrs n) configureFlags); configureFlags + assert (lib.all (n: lib.isDerivation n || !builtins.isList n && !builtins.isAttrs n) configureFlags); configureFlags ++ optional (elem "build" configurePlatforms) "--build=${stdenv.buildPlatform.config}" ++ optional (elem "host" configurePlatforms) "--host=${stdenv.hostPlatform.config}" ++ optional (elem "target" configurePlatforms) "--target=${stdenv.targetPlatform.config}"; From e890a42d6eb24e20320c4c5eec57b722bd90ab54 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 20 Nov 2019 10:17:54 +0100 Subject: [PATCH 084/323] treewide: configureFlags is a flat list --- pkgs/applications/misc/lsd2dsl/default.nix | 2 +- pkgs/applications/misc/mlterm/default.nix | 1 + pkgs/applications/networking/cluster/kubernetes/default.nix | 2 +- pkgs/data/misc/geolite-legacy/builder.sh | 2 ++ pkgs/development/libraries/hiredis/default.nix | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/lsd2dsl/default.nix b/pkgs/applications/misc/lsd2dsl/default.nix index 5dd5fa0f5122f..cd3cb4ecc6114 100644 --- a/pkgs/applications/misc/lsd2dsl/default.nix +++ b/pkgs/applications/misc/lsd2dsl/default.nix @@ -16,7 +16,7 @@ mkDerivation rec { buildInputs = [ boost libvorbis libsndfile minizip gtest ]; - NIX_CFLAGS_COMPILE = "-Wno-error=unused-result"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-result"; installPhase = '' install -Dm755 lsd2dsl $out/bin/lsd2dsl diff --git a/pkgs/applications/misc/mlterm/default.nix b/pkgs/applications/misc/mlterm/default.nix index 9b16a92721993..505eaa9c952e0 100644 --- a/pkgs/applications/misc/mlterm/default.nix +++ b/pkgs/applications/misc/mlterm/default.nix @@ -39,6 +39,7 @@ stdenv.mkDerivation rec { --replace "-m 2755 -g utmp" " " \ --replace "-m 4755 -o root" " " ''; + env.NIX_LDFLAGS = " -L${stdenv.cc.cc.lib}/lib -lX11 -lgdk_pixbuf-2.0 -lcairo -lfontconfig -lfreetype -lXft diff --git a/pkgs/applications/networking/cluster/kubernetes/default.nix b/pkgs/applications/networking/cluster/kubernetes/default.nix index f852c3ac0a3a9..451b2c5afa6ea 100644 --- a/pkgs/applications/networking/cluster/kubernetes/default.nix +++ b/pkgs/applications/networking/cluster/kubernetes/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { postPatch = '' # go env breaks the sandbox substituteInPlace "hack/lib/golang.sh" \ - --replace 'echo "$(go env GOHOSTOS)/$(go env GOHOSTARCH)"' 'echo "${go.GOOS}/${go.GOARCH}"' + --replace 'echo "$(go env GOHOSTOS)/$(go env GOHOSTARCH)"' 'echo "${go.env.GOOS}/${go.env.GOARCH}"' substituteInPlace "hack/update-generated-docs.sh" --replace "make" "make SHELL=${stdenv.shell}" # hack/update-munge-docs.sh only performs some tests on the documentation. diff --git a/pkgs/data/misc/geolite-legacy/builder.sh b/pkgs/data/misc/geolite-legacy/builder.sh index 683b2e8606b8b..3ba76d5cd74c1 100644 --- a/pkgs/data/misc/geolite-legacy/builder.sh +++ b/pkgs/data/misc/geolite-legacy/builder.sh @@ -1,3 +1,5 @@ +source .attrs.sh + source "$stdenv/setup" mkdir -p $out/share/GeoIP diff --git a/pkgs/development/libraries/hiredis/default.nix b/pkgs/development/libraries/hiredis/default.nix index 6dc3871e1c184..0f8beafcc81bc 100644 --- a/pkgs/development/libraries/hiredis/default.nix +++ b/pkgs/development/libraries/hiredis/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "0ik38lwpmm780jqrry95ckf6flmvd172444p3q8d1k9n99jwij9c"; }; - PREFIX = "\${out}"; + env.PREFIX = "\${out}"; meta = with stdenv.lib; { homepage = https://github.com/redis/hiredis; From 89d28e9c3b4b2f28c3f92edb0302f48fa9cc1d49 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 20 Nov 2019 23:32:36 -0500 Subject: [PATCH 085/323] WIP: gcc-*: Start to merge and fix differences --- .../development/compilers/gcc/4.8/default.nix | 44 ++++++++++--------- .../development/compilers/gcc/4.9/default.nix | 44 ++++++++++--------- pkgs/development/compilers/gcc/5/default.nix | 44 ++++++++++--------- pkgs/development/compilers/gcc/6/default.nix | 44 ++++++++++--------- pkgs/development/compilers/gcc/7/default.nix | 28 ++++++------ pkgs/development/compilers/gcc/9/default.nix | 28 ++++++------ .../compilers/gcc/snapshot/default.nix | 28 ++++++------ 7 files changed, 137 insertions(+), 123 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 6ac1c6941af32..016dd0e73cccf 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -244,27 +244,29 @@ stdenv.mkDerivation ({ # compiler (after the specs for the cross-gcc are created). Having # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] - ++ optional (zlib != null) zlib - ++ optional langJava boehmgc - ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ] - )); - - LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] - ++ optional (zlib != null) zlib - ++ optional langJava boehmgc - ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ] - )); - - inherit - (import ../common/extra-target-flags.nix { - inherit stdenv crossStageStatic libcCross threadsCross; - }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS - ; + env = { + CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ++ optional langJava boehmgc + ++ optionals javaAwtGtk xlibs + ++ optionals javaAwtGtk [ gmp mpfr ] + ))); + + LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] + ++ optional (zlib != null) zlib + ++ optional langJava boehmgc + ++ optionals javaAwtGtk xlibs + ++ optionals javaAwtGtk [ gmp mpfr ] + ))); + + inherit + (import ../common/extra-target-flags.nix { + inherit stdenv crossStageStatic libcCross threadsCross; + }) + EXTRA_TARGET_FLAGS + EXTRA_TARGET_LDFLAGS + ; + }; passthru = { inherit langC langCC langObjC langObjCpp langFortran langGo version; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index ff2726d872cca..c9a87db4a80b3 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -250,27 +250,29 @@ stdenv.mkDerivation ({ # compiler (after the specs for the cross-gcc are created). Having # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] - ++ optional (zlib != null) zlib - ++ optional langJava boehmgc - ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ] - )); - - LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] - ++ optional (zlib != null) zlib - ++ optional langJava boehmgc - ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ] - )); - - inherit - (import ../common/extra-target-flags.nix { - inherit stdenv crossStageStatic libcCross threadsCross; - }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS - ; + env = { + CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ++ optional langJava boehmgc + ++ optionals javaAwtGtk xlibs + ++ optionals javaAwtGtk [ gmp mpfr ] + ))); + + LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] + ++ optional (zlib != null) zlib + ++ optional langJava boehmgc + ++ optionals javaAwtGtk xlibs + ++ optionals javaAwtGtk [ gmp mpfr ] + ))); + + inherit + (import ../common/extra-target-flags.nix { + inherit stdenv crossStageStatic libcCross threadsCross; + }) + EXTRA_TARGET_FLAGS + EXTRA_TARGET_LDFLAGS + ; + }; passthru = { inherit langC langCC langObjC langObjCpp langFortran langGo version; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index abb654b9fdbfd..517c79f9fc5f8 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -261,27 +261,29 @@ stdenv.mkDerivation ({ # compiler (after the specs for the cross-gcc are created). Having # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] - ++ optional (zlib != null) zlib - ++ optional langJava boehmgc - ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ] - )); - - LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] - ++ optional (zlib != null) zlib - ++ optional langJava boehmgc - ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ] - )); - - inherit - (import ../common/extra-target-flags.nix { - inherit stdenv crossStageStatic libcCross threadsCross; - }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS - ; + env = { + CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ++ optional langJava boehmgc + ++ optionals javaAwtGtk xlibs + ++ optionals javaAwtGtk [ gmp mpfr ] + ))); + + LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] + ++ optional (zlib != null) zlib + ++ optional langJava boehmgc + ++ optionals javaAwtGtk xlibs + ++ optionals javaAwtGtk [ gmp mpfr ] + ))); + + inherit + (import ../common/extra-target-flags.nix { + inherit stdenv crossStageStatic libcCross threadsCross; + }) + EXTRA_TARGET_FLAGS + EXTRA_TARGET_LDFLAGS + ; + }; passthru = { inherit langC langCC langObjC langObjCpp langFortran langGo version; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 41cbc29229a53..964d7e6a5251f 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -269,27 +269,29 @@ stdenv.mkDerivation ({ # compiler (after the specs for the cross-gcc are created). Having # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] - ++ optional (zlib != null) zlib - ++ optional langJava boehmgc - ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ] - )); - - LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] - ++ optional (zlib != null) zlib - ++ optional langJava boehmgc - ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ] - )); - - inherit - (import ../common/extra-target-flags.nix { - inherit stdenv crossStageStatic libcCross threadsCross; - }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS - ; + env = { + CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ++ optional langJava boehmgc + ++ optionals javaAwtGtk xlibs + ++ optionals javaAwtGtk [ gmp mpfr ] + ))); + + LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] + ++ optional (zlib != null) zlib + ++ optional langJava boehmgc + ++ optionals javaAwtGtk xlibs + ++ optionals javaAwtGtk [ gmp mpfr ] + ))); + + inherit + (import ../common/extra-target-flags.nix { + inherit stdenv crossStageStatic libcCross threadsCross; + }) + EXTRA_TARGET_FLAGS + EXTRA_TARGET_LDFLAGS + ; + }; passthru = { inherit langC langCC langObjC langObjCpp langFortran langGo version; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index dfc265dc34962..fb423620df522 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -235,19 +235,21 @@ stdenv.mkDerivation ({ # compiler (after the specs for the cross-gcc are created). Having # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] - ++ optional (zlib != null) zlib - ))); - - LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib))); - - inherit - (import ../common/extra-target-flags.nix { - inherit stdenv crossStageStatic libcCross threadsCross; - }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS - ; + env = { + CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ))); + + LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib))); + + inherit + (import ../common/extra-target-flags.nix { + inherit stdenv crossStageStatic libcCross threadsCross; + }) + EXTRA_TARGET_FLAGS + EXTRA_TARGET_LDFLAGS + ; + }; passthru = { inherit langC langCC langObjC langObjCpp langFortran langGo version; diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index 5cb19c44f83b0..1e685ab69a784 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -221,19 +221,21 @@ stdenv.mkDerivation ({ # compiler (after the specs for the cross-gcc are created). Having # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] - ++ optional (zlib != null) zlib - )); - - LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); - - inherit - (import ../common/extra-target-flags.nix { - inherit stdenv crossStageStatic libcCross threadsCross; - }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS - ; + env = { + CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ))); + + LIBRARY_PATH = optional (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); + + inherit + (import ../common/extra-target-flags.nix { + inherit stdenv crossStageStatic libcCross threadsCross; + }) + EXTRA_TARGET_FLAGS + EXTRA_TARGET_LDFLAGS + ; + }; passthru = { inherit langC langCC langObjC langObjCpp langFortran langGo version; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index fc0452c4ae0ae..2a02df0639a55 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -192,19 +192,21 @@ stdenv.mkDerivation ({ # compiler (after the specs for the cross-gcc are created). Having # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] - ++ optional (zlib != null) zlib - )); - - LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); - - inherit - (import ../common/extra-target-flags.nix { - inherit stdenv crossStageStatic libcCross threadsCross; - }) - EXTRA_TARGET_FLAGS - EXTRA_TARGET_LDFLAGS - ; + env = { + CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ))); + + LIBRARY_PATH = optional (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); + + inherit + (import ../common/extra-target-flags.nix { + inherit stdenv crossStageStatic libcCross threadsCross; + }) + EXTRA_TARGET_FLAGS + EXTRA_TARGET_LDFLAGS + ; + }; passthru = { inherit langC langCC langObjC langObjCpp langFortran langGo version; From 58d5dc416175a148804df774cc8d83a8ee2c3959 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 24 Nov 2019 17:14:28 +0100 Subject: [PATCH 086/323] treewide: structured-attrs fixes --- pkgs/applications/kde/print-manager.nix | 2 +- pkgs/development/compilers/gcc/9/default.nix | 19 ++++++++++--------- pkgs/tools/text/smu/default.nix | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/kde/print-manager.nix b/pkgs/applications/kde/print-manager.nix index f0501ffadee48..1f21ad8829e83 100644 --- a/pkgs/applications/kde/print-manager.nix +++ b/pkgs/applications/kde/print-manager.nix @@ -22,5 +22,5 @@ mkDerivation { outputs = [ "out" "dev" ]; # Fix build with cups deprecations etc. # See: https://github.com/NixOS/nixpkgs/issues/73334 - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations -Wno-error=format-security"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations -Wno-error=format-security"; } diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index 1e685ab69a784..e5e1906dbb54e 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -83,7 +83,6 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -164,8 +163,6 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - env.NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; - preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; inherit version hostPlatform langGo; @@ -209,9 +206,6 @@ stdenv.mkDerivation ({ installTargets = optional stripped "install-strip"; - # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. # @@ -225,9 +219,11 @@ stdenv.mkDerivation ({ CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ))); - - LIBRARY_PATH = optional (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); - + + LIBRARY_PATH = optionalString (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); + + NIX_NO_SELF_RPATH = true; + inherit (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; @@ -235,6 +231,11 @@ stdenv.mkDerivation ({ EXTRA_TARGET_FLAGS EXTRA_TARGET_LDFLAGS ; + } // optionalAttrs hostPlatform.isSunOS { + NIX_LDFLAGS = "-lm -ldl"; + } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { + # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 + CC = "gcc -m64"; }; passthru = { diff --git a/pkgs/tools/text/smu/default.nix b/pkgs/tools/text/smu/default.nix index 50bceb4fcb347..0a36666ad5cc4 100644 --- a/pkgs/tools/text/smu/default.nix +++ b/pkgs/tools/text/smu/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { }; # _FORTIFY_SOURCE requires compiling with optimization (-O) - NIX_CFLAGS_COMPILE = "-O"; + env.NIX_CFLAGS_COMPILE = "-O"; makeFlags = [ "PREFIX=${placeholder "out"}" From f508397dab0de9f04c44eedf4b8b8d045cdc29f2 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 24 Nov 2019 19:16:06 +0000 Subject: [PATCH 087/323] gcc: Clean up and minimize differences --- .../development/compilers/gcc/4.8/default.nix | 52 +++++++++--------- .../development/compilers/gcc/4.9/default.nix | 52 +++++++++--------- pkgs/development/compilers/gcc/5/default.nix | 54 ++++++++++--------- pkgs/development/compilers/gcc/6/default.nix | 54 ++++++++++--------- pkgs/development/compilers/gcc/7/default.nix | 46 ++++++++-------- pkgs/development/compilers/gcc/8/default.nix | 8 +-- pkgs/development/compilers/gcc/9/default.nix | 43 ++++++++------- .../compilers/gcc/snapshot/default.nix | 46 ++++++++-------- 8 files changed, 189 insertions(+), 166 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 016dd0e73cccf..f29fd3d0a080a 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -127,7 +127,6 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -227,38 +226,39 @@ stdenv.mkDerivation ({ installTargets = optional stripped "install-strip"; - # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; - - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the - # library headers and binaries, regarless of the language being compiled. - # - # Note: When building the Java AWT GTK peer, the build system doesn't honor - # `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add - # them to $CPATH and $LIBRARY_PATH in this case. - # - # Likewise, the LTO code doesn't find zlib. - # - # Cross-compiling, we need gcc not to read ./specs in order to build the g++ - # compiler (after the specs for the cross-gcc are created). Having - # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - env = { - CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + NIX_NO_SELF_RPATH = true; + + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. + # + # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. + + CPATH = toString (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ))); - - LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] + )); + + # Per https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html only + # affects native buidls, but should be fine for cross. + LIBRARY_PATH = toString (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ))); - + )); + inherit (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; @@ -266,6 +266,10 @@ stdenv.mkDerivation ({ EXTRA_TARGET_FLAGS EXTRA_TARGET_LDFLAGS ; + NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { + # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 + CC = "gcc -m64"; }; passthru = { diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index c9a87db4a80b3..8d517cf146fd1 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -133,7 +133,6 @@ stdenv.mkDerivation ({ outputs = if langJava || langGo then ["out" "man" "info"] else [ "out" "lib" "man" "info" ]; setOutputFlags = false; - env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -233,38 +232,39 @@ stdenv.mkDerivation ({ installTargets = optional stripped "install-strip"; - # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; - - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the - # library headers and binaries, regarless of the language being compiled. - # - # Note: When building the Java AWT GTK peer, the build system doesn't honor - # `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add - # them to $CPATH and $LIBRARY_PATH in this case. - # - # Likewise, the LTO code doesn't find zlib. - # - # Cross-compiling, we need gcc not to read ./specs in order to build the g++ - # compiler (after the specs for the cross-gcc are created). Having - # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - env = { - CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + NIX_NO_SELF_RPATH = true; + + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. + # + # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. + + CPATH = toString (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ))); - - LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] + )); + + # Per https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html only + # affects native buidls, but should be fine for cross. + LIBRARY_PATH = toString (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ))); - + )); + inherit (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; @@ -272,6 +272,10 @@ stdenv.mkDerivation ({ EXTRA_TARGET_FLAGS EXTRA_TARGET_LDFLAGS ; + NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { + # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 + CC = "gcc -m64"; }; passthru = { diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 517c79f9fc5f8..3d3393b2e52e9 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -121,7 +121,6 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -196,8 +195,6 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - env.NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; - preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; inherit version hostPlatform langJava langGo; @@ -244,38 +241,39 @@ stdenv.mkDerivation ({ installTargets = optional stripped "install-strip"; - # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; - - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the - # library headers and binaries, regarless of the language being compiled. - # - # Note: When building the Java AWT GTK peer, the build system doesn't honor - # `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add - # them to $CPATH and $LIBRARY_PATH in this case. - # - # Likewise, the LTO code doesn't find zlib. - # - # Cross-compiling, we need gcc not to read ./specs in order to build the g++ - # compiler (after the specs for the cross-gcc are created). Having - # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - env = { - CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + NIX_NO_SELF_RPATH = true; + + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. + # + # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. + + CPATH = toString (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ))); - - LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] + )); + + # Per https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html only + # affects native buidls, but should be fine for cross. + LIBRARY_PATH = toString (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ))); - + )); + inherit (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; @@ -283,6 +281,10 @@ stdenv.mkDerivation ({ EXTRA_TARGET_FLAGS EXTRA_TARGET_LDFLAGS ; + NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { + # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 + CC = "gcc -m64"; }; passthru = { diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 964d7e6a5251f..04ad0c3bd8e51 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -124,7 +124,6 @@ stdenv.mkDerivation ({ outputs = if langJava || langGo then ["out" "man" "info"] else [ "out" "lib" "man" "info" ]; setOutputFlags = false; - env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -204,8 +203,6 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - env.NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; - preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; inherit version hostPlatform langJava langGo; @@ -252,38 +249,39 @@ stdenv.mkDerivation ({ installTargets = optional stripped "install-strip"; - # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; - - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the - # library headers and binaries, regarless of the language being compiled. - # - # Note: When building the Java AWT GTK peer, the build system doesn't honor - # `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add - # them to $CPATH and $LIBRARY_PATH in this case. - # - # Likewise, the LTO code doesn't find zlib. - # - # Cross-compiling, we need gcc not to read ./specs in order to build the g++ - # compiler (after the specs for the cross-gcc are created). Having - # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - env = { - CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + NIX_NO_SELF_RPATH = true; + + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. + # + # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. + + CPATH = toString (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ))); - - LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] + )); + + # Per https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html only + # affects native buidls, but should be fine for cross. + LIBRARY_PATH = toString (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ))); - + )); + inherit (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; @@ -291,6 +289,10 @@ stdenv.mkDerivation ({ EXTRA_TARGET_FLAGS EXTRA_TARGET_LDFLAGS ; + NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { + # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 + CC = "gcc -m64"; }; passthru = { diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index fb423620df522..8f3353de3f8bc 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -92,7 +92,6 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -173,9 +172,6 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument"; - env.NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; - preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; inherit version hostPlatform langGo; @@ -223,25 +219,28 @@ stdenv.mkDerivation ({ installTargets = optional stripped "install-strip"; - # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; - - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the - # library headers and binaries, regarless of the language being compiled. - # - # Likewise, the LTO code doesn't find zlib. - # - # Cross-compiling, we need gcc not to read ./specs in order to build the g++ - # compiler (after the specs for the cross-gcc are created). Having - # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - env = { - CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + NIX_NO_SELF_RPATH = true; + + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. + + CPATH = toString (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib - ))); - - LIBRARY_PATH = toString (optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib))); - + )); + + # Per https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html only + # affects native buidls, but should be fine for cross. + LIBRARY_PATH = toString (makeLibraryPath ([] + ++ optional (zlib != null) zlib + )); + inherit (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; @@ -249,6 +248,11 @@ stdenv.mkDerivation ({ EXTRA_TARGET_FLAGS EXTRA_TARGET_LDFLAGS ; + NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument"; + } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { + # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 + CC = "gcc -m64"; }; passthru = { diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 545eb3dca6e30..5c9e6bb4d48ee 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -132,10 +132,10 @@ stdenv.mkDerivation ({ ) else "") + stdenv.lib.optionalString targetPlatform.isAvr '' - makeFlagsArray+=( - 'LIMITS_H_TEST=false' - ) - ''; + makeFlagsArray+=( + 'LIMITS_H_TEST=false' + ) + ''; inherit noSysDirs staticCompiler crossStageStatic libcCross crossMingw; diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index e5e1906dbb54e..cec4f3748de51 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -131,10 +131,10 @@ stdenv.mkDerivation ({ ) else "") + stdenv.lib.optionalString targetPlatform.isAvr '' - makeFlagsArray+=( - 'LIMITS_H_TEST=false' - ) - ''; + makeFlagsArray+=( + 'LIMITS_H_TEST=false' + ) + ''; inherit noSysDirs staticCompiler crossStageStatic libcCross crossMingw; @@ -206,23 +206,27 @@ stdenv.mkDerivation ({ installTargets = optional stripped "install-strip"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the - # library headers and binaries, regarless of the language being compiled. - # - # Likewise, the LTO code doesn't find zlib. - # - # Cross-compiling, we need gcc not to read ./specs in order to build the g++ - # compiler (after the specs for the cross-gcc are created). Having - # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - env = { - CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] - ++ optional (zlib != null) zlib - ))); + NIX_NO_SELF_RPATH = true; - LIBRARY_PATH = optionalString (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - NIX_NO_SELF_RPATH = true; + CPATH = toString (makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + )); + + # Per https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html only + # affects native buidls, but should be fine for cross. + LIBRARY_PATH = toString (makeLibraryPath ([] + ++ optional (zlib != null) zlib + )); inherit (import ../common/extra-target-flags.nix { @@ -231,8 +235,7 @@ stdenv.mkDerivation ({ EXTRA_TARGET_FLAGS EXTRA_TARGET_LDFLAGS ; - } // optionalAttrs hostPlatform.isSunOS { - NIX_LDFLAGS = "-lm -ldl"; + NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = "gcc -m64"; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 2a02df0639a55..547b67062eb25 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -80,7 +80,6 @@ stdenv.mkDerivation ({ outputs = [ "out" "lib" "man" "info" ]; setOutputFlags = false; - env.NIX_NO_SELF_RPATH = true; libc_dev = stdenv.cc.libc_dev; @@ -131,8 +130,6 @@ stdenv.mkDerivation ({ depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; - env.NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; - preConfigure = import ../common/pre-configure.nix { inherit (stdenv) lib; inherit version hostPlatform langGo; @@ -173,32 +170,34 @@ stdenv.mkDerivation ({ (if profiledCompiler then "profiledbootstrap" else "bootstrap"); dontStrip = !stripped; - env.NIX_STRIP_DEBUG = !stripped; installTargets = if stripped then "install-strip" else "install"; - # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; - - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the - # library headers and binaries, regarless of the language being compiled. - # - # Likewise, the LTO code doesn't find zlib. - # - # Cross-compiling, we need gcc not to read ./specs in order to build the g++ - # compiler (after the specs for the cross-gcc are created). Having - # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - env = { - CPATH = toString (optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] + NIX_NO_SELF_RPATH = true; + + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. + + CPATH = toString (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib - ))); - - LIBRARY_PATH = optional (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); - + )); + + # Per https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html only + # affects native buidls, but should be fine for cross. + LIBRARY_PATH = toString (makeLibraryPath ([] + ++ optional (zlib != null) zlib + )); + inherit (import ../common/extra-target-flags.nix { inherit stdenv crossStageStatic libcCross threadsCross; @@ -206,6 +205,11 @@ stdenv.mkDerivation ({ EXTRA_TARGET_FLAGS EXTRA_TARGET_LDFLAGS ; + NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + NIX_STRIP_DEBUG = !stripped; + } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { + # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 + CC = "gcc -m64"; }; passthru = { From 3383f6bdecb93213e17a2efc1d5bedc9d9e3f4d3 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 31 Dec 2019 03:38:57 +0100 Subject: [PATCH 088/323] fixup! treewide: configureFlags is a flat list --- pkgs/development/go-modules/generic/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 0c24ae3487be6..b7b2a82d1fca5 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -98,7 +98,7 @@ let outputHashAlgo = "sha256"; outputHash = modSha256; } - )) // overrideModAttrs modArgs); + )) (overrideModAttrs modArgs)); package = go.stdenv.mkDerivation (args // { nativeBuildInputs = [ removeReferencesTo go ] ++ nativeBuildInputs; From 5239aeda52a4d4c04960b576f668764c26a09e29 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 31 Dec 2019 04:26:53 +0100 Subject: [PATCH 089/323] fixup! ninja: fix for structured attrs --- pkgs/development/compilers/swift/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix index cc64b7c7ebffe..43c58dab1442d 100644 --- a/pkgs/development/compilers/swift/default.nix +++ b/pkgs/development/compilers/swift/default.nix @@ -259,7 +259,7 @@ stdenv.mkDerivation { # TODO: investigate the non-working tests checkPhase = '' checkTarget=check-swift-all - ninjaFlags=('-C buildbot_linux/swift-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}') + ninjaFlags=('-C' 'buildbot_linux/swift-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}') ninjaCheckPhase ''; From 8e85d2730414cdc2d5212f801cc571bbb545b917 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 23 Jan 2020 14:25:06 +0100 Subject: [PATCH 090/323] audiofile: use env. with a string --- pkgs/development/libraries/audiofile/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/audiofile/default.nix b/pkgs/development/libraries/audiofile/default.nix index 680b585643b74..5b738983fd311 100644 --- a/pkgs/development/libraries/audiofile/default.nix +++ b/pkgs/development/libraries/audiofile/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { }; # fix build with gcc9 - NIX_CFLAGS_LINK = lib.optional (stdenv.system == "i686-linux") "-lgcc"; + env.NIX_CFLAGS_LINK = lib.optionalString (stdenv.system == "i686-linux") "-lgcc"; patches = [ ./gcc-6.patch From df715ebb4337ee17790256c087d9f27fd4a2869e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 1 Apr 2020 12:26:49 +0200 Subject: [PATCH 091/323] Revert "ruby: workaround __toString issue with toJSON" This reverts commit ceb5346aaefbd86ff9cabd657c947eed735326c7. Fixed in nix --- pkgs/development/interpreters/ruby/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index b68f17c604f11..8ddd19bb40cc9 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -25,7 +25,6 @@ let generic = { version, sha256 }: let ver = version; - versionString = version.__toString version; tag = ver.gitTag; atLeast27 = lib.versionAtLeast ver.majMin "2.7"; baseruby = self.override { @@ -57,7 +56,7 @@ let }: stdenv.mkDerivation rec { pname = "ruby"; - version = versionString; + inherit version; src = if useRailsExpress then fetchFromGitHub { owner = "ruby"; From c1854d86168c4036656ed76edf05cc66ad244dc0 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 1 Apr 2020 14:25:11 +0200 Subject: [PATCH 092/323] treewide: fix sconsFlags handling --- pkgs/applications/graphics/fluxus/default.nix | 5 ++--- pkgs/development/libraries/serf/default.nix | 18 +++++++++------- .../development/libraries/swiften/default.nix | 6 ++---- .../tools/build-managers/scons/setup-hook.sh | 10 ++++----- pkgs/development/tools/godot/default.nix | 7 +++---- pkgs/development/tools/nsis/default.nix | 2 +- pkgs/games/globulation/default.nix | 21 +++++++++++-------- pkgs/games/the-powder-toy/default.nix | 2 +- pkgs/misc/emulators/fceux/default.nix | 7 ++++++- pkgs/servers/gpsd/default.nix | 5 ++--- pkgs/servers/nosql/mongodb/mongodb.nix | 5 ++--- pkgs/servers/sql/mariadb/galera/default.nix | 6 +++++- 12 files changed, 52 insertions(+), 42 deletions(-) diff --git a/pkgs/applications/graphics/fluxus/default.nix b/pkgs/applications/graphics/fluxus/default.nix index e31b5fae9c4d9..2fe9efe5595ea 100644 --- a/pkgs/applications/graphics/fluxus/default.nix +++ b/pkgs/applications/graphics/fluxus/default.nix @@ -78,10 +78,9 @@ stdenv.mkDerivation rec { "RacketLib=${racket}/lib/racket" "LIBPATH=${stdenv.lib.makeLibraryPath libs}" "DESTDIR=build" + "Prefix=${placeholder "out"}" ]; - configurePhase = '' - sconsFlags+=" Prefix=$out" - ''; + installPhase = '' mkdir -p $out cp -r build$out/* $out/ diff --git a/pkgs/development/libraries/serf/default.nix b/pkgs/development/libraries/serf/default.nix index 3fd47125bcb30..0aa738d720553 100644 --- a/pkgs/development/libraries/serf/default.nix +++ b/pkgs/development/libraries/serf/default.nix @@ -17,14 +17,18 @@ stdenv.mkDerivation rec { prefixKey = "PREFIX="; + sconsFlags = [ + "OPENSSL=${openssl}" + "ZLIB=${zlib}" + ] ++ stdenv.lib.optional (!stdenv.isCygwin) + "GSSAPI=${kerberos.dev}"; + preConfigure = '' - sconsFlags+=" APR=$(echo ${apr.dev}/bin/*-config)" - sconsFlags+=" APU=$(echo ${aprutil.dev}/bin/*-config)" - sconsFlags+=" CC=$CC" - sconsFlags+=" OPENSSL=${openssl}" - sconsFlags+=" ZLIB=${zlib}" - '' + stdenv.lib.optionalString (!stdenv.isCygwin) '' - sconsFlags+=" GSSAPI=${kerberos.dev}" + sconsFlags+=( + "APR=$(echo ${apr.dev}/bin/*-config)" + "APU=$(echo ${aprutil.dev}/bin/*-config)" + "CC=$CC" + ) ''; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/swiften/default.nix b/pkgs/development/libraries/swiften/default.nix index edf882894a5b3..d124fb6e989e0 100644 --- a/pkgs/development/libraries/swiften/default.nix +++ b/pkgs/development/libraries/swiften/default.nix @@ -20,10 +20,8 @@ stdenv.mkDerivation rec { "boost_libdir=${boost.out}/lib" "boost_bundled_enable=false" ]; - preInstall = '' - installTargets="$out" - installFlags+=" SWIFT_INSTALLDIR=$out" - ''; + installFlags = [ "SWIFT_INSTALLDIR=${placeholder "out"}" ]; + installTargets = [ "${placeholder "out"}" ]; enableParallelBuilding = true; diff --git a/pkgs/development/tools/build-managers/scons/setup-hook.sh b/pkgs/development/tools/build-managers/scons/setup-hook.sh index 0b908f68286b5..76e6deb328910 100644 --- a/pkgs/development/tools/build-managers/scons/setup-hook.sh +++ b/pkgs/development/tools/build-managers/scons/setup-hook.sh @@ -11,8 +11,8 @@ sconsBuildPhase() { local flagsArray=( ${enableParallelBuilding:+-j${NIX_BUILD_CORES}} - $sconsFlags ${sconsFlagsArray[@]} - $buildFlags ${buildFlagsArray[@]} + ${sconsFlags[@]} + ${buildFlags[@]} ${buildFlagsArray[@]} ) echoCmd 'build flags' "${flagsArray[@]}" @@ -33,8 +33,8 @@ sconsInstallPhase() { fi local flagsArray=( - $sconsFlags ${sconsFlagsArray[@]} - $installFlags ${installFlagsArray[@]} + ${sconsFlags[@]} + ${installFlags[@]} ${installFlagsArray[@]} ${installTargets:-install} ) @@ -60,7 +60,7 @@ sconsCheckPhase() { else local flagsArray=( ${enableParallelChecking:+-j${NIX_BUILD_CORES}} - $sconsFlags ${sconsFlagsArray[@]} + ${sconsFlags[@]} ${checkFlagsArray[@]} ) diff --git a/pkgs/development/tools/godot/default.nix b/pkgs/development/tools/godot/default.nix index 832d30ee8e874..09ddb94fa5fad 100644 --- a/pkgs/development/tools/godot/default.nix +++ b/pkgs/development/tools/godot/default.nix @@ -33,10 +33,9 @@ in stdenv.mkDerivation rec { enableParallelBuilding = true; - sconsFlags = "target=release_debug platform=x11"; - preConfigure = '' - sconsFlags+=" ${lib.concatStringsSep " " (lib.mapAttrsToList (k: v: "${k}=${builtins.toJSON v}") options)}" - ''; + sconsFlags = [ + "target=release_debug" "platform=x11" + ] ++ (lib.mapAttrsToList (k: v: "${k}=${builtins.toJSON v}") options); outputs = [ "out" "dev" "man" ]; diff --git a/pkgs/development/tools/nsis/default.nix b/pkgs/development/tools/nsis/default.nix index 683d07ed49646..96e7b1df71311 100644 --- a/pkgs/development/tools/nsis/default.nix +++ b/pkgs/development/tools/nsis/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { ]; preBuild = '' - sconsFlagsArray+=("PATH=$PATH") + sconsFlags+=("PATH=$PATH") ''; prefixKey = "PREFIX="; diff --git a/pkgs/games/globulation/default.nix b/pkgs/games/globulation/default.nix index fae87423b18af..5169523332ca6 100644 --- a/pkgs/games/globulation/default.nix +++ b/pkgs/games/globulation/default.nix @@ -19,11 +19,13 @@ stdenv.mkDerivation rec { sha256 = "1f0l2cqp2g3llhr9jl6jj15k0wb5q8n29vqj99xy4p5hqs78jk8g"; }; - patches = [ ./header-order.patch ./public-buildproject.patch + patches = [ + ./header-order.patch + ./public-buildproject.patch (fetchpatch { - url = https://bitbucket.org/giszmo/glob2/commits/c9dc715624318e4fea4abb24e04f0ebdd9cd8d2a/raw; - sha256 = "0017xg5agj3dy0hx71ijdcrxb72bjqv7x6aq7c9zxzyyw0mkxj0k"; - }) + url = https://bitbucket.org/giszmo/glob2/commits/c9dc715624318e4fea4abb24e04f0ebdd9cd8d2a/raw; + sha256 = "0017xg5agj3dy0hx71ijdcrxb72bjqv7x6aq7c9zxzyyw0mkxj0k"; + }) ]; postPatch = '' @@ -35,11 +37,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ sconsPackages.scons_3_0_1 ]; buildInputs = [ libGLU libGL SDL SDL_ttf SDL_image zlib SDL_net speex libvorbis libogg boost fribidi bsdiff ]; - postConfigure = '' - sconsFlags+=" BINDIR=$out/bin" - sconsFlags+=" INSTALLDIR=$out/share/globulation2" - sconsFlags+=" DATADIR=$out/share/globulation2/glob2" - ''; + sconsFlags = [ + "BINDIR=${placeholder "out"}/bin" + "INSTALLDIR=${placeholder "out"}/share/globulation2" + "DATADIR=${placeholder "out"}/share/globulation2/glob2" + ]; env.NIX_LDFLAGS = "-lboost_system"; @@ -49,5 +51,6 @@ stdenv.mkDerivation rec { platforms = platforms.linux; license = licenses.gpl3; }; + passthru.updateInfo.downloadPage = "http://globulation2.org/wiki/Download_and_Install"; } diff --git a/pkgs/games/the-powder-toy/default.nix b/pkgs/games/the-powder-toy/default.nix index b0901fcb9a0f3..e9acf66017be2 100644 --- a/pkgs/games/the-powder-toy/default.nix +++ b/pkgs/games/the-powder-toy/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ SDL2 lua fftwFloat zlib bzip2 ]; - sconsFlags = "--tool="; + sconsFlags = [ "--tool=" ]; installPhase = '' install -Dm 755 build/powder* "$out/bin/powder" diff --git a/pkgs/misc/emulators/fceux/default.nix b/pkgs/misc/emulators/fceux/default.nix index 58a6a1dd44223..bd4d0f3570542 100644 --- a/pkgs/misc/emulators/fceux/default.nix +++ b/pkgs/misc/emulators/fceux/default.nix @@ -16,7 +16,12 @@ stdenv.mkDerivation { zlib SDL lua5_1 ]; - sconsFlags = "OPENGL=false GTK=false CREATE_AVI=false LOGO=false"; + sconsFlags = [ + "OPENGL=false" + "GTK=false" + "CREATE_AVI=false" + "LOGO=false" + ]; prefixKey = "--prefix="; # sed allows scons to find libraries in nix. diff --git a/pkgs/servers/gpsd/default.nix b/pkgs/servers/gpsd/default.nix index 8ea060a82552b..ef9b92c7df27d 100644 --- a/pkgs/servers/gpsd/default.nix +++ b/pkgs/servers/gpsd/default.nix @@ -51,9 +51,6 @@ stdenv.mkDerivation rec { preBuild = '' patchShebangs . sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConstruct - - sconsFlags+=" udevdir=$out/lib/udev" - sconsFlags+=" python_libdir=$out/lib/${python2Packages.python.libPrefix}/site-packages" ''; sconsFlags = [ @@ -61,6 +58,8 @@ stdenv.mkDerivation rec { "gpsd_user=${gpsdUser}" "gpsd_group=${gpsdGroup}" "systemd=yes" + "udevdir=${placeholder "out"}/lib/udev" + "python_libdir=${placeholder "out"}/lib/${python2Packages.python.libPrefix}/site-packages" ]; preCheck = '' diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 439b702ddad2a..bf27d265b2144 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -86,10 +86,9 @@ in stdenv.mkDerivation rec { ] ++ map (lib: "--use-system-${lib}") system-libraries; preBuild = '' - sconsFlags+=" CC=$CC" - sconsFlags+=" CXX=$CXX" + sconsFlags+=("CC=$CC" "CXX=$CXX") '' + optionalString stdenv.isAarch64 '' - sconsFlags+=" CCFLAGS='-march=armv8-a+crc'" + sconsFlags+=("CCFLAGS='-march=armv8-a+crc'") ''; preInstall = '' diff --git a/pkgs/servers/sql/mariadb/galera/default.nix b/pkgs/servers/sql/mariadb/galera/default.nix index 73d37ba11a220..f568ac7f195bc 100644 --- a/pkgs/servers/sql/mariadb/galera/default.nix +++ b/pkgs/servers/sql/mariadb/galera/default.nix @@ -34,7 +34,11 @@ in stdenv.mkDerivation { export LIBPATH="${galeraLibs}/lib" ''; - sconsFlags = "ssl=1 system_asio=1 strict_build_flags=0"; + sconsFlags = [ + "ssl=1" + "system_asio=1" + "strict_build_flags=0" + ]; enableParallelBuilding = true; From 7d80da31c7994b08362ba6fd995d69eeed60f753 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Fri, 3 Apr 2020 17:21:33 +0200 Subject: [PATCH 093/323] stdenv/linux: fix iconv support in libunistring --- pkgs/stdenv/linux/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 60c0730dce1f7..3d110800d424d 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -239,7 +239,7 @@ in # Apparently iconv won't work with bootstrap glibc, but it will be used # with glibc built later where we keep *this* build of libunistring, # so we need to trick it into supporting libiconv. - am_cv_func_iconv_works = "yes"; + env = { am_cv_func_iconv_works = "yes"; } // attrs.env or {}; }); libidn2 = super.libidn2.overrideAttrs (attrs: { postFixup = attrs.postFixup or "" + '' From cbfdbbfdf84cc614d20b1cbd5026e2ff8973a867 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 4 Apr 2020 15:46:08 +0200 Subject: [PATCH 094/323] perl-modules: fix building --- .../perl-modules/generic/default.nix | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pkgs/development/perl-modules/generic/default.nix b/pkgs/development/perl-modules/generic/default.nix index 79c7919a35414..d19ed42e22045 100644 --- a/pkgs/development/perl-modules/generic/default.nix +++ b/pkgs/development/perl-modules/generic/default.nix @@ -19,17 +19,19 @@ toPerlModule(stdenv.mkDerivation ( checkTarget = "test"; - # Prevent CPAN downloads. - PERL_AUTOINSTALL = "--skipdeps"; - - # From http://wiki.cpantesters.org/wiki/CPANAuthorNotes: "allows - # authors to skip certain tests (or include certain tests) when - # the results are not being monitored by a human being." - AUTOMATED_TESTING = true; - - # current directory (".") is removed from @INC in Perl 5.26 but many old libs rely on it - # https://metacpan.org/pod/release/XSAWYERX/perl-5.26.0/pod/perldelta.pod#Removal-of-the-current-directory-%28%22.%22%29-from-@INC - PERL_USE_UNSAFE_INC = "1"; + env = { + # Prevent CPAN downloads. + PERL_AUTOINSTALL = "--skipdeps"; + + # From http://wiki.cpantesters.org/wiki/CPANAuthorNotes: "allows + # authors to skip certain tests (or include certain tests) when + # the results are not being monitored by a human being." + AUTOMATED_TESTING = true; + + # current directory (".") is removed from @INC in Perl 5.26 but many old libs rely on it + # https://metacpan.org/pod/release/XSAWYERX/perl-5.26.0/pod/perldelta.pod#Removal-of-the-current-directory-%28%22.%22%29-from-@INC + PERL_USE_UNSAFE_INC = "1"; + }; meta.homepage = "https://metacpan.org/release/${lib.getName attrs}"; # TODO: phase-out `attrs.name` meta.platforms = perl.meta.platforms; From 24df1f0d067c4989c54eeff461ab1252a8ff6c0d Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 4 Apr 2020 15:56:47 +0200 Subject: [PATCH 095/323] rubyPackages.nokogiri: fix build --- pkgs/development/ruby-modules/gem-config/default.nix | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix index 0041aa91c40bd..7992f4543270b 100644 --- a/pkgs/development/ruby-modules/gem-config/default.nix +++ b/pkgs/development/ruby-modules/gem-config/default.nix @@ -375,14 +375,9 @@ in nokogiri = attrs: { buildFlags = [ "--use-system-libraries" - "--with-zlib-dir=${zlib.dev}" - "--with-xml2-lib=${libxml2.out}/lib" - "--with-xml2-include=${libxml2.dev}/include/libxml2" - "--with-xslt-lib=${libxslt.out}/lib" - "--with-xslt-include=${libxslt.dev}/include" - "--with-exslt-lib=${libxslt.out}/lib" - "--with-exslt-include=${libxslt.dev}/include" ] ++ lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}"; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ zlib libxml2 libxslt ]; }; opus-ruby = attrs: { From e5276c7fd9d13e5412376018268846d1f9a558b0 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 4 Apr 2020 15:58:05 +0200 Subject: [PATCH 096/323] makeFontsCache: fix for structuredAttrs --- pkgs/development/libraries/fontconfig/make-fonts-cache.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/fontconfig/make-fonts-cache.nix b/pkgs/development/libraries/fontconfig/make-fonts-cache.nix index f1a2e865bb73b..a6f8ccd1be43a 100644 --- a/pkgs/development/libraries/fontconfig/make-fonts-cache.nix +++ b/pkgs/development/libraries/fontconfig/make-fonts-cache.nix @@ -1,11 +1,10 @@ -{ runCommand, lib, fontconfig, fontDirectories }: +{ runCommand, lib, fontconfig, jq, fontDirectories }: runCommand "fc-cache" { - nativeBuildInputs = [ fontconfig.bin ]; + nativeBuildInputs = [ fontconfig.bin jq ]; preferLocalBuild = true; allowSubstitutes = false; - passAsFile = [ "fontDirs" ]; fontDirs = '' ${lib.concatStringsSep "\n" (map (font: "${font}") fontDirectories)} @@ -21,7 +20,7 @@ runCommand "fc-cache" ${fontconfig.out}/etc/fonts/fonts.conf $out EOF - cat "$fontDirsPath" >> fonts.conf + <.attrs.json jq .fontDirs >> fonts.conf echo "" >> fonts.conf mkdir -p $out From d8d10e520fedd08fcd567a81c4ce09f402c8d50e Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 4 Apr 2020 16:01:14 +0200 Subject: [PATCH 097/323] linux: fix build with structuredAttrs --- pkgs/os-specific/linux/kernel/generic.nix | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index e6e1bd842363a..fb4db82c070f5 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -1,6 +1,7 @@ { buildPackages , callPackage , perl +, jq , bison ? null , flex ? null , gmp ? null @@ -96,20 +97,21 @@ let pname = "linux-config"; inherit version; - generateConfig = ./generate-config.pl; - - kernelConfig = kernelConfigFun intermediateNixConfig; - passAsFile = [ "kernelConfig" ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = [ perl gmp libmpc mpfr ] + nativeBuildInputs = [ perl gmp libmpc mpfr jq ] ++ lib.optionals (stdenv.lib.versionAtLeast version "4.16") [ bison flex ]; - platformName = stdenv.hostPlatform.platform.name; - # e.g. "defconfig" - kernelBaseConfig = if defconfig != null then defconfig else stdenv.hostPlatform.platform.kernelBaseConfig; - # e.g. "bzImage" - kernelTarget = stdenv.hostPlatform.platform.kernelTarget; + kernelConfig = "${kernelConfigFun intermediateNixConfig}"; + + env = { + generateConfig = "${./generate-config.pl}"; + platformName = stdenv.hostPlatform.platform.name; + # e.g. "defconfig" + kernelBaseConfig = if defconfig != null then defconfig else stdenv.hostPlatform.platform.kernelBaseConfig; + # e.g. "bzImage" + kernelTarget = stdenv.hostPlatform.platform.kernelTarget; + }; prePatch = kernel.prePatch + '' # Patch kconfig to print "###" after every question so that @@ -132,7 +134,7 @@ let # Create the config file. echo "generating kernel configuration..." - ln -s "$kernelConfigPath" "$buildRoot/kernel-config" + jq -r <../.attrs.json '.kernelConfig' > "$buildRoot/kernel-config" DEBUG=1 ARCH=$kernelArch KERNEL_CONFIG="$buildRoot/kernel-config" AUTO_MODULES=$autoModules \ PREFER_BUILTIN=$preferBuiltin BUILD_ROOT="$buildRoot" SRC=. perl -w $generateConfig ''; From 7b4ac78035902276de9e32de75f4e18e1a37ae83 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 4 Apr 2020 16:01:51 +0200 Subject: [PATCH 098/323] sudo: fix structuredAttrs build --- pkgs/tools/security/sudo/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/sudo/default.nix b/pkgs/tools/security/sudo/default.nix index 842509888b415..40c5a82f53b73 100644 --- a/pkgs/tools/security/sudo/default.nix +++ b/pkgs/tools/security/sudo/default.nix @@ -45,8 +45,15 @@ stdenv.mkDerivation rec { #undef _PATH_MV #define _PATH_MV "${coreutils}/bin/mv" EOF - makeFlags="install_uid=$(id -u) install_gid=$(id -g)" - installFlags="sudoers_uid=$(id -u) sudoers_gid=$(id -g) sysconfdir=$out/etc rundir=$TMPDIR/dummy vardir=$TMPDIR/dummy DESTDIR=/" + makeFlagsArray+=("install_uid=$(id -u)" "install_gid=$(id -g)") + installFlagsArray+=( + "sudoers_uid=$(id -u)" + "sudoers_gid=$(id -g)" + "sysconfdir=$out/etc" + "rundir=$TMPDIR/dummy" + "vardir=$TMPDIR/dummy" + "DESTDIR=/" + ) ''; nativeBuildInputs = [ groff ]; From c829aab57c149b304adce6aa78f206b2aeccc5f8 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 4 Apr 2020 19:17:15 +0200 Subject: [PATCH 099/323] go_1_14: fix structuredAttrs build --- pkgs/development/compilers/go/1.14.nix | 66 +++++++++++++------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/pkgs/development/compilers/go/1.14.nix b/pkgs/development/compilers/go/1.14.nix index b8038a5d9dd0c..4c9be54bbdcab 100644 --- a/pkgs/development/compilers/go/1.14.nix +++ b/pkgs/development/compilers/go/1.14.nix @@ -148,36 +148,34 @@ stdenv.mkDerivation rec { find . -name '*.orig' -exec rm {} ';' ''; - GOOS = stdenv.targetPlatform.parsed.kernel.name; - GOARCH = goarch stdenv.targetPlatform; - # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. - # Go will nevertheless build a for host system that we will copy over in - # the install phase. - GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; - GOHOSTARCH = goarch stdenv.buildPlatform; - - # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those - # to be different from CC/CXX - CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc" - else - null; - CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++" - else - null; - - GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); - GO386 = 387; # from Arch: don't assume sse2 on i686 - CGO_ENABLED = 1; - # Hopefully avoids test timeouts on Hydra - GO_TEST_TIMEOUT_SCALE = 3; - - # Indicate that we are running on build infrastructure - # Some tests assume things like home directories and users exists - GO_BUILDER_NAME = "nix"; - - GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; + env = { + GOOS = stdenv.targetPlatform.parsed.kernel.name; + GOARCH = goarch stdenv.targetPlatform; + # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. + # Go will nevertheless build a for host system that we will copy over in + # the install phase. + GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; + GOHOSTARCH = goarch stdenv.buildPlatform; + + # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those + # to be different from CC/CXX + CC_FOR_TARGET = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"; + CXX_FOR_TARGET = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"; + + GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); + GO386 = 387; # from Arch: don't assume sse2 on i686 + CGO_ENABLED = 1; + # Hopefully avoids test timeouts on Hydra + GO_TEST_TIMEOUT_SCALE = 3; + + # Indicate that we are running on build infrastructure + # Some tests assume things like home directories and users exists + GO_BUILDER_NAME = "nix"; + + GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; + }; postConfigure = '' export GOCACHE=$TMPDIR/go-cache @@ -211,13 +209,13 @@ stdenv.mkDerivation rec { '' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then '' mv bin/*_*/* bin rmdir bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOHOSTOS}_${GOHOSTARCH} pkg/tool/${GOHOSTOS}_${GOHOSTARCH} + ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' + rm -rf pkg/${env.GOHOSTOS}_${env.GOHOSTARCH} pkg/tool/${env.GOHOSTOS}_${env.GOHOSTARCH} ''} '' else if (stdenv.hostPlatform != stdenv.targetPlatform) then '' rm -rf bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOOS}_${GOARCH} pkg/tool/${GOOS}_${GOARCH} + ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' + rm -rf pkg/${env.GOOS}_${env.GOARCH} pkg/tool/${env.GOOS}_${env.GOARCH} ''} '' else ""); From 25fcd7b25a939f92baae4dee0a4e0be7f1ecbdae Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 4 Apr 2020 19:21:31 +0200 Subject: [PATCH 100/323] ghc883: fix structuredAttrs build --- pkgs/development/compilers/ghc/8.8.3.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.8.3.nix b/pkgs/development/compilers/ghc/8.8.3.nix index e4ece9b8d8c16..237b03080f516 100644 --- a/pkgs/development/compilers/ghc/8.8.3.nix +++ b/pkgs/development/compilers/ghc/8.8.3.nix @@ -73,7 +73,7 @@ let ''; # Splicer will pull out correct variations - libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] + libDeps = platform: stdenv.lib.optional enableTerminfo ncurses ++ [libffi] ++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; @@ -158,10 +158,10 @@ stdenv.mkDerivation (rec { "--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [ + ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ + ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ From 476067a87343ce0928fb60b037e3d66978d0b370 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 4 Apr 2020 21:50:27 +0200 Subject: [PATCH 101/323] treewide: fix structured-attrs eval errors --- pkgs/applications/audio/faust/faust2.nix | 4 +--- pkgs/applications/blockchains/monero-gui/default.nix | 2 +- pkgs/applications/editors/hexcurse/default.nix | 5 ++++- pkgs/applications/graphics/apngasm/2.nix | 2 +- .../instant-messengers/pantalaimon/default.nix | 10 +++++----- .../networking/mailreaders/claws-mail/gtk3.nix | 2 +- .../networking/sniffers/ettercap/default.nix | 2 +- pkgs/applications/science/biology/minia/default.nix | 2 +- pkgs/applications/science/biology/niftyreg/default.nix | 2 +- pkgs/desktops/cinnamon/cjs/spidermonkey_52.nix | 2 +- pkgs/desktops/cinnamon/xapps/default.nix | 4 +--- .../gnome-3/extensions/workspace-matrix/default.nix | 2 +- .../gnome-3/misc/gnome-screensaver/default.nix | 2 +- pkgs/desktops/mate/mate-utils/default.nix | 2 +- pkgs/desktops/plasma-5/plasma-workspace/default.nix | 2 +- pkgs/development/compilers/llvm/10/compiler-rt.nix | 5 ++--- pkgs/development/compilers/llvm/8/compiler-rt.nix | 5 ++--- pkgs/development/compilers/llvm/9/compiler-rt.nix | 5 ++--- pkgs/development/compilers/openjdk/openjfx/11.nix | 6 +++--- pkgs/development/compilers/openjdk/openjfx/13.nix | 6 +++--- pkgs/development/libraries/libicns/default.nix | 2 +- pkgs/development/libraries/libvirt/5.9.0.nix | 2 +- pkgs/development/libraries/opae/default.nix | 5 +---- pkgs/development/libraries/rocksdb/default.nix | 2 +- pkgs/development/tools/misc/ddd/default.nix | 2 +- .../development/tools/misc/intel-gpu-tools/default.nix | 2 +- pkgs/development/tools/ocaml/dune/2.nix | 2 +- pkgs/development/tools/phantomjs2/default.nix | 2 +- pkgs/games/cataclysm-dda/default.nix | 2 +- pkgs/misc/gnash/default.nix | 2 +- pkgs/os-specific/linux/odp-dpdk/default.nix | 2 +- pkgs/servers/monitoring/nagios/default.nix | 2 +- pkgs/servers/osrm-backend/default.nix | 2 +- pkgs/servers/sql/cockroachdb/default.nix | 3 ++- pkgs/tools/misc/pipelight/default.nix | 2 +- pkgs/tools/networking/pmacct/default.nix | 4 ++-- pkgs/tools/security/trousers/default.nix | 2 +- pkgs/tools/system/clinfo/default.nix | 2 +- pkgs/tools/system/facter/default.nix | 5 ++--- pkgs/top-level/perl-packages.nix | 2 +- 40 files changed, 57 insertions(+), 64 deletions(-) diff --git a/pkgs/applications/audio/faust/faust2.nix b/pkgs/applications/audio/faust/faust2.nix index cca0e21f83582..2c96d59444898 100644 --- a/pkgs/applications/audio/faust/faust2.nix +++ b/pkgs/applications/audio/faust/faust2.nix @@ -58,9 +58,7 @@ let cd build ''; - cmakeFlags = '' - -C ../backends/all.cmake -C ../targets/all.cmake .. - ''; + cmakeFlags = [ "-C ../backends/all.cmake" "-C ../targets/all.cmake .." ]; postInstall = '' # syntax error when eval'd directly diff --git a/pkgs/applications/blockchains/monero-gui/default.nix b/pkgs/applications/blockchains/monero-gui/default.nix index 980e20d04b756..e5f4a0040e0fc 100644 --- a/pkgs/applications/blockchains/monero-gui/default.nix +++ b/pkgs/applications/blockchains/monero-gui/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { cppzmq hidapi libusb protobuf randomx ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=format-security" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-security"; patches = [ ./move-log-file.patch ]; diff --git a/pkgs/applications/editors/hexcurse/default.nix b/pkgs/applications/editors/hexcurse/default.nix index c87694321f35e..614628b91507d 100644 --- a/pkgs/applications/editors/hexcurse/default.nix +++ b/pkgs/applications/editors/hexcurse/default.nix @@ -10,8 +10,11 @@ stdenv.mkDerivation rec { rev = "v${version}"; sha256 = "17ckkxfzbqvvfdnh10if4aqdcq98q3vl6dn1v6f4lhr4ifnyjdlk"; }; + buildInputs = [ ncurses ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-overflow" "-Wno-error=stringop-truncation" ]; + + env.NIX_CFLAGS_COMPILE = "-Wno-error=stringop-overflow -Wno-error=stringop-truncation"; + patches = [ # gcc7 compat (fetchpatch { diff --git a/pkgs/applications/graphics/apngasm/2.nix b/pkgs/applications/graphics/apngasm/2.nix index 166bc135c1936..17277c32d8477 100644 --- a/pkgs/applications/graphics/apngasm/2.nix +++ b/pkgs/applications/graphics/apngasm/2.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { rm -rf libpng zlib zopfli ''; - NIX_CFLAGS_LINK = "-lzopfli"; + env.NIX_CFLAGS_LINK = "-lzopfli"; installPhase = '' install -Dt $out/bin apngasm diff --git a/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix b/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix index c7d8ce4b56d55..89708a2fbc63d 100644 --- a/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix +++ b/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix @@ -32,11 +32,11 @@ buildPythonApplication rec { matrix-nio peewee prompt_toolkit - ] ++ lib.optional enableDbusUi [ - dbus-python - notify2 - pygobject3 - pydbus + ] ++ lib.optionals enableDbusUi [ + dbus-python + notify2 + pygobject3 + pydbus ]; checkInputs = [ diff --git a/pkgs/applications/networking/mailreaders/claws-mail/gtk3.nix b/pkgs/applications/networking/mailreaders/claws-mail/gtk3.nix index 1e1909e7109a5..fa6dcc8f5b0ea 100644 --- a/pkgs/applications/networking/mailreaders/claws-mail/gtk3.nix +++ b/pkgs/applications/networking/mailreaders/claws-mail/gtk3.nix @@ -109,7 +109,7 @@ stdenv.mkDerivation rec { cp claws-mail.desktop $out/share/applications ''; - NIX_CFLAGS_COMPILE = [ "-Wno-deprecated-declarations" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations"; meta = { description = "The user-friendly, lightweight, and fast email client"; diff --git a/pkgs/applications/networking/sniffers/ettercap/default.nix b/pkgs/applications/networking/sniffers/ettercap/default.nix index c548098baa7ef..621c9413e0c3f 100644 --- a/pkgs/applications/networking/sniffers/ettercap/default.nix +++ b/pkgs/applications/networking/sniffers/ettercap/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { ]; # TODO: Remove after the next release (0.8.4 should work without this): - NIX_CFLAGS_COMPILE = [ "-I${harfbuzz.dev}/include/harfbuzz" ]; + env.NIX_CFLAGS_COMPILE = "-I${harfbuzz.dev}/include/harfbuzz"; meta = with stdenv.lib; { description = "Comprehensive suite for man in the middle attacks"; diff --git a/pkgs/applications/science/biology/minia/default.nix b/pkgs/applications/science/biology/minia/default.nix index 2a80de733b08f..d3e4a726b52b8 100644 --- a/pkgs/applications/science/biology/minia/default.nix +++ b/pkgs/applications/science/biology/minia/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { patches = [ ./no-bundle.patch ]; - NIX_CFLAGS_COMPILE = [ "-Wformat" ]; + env.NIX_CFLAGS_COMPILE = "-Wformat"; nativeBuildInputs = [ cmake ]; buildInputs = [ hdf5 boost ]; diff --git a/pkgs/applications/science/biology/niftyreg/default.nix b/pkgs/applications/science/biology/niftyreg/default.nix index 48bd1b21ecd6c..e1aa30bdb19f5 100644 --- a/pkgs/applications/science/biology/niftyreg/default.nix +++ b/pkgs/applications/science/biology/niftyreg/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "07v9v9s41lvw72wpb1jgh2nzanyc994779bd35p76vg8mzifmprl"; }; - NIX_CFLAGS_COMPILE = [ "-Wno-error=narrowing" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=narrowing"; nativeBuildInputs = [ cmake ]; buildInputs = [ zlib ]; diff --git a/pkgs/desktops/cinnamon/cjs/spidermonkey_52.nix b/pkgs/desktops/cinnamon/cjs/spidermonkey_52.nix index 87f670c8c099d..d5fa8df6181cd 100644 --- a/pkgs/desktops/cinnamon/cjs/spidermonkey_52.nix +++ b/pkgs/desktops/cinnamon/cjs/spidermonkey_52.nix @@ -21,7 +21,7 @@ in stdenv.mkDerivation { # on ARMv6 causes polkit testsuite to break with an assertion failure in spidermonkey. # These flags were stolen from: # https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/js52 - NIX_CFLAGS_COMPILE = "-fno-delete-null-pointer-checks -fno-strict-aliasing -fno-tree-vrp"; + env.NIX_CFLAGS_COMPILE = "-fno-delete-null-pointer-checks -fno-strict-aliasing -fno-tree-vrp"; patches = [ # needed to build gnome3.gjs diff --git a/pkgs/desktops/cinnamon/xapps/default.nix b/pkgs/desktops/cinnamon/xapps/default.nix index ff02720e8021d..5969c190a086b 100644 --- a/pkgs/desktops/cinnamon/xapps/default.nix +++ b/pkgs/desktops/cinnamon/xapps/default.nix @@ -32,9 +32,7 @@ stdenv.mkDerivation rec { }; # TODO: https://github.com/NixOS/nixpkgs/issues/36468 - NIX_CFLAGS_COMPILE = [ - "-I${glib.dev}/include/gio-unix-2.0" - ]; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; patches = [ (fetchpatch { # details see https://github.com/linuxmint/xapps/pull/65 diff --git a/pkgs/desktops/gnome-3/extensions/workspace-matrix/default.nix b/pkgs/desktops/gnome-3/extensions/workspace-matrix/default.nix index ca4b72111c6c6..32ce0a0cd98e1 100644 --- a/pkgs/desktops/gnome-3/extensions/workspace-matrix/default.nix +++ b/pkgs/desktops/gnome-3/extensions/workspace-matrix/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { glib ]; - buildFlags = "schemas"; + buildFlags = [ "schemas" ]; installPhase = '' mkdir -p $out/share/gnome-shell/extensions diff --git a/pkgs/desktops/gnome-3/misc/gnome-screensaver/default.nix b/pkgs/desktops/gnome-3/misc/gnome-screensaver/default.nix index 4a530e54de716..6aa3e45672a3a 100644 --- a/pkgs/desktops/gnome-3/misc/gnome-screensaver/default.nix +++ b/pkgs/desktops/gnome-3/misc/gnome-screensaver/default.nix @@ -71,7 +71,7 @@ stdenv.mkDerivation rec { systemd ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=return-type" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=return-type"; configureFlags = [ "--enable-locking" "--with-systemd=yes" ]; diff --git a/pkgs/desktops/mate/mate-utils/default.nix b/pkgs/desktops/mate/mate-utils/default.nix index e36ff69a6fa7f..f81af57ddf1d3 100644 --- a/pkgs/desktops/mate/mate-utils/default.nix +++ b/pkgs/desktops/mate/mate-utils/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { hicolor-icon-theme ]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; enableParallelBuilding = true; diff --git a/pkgs/desktops/plasma-5/plasma-workspace/default.nix b/pkgs/desktops/plasma-5/plasma-workspace/default.nix index 6aa0e3b573820..833548474ea05 100644 --- a/pkgs/desktops/plasma-5/plasma-workspace/default.nix +++ b/pkgs/desktops/plasma-5/plasma-workspace/default.nix @@ -48,7 +48,7 @@ mkDerivation { ]; - NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = toString [ ''-DNIXPKGS_XMESSAGE="${getBin xmessage}/bin/xmessage"'' ''-DNIXPKGS_XRDB="${getBin xrdb}/bin/xrdb"'' ''-DNIXPKGS_XSETROOT="${getBin xsetroot}/bin/xsetroot"'' diff --git a/pkgs/development/compilers/llvm/10/compiler-rt.nix b/pkgs/development/compilers/llvm/10/compiler-rt.nix index 8c870a610cc2c..706c8aa70c9ea 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/10/compiler-rt.nix @@ -7,9 +7,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake python3 llvm ]; buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi; - NIX_CFLAGS_COMPILE = [ - "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" - ]; + env.NIX_CFLAGS_COMPILE = + "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"; cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false) [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" diff --git a/pkgs/development/compilers/llvm/8/compiler-rt.nix b/pkgs/development/compilers/llvm/8/compiler-rt.nix index 795c81f421967..45a7c3feda9c6 100644 --- a/pkgs/development/compilers/llvm/8/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/8/compiler-rt.nix @@ -16,9 +16,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake python3 llvm ]; buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi; - NIX_CFLAGS_COMPILE = [ - "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" - ]; + env.NIX_CFLAGS_COMPILE = + "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"; cmakeFlags = stdenv.lib.optionals (useLLVM || stdenv.isDarwin) [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" diff --git a/pkgs/development/compilers/llvm/9/compiler-rt.nix b/pkgs/development/compilers/llvm/9/compiler-rt.nix index 0cfd8d7c9e723..d4e4fbb657785 100644 --- a/pkgs/development/compilers/llvm/9/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/9/compiler-rt.nix @@ -16,9 +16,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake python3 llvm ]; buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi; - NIX_CFLAGS_COMPILE = [ - "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" - ]; + env.NIX_CFLAGS_COMPILE = + "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"; cmakeFlags = stdenv.lib.optionals (useLLVM || stdenv.isDarwin) [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" diff --git a/pkgs/development/compilers/openjdk/openjfx/11.nix b/pkgs/development/compilers/openjdk/openjfx/11.nix index 9def2c8c9e08b..4f9f6afdeb8fa 100644 --- a/pkgs/development/compilers/openjdk/openjfx/11.nix +++ b/pkgs/development/compilers/openjdk/openjfx/11.nix @@ -11,7 +11,7 @@ let java = openjdk11-bootstrap; }).gradle_4_10; - makePackage = args: stdenv.mkDerivation ({ + makePackage = args: stdenv.mkDerivation (lib.recursiveUpdate { version = "${major}${update}-${build}"; src = fetchurl { @@ -30,7 +30,7 @@ let '' + args.gradleProperties or ""); #avoids errors about deprecation of GTypeDebugFlags, GTimeVal, etc. - NIX_CFLAGS_COMPILE = [ "-DGLIB_DISABLE_DEPRECATION_WARNINGS" ]; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; buildPhase = '' runHook preBuild @@ -42,7 +42,7 @@ let runHook postBuild ''; - } // args); + } args); # Fake build to pre-download deps into fixed-output derivation. # We run nearly full build because I see no other way to download everything that's needed. diff --git a/pkgs/development/compilers/openjdk/openjfx/13.nix b/pkgs/development/compilers/openjdk/openjfx/13.nix index f94940a800324..e8aecdd2eef29 100644 --- a/pkgs/development/compilers/openjdk/openjfx/13.nix +++ b/pkgs/development/compilers/openjdk/openjfx/13.nix @@ -11,7 +11,7 @@ let java = openjdk11_headless; }).gradle_4_10; - makePackage = args: stdenv.mkDerivation ({ + makePackage = args: stdenv.mkDerivation (lib.recursiveUpdate { version = "${major}${update}-${build}"; src = fetchurl { @@ -30,7 +30,7 @@ let '' + args.gradleProperties or ""); #avoids errors about deprecation of GTypeDebugFlags, GTimeVal, etc. - NIX_CFLAGS_COMPILE = [ "-DGLIB_DISABLE_DEPRECATION_WARNINGS" ]; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; buildPhase = '' runHook preBuild @@ -42,7 +42,7 @@ let runHook postBuild ''; - } // args); + } args); # Fake build to pre-download deps into fixed-output derivation. # We run nearly full build because I see no other way to download everything that's needed. diff --git a/pkgs/development/libraries/libicns/default.nix b/pkgs/development/libraries/libicns/default.nix index 27ec8b17c0d20..82d43e3e4a0a8 100644 --- a/pkgs/development/libraries/libicns/default.nix +++ b/pkgs/development/libraries/libicns/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ libpng openjpeg ]; - NIX_CFLAGS_COMPILE = [ "-I${openjpeg.dev}/include/${openjpeg.incDir}" ]; + env.NIX_CFLAGS_COMPILE = "-I${openjpeg.dev}/include/${openjpeg.incDir}"; meta = with stdenv.lib; { description = "Library for manipulation of the Mac OS icns resource format"; diff --git a/pkgs/development/libraries/libvirt/5.9.0.nix b/pkgs/development/libraries/libvirt/5.9.0.nix index 3a57a91a22ae3..e8813123ec2c4 100644 --- a/pkgs/development/libraries/libvirt/5.9.0.nix +++ b/pkgs/development/libraries/libvirt/5.9.0.nix @@ -120,7 +120,7 @@ in stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-fno-stack-protector"; + env.NIX_CFLAGS_COMPILE = "-fno-stack-protector"; meta = { homepage = http://libvirt.org/; diff --git a/pkgs/development/libraries/opae/default.nix b/pkgs/development/libraries/opae/default.nix index 46b03720d16cb..ffa5c070fcc75 100644 --- a/pkgs/development/libraries/opae/default.nix +++ b/pkgs/development/libraries/opae/default.nix @@ -20,10 +20,7 @@ stdenv.mkDerivation rec { doCheck = false; - NIX_CFLAGS_COMPILE = [ - "-Wno-error=format-truncation" - "-Wno-error=address-of-packed-member" - ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation -Wno-error=address-of-packed-member"; nativeBuildInputs = [ cmake doxygen perl python2Packages.sphinx ]; buildInputs = [ libuuid json_c python2 ]; diff --git a/pkgs/development/libraries/rocksdb/default.nix b/pkgs/development/libraries/rocksdb/default.nix index 2d3d1e8d722d9..bedfab6f3416b 100644 --- a/pkgs/development/libraries/rocksdb/default.nix +++ b/pkgs/development/libraries/rocksdb/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { substituteInPlace CMakeLists.txt --replace "find_package(zlib " "find_package(ZLIB " ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move"; cmakeFlags = [ "-DPORTABLE=1" diff --git a/pkgs/development/tools/misc/ddd/default.nix b/pkgs/development/tools/misc/ddd/default.nix index 1ff9691876683..da9687195c5f7 100644 --- a/pkgs/development/tools/misc/ddd/default.nix +++ b/pkgs/development/tools/misc/ddd/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { patches = [ ./gcc44.patch ]; - NIX_CFLAGS_COMPILE = "-fpermissive"; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; meta = { homepage = https://www.gnu.org/software/ddd; diff --git a/pkgs/development/tools/misc/intel-gpu-tools/default.nix b/pkgs/development/tools/misc/intel-gpu-tools/default.nix index 19556aeafc01d..3fa6465f2da82 100644 --- a/pkgs/development/tools/misc/intel-gpu-tools/default.nix +++ b/pkgs/development/tools/misc/intel-gpu-tools/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { libXext libXv libXrandr glib bison libunwind python3 procps gtk-doc openssl peg elfutils ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=array-bounds" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=array-bounds"; preConfigure = '' ./autogen.sh diff --git a/pkgs/development/tools/ocaml/dune/2.nix b/pkgs/development/tools/ocaml/dune/2.nix index 47e71c41568db..a0398439f0ea4 100644 --- a/pkgs/development/tools/ocaml/dune/2.nix +++ b/pkgs/development/tools/ocaml/dune/2.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ ocaml findlib ]; - buildFlags = "release"; + buildFlags = [ "release" ]; dontAddPrefix = true; diff --git a/pkgs/development/tools/phantomjs2/default.nix b/pkgs/development/tools/phantomjs2/default.nix index b18bd0104ce6c..b8f6984417265 100644 --- a/pkgs/development/tools/phantomjs2/default.nix +++ b/pkgs/development/tools/phantomjs2/default.nix @@ -71,7 +71,7 @@ in stdenv.mkDerivation rec { # Avoids error in webpage.cpp:80:89: # invalid suffix on literal; C++11 requires a space between litend identifier - NIX_CFLAGS_COMPILE = "-Wno-reserved-user-defined-literal"; + env.NIX_CFLAGS_COMPILE = "-Wno-reserved-user-defined-literal"; __impureHostDeps = stdenv.lib.optional stdenv.isDarwin "/usr/lib/libicucore.dylib"; diff --git a/pkgs/games/cataclysm-dda/default.nix b/pkgs/games/cataclysm-dda/default.nix index ced19bffb31a0..3d356f03536ad 100644 --- a/pkgs/games/cataclysm-dda/default.nix +++ b/pkgs/games/cataclysm-dda/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation (common // rec { substituteInPlace lua/autoexec.lua --replace "/usr/share" "$out/share" ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy"; + env.NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy"; makeFlags = common.makeFlags ++ [ "LUA=1" diff --git a/pkgs/misc/gnash/default.nix b/pkgs/misc/gnash/default.nix index 56dfe2f19f87c..3307c4229bd7e 100644 --- a/pkgs/misc/gnash/default.nix +++ b/pkgs/misc/gnash/default.nix @@ -90,7 +90,7 @@ stdenv.mkDerivation { ++ optional enableQt qt4 ++ optional enableFFmpeg ffmpeg_2 ++ optional enableJemalloc jemalloc - ++ optional enableHwAccel [ libGL libGLU ] + ++ optionals enableHwAccel [ libGL libGLU ] ++ optionals enableOpenGL [ libGL libGLU ] ++ optionals enablePlugins [ xulrunner npapi_sdk ] ++ optionals enableGTK [ gtk2 gnome2.gtkglext gnome2.GConf ]; diff --git a/pkgs/os-specific/linux/odp-dpdk/default.nix b/pkgs/os-specific/linux/odp-dpdk/default.nix index e1acda120253e..52eed71c8412a 100644 --- a/pkgs/os-specific/linux/odp-dpdk/default.nix +++ b/pkgs/os-specific/linux/odp-dpdk/default.nix @@ -34,7 +34,7 @@ in stdenv.mkDerivation rec { jansson ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=address-of-packed-member"; # for some reason, /build/odp-dpdk-1.22.0.0_DPDK_18.11/lib/.libs ends up in all binaries, # while it should be $out/lib instead. diff --git a/pkgs/servers/monitoring/nagios/default.nix b/pkgs/servers/monitoring/nagios/default.nix index 006d91ef74eb7..13c205a29f850 100644 --- a/pkgs/servers/monitoring/nagios/default.nix +++ b/pkgs/servers/monitoring/nagios/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { preInstall = '' substituteInPlace Makefile --replace '$(MAKE) install-basic' "" ''; - installTargets = "install install-config"; + installTargets = [ "install" "install-config" ]; postInstall = '' # don't make default files use hardcoded paths to commands sed -i 's@command_line *[^ ]*/\([^/]*\) @command_line \1 @' $out/etc/objects/commands.cfg diff --git a/pkgs/servers/osrm-backend/default.nix b/pkgs/servers/osrm-backend/default.nix index b744c58d4fb18..05066161442ab 100644 --- a/pkgs/servers/osrm-backend/default.nix +++ b/pkgs/servers/osrm-backend/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "1m4hf26mgfvvx9z37qww8v8w4mhzyfl554ymdnzl99pr5ild093s"; }; - NIX_CFLAGS_COMPILE = [ "-Wno-error=pessimizing-move" "-Wno-error=redundant-move" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=pessimizing-move -Wno-error=redundant-move"; nativeBuildInputs = [ cmake pkgconfig ]; buildInputs = [ bzip2 libxml2 libzip boost lua luabind tbb expat ]; diff --git a/pkgs/servers/sql/cockroachdb/default.nix b/pkgs/servers/sql/cockroachdb/default.nix index 6637a75ea2f7d..e9c615981da36 100644 --- a/pkgs/servers/sql/cockroachdb/default.nix +++ b/pkgs/servers/sql/cockroachdb/default.nix @@ -22,7 +22,8 @@ buildGoPackage rec { sha256 = "1pnzzmxxb7qxiiy8qpl2sifk4qrijjbhmzy47bnjj5ssdsjjjcqy"; }; - NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.cc.isGNU [ "-Wno-error=deprecated-copy" "-Wno-error=redundant-move" "-Wno-error=pessimizing-move" ]; + envNIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU + "-Wno-error=deprecated-copy -Wno-error=redundant-move -Wno-error=pessimizing-move"; inherit nativeBuildInputs buildInputs; diff --git a/pkgs/tools/misc/pipelight/default.nix b/pkgs/tools/misc/pipelight/default.nix index 4c7e9d0892cae..d8f568a2c2833 100644 --- a/pkgs/tools/misc/pipelight/default.nix +++ b/pkgs/tools/misc/pipelight/default.nix @@ -19,7 +19,7 @@ in stdenv.mkDerivation rec { buildInputs = [ wine_custom libX11 libGLU libGL curl ]; - NIX_CFLAGS_COMPILE = [ "-fpermissive" ]; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; patches = [ ./pipelight.patch ]; diff --git a/pkgs/tools/networking/pmacct/default.nix b/pkgs/tools/networking/pmacct/default.nix index 861c44ef70fe5..61735836fee11 100644 --- a/pkgs/tools/networking/pmacct/default.nix +++ b/pkgs/tools/networking/pmacct/default.nix @@ -19,7 +19,7 @@ assert withSQLite -> sqlite != null; assert withPgSQL -> postgresql != null; assert withMysql -> libmysqlclient != null; -let inherit (stdenv.lib) optional; in +let inherit (stdenv.lib) optional optionals; in stdenv.mkDerivation rec { version = "1.7.3"; @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { ++ optional withNflog libnetfilter_log ++ optional withSQLite sqlite ++ optional withPgSQL postgresql - ++ optional withMysql [ libmysqlclient zlib ]; + ++ optionals withMysql [ libmysqlclient zlib ]; configureFlags = [ "--with-pcap-includes=${libpcap}/include" diff --git a/pkgs/tools/security/trousers/default.nix b/pkgs/tools/security/trousers/default.nix index e1938b65fcfc1..26d376dc4adca 100644 --- a/pkgs/tools/security/trousers/default.nix +++ b/pkgs/tools/security/trousers/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-usercheck" ]; - env.NIX_CFLAGS_COMPILE = [ "-DALLOW_NON_TSS_CONFIG_FILE" ]; + env.NIX_CFLAGS_COMPILE = "-DALLOW_NON_TSS_CONFIG_FILE"; enableParallelBuilding = true; meta = with stdenv.lib; { diff --git a/pkgs/tools/system/clinfo/default.nix b/pkgs/tools/system/clinfo/default.nix index dd6e3d4a84b88..ad05e84a41567 100644 --- a/pkgs/tools/system/clinfo/default.nix +++ b/pkgs/tools/system/clinfo/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ ocl-icd opencl-headers ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-truncation" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=stringop-truncation"; makeFlags = [ "PREFIX=${placeholder "out"}" ]; diff --git a/pkgs/tools/system/facter/default.nix b/pkgs/tools/system/facter/default.nix index 49d9462eddf48..31290d50a1d2c 100644 --- a/pkgs/tools/system/facter/default.nix +++ b/pkgs/tools/system/facter/default.nix @@ -11,16 +11,15 @@ stdenv.mkDerivation rec { owner = "puppetlabs"; }; - CXXFLAGS = "-fpermissive -Wno-error=catch-value"; + env.CXXFLAGS = "-fpermissive -Wno-error=catch-value"; env.NIX_LDFLAGS = "-lblkid"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-copy"; cmakeFlags = [ "-DFACTER_RUBY=${ruby}/lib/libruby.so" "-DRUBY_LIB_INSTALL=${placeholder "out"}/lib/ruby" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-copy"; - nativeBuildInputs = [ cmake ]; buildInputs = [ boost cpp-hocon curl leatherman libwhereami libyamlcpp openssl ruby utillinux ]; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index a3ddf460e1851..5f2891eacbc88 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -14812,7 +14812,7 @@ let sha256 = "4848679a3f201e3f3b0c5f6f9526e602af52923ffa471a2a3657db786bd3bdc5"; }; buildInputs = [ pkgs.zlib ]; - NIX_CFLAGS_LINK = "-L${pkgs.zlib.out}/lib -lz"; + env.NIX_CFLAGS_LINK = "-L${pkgs.zlib.out}/lib -lz"; meta = { description = "Perl extension to provide a PerlIO layer to gzip/gunzip"; license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; From e256a20a489ce8ac379dcc090f5dab15f699c0ca Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 5 Apr 2020 13:02:56 +0200 Subject: [PATCH 102/323] Use env. for environment variables --- pkgs/os-specific/linux/ddcci/default.nix | 2 +- pkgs/os-specific/linux/usbip/default.nix | 2 +- pkgs/servers/x11/xorg/overrides.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/ddcci/default.nix b/pkgs/os-specific/linux/ddcci/default.nix index a399ad7029f99..c1cf19d68f17e 100644 --- a/pkgs/os-specific/linux/ddcci/default.nix +++ b/pkgs/os-specific/linux/ddcci/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; - NIX_CFLAGS_COMPILE = [ "-Wno-error=incompatible-pointer-types" ]; + env.NIX_CFLAGS_COMPILE = [ "-Wno-error=incompatible-pointer-types" ]; prePatch = '' substituteInPlace ./ddcci/Makefile \ diff --git a/pkgs/os-specific/linux/usbip/default.nix b/pkgs/os-specific/linux/usbip/default.nix index f927eaefb4eb7..c078d52e6477a 100644 --- a/pkgs/os-specific/linux/usbip/default.nix +++ b/pkgs/os-specific/linux/usbip/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ autoconf automake libtool ]; buildInputs = [ udev ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ]; + env.NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ]; preConfigure = '' cd tools/usb/usbip diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 4a55ced18be48..c2e0947c4da44 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -407,7 +407,7 @@ self: super: xf86videowsfb = super.xf86videowsfb.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; }); xf86videoomap = super.xf86videoomap.overrideAttrs (attrs: { - NIX_CFLAGS_COMPILE = [ "-Wno-error=format-overflow" ]; + env.NIX_CFLAGS_COMPILE = [ "-Wno-error=format-overflow" ]; }); xf86videoamdgpu = super.xf86videoamdgpu.overrideAttrs (attrs: { From 742ae57968b43925e58e33313444fb42c05a363a Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 5 Apr 2020 13:03:22 +0200 Subject: [PATCH 103/323] ssh validationPackage is a single value, not a list --- nixos/modules/services/networking/ssh/sshd.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index 464e9ed38c42f..17f31e3a488d8 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -9,8 +9,8 @@ let # This middle-ground solution ensures *an* sshd can do their basic validation # on the configuration. validationPackage = if pkgs.stdenv.buildPlatform == pkgs.stdenv.hostPlatform - then [ cfgc.package ] - else [ pkgs.buildPackages.openssh ]; + then cfgc.package + else pkgs.buildPackages.openssh; sshconf = pkgs.runCommand "sshd.conf-validated" { nativeBuildInputs = [ validationPackage ]; } '' cat >$out < Date: Sun, 5 Apr 2020 13:03:35 +0200 Subject: [PATCH 104/323] zenpower: makeFlags is a list --- pkgs/os-specific/linux/zenpower/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/zenpower/default.nix b/pkgs/os-specific/linux/zenpower/default.nix index 8fdf7f23cf83b..b37512cc6f4be 100644 --- a/pkgs/os-specific/linux/zenpower/default.nix +++ b/pkgs/os-specific/linux/zenpower/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; - makeFlags = "KERNEL_BUILD=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; + makeFlags = [ "KERNEL_BUILD=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; installPhase = '' install -D zenpower.ko -t "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/hwmon/zenpower/" From 15a0499028a95b3393544cb7b4d7507016da3473 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 5 Apr 2020 13:27:55 +0200 Subject: [PATCH 105/323] Revert "Use env. for environment variables" env. cannot handle list of strings. This reverts commit e256a20a489ce8ac379dcc090f5dab15f699c0ca. --- pkgs/os-specific/linux/ddcci/default.nix | 2 +- pkgs/os-specific/linux/usbip/default.nix | 2 +- pkgs/servers/x11/xorg/overrides.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/ddcci/default.nix b/pkgs/os-specific/linux/ddcci/default.nix index c1cf19d68f17e..a399ad7029f99 100644 --- a/pkgs/os-specific/linux/ddcci/default.nix +++ b/pkgs/os-specific/linux/ddcci/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; - env.NIX_CFLAGS_COMPILE = [ "-Wno-error=incompatible-pointer-types" ]; + NIX_CFLAGS_COMPILE = [ "-Wno-error=incompatible-pointer-types" ]; prePatch = '' substituteInPlace ./ddcci/Makefile \ diff --git a/pkgs/os-specific/linux/usbip/default.nix b/pkgs/os-specific/linux/usbip/default.nix index c078d52e6477a..f927eaefb4eb7 100644 --- a/pkgs/os-specific/linux/usbip/default.nix +++ b/pkgs/os-specific/linux/usbip/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ autoconf automake libtool ]; buildInputs = [ udev ]; - env.NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ]; + NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ]; preConfigure = '' cd tools/usb/usbip diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index c2e0947c4da44..4a55ced18be48 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -407,7 +407,7 @@ self: super: xf86videowsfb = super.xf86videowsfb.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; }); xf86videoomap = super.xf86videoomap.overrideAttrs (attrs: { - env.NIX_CFLAGS_COMPILE = [ "-Wno-error=format-overflow" ]; + NIX_CFLAGS_COMPILE = [ "-Wno-error=format-overflow" ]; }); xf86videoamdgpu = super.xf86videoamdgpu.overrideAttrs (attrs: { From 1b29d05007ab1097ef45202a7cb45160f411f009 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sun, 5 Apr 2020 18:23:51 +0200 Subject: [PATCH 106/323] Use env. for environment variables --- pkgs/os-specific/linux/ddcci/default.nix | 2 +- pkgs/os-specific/linux/usbip/default.nix | 2 +- pkgs/servers/x11/xorg/overrides.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/ddcci/default.nix b/pkgs/os-specific/linux/ddcci/default.nix index a399ad7029f99..142ec044b2ca7 100644 --- a/pkgs/os-specific/linux/ddcci/default.nix +++ b/pkgs/os-specific/linux/ddcci/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; - NIX_CFLAGS_COMPILE = [ "-Wno-error=incompatible-pointer-types" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; prePatch = '' substituteInPlace ./ddcci/Makefile \ diff --git a/pkgs/os-specific/linux/usbip/default.nix b/pkgs/os-specific/linux/usbip/default.nix index f927eaefb4eb7..3f55c4bd32e91 100644 --- a/pkgs/os-specific/linux/usbip/default.nix +++ b/pkgs/os-specific/linux/usbip/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ autoconf automake libtool ]; buildInputs = [ udev ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=address-of-packed-member"; preConfigure = '' cd tools/usb/usbip diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 4a55ced18be48..d2d0d6a0a2396 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -407,7 +407,7 @@ self: super: xf86videowsfb = super.xf86videowsfb.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; }); xf86videoomap = super.xf86videoomap.overrideAttrs (attrs: { - NIX_CFLAGS_COMPILE = [ "-Wno-error=format-overflow" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-overflow"; }); xf86videoamdgpu = super.xf86videoamdgpu.overrideAttrs (attrs: { From 7bac61638fc47cb1bbd0b7b946e2d49cccd15bd5 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 13:32:16 +0200 Subject: [PATCH 107/323] treewide: fix structured-attrs build errors --- pkgs/build-support/fetchurl/default.nix | 11 ++++++----- .../build-support/fetchurl/write-mirror-list.sh | 4 ---- .../libraries/java/dbus-java/default.nix | 15 ++++++++++----- .../libraries/java/libmatthew-java/default.nix | 8 ++++++-- pkgs/servers/http/tomcat/axis2/builder.sh | 15 --------------- pkgs/servers/http/tomcat/axis2/default.nix | 15 ++++++++++++++- .../disnix/DisnixWebService/default.nix | 17 ++++++++++++----- 7 files changed, 48 insertions(+), 37 deletions(-) delete mode 100644 pkgs/build-support/fetchurl/write-mirror-list.sh delete mode 100644 pkgs/servers/http/tomcat/axis2/builder.sh diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index 7d23a3a7f8f1c..00215efd7527b 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -10,11 +10,12 @@ let # resulting store derivations (.drv files) much smaller, which in # turn makes nix-env/nix-instantiate faster. mirrorsFile = - buildPackages.stdenvNoCC.mkDerivation ({ - name = "mirrors-list"; - builder = ./write-mirror-list.sh; - preferLocalBuild = true; - } // mirrors); + buildPackages.runCommandNoCCLocal "mirrors-list" { + env = stdenvNoCC.lib.mapAttrs (k: m: toString m) mirrors; + } '' + # !!! this is kinda hacky. + set | grep -E '^[a-zA-Z]+=.*://' > $out + ''; # Names of the master sites that are mirrored (i.e., "sourceforge", # "gnu", etc.). diff --git a/pkgs/build-support/fetchurl/write-mirror-list.sh b/pkgs/build-support/fetchurl/write-mirror-list.sh deleted file mode 100644 index 2dabd2e722be8..0000000000000 --- a/pkgs/build-support/fetchurl/write-mirror-list.sh +++ /dev/null @@ -1,4 +0,0 @@ -source $stdenv/setup - -# !!! this is kinda hacky. -set | grep -E '^[a-zA-Z]+=.*://' > $out diff --git a/pkgs/development/libraries/java/dbus-java/default.nix b/pkgs/development/libraries/java/dbus-java/default.nix index 5ec10cc7e0dfd..ba427b4f6da18 100644 --- a/pkgs/development/libraries/java/dbus-java/default.nix +++ b/pkgs/development/libraries/java/dbus-java/default.nix @@ -6,12 +6,17 @@ stdenv.mkDerivation { url = https://dbus.freedesktop.org/releases/dbus-java/dbus-java-2.7.tar.gz; sha256 = "0cyaxd8x6sxmi6pklkkx45j311a6w51fxl4jc5j3inc4cailwh5y"; }; - JAVA_HOME=jdk; - JAVA="${jdk}/bin/java"; - PREFIX=''''${out}''; - JAVAUNIXLIBDIR="${libmatthew_java}/lib/jni"; - JAVAUNIXJARDIR="${libmatthew_java}/share/java"; + + env = { + JAVA_HOME = toString jdk; + JAVA = "${jdk}/bin/java"; + PREFIX = placeholder "out"; + JAVAUNIXLIBDIR = "${libmatthew_java}/lib/jni"; + JAVAUNIXJARDIR = "${libmatthew_java}/share/java"; + }; + buildInputs = [ gettext jdk ]; + # I'm too lazy to build the documentation preBuild = '' sed -i -e "s|all: bin doc man|all: bin|" \ diff --git a/pkgs/development/libraries/java/libmatthew-java/default.nix b/pkgs/development/libraries/java/libmatthew-java/default.nix index 98291a7763cab..bbd3f873d66b8 100644 --- a/pkgs/development/libraries/java/libmatthew-java/default.nix +++ b/pkgs/development/libraries/java/libmatthew-java/default.nix @@ -6,8 +6,12 @@ stdenv.mkDerivation { url = https://src.fedoraproject.org/repo/pkgs/libmatthew-java/libmatthew-java-0.8.tar.gz/8455b8751083ce25c99c2840609271f5/libmatthew-java-0.8.tar.gz; sha256 = "1yldkhsdzm0a41a0i881bin2jklhp85y3ah245jd6fz3npcx7l85"; }; - JAVA_HOME=jdk; - PREFIX=''''${out}''; + + env = { + JAVA_HOME = toString jdk; + PREFIX = placeholder "out"; + }; + buildInputs = [ jdk ]; meta = with stdenv.lib; { diff --git a/pkgs/servers/http/tomcat/axis2/builder.sh b/pkgs/servers/http/tomcat/axis2/builder.sh deleted file mode 100644 index 2e36367e9dcf5..0000000000000 --- a/pkgs/servers/http/tomcat/axis2/builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -source $stdenv/setup - -unzip $src -cd axis2-* -mkdir -p $out -cp -av * $out -cd webapp -ant -cd .. -mkdir -p $out/webapps -cp dist/axis2.war $out/webapps -cd $out/webapps -mkdir axis2 -cd axis2 -unzip ../axis2.war diff --git a/pkgs/servers/http/tomcat/axis2/default.nix b/pkgs/servers/http/tomcat/axis2/default.nix index 59a4ab6e5b491..9247915136d86 100644 --- a/pkgs/servers/http/tomcat/axis2/default.nix +++ b/pkgs/servers/http/tomcat/axis2/default.nix @@ -10,7 +10,20 @@ stdenv.mkDerivation rec { }; buildInputs = [ unzip apacheAnt jdk ]; - builder = ./builder.sh; + + installPhase = '' + mkdir -p $out + cp -av * $out + cd webapp + ant + cd .. + mkdir -p $out/webapps + cp dist/axis2.war $out/webapps + cd $out/webapps + mkdir axis2 + cd axis2 + unzip ../axis2.war + ''; meta = { description = "Web Services / SOAP / WSDL engine, the successor to the widely used Apache Axis SOAP stack"; diff --git a/pkgs/tools/package-management/disnix/DisnixWebService/default.nix b/pkgs/tools/package-management/disnix/DisnixWebService/default.nix index dd64241fd3720..20f485b8fb19d 100644 --- a/pkgs/tools/package-management/disnix/DisnixWebService/default.nix +++ b/pkgs/tools/package-management/disnix/DisnixWebService/default.nix @@ -6,19 +6,26 @@ stdenv.mkDerivation { url = https://github.com/svanderburg/DisnixWebService/releases/download/DisnixWebService-0.9/DisnixWebService-0.9.tar.gz; sha256 = "1z7w44bf023c0aqchjfi4mla3qbhsh87mdzx7pqn0sy74cjfgqvl"; }; + buildInputs = [ apacheAnt jdk ]; - PREFIX = ''''${env.out}''; - AXIS2_LIB = "${axis2}/lib"; - AXIS2_WEBAPP = "${axis2}/webapps/axis2"; - DBUS_JAVA_LIB = "${dbus_java}/share/java"; + + env = { + PREFIX = placeholder "out"; + AXIS2_LIB = "${axis2}/lib"; + AXIS2_WEBAPP = "${axis2}/webapps/axis2"; + DBUS_JAVA_LIB = "${dbus_java}/share/java"; + }; + prePatch = '' sed -i -e "s|#JAVA_HOME=|JAVA_HOME=${jdk}|" \ -e "s|#AXIS2_LIB=|AXIS2_LIB=${axis2}/lib|" \ scripts/disnix-soap-client ''; + buildPhase = "ant"; + installPhase = "ant install"; - + meta = { description = "A SOAP interface and client for Disnix"; license = stdenv.lib.licenses.mit; From ac1c294387f8e30d34a73d4eaf60466553ec564a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:42:45 +0200 Subject: [PATCH 108/323] akonadi: add CXXFLAGS to env --- pkgs/applications/kde/akonadi/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/kde/akonadi/default.nix b/pkgs/applications/kde/akonadi/default.nix index b9a96394a6745..51dd43ef5eca9 100644 --- a/pkgs/applications/kde/akonadi/default.nix +++ b/pkgs/applications/kde/akonadi/default.nix @@ -19,7 +19,7 @@ mkDerivation { ]; propagatedBuildInputs = [ boost kitemmodels ]; outputs = [ "out" "dev" ]; - CXXFLAGS = [ + env.CXXFLAGS = toString [ ''-DNIXPKGS_MYSQL_MYSQLD=\"${lib.getBin mysql}/bin/mysqld\"'' ''-DNIXPKGS_MYSQL_MYSQLADMIN=\"${lib.getBin mysql}/bin/mysqladmin\"'' ''-DNIXPKGS_MYSQL_MYSQL_INSTALL_DB=\"${lib.getBin mysql}/bin/mysql_install_db\"'' From 30d6ad33042477d2ff669b133a429c0e0c5072bd Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:43:24 +0200 Subject: [PATCH 109/323] afew: fix makeWrapperArgs handling --- pkgs/applications/networking/mailreaders/afew/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/applications/networking/mailreaders/afew/default.nix b/pkgs/applications/networking/mailreaders/afew/default.nix index 54b3e10b5e297..79d238ddb3a29 100644 --- a/pkgs/applications/networking/mailreaders/afew/default.nix +++ b/pkgs/applications/networking/mailreaders/afew/default.nix @@ -15,9 +15,7 @@ python3Packages.buildPythonApplication rec { python3Packages.setuptools python3Packages.notmuch chardet dkimpy ] ++ stdenv.lib.optional (!python3Packages.isPy3k) subprocess32; - makeWrapperArgs = [ - ''--prefix PATH ':' "${notmuch}/bin"'' - ]; + makeWrapperArgs = ''--prefix PATH ':' "${notmuch}/bin"''; outputs = [ "out" "doc" ]; From 5bed43a629af6119deb14e0232674aeba2642724 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:43:47 +0200 Subject: [PATCH 110/323] aegisub: add CXXFLAGS to env --- pkgs/applications/video/aegisub/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/aegisub/default.nix b/pkgs/applications/video/aegisub/default.nix index 88b3949dccaf9..d33efee038adb 100644 --- a/pkgs/applications/video/aegisub/default.nix +++ b/pkgs/applications/video/aegisub/default.nix @@ -104,7 +104,7 @@ stdenv.mkDerivation hardeningDisable = [ "bindnow" "relro" ]; # compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554 - CXXFLAGS = [ "-DU_USING_ICU_NAMESPACE=1" ]; + env.CXXFLAGS = "-DU_USING_ICU_NAMESPACE=1"; # this is fixed upstream though not yet in an officially released version, # should be fine remove on next release (if one ever happens) From 7d6f7dcade5443b034ce6988d55291174eb6e5e1 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:44:11 +0200 Subject: [PATCH 111/323] aegisub: add FLAGS and CRYSTAL_LIBRARY_PATH to env --- pkgs/development/compilers/crystal/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix index 89dbda4e2a9a9..1820e4a39c046 100644 --- a/pkgs/development/compilers/crystal/default.nix +++ b/pkgs/development/compilers/crystal/default.nix @@ -108,14 +108,11 @@ let "all" "docs" ]; - FLAGS = [ - "--release" - "--single-module" # needed for deterministic builds - ]; + env.FLAGS = "--release --single-module"; # needed for deterministic builds # This makes sure we don't keep depending on the previous version of # crystal used to build this one. - CRYSTAL_LIBRARY_PATH = "${placeholder "lib"}/crystal"; + env.CRYSTAL_LIBRARY_PATH = "${placeholder "lib"}/crystal"; # We *have* to add `which` to the PATH or crystal is unable to build stuff # later if which is not available. From 668174f038df026f8c663e3d9dca37250f552f7b Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:44:38 +0200 Subject: [PATCH 112/323] goocanvas: add PKG_CONFIG_* to env --- pkgs/development/libraries/goocanvas/2.x.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/goocanvas/2.x.nix b/pkgs/development/libraries/goocanvas/2.x.nix index 1440d3f6aa04a..be9a4890d99a5 100644 --- a/pkgs/development/libraries/goocanvas/2.x.nix +++ b/pkgs/development/libraries/goocanvas/2.x.nix @@ -19,8 +19,9 @@ in stdenv.mkDerivation rec { configureFlags = [ "--disable-python" ]; - PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "$(dev)/share/gir-1.0"; - PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "$(out)/lib/girepository-1.0"; + + env.PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "$(dev)/share/gir-1.0"; + env.PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "$(out)/lib/girepository-1.0"; meta = with stdenv.lib; { description = "Canvas widget for GTK based on the the Cairo 2D library"; From e68239a005e5ffac14c16e5b8a29d201de1d4967 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:45:26 +0200 Subject: [PATCH 113/323] hspell: add PERL_USE_UNSAFE_INC to env --- pkgs/development/libraries/hspell/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/hspell/default.nix b/pkgs/development/libraries/hspell/default.nix index 32743e6179704..b29104f17e9fe 100644 --- a/pkgs/development/libraries/hspell/default.nix +++ b/pkgs/development/libraries/hspell/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { version = "1.1"; }; - PERL_USE_UNSAFE_INC = "1"; + env.PERL_USE_UNSAFE_INC = "1"; src = fetchurl { url = "${meta.homepage}${name}.tar.gz"; From 76b88d9a6e8ec5d4e01b92ba7d03e13aea0209f1 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:45:53 +0200 Subject: [PATCH 114/323] libcdr: add CXXFLAGS to env --- pkgs/development/libraries/libcdr/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libcdr/default.nix b/pkgs/development/libraries/libcdr/default.nix index cfd768b5272d3..e494372e81b66 100644 --- a/pkgs/development/libraries/libcdr/default.nix +++ b/pkgs/development/libraries/libcdr/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; - CXXFLAGS="--std=gnu++0x"; # For c++11 constants in lcms2.h + env.CXXFLAGS = "--std=gnu++0x"; # For c++11 constants in lcms2.h meta = { description = "A library providing ability to interpret and import Corel Draw drawings into various applications"; From 942d915637f01e7c0a507564158e396000ac6913 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:46:19 +0200 Subject: [PATCH 115/323] wxGTK: add SEARCH_INCLUDE and SEARCH_LIB to env --- pkgs/development/libraries/wxwidgets/2.8/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/wxwidgets/2.8/default.nix b/pkgs/development/libraries/wxwidgets/2.8/default.nix index a49fadc593618..d876b2d45ff87 100644 --- a/pkgs/development/libraries/wxwidgets/2.8/default.nix +++ b/pkgs/development/libraries/wxwidgets/2.8/default.nix @@ -37,9 +37,9 @@ stdenv.mkDerivation rec { ] ++ optional withMesa "--with-opengl"; # These variables are used by configure to find some dependencies. - SEARCH_INCLUDE = + env.SEARCH_INCLUDE = "${libXinerama.dev}/include ${libSM.dev}/include ${libXxf86vm.dev}/include"; - SEARCH_LIB = + env.SEARCH_LIB = "${libXinerama.out}/lib ${libSM.out}/lib ${libXxf86vm.out}/lib " + optionalString withMesa "${libGLU.out}/lib ${libGL.out}/lib "; From 417aea17099d1865ce4b3f7025d1cb664f086d3b Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:46:55 +0200 Subject: [PATCH 116/323] lvm2: fix build with structured attrs --- pkgs/os-specific/linux/lvm2/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix index 7eac8fad64cda..efb7bf586bfa1 100644 --- a/pkgs/os-specific/linux/lvm2/default.nix +++ b/pkgs/os-specific/linux/lvm2/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation { "--enable-udev_sync" "--enable-pkgconfig" "--enable-cmdlib" - ] ++ stdenv.lib.optional enable_dmeventd " --enable-dmeventd" + ] ++ stdenv.lib.optional enable_dmeventd "--enable-dmeventd" ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" From bc348d0e3b56c73c97447edd9d318567546dc5e8 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:47:19 +0200 Subject: [PATCH 117/323] apcupsd: fix configureFlags handling --- pkgs/servers/apcupsd/default.nix | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/pkgs/servers/apcupsd/default.nix b/pkgs/servers/apcupsd/default.nix index bec61d460a7a9..15c1b19e8c493 100644 --- a/pkgs/servers/apcupsd/default.nix +++ b/pkgs/servers/apcupsd/default.nix @@ -16,6 +16,24 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ utillinux man ] ++ stdenv.lib.optional enableCgiScripts gd; + configureFlags = [ + "--bindir=${placeholder "out"}/bin" + "--sbindir=${placeholder "out"}/bin" + "--sysconfdir=${placeholder "out"}/etc/apcupsd" + "--mandir=${placeholder "out"}/share/man" + "--with-halpolicydir=${placeholder "out"}/share/halpolicy" + "--localstatedir=/var/" + "--with-nologin=/run" + "--with-log-dir=/var/log/apcupsd" + "--with-pwrfail-dir=/run/apcupsd" + "--with-lock-dir=/run/lock" + "--with-pid-dir=/run" + "--enable-usb" + ] ++ stdenv.lib.optionals enableCgiScripts [ + "--enable-cgi" + "--with-cgi-bin=${placeholder "out"}/libexec/cgi-bin" + ]; + prePatch = '' sed -e "s,\$(INSTALL_PROGRAM) \$(STRIP),\$(INSTALL_PROGRAM)," \ -i ./src/apcagent/Makefile ./autoconf/targets.mak @@ -27,21 +45,6 @@ stdenv.mkDerivation rec { export ac_cv_path_SHUTDOWN=${systemd}/sbin/shutdown export ac_cv_path_WALL=${wall}/bin/wall sed -i 's|/bin/cat|${coreutils}/bin/cat|' configure - export configureFlags="\ - --bindir=$out/bin \ - --sbindir=$out/bin \ - --sysconfdir=$out/etc/apcupsd \ - --mandir=$out/share/man \ - --with-halpolicydir=$out/share/halpolicy \ - --localstatedir=/var/ \ - --with-nologin=/run \ - --with-log-dir=/var/log/apcupsd \ - --with-pwrfail-dir=/run/apcupsd \ - --with-lock-dir=/run/lock \ - --with-pid-dir=/run \ - --enable-usb \ - ${stdenv.lib.optionalString enableCgiScripts "--enable-cgi --with-cgi-bin=$out/libexec/cgi-bin"} - " ''; postInstall = '' From fc0604eeec56a475a9fd6afda9f4f0ab7459b43a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:47:54 +0200 Subject: [PATCH 118/323] stdenv: assert CXXFLAGS -> env --- pkgs/stdenv/generic/make-derivation.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 175d93e3304db..305ab900afb33 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -101,6 +101,7 @@ in rec { assert lib.isList (attrs.patchFlags or []); assert lib.isList (attrs.installFlags or []); assert lib.isList (attrs.installTargets or []); + assert !(attrs ? CXXFLAGS); assert !(attrs ? NIX_LDFLAGS); assert !(attrs ? NIX_CFLAGS_COMPILE); assert !(attrs ? NIX_CFLAGS_LINK); From 502513ef1c9ada41a98250f3bb02cabfc5e2e445 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 5 Apr 2020 18:48:26 +0200 Subject: [PATCH 119/323] texlive: fix with structured attrs --- pkgs/tools/typesetting/tex/texlive/bin.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index 6054ea5c6e922..43ae20bd9eefb 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -181,7 +181,7 @@ core = stdenv.mkDerivation rec { '' + cleanBrokenLinks; # needed for poppler and xpdf - CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++14"; + env.CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++14"; setupHook = ./setup-hook.sh; # TODO: maybe texmf-nix -> texmf (and all references) passthru = { inherit version buildInputs; }; @@ -232,7 +232,7 @@ core-big = stdenv.mkDerivation { #TODO: upmendex fi mkdir -p "$path" && cd "$path" - "../../../$path/configure" $configureFlags $extraConfig + "../../../$path/configure" ''${configureFlags[@]} $extraConfig ) done ''; @@ -246,8 +246,8 @@ core-big = stdenv.mkDerivation { #TODO: upmendex # (uninteresting stuff remains in $out, typically duplicates from `core`) outputs = [ "out" "metafont" "metapost" "luatex" "xetex" ]; postInstall = '' - for output in $outputs; do - mkdir -p "''${!output}/bin" + for output in ''${outputs[@]}; do + mkdir -p "$output/bin" done mv "$out/bin"/{inimf,mf,mf-nowin} "$metafont/bin/" From 86e1a96d2708eb186436961a1a0fea9c843f271d Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 4 Apr 2020 18:10:39 +0200 Subject: [PATCH 120/323] modules-closure: fix for structuredAttrs --- pkgs/build-support/kernel/modules-closure.nix | 9 +++++++-- pkgs/build-support/kernel/modules-closure.sh | 8 +++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pkgs/build-support/kernel/modules-closure.nix b/pkgs/build-support/kernel/modules-closure.nix index d82e279799ba3..a037f3c42a066 100644 --- a/pkgs/build-support/kernel/modules-closure.nix +++ b/pkgs/build-support/kernel/modules-closure.nix @@ -8,8 +8,13 @@ stdenvNoCC.mkDerivation { name = kernel.name + "-shrunk"; - builder = ./modules-closure.sh; + buildCommand = builtins.readFile ./modules-closure.sh; nativeBuildInputs = [ nukeReferences kmod ]; - inherit kernel firmware rootModules allowMissing; + inherit rootModules; + env = { + kernel = "${kernel}"; + firmware = "${firmware}"; + inherit allowMissing; + }; allowedReferences = ["out"]; } diff --git a/pkgs/build-support/kernel/modules-closure.sh b/pkgs/build-support/kernel/modules-closure.sh index 220f3b00a7717..b539043fbde27 100644 --- a/pkgs/build-support/kernel/modules-closure.sh +++ b/pkgs/build-support/kernel/modules-closure.sh @@ -1,14 +1,12 @@ -source $stdenv/setup - # When no modules are built, the $out/lib/modules directory will not # exist. Because the rest of the script assumes it does exist, we # handle this special case first. if ! test -d "$kernel/lib/modules"; then - if test -z "$rootModules" || test -n "$allowMissing"; then + if test -z "${rootModules[*]}" || test -n "$allowMissing"; then mkdir -p "$out" exit 0 else - echo "Required modules: $rootModules" + echo "Required modules: ${rootModules[*]}" echo "Can not derive a closure of kernel modules because no modules were provided." exit 1 fi @@ -20,7 +18,7 @@ echo "kernel version is $version" # Determine the dependencies of each root module. closure= -for module in $rootModules; do +for module in "${rootModules[@]}"; do echo "root module: $module" deps=$(modprobe --config no-config -d $kernel --set-version "$version" --show-depends "$module" \ | sed 's/^insmod //') \ From 609ef4045f9767181228480706189fa1ab684acc Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 4 Apr 2020 18:10:53 +0200 Subject: [PATCH 121/323] linux: fix build with structuredAttrs (really this time) --- pkgs/os-specific/linux/kernel/manual-config.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 0538511c528c1..e2b9426d52621 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -161,11 +161,11 @@ let installFlags = [ "INSTALLKERNEL=${installkernel}" "INSTALL_PATH=$(out)" - ] ++ (optional isModular "INSTALL_MOD_PATH=$(out)") + ] ++ optional isModular "INSTALL_MOD_PATH=$(out)" ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware"; preInstall = '' - installFlagsArray+=("-j$NIX_BUILD_CORES") + installFlags+=("-j$NIX_BUILD_CORES") ''; # Some image types need special install targets (e.g. uImage is installed with make uinstall) @@ -184,10 +184,10 @@ let mkdir -p $dev cp vmlinux $dev/ if [ -z "''${dontStrip-}" ]; then - installFlagsArray+=("INSTALL_MOD_STRIP=1") + installFlags+=("INSTALL_MOD_STRIP=1") fi make modules_install $makeFlags "''${makeFlagsArray[@]}" \ - $installFlags "''${installFlagsArray[@]}" + "''${installFlags[@]}" unlink $out/lib/modules/${modDirVersion}/build unlink $out/lib/modules/${modDirVersion}/source @@ -256,7 +256,7 @@ let sed -i Makefile -e 's|= ${buildPackages.kmod}/bin/depmod|= depmod|' '' else optionalString installsFirmware '' make firmware_install $makeFlags "''${makeFlagsArray[@]}" \ - $installFlags "''${installFlagsArray[@]}" + "''${installFlags[@]}" ''); requiredSystemFeatures = [ "big-parallel" ]; From eb26c487f326f964f3ba918dc7cda776d8ac8852 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sat, 4 Apr 2020 18:12:00 +0200 Subject: [PATCH 122/323] stdenv: improve error message when env contains a bad type --- pkgs/stdenv/generic/make-derivation.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 305ab900afb33..2194f812cf61f 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -228,8 +228,10 @@ in rec { args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; inherit stdenv; - env = - assert lib.all (v: lib.isString v || lib.isBool v || lib.isInt v) (lib.attrValues env); + env = lib.mapAttrs + (k: v: if lib.isString v || lib.isBool v || lib.isInt v + then v + else throw "Environment variable '${k}' is a ${builtins.typeOf v} but should be a string, boolean or integer") env; # The `system` attribute of a derivation has special meaning to Nix. From 59d6f2a1f860f6cf710b3829cf1b58130c244f99 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sun, 5 Apr 2020 17:09:42 +0200 Subject: [PATCH 123/323] nixos/etc: fix building etc with structuredAttrs Yay, no more should-use-XML todo! --- nixos/modules/system/etc/etc.nix | 3 +- nixos/modules/system/etc/make-etc.sh | 41 ++++++++++------------------ 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/nixos/modules/system/etc/etc.nix b/nixos/modules/system/etc/etc.nix index 1f4d54a1ae205..1d8912ce18ed7 100644 --- a/nixos/modules/system/etc/etc.nix +++ b/nixos/modules/system/etc/etc.nix @@ -11,12 +11,11 @@ let etc = pkgs.stdenvNoCC.mkDerivation { name = "etc"; - builder = ./make-etc.sh; + buildCommand = builtins.readFile ./make-etc.sh; preferLocalBuild = true; allowSubstitutes = false; - /* !!! Use toXML. */ sources = map (x: x.source) etc'; targets = map (x: x.target) etc'; modes = map (x: x.mode) etc'; diff --git a/nixos/modules/system/etc/make-etc.sh b/nixos/modules/system/etc/make-etc.sh index 1ca4c3046f0e5..36ca2d1a5816f 100644 --- a/nixos/modules/system/etc/make-etc.sh +++ b/nixos/modules/system/etc/make-etc.sh @@ -1,32 +1,22 @@ -source $stdenv/setup +mkdir -p "$out/etc" -mkdir -p $out/etc - -set -f -sources_=($sources) -targets_=($targets) -modes_=($modes) -users_=($users) -groups_=($groups) -set +f - -for ((i = 0; i < ${#targets_[@]}; i++)); do - source="${sources_[$i]}" - target="${targets_[$i]}" +for ((i = 0; i < ${#targets[@]}; i++)); do + source="${sources[$i]}" + target="${targets[$i]}" if [[ "$source" =~ '*' ]]; then # If the source name contains '*', perform globbing. - mkdir -p $out/etc/$target + mkdir -p "$out/etc/$target" for fn in $source; do - ln -s "$fn" $out/etc/$target/ + ln -s "$fn" "$out/etc/$target/" done else - - mkdir -p $out/etc/$(dirname $target) - if ! [ -e $out/etc/$target ]; then - ln -s $source $out/etc/$target + + mkdir -p "$out/etc/$(dirname "$target")" + if ! [ -e "$out/etc/$target" ]; then + ln -s "$source" "$out/etc/$target" else echo "duplicate entry $target -> $source" if test "$(readlink $out/etc/$target)" != "$source"; then @@ -34,13 +24,12 @@ for ((i = 0; i < ${#targets_[@]}; i++)); do exit 1 fi fi - - if test "${modes_[$i]}" != symlink; then - echo "${modes_[$i]}" > $out/etc/$target.mode - echo "${users_[$i]}" > $out/etc/$target.uid - echo "${groups_[$i]}" > $out/etc/$target.gid + + if test "${modes[$i]}" != symlink; then + echo "${modes[$i]}" > "$out/etc/$target.mode" + echo "${users[$i]}" > "$out/etc/$target.uid" + echo "${groups[$i]}" > "$out/etc/$target.gid" fi - fi done From ea9ad7e38f2635bee736d86df718b583106e9e0f Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sun, 5 Apr 2020 17:11:10 +0200 Subject: [PATCH 124/323] make-initrd: fix for structuredAttrs no more "!!! should use XML" :) --- pkgs/build-support/kernel/make-initrd.nix | 23 ++++++----------------- pkgs/build-support/kernel/make-initrd.sh | 22 ++++++---------------- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix index ed5dbdaee1714..152fe80aed662 100644 --- a/pkgs/build-support/kernel/make-initrd.nix +++ b/pkgs/build-support/kernel/make-initrd.nix @@ -12,7 +12,7 @@ # `contents = {object = ...; symlink = /init;}' is a typical # argument. -{ stdenvNoCC, perl, cpio, contents, ubootTools +{ stdenvNoCC, closureInfo, cpio, contents, ubootTools, jq , name ? "initrd" , compressor ? "gzip -9n" , prepend ? [] @@ -26,27 +26,16 @@ let in stdenvNoCC.mkDerivation rec { inherit name; - builder = ./make-initrd.sh; + buildCommand = builtins.readFile ./make-initrd.sh; makeUInitrd = stdenvNoCC.hostPlatform.platform.kernelTarget == "uImage"; - nativeBuildInputs = [ perl cpio ] + nativeBuildInputs = [ cpio jq ] ++ stdenvNoCC.lib.optional makeUInitrd ubootTools; - # !!! should use XML. - objects = map (x: x.object) contents; - symlinks = map (x: x.symlink) contents; - suffices = map (x: if x ? suffix then x.suffix else "none") contents; - - # For obtaining the closure of `contents'. - # Note: we don't use closureInfo yet, as that won't build with nix-1.x. - # See #36268. - exportReferencesGraph = - lib.zipListsWith - (x: i: [("closure-${toValidStoreName (baseNameOf x.symlink)}-${toString i}") x.object]) - contents - (lib.range 0 (lib.length contents - 1)); - pathsFromGraph = ./paths-from-graph.pl; + inherit contents; + + env.closure = "${closureInfo { rootPaths = map (x: x.object) contents; }}"; inherit compressor prepend; } diff --git a/pkgs/build-support/kernel/make-initrd.sh b/pkgs/build-support/kernel/make-initrd.sh index 0aeaedeb37243..550aa39220c58 100644 --- a/pkgs/build-support/kernel/make-initrd.sh +++ b/pkgs/build-support/kernel/make-initrd.sh @@ -1,11 +1,5 @@ -source $stdenv/setup - set -o pipefail -objects=($objects) -symlinks=($symlinks) -suffices=($suffices) - mkdir root # Needed for splash_helper, which gets run before init. @@ -13,25 +7,21 @@ mkdir root/dev mkdir root/sys mkdir root/proc +objectCount=$(<.attrs.json jq '.contents | length') -for ((n = 0; n < ${#objects[*]}; n++)); do - object=${objects[$n]} - symlink=${symlinks[$n]} - suffix=${suffices[$n]} +for ((n = 0; n < $objectCount; n++)); do + object=$(<.attrs.json jq -r ".contents[$n].object") + symlink=$(<.attrs.json jq -r ".contents[$n].symlink") + suffix=$(<.attrs.json jq -r '.contents['"$n"'] | if has("suffix") then .suffix else "" end') if test "$suffix" = none; then suffix=; fi mkdir -p $(dirname root/$symlink) ln -s $object$suffix root/$symlink done - -# Get the paths in the closure of `object'. -storePaths=$(perl $pathsFromGraph closure-*) - - # Paths in cpio archives *must* be relative, otherwise the kernel # won't unpack 'em. -(cd root && cp -prd --parents $storePaths .) +(cd root && cp -prd --parents $(cat "$closure/store-paths") .) # Put the closure in a gzipped cpio archive. From db02491b5b083bd6ecc99821c6830d87c558247f Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sun, 5 Apr 2020 17:16:26 +0200 Subject: [PATCH 125/323] libunistring: only provide libiconv-prefix on non-linux --- pkgs/development/libraries/libunistring/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/development/libraries/libunistring/default.nix b/pkgs/development/libraries/libunistring/default.nix index 2c9a13788c5bf..ef92a7b9f294f 100644 --- a/pkgs/development/libraries/libunistring/default.nix +++ b/pkgs/development/libraries/libunistring/default.nix @@ -13,9 +13,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = stdenv.lib.optional (!stdenv.isLinux) libiconv; - configureFlags = [ - "--with-libiconv-prefix=${libiconv}" - ]; + configureFlags = stdenv.lib.optional (!stdenv.isLinux) "--with-libiconv-prefix=${libiconv}"; doCheck = false; From 6771c1fa40d69538b473755eff8319ebccc6ed69 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sun, 5 Apr 2020 17:14:01 +0200 Subject: [PATCH 126/323] linux/firmware: misc structuredAttrs fixes --- .../linux/firmware/openelec-dvb-firmware/default.nix | 2 +- pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix | 2 +- pkgs/os-specific/linux/firmware/rtl8723bs-firmware/default.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/openelec-dvb-firmware/default.nix b/pkgs/os-specific/linux/firmware/openelec-dvb-firmware/default.nix index 421a3300f7b07..dbc6c73236d7e 100644 --- a/pkgs/os-specific/linux/firmware/openelec-dvb-firmware/default.nix +++ b/pkgs/os-specific/linux/firmware/openelec-dvb-firmware/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "cef3ce537d213e020af794cecf9de207e2882c375ceda39102eb6fa2580bad8d"; }; - phases = [ "unpackPhase" "installPhase" ]; + dontBuild = true; installPhase = '' DESTDIR="$out" ./install diff --git a/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix b/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix index d8d4c37fd886d..31ac0c61cc4aa 100644 --- a/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix +++ b/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { sha256 = "0j3c35paapq1icmxq0mg7pm2xa2m69q7bkfmwgq99d682yr2cb5l"; }; - phases = [ "unpackPhase" "installPhase" ]; + dontBuild = true; installPhase = '' for i in rtl8192sfw.bin \ diff --git a/pkgs/os-specific/linux/firmware/rtl8723bs-firmware/default.nix b/pkgs/os-specific/linux/firmware/rtl8723bs-firmware/default.nix index eea6f2893f22b..8c52f8afa6e87 100644 --- a/pkgs/os-specific/linux/firmware/rtl8723bs-firmware/default.nix +++ b/pkgs/os-specific/linux/firmware/rtl8723bs-firmware/default.nix @@ -4,7 +4,7 @@ stdenv.mkDerivation { name = "rtl8723bs-firmware-${linuxPackages.rtl8723bs.version}"; inherit (linuxPackages.rtl8723bs) src; - phases = [ "unpackPhase" "installPhase" ]; + dontBuild = true; installPhase = '' mkdir -p "$out/lib/firmware/rtlwifi" From 88927d408b1ebfbb228de9e8eef98eb83fb4b4c8 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Sun, 5 Apr 2020 21:17:21 +0200 Subject: [PATCH 127/323] unifont: fix build with structuredAttrs --- pkgs/data/fonts/unifont/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/data/fonts/unifont/default.nix b/pkgs/data/fonts/unifont/default.nix index 034c2583d268b..3530f447933f9 100644 --- a/pkgs/data/fonts/unifont/default.nix +++ b/pkgs/data/fonts/unifont/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ libfaketime fonttosfnt mkfontscale ]; - phases = [ "buildPhase" "installPhase" ]; + dontUnpack = true; buildPhase = '' From 903d5aac52d5e9d9ff8b5991786f563a9b524ace Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 6 Apr 2020 15:55:56 +0200 Subject: [PATCH 128/323] libfolia: add CXXFLAGS to env --- pkgs/development/libraries/languagemachines/libfolia.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/languagemachines/libfolia.nix b/pkgs/development/libraries/languagemachines/libfolia.nix index a00c3be4193ea..2a303db9a91c0 100644 --- a/pkgs/development/libraries/languagemachines/libfolia.nix +++ b/pkgs/development/libraries/languagemachines/libfolia.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { preConfigure = "sh bootstrap.sh"; # compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554 - CXXFLAGS = [ "-DU_USING_ICU_NAMESPACE=1" ]; + env.CXXFLAGS = "-DU_USING_ICU_NAMESPACE=1"; meta = with stdenv.lib; { description = "A C++ API for FoLiA documents; an XML-based linguistic annotation format."; From ff6b7b09b94ebd3b292a17232abc218f983f52a4 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 6 Apr 2020 15:56:14 +0200 Subject: [PATCH 129/323] libpar2: add CXXFLAGS to env --- pkgs/development/libraries/libpar2/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libpar2/default.nix b/pkgs/development/libraries/libpar2/default.nix index bbdce71bad6ae..260c1e6218931 100644 --- a/pkgs/development/libraries/libpar2/default.nix +++ b/pkgs/development/libraries/libpar2/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { patches = [ ./libpar2-0.4-external-verification.patch ]; - CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11"; + env.CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11"; meta = { homepage = http://parchive.sourceforge.net/; From 537df49ce89b07d02b4815e19f57f4dd0fbbe14f Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 6 Apr 2020 15:56:37 +0200 Subject: [PATCH 130/323] xmoto: add CXXFLAGS to env --- pkgs/games/xmoto/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/games/xmoto/default.nix b/pkgs/games/xmoto/default.nix index 34c9bf1f06d14..92064a9d62dcb 100644 --- a/pkgs/games/xmoto/default.nix +++ b/pkgs/games/xmoto/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { lua5 ode libxdg_basedir libxml2 ]; - CXXFLAGS = [ "-fpermissive" ]; + env.CXXFLAGS = "-fpermissive"; meta = with stdenv.lib; { description = "Obstacled race game"; From f1dfebe55b87f24ccc861b3004f026e8ba21fad7 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 6 Apr 2020 15:57:47 +0200 Subject: [PATCH 131/323] desmume: add CXXFLAGS to env --- pkgs/misc/emulators/desmume/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/misc/emulators/desmume/default.nix b/pkgs/misc/emulators/desmume/default.nix index d5d63cc269440..762fb99e1fa95 100644 --- a/pkgs/misc/emulators/desmume/default.nix +++ b/pkgs/misc/emulators/desmume/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { ./01_use_system_tinyxml.patch ]; - CXXFLAGS = "-fpermissive"; + env.CXXFLAGS = "-fpermissive"; buildInputs = [ pkgconfig libtool intltool libXmu lua agg alsaLib soundtouch From 041d756a70963c893487ad999cb5b1b5bb0b99e0 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 6 Apr 2020 15:58:14 +0200 Subject: [PATCH 132/323] upx: add CXXFLAGS to env --- pkgs/tools/compression/upx/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/compression/upx/default.nix b/pkgs/tools/compression/upx/default.nix index f602a52d85abb..b0c2ada220fb5 100644 --- a/pkgs/tools/compression/upx/default.nix +++ b/pkgs/tools/compression/upx/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "051pk5jk8fcfg5mpgzj43z5p4cn7jy5jbyshyn78dwjqr7slsxs7"; }; - CXXFLAGS = "-Wno-unused-command-line-argument"; + env.CXXFLAGS = "-Wno-unused-command-line-argument"; buildInputs = [ ucl zlib perl ]; From 25add836a54af3f27e5c4db41f1ffe5bcff7b1d8 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 15:58:49 +0200 Subject: [PATCH 133/323] ocaml: remove unreferenced files --- pkgs/development/compilers/ocaml/3.08.0.nix | 21 - pkgs/development/compilers/ocaml/3.10.0.nix | 34 - pkgs/development/compilers/ocaml/3.11.2.nix | 75 - .../ocaml/3.12.1-darwin-fix-configure.patch | 32 - pkgs/development/compilers/ocaml/3.12.1.nix | 69 - pkgs/development/compilers/ocaml/builder.sh | 8 - .../compilers/ocaml/configure-3.08.0 | 1482 ----------------- .../compilers/ocaml/gnused-on-osx-fix.patch | 9 - pkgs/development/compilers/ocaml/mips64.patch | 240 --- 9 files changed, 1970 deletions(-) delete mode 100644 pkgs/development/compilers/ocaml/3.08.0.nix delete mode 100644 pkgs/development/compilers/ocaml/3.10.0.nix delete mode 100644 pkgs/development/compilers/ocaml/3.11.2.nix delete mode 100644 pkgs/development/compilers/ocaml/3.12.1-darwin-fix-configure.patch delete mode 100644 pkgs/development/compilers/ocaml/3.12.1.nix delete mode 100644 pkgs/development/compilers/ocaml/builder.sh delete mode 100755 pkgs/development/compilers/ocaml/configure-3.08.0 delete mode 100644 pkgs/development/compilers/ocaml/gnused-on-osx-fix.patch delete mode 100644 pkgs/development/compilers/ocaml/mips64.patch diff --git a/pkgs/development/compilers/ocaml/3.08.0.nix b/pkgs/development/compilers/ocaml/3.08.0.nix deleted file mode 100644 index cd621c131ffab..0000000000000 --- a/pkgs/development/compilers/ocaml/3.08.0.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ stdenv, fetchurl, xlibsWrapper }: - -stdenv.mkDerivation rec { - pname = "ocaml"; - version = "3.08.0"; - - builder = ./builder.sh; - src = fetchurl { - url = "http://tarballs.nixos.org/${pname}-${version}.tar.gz"; - sha256 = "135g5waj7djzrj0dbc8z1llasfs2iv5asq41jifhldxb4l2b97mx"; - }; - configureScript = ./configure-3.08.0; - dontAddPrefix = "True"; - configureFlags = ["-no-tk" "-x11lib" xlibsWrapper]; - buildFlags = ["world" "bootstrap" "opt"]; - checkTarget = ["opt.opt"]; - - meta = { - platforms = stdenv.lib.platforms.linux; - }; -} diff --git a/pkgs/development/compilers/ocaml/3.10.0.nix b/pkgs/development/compilers/ocaml/3.10.0.nix deleted file mode 100644 index a6d2bcd875e18..0000000000000 --- a/pkgs/development/compilers/ocaml/3.10.0.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ stdenv, fetchurl, xlibsWrapper, ncurses }: - -stdenv.mkDerivation (rec { - - pname = "ocaml"; - version = "3.10.0"; - - src = fetchurl { - url = "https://caml.inria.fr/pub/distrib/ocaml-3.10/${pname}-${version}.tar.bz2"; - sha256 = "1ihmx1civ78s7k2hfc05z1s9vbyx2qw7fg8lnbxnfd6zxkk8878d"; - }; - - prefixKey = "-prefix "; - configureFlags = ["-no-tk" "-x11lib" xlibsWrapper]; - buildFlags = [ "world" "bootstrap" "world.opt" ]; - buildInputs = [xlibsWrapper ncurses]; - installTargets = "install installopt"; - patchPhase = '' - CAT=$(type -tp cat) - sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang - ''; - postBuild = '' - mkdir -p $out/include - ln -sv $out/lib/ocaml/caml $out/include/caml - ''; - - meta = { - homepage = http://caml.inria.fr/ocaml; - license = with stdenv.lib.licenses; [ qpl lgpl2 ]; - description = "Most popular variant of the Caml language"; - platforms = stdenv.lib.platforms.linux; - }; - -}) diff --git a/pkgs/development/compilers/ocaml/3.11.2.nix b/pkgs/development/compilers/ocaml/3.11.2.nix deleted file mode 100644 index 2229a1bf0a082..0000000000000 --- a/pkgs/development/compilers/ocaml/3.11.2.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ stdenv, fetchurl, ncurses, xlibsWrapper }: - -let - useX11 = stdenv.isi686 || stdenv.isx86_64; - useNativeCompilers = stdenv.isi686 || stdenv.isx86_64 || stdenv.isMips; - inherit (stdenv.lib) optionals optionalString; -in - -stdenv.mkDerivation rec { - - pname = "ocaml"; - version = "3.11.2"; - - src = fetchurl { - url = "https://caml.inria.fr/pub/distrib/ocaml-3.11/${pname}-${version}.tar.bz2"; - sha256 = "86f3387a0d7e7c8be2a3c53af083a5a726e333686208d5ea0dd6bb5ac3f58143"; - }; - - # Needed to avoid a SIGBUS on the final executable on mips - env.NIX_CFLAGS_COMPILE = if stdenv.isMips then "-fPIC" else ""; - - patches = optionals stdenv.isDarwin [ ./gnused-on-osx-fix.patch ] ++ - [ (fetchurl { - name = "0007-Fix-ocamlopt-w.r.t.-binutils-2.21.patch"; - url = "http://caml.inria.fr/mantis/file_download.php?file_id=418&type=bug"; - sha256 = "612a9ac108bbfce2238aa5634123da162f0315dedb219958be705e0d92dcdd8e"; - }) - ]; - - prefixKey = "-prefix "; - configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" xlibsWrapper ]; - buildFlags = [ "world" ] ++ optionals useNativeCompilers [ "bootstrap" "world.opt" ]; - buildInputs = [ncurses] ++ optionals useX11 [ xlibsWrapper ]; - installTargets = "install" + optionalString useNativeCompilers " installopt"; - prePatch = '' - CAT=$(type -tp cat) - sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang - patch -p0 < ${./mips64.patch} - ''; - postBuild = '' - mkdir -p $out/include - ln -sv $out/lib/ocaml/caml $out/include/caml - ''; - - meta = with stdenv.lib; { - homepage = http://caml.inria.fr/ocaml; - license = with licenses; [ - qpl /* compiler */ - lgpl2 /* library */ - ]; - description = "Most popular variant of the Caml language"; - - longDescription = - '' Objective Caml is the most popular variant of the Caml language. - From a language standpoint, it extends the core Caml language with a - fully-fledged object-oriented layer, as well as a powerful module - system, all connected by a sound, polymorphic type system featuring - type inference. - - The Objective Caml system is an industrial-strength implementation - of this language, featuring a high-performance native-code compiler - (ocamlopt) for 9 processor architectures (IA32, PowerPC, AMD64, - Alpha, Sparc, Mips, IA64, HPPA, StrongArm), as well as a bytecode - compiler (ocamlc) and an interactive read-eval-print loop (ocaml) - for quick development and portability. The Objective Caml - distribution includes a comprehensive standard library, a replay - debugger (ocamldebug), lexer (ocamllex) and parser (ocamlyacc) - generators, a pre-processor pretty-printer (camlp4) and a - documentation generator (ocamldoc). - ''; - - platforms = with platforms; linux ++ darwin; - }; - -} diff --git a/pkgs/development/compilers/ocaml/3.12.1-darwin-fix-configure.patch b/pkgs/development/compilers/ocaml/3.12.1-darwin-fix-configure.patch deleted file mode 100644 index 4b867bbb1e6fd..0000000000000 --- a/pkgs/development/compilers/ocaml/3.12.1-darwin-fix-configure.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -Nuar ocaml-3.12.1/configure ocaml-3.12.1-fix-configure/configure ---- ocaml-3.12.1/configure 2011-07-04 23:15:01.000000000 +0200 -+++ ocaml-3.12.1-fix-configure/configure 2012-06-06 22:20:40.000000000 +0200 -@@ -259,7 +259,7 @@ - bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC" - mathlib="";; - *,*-*-darwin*) -- bytecccompopts="-fno-defer-pop -no-cpp-precomp $gcc_warnings" -+ bytecccompopts="-fno-defer-pop $gcc_warnings" - mathlib="" - # Tell gcc that we can use 32-bit code addresses for threaded code - # unless we are compiled for a shared library (-fPIC option) -@@ -739,7 +739,7 @@ - *,*,rhapsody,*) nativecccompopts="$gcc_warnings -DDARWIN_VERSION_6 $dl_defs" - if $arch64; then partialld="ld -r -arch ppc64"; fi;; - *,gcc*,cygwin,*) nativecccompopts="$gcc_warnings -U_WIN32";; -- amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64";; -+ amd64,gcc*,macosx,*) partialld="ld -r";; - amd64,gcc*,solaris,*) partialld="ld -r -m elf_x86_64";; - *,gcc*,*,*) nativecccompopts="$gcc_warnings";; - esac -@@ -752,8 +752,8 @@ - asppprofflags='-pg -DPROFILING';; - alpha,*,*) as='as' - aspp='gcc -c';; -- amd64,*,macosx) as='as -arch x86_64' -- aspp='gcc -arch x86_64 -c';; -+ amd64,*,macosx) as='as' -+ aspp='gcc -c';; - amd64,*,solaris) as='as --64' - aspp='gcc -m64 -c';; - amd64,*,*) as='as' diff --git a/pkgs/development/compilers/ocaml/3.12.1.nix b/pkgs/development/compilers/ocaml/3.12.1.nix deleted file mode 100644 index 1026b1bd8d75d..0000000000000 --- a/pkgs/development/compilers/ocaml/3.12.1.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ stdenv, fetchurl, ncurses, xlibsWrapper }: - -let - useX11 = !stdenv.isAarch32 && !stdenv.isMips; - useNativeCompilers = !stdenv.isMips; - inherit (stdenv.lib) optionals optionalString; -in - -stdenv.mkDerivation rec { - - pname = "ocaml"; - version = "3.12.1"; - - src = fetchurl { - url = "https://caml.inria.fr/pub/distrib/ocaml-3.12/${pname}-${version}.tar.bz2"; - sha256 = "13cmhkh7s6srnlvhg3s9qzh3a5dbk2m9qr35jzq922sylwymdkzd"; - }; - - prefixKey = "-prefix "; - configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" xlibsWrapper ]; - buildFlags = [ "world" ] ++ optionals useNativeCompilers [ "bootstrap" "world.opt" ]; - buildInputs = [ncurses] ++ optionals useX11 [ xlibsWrapper ]; - installTargets = "install" + optionalString useNativeCompilers " installopt"; - patches = optionals stdenv.isDarwin [ ./3.12.1-darwin-fix-configure.patch ]; - preConfigure = '' - CAT=$(type -tp cat) - sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang - ''; - postBuild = '' - mkdir -p $out/include - ln -sv $out/lib/ocaml/caml $out/include/caml - ''; - - passthru = { - nativeCompilers = useNativeCompilers; - }; - - meta = with stdenv.lib; { - homepage = http://caml.inria.fr/ocaml; - branch = "3.12"; - license = with licenses; [ - qpl /* compiler */ - lgpl2 /* library */ - ]; - description = "Most popular variant of the Caml language"; - - longDescription = - '' - OCaml is the most popular variant of the Caml language. From a - language standpoint, it extends the core Caml language with a - fully-fledged object-oriented layer, as well as a powerful module - system, all connected by a sound, polymorphic type system featuring - type inference. - - The OCaml system is an industrial-strength implementation of this - language, featuring a high-performance native-code compiler (ocamlopt) - for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc, - Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc) - and an interactive read-eval-print loop (ocaml) for quick development - and portability. The OCaml distribution includes a comprehensive - standard library, a replay debugger (ocamldebug), lexer (ocamllex) and - parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4) - and a documentation generator (ocamldoc). - ''; - - platforms = with platforms; linux; - }; - -} diff --git a/pkgs/development/compilers/ocaml/builder.sh b/pkgs/development/compilers/ocaml/builder.sh deleted file mode 100644 index a1807682d8674..0000000000000 --- a/pkgs/development/compilers/ocaml/builder.sh +++ /dev/null @@ -1,8 +0,0 @@ -source $stdenv/setup - -configureFlags="-prefix $out $configureFlags" -genericBuild - -#cd emacs/ -#mkdir -p $out/share/ocaml/emacs -#make EMACSDIR=$out/share/ocaml/emacs install diff --git a/pkgs/development/compilers/ocaml/configure-3.08.0 b/pkgs/development/compilers/ocaml/configure-3.08.0 deleted file mode 100755 index 9c8705855120b..0000000000000 --- a/pkgs/development/compilers/ocaml/configure-3.08.0 +++ /dev/null @@ -1,1482 +0,0 @@ -#! /bin/sh - -######################################################################### -# # -# Objective Caml # -# # -# Xavier Leroy, projet Cristal, INRIA Rocquencourt # -# # -# Copyright 1999 Institut National de Recherche en Informatique et # -# en Automatique. All rights reserved. This file is distributed # -# under the terms of the GNU Library General Public License, with # -# the special exception on linking described in file LICENSE. # -# # -######################################################################### - -# $Id: configure,v 1.215.2.3 2004/07/09 15:08:51 doligez Exp $ - -configure_options="$*" -prefix=/usr/local -bindir='' -libdir='' -mandir='' -manext=1 -host_type=unknown -ccoption='' -cclibs='' -curseslibs='' -mathlib='-lm' -dllib='' -x11_include_dir='' -x11_lib_dir='' -tk_wanted=yes -pthread_wanted=yes -tk_defs='' -tk_libs='' -tk_x11=yes -dl_defs='' -verbose=no -withcurses=yes -withsharedlibs=yes -binutils_dir='' -gcc_warnings="-Wall" - -# Try to turn internationalization off, can cause config.guess to malfunction! -unset LANG -unset LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME - -# Turn off some macOS debugging stuff, same reason -unset RC_TRACE_ARCHIVES RC_TRACE_DYLIBS RC_TRACE_PREBINDING_DISABLED - -# Parse command-line arguments - -while : ; do - case "$1" in - "") break;; - -prefix|--prefix) - prefix=$2; shift;; - -bindir|--bindir) - bindir=$2; shift;; - -libdir|--libdir) - libdir=$2; shift;; - -mandir|--mandir) - case "$2" in - */man[1-9ln]) - mandir=`echo $2 | sed -e 's|^\(.*\)/man.$|\1|'` - manext=`echo $2 | sed -e 's/^.*\(.\)$/\1/'`;; - *) - mandir=$2 - manext=1;; - esac - shift;; - -host*|--host*) - host_type=$2; shift;; - -cc*) - ccoption="$2"; shift;; - -lib*) - cclibs="$2 $cclibs"; shift;; - -no-curses) - withcurses=no;; - -no-shared-libs) - withsharedlibs=no;; - -x11include*|--x11include*) - x11_include_dir=$2; shift;; - -x11lib*|--x11lib*) - x11_lib_dir=$2; shift;; - -with-pthread*|--with-pthread*) - ;; # Ignored for backward compatibility - -no-pthread*|--no-pthread*) - pthread_wanted=no;; - -no-tk|--no-tk) - tk_wanted=no;; - -tkdefs*|--tkdefs*) - tk_defs=$2; shift;; - -tklibs*|--tklibs*) - tk_libs=$2; shift;; - -tk-no-x11|--tk-no-x11) - tk_x11=no;; - -dldefs*|--dldefs*) - dl_defs="$2"; shift;; - -dllibs*|--dllibs*) - dllib="$2"; shift;; - -binutils*|--binutils*) - binutils_dir=$2; shift;; - -verbose|--verbose) - verbose=yes;; - *) echo "Unknown option \"$1\"." 1>&2; exit 2;; - esac - shift -done - -# Sanity checks - -case "$prefix" in - /*) ;; - *) echo "The -prefix directory must be absolute." 1>&2; exit 2;; -esac -case "$bindir" in - /*) ;; - "") ;; - *) echo "The -bindir directory must be absolute." 1>&2; exit 2;; -esac -case "$libdir" in - /*) ;; - "") ;; - *) echo "The -libdir directory must be absolute." 1>&2; exit 2;; -esac -case "$mandir" in - /*) ;; - "") ;; - *) echo "The -mandir directory must be absolute." 1>&2; exit 2;; -esac - -# Generate the files - -cd config/auto-aux -rm -f s.h m.h Makefile -touch s.h m.h Makefile - -# Write options to Makefile - -echo "# generated by ./configure $configure_options" >> Makefile - -# Where to install - -echo "PREFIX=$prefix" >> Makefile -case "$bindir" in - "") echo 'BINDIR=$(PREFIX)/bin' >> Makefile - bindir="$prefix/bin";; - *) echo "BINDIR=$bindir" >> Makefile;; -esac -case "$libdir" in - "") echo 'LIBDIR=$(PREFIX)/lib/ocaml' >> Makefile - libdir="$prefix/lib/ocaml";; - *) echo "LIBDIR=$libdir" >> Makefile;; -esac -echo 'STUBLIBDIR=$(LIBDIR)/stublibs' >> Makefile -case "$mandir" in - "") echo 'MANDIR=$(PREFIX)/man' >> Makefile - mandir="$prefix/man";; - *) echo "MANDIR=$mandir" >> Makefile;; -esac -echo "MANEXT=$manext" >> Makefile - -# Determine the system type - -if test "$host_type" = "unknown"; then - if host_type=`../gnu/config.guess`; then :; else - echo "Cannot guess host type" - echo "You must specify one with the -host option" - exit 2 - fi -fi -if host=`../gnu/config.sub $host_type`; then :; else - echo "Please specify the correct host type with the -host option" - exit 2 -fi -echo "Configuring for a $host ..." - -# Do we have gcc? - -if test -z "$ccoption"; then - if sh ./searchpath gcc; then - echo "gcc found" - cc=gcc - else - cc=cc - fi -else - cc="$ccoption" -fi - -# Check for buggy versions of GCC - -buggycc="no" - -case "$host,$cc" in - i[3456]86-*-*,gcc*) - case `$cc --version` in - 2.7.2.1) cat <<'EOF' - -WARNING: you are using gcc version 2.7.2.1 on an Intel x86 processor. -This version of gcc is known to generate incorrect code for the -Objective Caml runtime system on some Intel x86 machines. (The symptom -is a crash of boot/ocamlc when compiling stdlib/pervasives.mli.) -In particular, the version of gcc 2.7.2.1 that comes with -Linux RedHat 4.x / Intel is affected by this problem. -Other Linux distributions might also be affected. -If you are using one of these configurations, you are strongly advised -to use another version of gcc, such as 2.95, which are -known to work well with Objective Caml. - -Press to proceed or to stop. -EOF - read reply;; - 2.96*) cat <<'EOF' - -WARNING: you are using gcc version 2.96 on an Intel x86 processor. -Certain patched versions of gcc 2.96 are known to generate incorrect -code for the Objective Caml runtime system. (The symptom is a segmentation -violation on boot/ocamlc.) Those incorrectly patched versions can be found -in RedHat 7.2 and Mandrake 8.0 and 8.1; other Linux distributions -might also be affected. (See bug #57760 on bugzilla.redhat.com) - -Auto-configuration will now select gcc compiler flags that work around -the problem. Still, if you observe segmentation faults while running -ocamlc or ocamlopt, you are advised to try another version of gcc, -such as 2.95.3 or 3.2. - -EOF - buggycc="gcc.2.96";; - - esac;; -esac - -# Configure the bytecode compiler - -bytecc="$cc" -bytecccompopts="" -bytecclinkopts="" -ostype="Unix" -exe="" - -case "$bytecc,$host" in - cc,*-*-nextstep*) - # GNU C extensions disabled, but __GNUC__ still defined! - bytecccompopts="-fno-defer-pop $gcc_warnings -U__GNUC__ -posix" - bytecclinkopts="-posix";; - *,*-*-rhapsody*) - # Almost the same as NeXTStep - bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC" - mathlib="";; - *,*-*-darwin*) - # Almost the same as rhapsody - bytecccompopts="-fno-defer-pop -no-cpp-precomp $gcc_warnings" - mathlib="";; - *,*-*-beos*) - bytecccompopts="-fno-defer-pop $gcc_warnings" - # No -lm library - mathlib="";; - gcc,alpha*-*-osf*) - bytecccompopts="-fno-defer-pop $gcc_warnings" - if cc="$bytecc" sh ./hasgot -mieee; then - bytecccompopts="-mieee $bytecccompopts"; - fi - # Put code and static data in lower 4GB - bytecclinkopts="-Wl,-T,12000000 -Wl,-D,14000000" - # Tell gcc that we can use 32-bit code addresses for threaded code - echo "#define ARCH_CODE32" >> m.h;; - cc,alpha*-*-osf*) - bytecccompopts="-std1 -ieee";; - gcc,alpha*-*-linux*) - if cc="$bytecc" sh ./hasgot -mieee; then - bytecccompopts="-mieee $bytecccompopts"; - fi;; - cc,mips-*-irix6*) - # Add -n32 flag to ensure compatibility with native-code compiler - bytecccompopts="-n32" - # Turn off warning "unused library" - bytecclinkopts="-n32 -Wl,-woff,84";; - cc*,mips-*-irix6*) - # (For those who want to force "cc -64") - # Turn off warning "unused library" - bytecclinkopts="-Wl,-woff,84";; - *,alpha*-*-unicos*) - # For the Cray T3E - bytecccompopts="-DUMK";; - gcc*,powerpc-*-aix4.3*) - # Avoid name-space pollution by requiring Unix98-conformant includes - bytecccompopts="-fno-defer-pop $gcc_warnings -D_XOPEN_SOURCE=500";; - *,powerpc-*-aix4.3*) - bytecccompopts="-D_XOPEN_SOURCE=500";; - gcc*,*-*-cygwin*) - bytecccompopts="-fno-defer-pop $gcc_warnings -U_WIN32" - exe=".exe" - ostype="Cygwin";; - gcc*,x86_64-*-linux*) - bytecccompopts="-fno-defer-pop $gcc_warnings" - # Tell gcc that we can use 32-bit code addresses for threaded code - echo "#define ARCH_CODE32" >> m.h;; - gcc*) - bytecccompopts="-fno-defer-pop $gcc_warnings";; -esac - -# Configure compiler to use in further tests - -cc="$bytecc -O $bytecclinkopts" -export cc cclibs verbose - -# Check C compiler - -sh ./runtest ansi.c -case $? in - 0) echo "The C compiler is ANSI-compliant.";; - 1) echo "The C compiler $cc is not ANSI-compliant." - echo "You need an ANSI C compiler to build Objective Caml." - exit 2;; - *) echo "Unable to compile the test program." - echo "Make sure the C compiler $cc is properly installed." - exit 2;; -esac - -# Check the sizes of data types - -echo "Checking the sizes of integers and pointers..." -set `sh ./runtest sizes.c` -case "$2,$3" in - 4,4) echo "OK, this is a regular 32 bit architecture." - echo "#undef ARCH_SIXTYFOUR" >> m.h;; - 8,8) echo "Wow! A 64 bit architecture!" - echo "#define ARCH_SIXTYFOUR" >> m.h;; - *,8) echo "Wow! A 64 bit architecture!" - echo "Unfortunately, Objective Caml cannot work in the case" - echo "sizeof(long) != sizeof(long *)." - echo "Objective Caml won't run on this architecture." - exit 2;; - *,*) echo "This architecture seems to be neither 32 bits nor 64 bits." - echo "Objective Caml won't run on this architecture." - exit 2;; - *) echo "Unable to compile the test program." - echo "Make sure the C compiler $cc is properly installed." - exit 2;; -esac -if test $1 != 4 && test $2 != 4 && test $4 != 4; then - echo "Sorry, we can't find a 32-bit integer type" - echo "(sizeof(short) = $4, sizeof(int) = $1, sizeof(long) = $2)" - echo "Objective Caml won't run on this architecture." - exit 2 -fi - -echo "#define SIZEOF_INT $1" >> m.h -echo "#define SIZEOF_LONG $2" >> m.h -echo "#define SIZEOF_SHORT $4" >> m.h - -if test $2 = 8; then - echo "#define ARCH_INT64_TYPE long" >> m.h - echo "#define ARCH_UINT64_TYPE unsigned long" >> m.h - echo '#define ARCH_INT64_PRINTF_FORMAT "l"' >> m.h - int64_native=true -else - sh ./runtest longlong.c - case $? in - 0) echo "64-bit \"long long\" integer type found (printf with \"%ll\")." - echo "#define ARCH_INT64_TYPE long long" >> m.h - echo "#define ARCH_UINT64_TYPE unsigned long long" >> m.h - echo '#define ARCH_INT64_PRINTF_FORMAT "ll"' >> m.h - int64_native=true;; - 1) echo "64-bit \"long long\" integer type found (printf with \"%q\")." - echo "#define ARCH_INT64_TYPE long long" >> m.h - echo "#define ARCH_UINT64_TYPE unsigned long long" >> m.h - echo '#define ARCH_INT64_PRINTF_FORMAT "q"' >> m.h - int64_native=true;; - 2) echo "64-bit \"long long\" integer type found (but no printf)." - echo "#define ARCH_INT64_TYPE long long" >> m.h - echo "#define ARCH_UINT64_TYPE unsigned long long" >> m.h - echo '#undef ARCH_INT64_PRINTF_FORMAT' >> m.h - int64_native=true;; - *) echo "No suitable 64-bit integer type found, will use software emulation." - echo "#undef ARCH_INT64_TYPE" >> m.h - echo "#undef ARCH_UINT64_TYPE" >> m.h - echo '#undef ARCH_INT64_PRINTF_FORMAT' >> m.h - int64_native=false;; - esac -fi - -# Determine endianness - -sh ./runtest endian.c -case $? in - 0) echo "This is a big-endian architecture." - echo "#define ARCH_BIG_ENDIAN" >> m.h;; - 1) echo "This is a little-endian architecture." - echo "#undef ARCH_BIG_ENDIAN" >> m.h;; - 2) echo "This architecture seems to be neither big endian nor little endian." - echo "Objective Caml won't run on this architecture." - exit 2;; - *) echo "Something went wrong during endianness determination." - echo "You'll have to figure out endianness yourself" - echo "(option ARCH_BIG_ENDIAN in m.h).";; -esac - -# Determine alignment constraints - -case "$host" in - sparc-*-*|hppa*-*-*) - # On Sparc V9 with certain versions of gcc, determination of double - # alignment is not reliable (PR#1521), hence force it. - # Same goes for hppa. - # But there's a knack (PR#2572): - # if we're in 64-bit mode (sizeof(long) == 8), - # we must not doubleword-align floats... - if test $2 = 8; then - echo "Doubles can be word-aligned." - echo "#undef ARCH_ALIGN_DOUBLE" >> m.h - else - echo "Doubles must be doubleword-aligned." - echo "#define ARCH_ALIGN_DOUBLE" >> m.h - fi;; - *) - sh ./runtest dblalign.c - case $? in - 0) echo "Doubles can be word-aligned." - echo "#undef ARCH_ALIGN_DOUBLE" >> m.h;; - 1) echo "Doubles must be doubleword-aligned." - echo "#define ARCH_ALIGN_DOUBLE" >> m.h;; - *) echo "Something went wrong during alignment determination for doubles." - echo "I'm going to assume this architecture has alignment constraints over doubles." - echo "That's a safe bet: Objective Caml will work even if" - echo "this architecture has actually no alignment constraints." - echo "#define ARCH_ALIGN_DOUBLE" >> m.h;; - esac;; -esac - -if $int64_native; then - case "$host" in - hppa*-*-*) - if test $2 = 8; then - echo "64-bit integers can be word-aligned." - echo "#undef ARCH_ALIGN_INT64" >> m.h - else - echo "64-bit integers must be doubleword-aligned." - echo "#define ARCH_ALIGN_INT64" >> m.h - fi;; - *) - sh ./runtest int64align.c - case $? in - 0) echo "64-bit integers can be word-aligned." - echo "#undef ARCH_ALIGN_INT64" >> m.h;; - 1) echo "64-bit integers must be doubleword-aligned." - echo "#define ARCH_ALIGN_INT64" >> m.h;; - *) echo "Something went wrong during alignment determination for 64-bit integers." - echo "I'm going to assume this architecture has alignment constraints." - echo "That's a safe bet: Objective Caml will work even if" - echo "this architecture has actually no alignment constraints." - echo "#define ARCH_ALIGN_INT64" >> m.h;; - esac - esac -else - echo "#undef ARCH_ALIGN_INT64" >> m.h -fi - -# Check semantics of division and modulus - -sh ./runtest divmod.c -case $? in - 0) echo "Native division and modulus have round-towards-zero semantics, will use them." - echo "#undef NONSTANDARD_DIV_MOD" >> m.h;; - 1) echo "Native division and modulus do not have round-towards-zero semantics, will use software emulation." - echo "#define NONSTANDARD_DIV_MOD" >> m.h;; - *) echo "Something went wrong while checking native division and modulus, please report it." - echo "#define NONSTANDARD_DIV_MOD" >> m.h;; -esac - -# Shared library support - -shared_libraries_supported=false -dl_needs_underscore=false -sharedcccompopts='' -mksharedlib='' -byteccrpath='' -mksharedlibrpath='' - -if test $withsharedlibs = "yes"; then - case "$host" in - *-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*) - sharedcccompopts="-fPIC" - mksharedlib="$bytecc -shared -o" - bytecclinkopts="$bytecclinkopts -Wl,-E" - byteccrpath="-Wl,-rpath," - mksharedlibrpath="-Wl,-rpath," - shared_libraries_supported=true;; - alpha*-*-osf*) - case "$bytecc" in - gcc*) - sharedcccompopts="-fPIC" - mksharedlib="$bytecc -shared -o" - byteccrpath="-Wl,-rpath," - mksharedlibrpath="-Wl,-rpath," - shared_libraries_supported=true;; - cc*) - sharedcccompopts="" - mksharedlib="ld -shared -expect_unresolved '*' -o" - byteccrpath="-Wl,-rpath," - mksharedlibrpath="-rpath " - shared_libraries_supported=true;; - esac;; - *-*-solaris2*) - case "$bytecc" in - gcc*) - sharedcccompopts="-fPIC" - if sh ./solaris-ld; then - mksharedlib="$bytecc -shared -o" - byteccrpath="-R" - mksharedlibrpath="-R" - else - mksharedlib="$bytecc -shared -o" - bytecclinkopts="$bytecclinkopts -Wl,-E" - byteccrpath="-Wl,-rpath," - mksharedlibrpath="-Wl,-rpath," - fi - shared_libraries_supported=true;; - *) - sharedcccompopts="-KPIC" - byteccrpath="-R" - mksharedlibrpath="-R" - mksharedlib="/usr/ccs/bin/ld -G -o" - shared_libraries_supported=true;; - esac;; - mips*-*-irix[56]*) - case "$bytecc" in - cc*) sharedcccompopts="";; - gcc*) sharedcccompopts="-fPIC";; - esac - mksharedlib="ld -shared -rdata_shared -o" - byteccrpath="-Wl,-rpath," - mksharedlibrpath="-rpath " - shared_libraries_supported=true;; - powerpc-apple-darwin*) - mksharedlib="cc -bundle -flat_namespace -undefined suppress -o" - bytecccompopts="$dl_defs $bytecccompopts" - #sharedcccompopts="-fnocommon" - dl_needs_underscore=true - shared_libraries_supported=true;; - esac -fi - -# Further machine-specific hacks - -case "$host" in - ia64-*-linux*|alpha*-*-linux*|x86_64-*-linux*) - echo "Will use mmap() instead of malloc() for allocation of major heap chunks." - echo "#define USE_MMAP_INSTEAD_OF_MALLOC" >> s.h;; -esac - -# Configure the native-code compiler - -arch=none -model=default -system=unknown - -case "$host" in - alpha*-*-osf*) arch=alpha; system=digital;; - alpha*-*-linux*) arch=alpha; system=linux;; - alpha*-*-freebsd*) arch=alpha; system=freebsd;; - alpha*-*-netbsd*) arch=alpha; system=netbsd;; - alpha*-*-openbsd*) arch=alpha; system=openbsd;; - sparc*-*-sunos4.*) arch=sparc; system=sunos;; - sparc*-*-solaris2.*) arch=sparc; system=solaris;; - sparc*-*-*bsd*) arch=sparc; system=bsd;; - sparc*-*-linux*) arch=sparc; system=linux;; - i[3456]86-*-linux*) arch=i386; system=linux_`sh ./runtest elf.c`;; - i[3456]86-*-*bsd*) arch=i386; system=bsd_`sh ./runtest elf.c`;; - i[3456]86-*-nextstep*) arch=i386; system=nextstep;; - i[3456]86-*-solaris*) arch=i386; system=solaris;; - i[3456]86-*-beos*) arch=i386; system=beos;; - i[3456]86-*-cygwin*) arch=i386; system=cygwin;; - mips-*-irix6*) arch=mips; system=irix;; - hppa1.1-*-hpux*) arch=hppa; system=hpux;; - hppa2.0*-*-hpux*) arch=hppa; system=hpux;; - hppa*-*-linux*) arch=hppa; system=linux;; - powerpc-*-linux*) arch=power; model=ppc; system=elf;; - powerpc-*-netbsd*) arch=power; model=ppc; system=bsd;; - powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;; - powerpc-*-darwin*) arch=power; model=ppc; system=rhapsody;; - arm*-*-linux*) arch=arm; system=linux;; - ia64-*-linux*) arch=ia64; system=linux;; - ia64-*-freebsd*) arch=ia64; system=freebsd;; - x86_64-*-linux*) arch=amd64; system=linux;; - x86_64-*-freebsd*) arch=amd64; system=freebsd;; - x86_64-*-openbsd*) arch=amd64; system=openbsd;; -esac - -if test -z "$ccoption"; then - case "$arch,$system,$cc" in - alpha,digital,gcc*) nativecc=cc;; - mips,*,gcc*) nativecc=cc;; - *) nativecc="$bytecc";; - esac -else - nativecc="$ccoption" -fi - -nativecccompopts='' -nativecclinkopts='' -nativeccrpath="$byteccrpath" - -case "$arch,$nativecc,$system,$host_type" in - alpha,cc*,digital,*) nativecccompopts=-std1;; - mips,cc*,irix,*) nativecccompopts=-n32 - nativecclinkopts="-n32 -Wl,-woff,84";; - *,*,nextstep,*) nativecccompopts="$gcc_warnings -U__GNUC__ -posix" - nativecclinkopts="-posix";; - *,*,rhapsody,*darwin[1-5].*) - nativecccompopts="$gcc_warnings -DSHRINKED_GNUC";; - *,*,rhapsody,*) - nativecccompopts="$gcc_warnings -DDARWIN_VERSION_6 $dl_defs";; - *,gcc*,cygwin,*) nativecccompopts="$gcc_warnings -U_WIN32";; - *,gcc*,*,*) nativecccompopts="$gcc_warnings";; -esac - -asflags='' -aspp='$(AS)' -asppflags='' -asppprofflags='-DPROFILING' - -case "$arch,$model,$system" in - alpha,*,digital) asflags='-O2'; asppflags='-O2 -DSYS_$(SYSTEM)'; - asppprofflags='-pg -DPROFILING';; - alpha,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; - alpha,*,freebsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; - alpha,*,netbsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; - alpha,*,openbsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; - mips,*,irix) asflags='-n32 -O2'; asppflags="$asflags";; - sparc,*,bsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; - sparc,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; - sparc,*,*) case "$cc" in - gcc*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; - *) asppflags='-P -DSYS_$(SYSTEM)';; - esac;; - i386,*,solaris) aspp='/usr/ccs/bin/as'; asppflags='-P -DSYS_$(SYSTEM)';; - i386,*,*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; - hppa,*,*) aspp="$cc"; asppflags='-traditional -c -DSYS_$(SYSTEM)';; - power,*,elf) aspp='gcc'; asppflags='-c';; - power,*,bsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; - power,*,rhapsody) ;; - arm,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; - ia64,*,*) asflags=-xexplicit - aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM) -Wa,-xexplicit';; - amd64,*,*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';; -esac - -cc_profile='-pg' -case "$arch,$model,$system" in - alpha,*,digital) profiling='prof';; - i386,*,linux_elf) profiling='prof';; - i386,*,bsd_elf) profiling='prof';; - sparc,*,solaris) - profiling='prof' - case "$nativecc" in gcc*) ;; *) cc_profile='-xpg';; esac;; - amd64,*,linux) profiling='prof';; - *) profiling='noprof';; -esac - -# Where are GNU binutils? - -binutils_objcopy='' -binutils_nm='' - -if test "$arch" != "none"; then - binutils_path="${binutils_dir}:${PATH}:/usr/libexec/binutils" - old_IFS="$IFS" - IFS=':' - for d in ${binutils_path}; do - if test -z "$d"; then continue; fi - if test -f "$d/objcopy" && test -f "$d/nm"; then - echo "objcopy and nm found in $d" - if test `$d/objcopy --help | grep -s -c 'redefine-sym'` -eq 0; then - echo "$d/objcopy does not support option --redefine-sym, discarded" - continue; - fi - if test `$d/nm --version | grep -s -c 'GNU nm'` -eq 0; then - echo "$d/nm is not from GNU binutils, discarded" - continue; - fi - binutils_objcopy="$d/objcopy" - binutils_nm="$d/nm" - break - fi - done - IFS="$old_IFS" -fi - -# Where is ranlib? - -if sh ./searchpath ranlib; then - echo "ranlib found" - echo "RANLIB=ranlib" >> Makefile - echo "RANLIBCMD=ranlib" >> Makefile -else - echo "ranlib not used" - echo "RANLIB=ar rs" >> Makefile - echo "RANLIBCMD=" >> Makefile -fi - -# Do #! scripts work? - -if (SHELL=/bin/sh; export SHELL; (./sharpbang || ./sharpbang2) >/dev/null); then - echo "#! appears to work in shell scripts" - case "$host" in - *-*-sunos*|*-*-unicos*) - echo "We won't use it, though, because under SunOS and Unicos it breaks" - echo "on pathnames longer than 30 characters" - echo "SHARPBANGSCRIPTS=false" >> Makefile;; - *-*-cygwin*) - echo "We won't use it, though, because of conflicts with .exe extension" - echo "under Cygwin" - echo "SHARPBANGSCRIPTS=false" >> Makefile;; - *) - echo "SHARPBANGSCRIPTS=true" >> Makefile;; - esac -else - echo "No support for #! in shell scripts" - echo "SHARPBANGSCRIPTS=false" >> Makefile -fi - -# Write the OS type (Unix or Cygwin) - -echo "#define OCAML_OS_TYPE \"$ostype\"" >> s.h -echo "#define OCAML_STDLIB_DIR \"$libdir\"" >> s.h - -# Use 64-bit file offset if possible - -bytecccompopts="$bytecccompopts -D_FILE_OFFSET_BITS=64" -nativecccompopts="$nativecccompopts -D_FILE_OFFSET_BITS=64" - -# Check the semantics of signal handlers - -if sh ./hasgot sigaction sigprocmask; then - echo "POSIX signal handling found." - echo "#define POSIX_SIGNALS" >> s.h -else - if sh ./runtest signals.c; then - echo "Signals have the BSD semantics." - echo "#define BSD_SIGNALS" >> s.h - else - echo "Signals have the System V semantics." - fi - if sh ./hasgot sigsetmask; then - echo "sigsetmask() found" - echo "#define HAS_SIGSETMASK" >> s.h - fi -fi - -# For the sys module - -if sh ./hasgot times; then - echo "times() found." - echo "#define HAS_TIMES" >> s.h -fi - -# For the terminfo module - -if test "$withcurses" = "yes"; then - for libs in "" "-lcurses" "-ltermcap" "-lcurses -ltermcap" "-lncurses"; do - if sh ./hasgot $libs tgetent tgetstr tgetnum tputs; then - echo "termcap functions found (with libraries '$libs')" - echo "#define HAS_TERMCAP" >> s.h - curseslibs="${libs}" - break - fi - done -fi - -# Configuration for the libraries - -otherlibraries="unix str num dynlink bigarray" - -# For the Unix library - -has_sockets=no -if sh ./hasgot socket socketpair bind listen accept connect; then - echo "You have BSD sockets." - echo "#define HAS_SOCKETS" >> s.h - has_sockets=yes -elif sh ./hasgot -lnsl -lsocket socket socketpair bind listen accept connect; then - echo "You have BSD sockets (with libraries '-lnsl -lsocket')" - cclibs="$cclibs -lnsl -lsocket" - echo "#define HAS_SOCKETS" >> s.h - has_sockets=yes -fi - -if sh ./hasgot -i sys/socket.h -t socklen_t; then - echo "socklen_t is defined in " - echo "#define HAS_SOCKLEN_T" >> s.h -fi - -if sh ./hasgot inet_aton; then - echo "inet_aton() found." - echo "#define HAS_INET_ATON" >> s.h -fi - -if sh ./hasgot -i sys/types.h -i sys/socket.h -i netinet/in.h \ - -t 'struct sockaddr_in6' \ -&& sh ./hasgot getaddrinfo getnameinfo inet_pton inet_ntop; then - echo "IPv6 is supported." - echo "#define HAS_IPV6" >> s.h -fi - -if sh ./hasgot -i unistd.h; then - echo "unistd.h found." - echo "#define HAS_UNISTD" >> s.h -fi - -if sh ./hasgot -i sys/types.h -t off_t; then - echo "off_t is defined in " - echo "#define HAS_OFF_T" >> s.h -fi - -if sh ./hasgot -i sys/types.h -i dirent.h; then - echo "dirent.h found." - echo "#define HAS_DIRENT" >> s.h -fi - -if sh ./hasgot rewinddir; then - echo "rewinddir() found." - echo "#define HAS_REWINDDIR" >> s.h -fi - -if sh ./hasgot lockf; then - echo "lockf() found." - echo "#define HAS_LOCKF" >> s.h -fi - -if sh ./hasgot mkfifo; then - echo "mkfifo() found." - echo "#define HAS_MKFIFO" >> s.h -fi - -if sh ./hasgot getcwd; then - echo "getcwd() found." - echo "#define HAS_GETCWD" >> s.h -fi - -if sh ./hasgot getwd; then - echo "getwd() found." - echo "#define HAS_GETWD" >> s.h -fi - -if sh ./hasgot getpriority setpriority; then - echo "getpriority() found." - echo "#define HAS_GETPRIORITY" >> s.h -fi - -if sh ./hasgot -i sys/types.h -i utime.h && sh ./hasgot utime; then - echo "utime() found." - echo "#define HAS_UTIME" >> s.h -fi - -if sh ./hasgot utimes; then - echo "utimes() found." - echo "#define HAS_UTIMES" >> s.h -fi - -if sh ./hasgot dup2; then - echo "dup2() found." - echo "#define HAS_DUP2" >> s.h -fi - -if sh ./hasgot fchmod fchown; then - echo "fchmod() found." - echo "#define HAS_FCHMOD" >> s.h -fi - -if sh ./hasgot truncate ftruncate; then - echo "truncate() found." - echo "#define HAS_TRUNCATE" >> s.h -fi - -select_include='' -if sh ./hasgot -i sys/types.h -i sys/select.h; then - echo "sys/select.h found." - echo "#define HAS_SYS_SELECT_H" >> s.h - select_include='-i sys/select.h' -fi - -has_select=no -if sh ./hasgot select && \ - sh ./hasgot -i sys/types.h $select_include -t fd_set ; then - echo "select() found." - echo "#define HAS_SELECT" >> s.h - has_select=yes -fi - -if sh ./hasgot symlink readlink lstat; then - echo "symlink() found." - echo "#define HAS_SYMLINK" >> s.h -fi - -has_wait=no -if sh ./hasgot waitpid; then - echo "waitpid() found." - echo "#define HAS_WAITPID" >> s.h - has_wait=yes -fi - -if sh ./hasgot wait4; then - echo "wait4() found." - echo "#define HAS_WAIT4" >> s.h - has_wait=yes -fi - -if sh ./hasgot -i limits.h && sh ./runtest getgroups.c; then - echo "getgroups() found." - echo "#define HAS_GETGROUPS" >> s.h -fi - -if sh ./hasgot -i termios.h && - sh ./hasgot tcgetattr tcsetattr tcsendbreak tcflush tcflow; then - echo "POSIX termios found." - echo "#define HAS_TERMIOS" >> s.h -fi - -# Async I/O under OSF1 3.x are so buggy that the test program hangs... -testasyncio=true -if test -f /usr/bin/uname; then - case "`/usr/bin/uname -s -r`" in - "OSF1 V3."*) testasyncio=false;; - esac -fi -if $testasyncio && sh ./runtest async_io.c; then - echo "Asynchronous I/O are supported." - echo "#define HAS_ASYNC_IO" >> s.h -fi - -has_setitimer=no -if sh ./hasgot setitimer; then - echo "setitimer() found." - echo "#define HAS_SETITIMER" >> s.h - has_setitimer="yes" -fi - -if sh ./hasgot gethostname; then - echo "gethostname() found." - echo "#define HAS_GETHOSTNAME" >> s.h -fi - -if sh ./hasgot -i sys/utsname.h && sh ./hasgot uname; then - echo "uname() found." - echo "#define HAS_UNAME" >> s.h -fi - -has_gettimeofday=no -if sh ./hasgot gettimeofday; then - echo "gettimeofday() found." - echo "#define HAS_GETTIMEOFDAY" >> s.h - has_gettimeofday="yes" -fi - -if sh ./hasgot mktime; then - echo "mktime() found." - echo "#define HAS_MKTIME" >> s.h -fi - -case "$host" in - *-*-cygwin*) ;; # setsid emulation under Cygwin breaks the debugger - *) if sh ./hasgot setsid; then - echo "setsid() found." - echo "#define HAS_SETSID" >> s.h - fi;; -esac - -if sh ./hasgot putenv; then - echo "putenv() found." - echo "#define HAS_PUTENV" >> s.h -fi - -if sh ./hasgot -i locale.h && sh ./hasgot setlocale; then - echo "setlocale() and found." - echo "#define HAS_LOCALE" >> s.h -fi - -if sh ./hasgot -i mach-o/dyld.h && sh ./hasgot NSLinkModule; then - echo "NSLinkModule() found. Using darwin dynamic loading." - echo "#define HAS_NSLINKMODULE" >> s.h -elif sh ./hasgot $dllib dlopen; then - echo "dlopen() found." -elif sh ./hasgot $dllib -ldl dlopen; then - echo "dlopen() found in -ldl." - dllib="$dllib -ldl" -else - shared_libraries_supported=no -fi - -if $shared_libraries_supported; then - echo "Dynamic loading of shared libraries is supported." - echo "#define SUPPORT_DYNAMIC_LINKING" >> s.h - if $dl_needs_underscore; then - echo '#define DL_NEEDS_UNDERSCORE' >>s.h - fi -fi - -if sh ./hasgot -i sys/types.h -i sys/mman.h && sh ./hasgot mmap munmap; then - echo "mmap() found." - echo "#define HAS_MMAP" >> s.h -fi - -nargs=none -for i in 5 6; do - if sh ./trycompile -DNUM_ARGS=${i} gethostbyname.c; then nargs=$i; break; fi -done -if test $nargs != "none"; then - echo "gethostbyname_r() found (with ${nargs} arguments)." - echo "#define HAS_GETHOSTBYNAME_R $nargs" >> s.h -fi - -nargs=none -for i in 7 8; do - if sh ./trycompile -DNUM_ARGS=${i} gethostbyaddr.c; then nargs=$i; break; fi -done -if test $nargs != "none"; then - echo "gethostbyaddr_r() found (with ${nargs} arguments)." - echo "#define HAS_GETHOSTBYADDR_R $nargs" >> s.h -fi - -# Determine if the debugger is supported - -if test "$has_sockets" = "yes"; then - echo "Replay debugger supported." - debugger="ocamldebugger" -else - echo "No replay debugger (missing system calls)" - debugger="" -fi - - -# Determine if system stack overflows can be detected - -case "$arch,$system" in - i386,linux_elf) - echo "System stack overflow can be detected." - echo "#define HAS_STACK_OVERFLOW_DETECTION" >> s.h;; - *) - echo "Cannot detect system stack overflow.";; -esac - -# Determine the target architecture for the "num" library - -case "$host" in - alpha*-*-*) bng_arch=alpha; bng_asm_level=1;; - i[3456]86-*-*) bng_arch=ia32 - if sh ./trycompile ia32sse2.c - then bng_asm_level=2 - else bng_asm_level=1 - fi;; - mips-*-*) bng_arch=mips; bng_asm_level=1;; - powerpc-*-*) bng_arch=ppc; bng_asm_level=1;; - sparc*-*-*) bng_arch=sparc; bng_asm_level=1;; - x86_64-*-*) bng_arch=amd64; bng_asm_level=1;; - *) bng_arch=generic; bng_asm_level=0;; -esac - -echo "BNG_ARCH=$bng_arch" >> Makefile -echo "BNG_ASM_LEVEL=$bng_asm_level" >> Makefile - -# Determine if the POSIX threads library is supported - -if test "$pthread_wanted" = "yes"; then - case "$host" in - *-*-solaris*) pthread_link="-lpthread -lposix4";; - *-*-freebsd*) pthread_link="-pthread";; - *-*-openbsd*) pthread_link="-pthread";; - *) pthread_link="-lpthread";; - esac - if ./hasgot -i pthread.h $pthread_link pthread_self; then - echo "POSIX threads library supported." - otherlibraries="$otherlibraries systhreads" - bytecccompopts="$bytecccompopts -D_REENTRANT" - nativecccompopts="$nativecccompopts -D_REENTRANT" - case "$host" in - *-*-freebsd*) - bytecccompopts="$bytecccompopts -D_THREAD_SAFE" - nativecccompopts="$nativecccompopts -D_THREAD_SAFE";; - *-*-openbsd*) - bytecccompopts="$bytecccompopts -pthread" - asppflags="$asppflags -pthread" - nativecccompopts="$nativecccompopts -pthread";; - esac - echo "Options for linking with POSIX threads: $pthread_link" - echo "PTHREAD_LINK=$pthread_link" >> Makefile - if sh ./hasgot $pthread_link sigwait; then - echo "sigwait() found" - echo "#define HAS_SIGWAIT" >> s.h - fi - else - echo "POSIX threads not found." - pthread_link="" - fi -fi - -# Determine if the bytecode thread library is supported - -if test "$has_select" = "yes" \ -&& test "$has_setitimer" = "yes" \ -&& test "$has_gettimeofday" = "yes" \ -&& test "$has_wait" = "yes"; then - echo "Bytecode threads library supported." - otherlibraries="$otherlibraries threads" -else - echo "Bytecode threads library not supported (missing system calls)" -fi - -# Determine the location of X include files and libraries - -x11_include="not found" -x11_link="not found" - -for dir in \ - $x11_include_dir \ - ; \ -do - if test -f $dir/X11/X.h; then - x11_include=$dir - break - fi -done - -if test "$x11_include" = "not found"; then - x11_try_lib_dir='' -else - x11_try_lib_dir=`echo $x11_include | sed -e 's|include|lib|'` -fi - -for dir in \ - $x11_lib_dir \ - $x11_try_lib_dir \ - ; \ -do - if test -f $dir/libX11.a || \ - test -f $dir/libX11.so || \ - test -f $dir/libX11.dll.a || \ - test -f $dir/libX11.sa; then - if test $dir = /usr/lib; then - x11_link="-lX11" - else - x11_link="-L$dir -lX11" - x11_libs="-L$dir" - fi - break - fi -done - - -if test "$x11_include" = "not found" || test "$x11_link" = "not found" -then - echo "X11 not found, the \"graph\" library will not be supported." - x11_include="" -else - echo "Location of X11 include files: $x11_include/X11" - echo "Options for linking with X11: $x11_link" - otherlibraries="$otherlibraries graph" - if test "$x11_include" = "/usr/include"; then - x11_include="" - else - x11_include="-I$x11_include" - fi - echo "X11_INCLUDES=$x11_include" >> Makefile - echo "X11_LINK=$x11_link" >> Makefile -fi - -# See if we can compile the dbm library - -dbm_include="not found" -dbm_link="not found" -use_gdbm_ndbm=no - -for dir in ; do - if test -f $dir/ndbm.h; then - dbm_include=$dir - if sh ./hasgot dbm_open; then - dbm_link="" - elif sh ./hasgot -lndbm dbm_open; then - dbm_link="-lndbm" - elif sh ./hasgot -ldb1 dbm_open; then - dbm_link="-ldb1" - elif sh ./hasgot -lgdbm dbm_open; then - dbm_link="-lgdbm" - elif sh ./hasgot -lgdbm_compat -lgdbm dbm_open; then - dbm_link="-lgdbm_compat -lgdbm" - fi - break - fi - if test -f $dir/gdbm-ndbm.h; then - dbm_include=$dir - use_gdbm_ndbm=yes - if sh ./hasgot -lgdbm_compat -lgdbm dbm_open; then - dbm_link="-lgdbm_compat -lgdbm" - fi - break - fi -done -if test "$dbm_include" = "not found" || test "$dbm_link" = "not found"; then - echo "NDBM not found, the \"dbm\" library will not be supported." -else - echo "NDBM found (in $dbm_include)" - if test "$dbm_include" = "/usr/include"; then - dbm_include="" - else - dbm_include="-I$dbm_include" - fi - echo "DBM_INCLUDES=$dbm_include" >> Makefile - echo "DBM_LINK=$dbm_link" >> Makefile - if test "$use_gdbm_ndbm" = "yes"; then - echo "#define DBM_USES_GDBM_NDBM" >> s.h - fi - otherlibraries="$otherlibraries dbm" -fi - -# Look for tcl/tk - -echo "Configuring LablTk..." - -if test $tk_wanted = no; then - has_tk=false -elif test $tk_x11 = no; then - has_tk=true -elif test "$x11_include" = "not found" || test "$x11_link" = "not found"; then - echo "X11 not found." - has_tk=false -else - tk_x11_include="$x11_include" - tk_x11_libs="$x11_libs -lX11" - has_tk=true -fi - -if test $has_tk = true; then - tcl_version='' - tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` - if test -z "$tcl_version" && test -z "$tk_defs"; then - tk_defs=-I/usr/local/include - tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` - fi - if test -z "$tcl_version"; then - tk_defs="-I/usr/local/include/tcl8.2 -I/usr/local/include/tk8.2" - tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` - fi - if test -z "$tcl_version"; then - tk_defs="-I/usr/local/include/tcl8.3 -I/usr/local/include/tk8.3" - tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` - fi - if test -z "$tcl_version"; then - tk_defs="-I/usr/local/include/tcl8.4 -I/usr/local/include/tk8.4" - tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` - fi - if test -z "$tcl_version"; then - tk_defs="-I/usr/include/tcl8.2 -I/usr/include/tk8.2" - tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` - fi - if test -z "$tcl_version"; then - tk_defs="-I/usr/include/tcl8.3 -I/usr/include/tk8.3" - tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` - fi - if test -z "$tcl_version"; then - tk_defs="-I/usr/include/tcl8.4 -I/usr/include/tk8.4" - tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` - fi - if test -z "$tcl_version"; then - tk_defs="-I/sw/include" - tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c` - fi - if test -n "$tcl_version"; then - echo "tcl.h version $tcl_version found with \"$tk_defs\"." - case $tcl_version in - 7.5) tclmaj=7 tclmin=5 tkmaj=4 tkmin=1 ;; - 7.6) tclmaj=7 tclmin=6 tkmaj=4 tkmin=2 ;; - 8.0) tclmaj=8 tclmin=0 tkmaj=8 tkmin=0 ;; - 8.1) tclmaj=8 tclmin=1 tkmaj=8 tkmin=1 ;; - 8.2) tclmaj=8 tclmin=2 tkmaj=8 tkmin=2 ;; - 8.3) tclmaj=8 tclmin=3 tkmaj=8 tkmin=3 ;; - 8.4) tclmaj=8 tclmin=4 tkmaj=8 tkmin=4 ;; - *) echo "This version is not known."; has_tk=false ;; - esac - else - echo "tcl.h not found." - has_tk=false - fi -fi - -if test $has_tk = true; then - if sh ./hasgot $tk_x11_include $tk_defs -i tk.h; then - echo "tk.h found." - else - echo "tk.h not found." - has_tk=false - fi -fi - -tkauxlibs="$mathlib $dllib" -tcllib='' -tklib='' -if test $has_tk = true; then - if sh ./hasgot $tk_libs $tk_x11_libs $tkauxlibs Tcl_DoOneEvent - then tk_libs="$tk_libs $dllib" - elif sh ./hasgot $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs Tcl_DoOneEvent - then - tk_libs="$tk_libs -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib" - elif sh ./hasgot $tk_libs -ltcl$tclmaj$tclmin $tkauxlibs Tcl_DoOneEvent - then - tk_libs="$tk_libs -ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin $dllib" - elif test -z "$tk_libs" && tk_libs=-L/usr/local/lib && \ - sh ./hasgot $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs Tcl_DoOneEvent - then - tk_libs="$tk_libs -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib" - elif sh ./hasgot $tk_libs -ltcl$tclmaj$tclmin $tkauxlibs Tcl_DoOneEvent - then - tk_libs="$tk_libs -ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin $dllib" -# elif sh ./hasgot $tk_libs -ltcl $tkauxlibs Tcl_DoOneEvent; then -# tk_libs="$tk_libs -ltk -ltcl" - elif sh ./hasgot -L/sw/lib $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs \ - Tcl_DoOneEvent - then tk_libs="-L/sw/lib -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib" - else - echo "Tcl library not found." - has_tk=false - fi -fi -if test $has_tk = true; then - if sh ./hasgot $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then - echo "Tcl/Tk libraries found." - elif sh ./hasgot -L/sw/lib $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then - tk_libs="-L/sw/lib $tk_libs" - echo "Tcl/Tk libraries found." - else - echo "Tcl library found." - echo "Tk library not found." - has_tk=false - fi -fi - -if test $has_tk = true; then - if test $tk_x11 = yes; then - echo "TK_DEFS=$tk_defs "'$(X11_INCLUDES)' >> Makefile - echo "TK_LINK=$tk_libs "'$(X11_LINK)' >> Makefile - else - echo "TK_DEFS=$tk_defs" >> Makefile - echo "TK_LINK=$tk_libs" >> Makefile - fi - otherlibraries="$otherlibraries labltk" -else - echo "Configuration failed, LablTk will not be built." -fi - -# Camlp4 - -( -cd ../../camlp4/config -EXE=$exe ./configure_batch -bindir "$bindir" -libdir "$libdir" -mandir "$mandir" -ocaml-top ../.. > /dev/null -) - -# Final twiddling of compiler options to work around known bugs - -nativeccprofopts="$nativecccompopts" -case "$buggycc" in - gcc.2.96) - bytecccompopts="$bytecccompopts -fomit-frame-pointer" - nativecccompopts="$nativecccompopts -fomit-frame-pointer";; -esac - -# Finish generated files - -cclibs="$cclibs $mathlib" - -echo "BYTECC=$bytecc" >> Makefile -echo "BYTECCCOMPOPTS=$bytecccompopts" >> Makefile -echo "BYTECCLINKOPTS=$bytecclinkopts" >> Makefile -echo "BYTECCLIBS=$cclibs $dllib $curseslibs $pthread_link" >> Makefile -echo "BYTECCRPATH=$byteccrpath" >> Makefile -echo "EXE=$exe" >> Makefile -echo "SUPPORTS_SHARED_LIBRARIES=$shared_libraries_supported" >> Makefile -echo "SHAREDCCCOMPOPTS=$sharedcccompopts" >> Makefile -echo "MKSHAREDLIB=$mksharedlib" >> Makefile -echo "MKSHAREDLIBRPATH=$mksharedlibrpath" >> Makefile -echo "ARCH=$arch" >> Makefile -echo "MODEL=$model" >> Makefile -echo "SYSTEM=$system" >> Makefile -echo "NATIVECC=$nativecc" >> Makefile -echo "NATIVECCCOMPOPTS=$nativecccompopts" >> Makefile -echo "NATIVECCPROFOPTS=$nativeccprofopts" >> Makefile -echo "NATIVECCLINKOPTS=$nativecclinkopts" >> Makefile -echo "NATIVECCRPATH=$nativeccrpath" >> Makefile -echo "NATIVECCLIBS=$cclibs $dllib" >> Makefile -echo "ASFLAGS=$asflags" >> Makefile -echo "ASPP=$aspp" >> Makefile -echo "ASPPFLAGS=$asppflags" >> Makefile -echo "ASPPPROFFLAGS=$asppprofflags" >> Makefile -echo "PROFILING=$profiling" >> Makefile -echo "BINUTILS_OBJCOPY=$binutils_objcopy" >> Makefile -echo "BINUTILS_NM=$binutils_nm" >> Makefile -echo "DYNLINKOPTS=$dllib" >> Makefile -echo "OTHERLIBRARIES=$otherlibraries" >> Makefile -echo "DEBUGGER=$debugger" >> Makefile -echo "CC_PROFILE=$cc_profile" >> Makefile - -rm -f tst hasgot.c -rm -f ../m.h ../s.h ../Makefile -mv m.h s.h Makefile .. - -# Print a summary - -echo -echo "** Configuration summary **" -echo -echo "Directories where Objective Caml will be installed:" -echo " binaries.................. $bindir" -echo " standard library.......... $libdir" -echo " manual pages.............. $mandir (with extension .$manext)" - -echo "Configuration for the bytecode compiler:" -echo " C compiler used........... $bytecc" -echo " options for compiling..... $bytecccompopts" -echo " options for linking....... $bytecclinkopts $cclibs $dllib $curseslibs $pthread_link" -if $shared_libraries_supported; then -echo " shared libraries are supported" -echo " options for compiling..... $sharedcccompopts $bytecccompopts" -echo " command for building...... $mksharedlib lib.so $mksharedlibrpath/a/path objs" -else -echo " shared libraries not supported" -fi - -echo "Configuration for the native-code compiler:" -if test "$arch" = "none"; then - echo " (not supported on this platform)" -else - if test "$model" = "default"; then - echo " hardware architecture..... $arch" - else - echo " hardware architecture..... $arch ($model)" - fi - if test "$system" = "unknown"; then : ; else - echo " OS variant................ $system" - fi - echo " C compiler used........... $nativecc" - echo " options for compiling..... $nativecccompopts" - echo " options for linking....... $nativecclinkopts $cclibs" - echo " assembler ................ \$(AS) $asflags" - echo " preprocessed assembler ... $aspp $asppflags" - if test "$profiling" = "prof"; then - echo " profiling with gprof ..... supported" - else - echo " profiling with gprof ..... not supported" - fi - if test -n "$binutils_objcopy" && test -n "$binutils_nm"; then - echo " ocamlopt -pack ........... supported" - else - echo " ocamlopt -pack ........... not supported (no binutils)" - fi -fi - -if test "$debugger" = "ocamldebugger"; then - echo "Source-level replay debugger: supported" -else - echo "Source-level replay debugger: not supported" -fi - -echo "Additional libraries supported:" -echo " $otherlibraries" - -echo "Configuration for the \"num\" library:" -echo " target architecture ...... $bng_arch (asm level $bng_asm_level)" - -if test "$x11_include" != "not found" && test "$x11_lib" != "not found"; then -echo "Configuration for the \"graph\" library:" -echo " options for compiling .... $x11_include" -echo " options for linking ...... $x11_link" -fi - -if test $has_tk = true; then -echo "Configuration for the \"labltk\" library:" -echo " use tcl/tk version ....... $tcl_version" -echo " options for compiling .... $tk_defs" -echo " options for linking ...... $tk_libs" -else -echo "The \"labltk\" library: not found" -fi diff --git a/pkgs/development/compilers/ocaml/gnused-on-osx-fix.patch b/pkgs/development/compilers/ocaml/gnused-on-osx-fix.patch deleted file mode 100644 index dc2bcb869766a..0000000000000 --- a/pkgs/development/compilers/ocaml/gnused-on-osx-fix.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -Nuar ocaml-3.11.1/ocamldoc/remove_DEBUG ocaml-3.11.1-nixpkgs/ocamldoc/remove_DEBUG ---- ocaml-3.11.1/ocamldoc/remove_DEBUG 2004-04-15 18:18:52.000000000 +0200 -+++ ocaml-3.11.1-nixpkgs/ocamldoc/remove_DEBUG 2011-01-01 17:37:07.000000000 +0100 -@@ -18,4 +18,4 @@ - # respecting the cpp # line annotation conventions - - echo "# 1 \"$1\"" --LC_ALL=C sed -e '/DEBUG/s/.*//' "$1" -+grep -v 'DEBUG' "$1" diff --git a/pkgs/development/compilers/ocaml/mips64.patch b/pkgs/development/compilers/ocaml/mips64.patch deleted file mode 100644 index cdef9cafb9323..0000000000000 --- a/pkgs/development/compilers/ocaml/mips64.patch +++ /dev/null @@ -1,240 +0,0 @@ -http://caml.inria.fr/mantis/view.php?id=4849 - -diff -bur ocaml-3.11.1/asmcomp/mips/arch.ml my_ocaml/asmcomp/mips/arch.ml ---- asmcomp/mips/arch.ml 2002-11-29 16:03:36.000000000 +0100 -+++ asmcomp/mips/arch.ml 2009-08-09 23:18:31.000000000 +0200 -@@ -35,7 +35,7 @@ - - let big_endian = - match Config.system with -- "ultrix" -> false -+ "ultrix" | "gnu" -> false - | "irix" -> true - | _ -> fatal_error "Arch_mips.big_endian" - -diff -bur ocaml-3.11.1/asmcomp/mips/emit.mlp my_ocaml/asmcomp/mips/emit.mlp ---- asmcomp/mips/emit.mlp 2004-01-05 21:25:56.000000000 +0100 -+++ asmcomp/mips/emit.mlp 2009-08-23 12:11:58.000000000 +0200 -@@ -58,7 +58,7 @@ - !stack_offset + - 4 * num_stack_slots.(0) + 8 * num_stack_slots.(1) + - (if !contains_calls then if !uses_gp then 8 else 4 else 0) in -- Misc.align size 16 -+ Misc.align size 16 (* n32 require quadword alignment *) - - let slot_offset loc cl = - match loc with -@@ -252,7 +252,7 @@ - | Lop(Icall_ind) -> - ` move $25, {emit_reg i.arg.(0)}\n`; - liveregs i live_25; -- ` jal {emit_reg i.arg.(0)}\n`; -+ ` jal $25\n`; (* {emit_reg i.arg.(0)}\n; Equivalent but avoids "Warning: MIPS PIC call to register other than $25" on GNU as *) - `{record_frame i.live}\n` - | Lop(Icall_imm s) -> - liveregs i 0; -@@ -269,7 +269,7 @@ - liveregs i 0; - ` move $25, {emit_reg i.arg.(0)}\n`; - liveregs i live_25; -- ` j {emit_reg i.arg.(0)}\n` -+ ` j $25\n` - | Lop(Itailcall_imm s) -> - if s = !function_name then begin - ` b {emit_label !tailrec_entry_point}\n` -@@ -277,11 +277,11 @@ - let n = frame_size() in - if !contains_calls then - ` lw $31, {emit_int(n - 4)}($sp)\n`; -+ ` la $25, {emit_symbol s}\n`; (* Rxd: put before gp restore *) - if !uses_gp then - ` lw $gp, {emit_int(n - 8)}($sp)\n`; - if n > 0 then - ` addu $sp, $sp, {emit_int n}\n`; -- ` la $25, {emit_symbol s}\n`; - liveregs i live_25; - ` j $25\n` - end -@@ -305,8 +305,13 @@ - begin match chunk with - Double_u -> - (* Destination is not 8-aligned, hence cannot use l.d *) -+ if big_endian then begin - ` ldl $24, {emit_addressing addr i.arg 0}\n`; -- ` ldr $24, {emit_addressing (offset_addressing addr 7) i.arg 0}\n`; -+ ` ldr $24, {emit_addressing (offset_addressing addr 7) i.arg 0}\n` -+ end else begin -+ ` ldl $24, {emit_addressing (offset_addressing addr 7) i.arg 0}\n`; -+ ` ldr $24, {emit_addressing addr i.arg 0}\n` -+ end; - ` dmtc1 $24, {emit_reg dest}\n` - | Single -> - ` l.s {emit_reg dest}, {emit_addressing addr i.arg 0}\n`; -@@ -328,8 +333,13 @@ - Double_u -> - (* Destination is not 8-aligned, hence cannot use l.d *) - ` dmfc1 $24, {emit_reg src}\n`; -+ if big_endian then begin - ` sdl $24, {emit_addressing addr i.arg 1}\n`; - ` sdr $24, {emit_addressing (offset_addressing addr 7) i.arg 1}\n` -+ end else begin -+ ` sdl $24, {emit_addressing (offset_addressing addr 7) i.arg 1}\n`; -+ ` sdr $24, {emit_addressing addr i.arg 1}\n` -+ end - | Single -> - ` cvt.s.d $f31, {emit_reg src}\n`; - ` s.s $f31, {emit_addressing addr i.arg 1}\n` -@@ -552,6 +562,7 @@ - (* There are really two groups of registers: - $sp and $30 always point to stack locations - $2 - $21 never point to stack locations. *) -+ if Config.system = "irix" then begin - ` .noalias $2,$sp; .noalias $2,$30; .noalias $3,$sp; .noalias $3,$30\n`; - ` .noalias $4,$sp; .noalias $4,$30; .noalias $5,$sp; .noalias $5,$30\n`; - ` .noalias $6,$sp; .noalias $6,$30; .noalias $7,$sp; .noalias $7,$30\n`; -@@ -561,7 +572,8 @@ - ` .noalias $14,$sp; .noalias $14,$30; .noalias $15,$sp; .noalias $15,$30\n`; - ` .noalias $16,$sp; .noalias $16,$30; .noalias $17,$sp; .noalias $17,$30\n`; - ` .noalias $18,$sp; .noalias $18,$30; .noalias $19,$sp; .noalias $19,$30\n`; -- ` .noalias $20,$sp; .noalias $20,$30; .noalias $21,$sp; .noalias $21,$30\n\n`; -+ ` .noalias $20,$sp; .noalias $20,$30; .noalias $21,$sp; .noalias $21,$30\n\n` -+ end; - let lbl_begin = Compilenv.make_symbol (Some "data_begin") in - ` .data\n`; - ` .globl {emit_symbol lbl_begin}\n`; -diff -bur ocaml-3.11.1/asmrun/mips.s my_ocaml/asmrun/mips.s ---- asmrun/mips.s 2004-07-13 14:18:53.000000000 +0200 -+++ asmrun/mips.s 2009-08-20 09:34:36.000000000 +0200 -@@ -187,7 +187,7 @@ - sw $30, caml_exception_pointer - /* Call C function */ - move $25, $24 -- jal $24 -+ jal $25 /* Rxd: $24 replaced by $25 to avoid this "Warning: MIPS PIC call to register other than $25" ? */ - /* Reload return address, alloc ptr, alloc limit */ - lw $31, 0($16) /* caml_last_return_address */ - lw $22, 0($17) /* caml_young_ptr */ -@@ -254,7 +254,7 @@ - sw $0, caml_last_return_address - /* Call the Caml code */ - move $25, $24 -- jal $24 -+ jal $25 /* Rxd: 24 replaced by 25 */ - $104: - /* Pop the trap frame, restoring caml_exception_pointer */ - lw $24, 0($sp) -@@ -384,3 +384,8 @@ - .word $104 /* return address into callback */ - .half -1 /* negative frame size => use callback link */ - .half 0 /* no roots here */ -+ -+#if defined(SYS_linux) -+ /* Mark stack as non-executable, PR#4564 */ -+ .section .note.GNU-stack,"",%progbits -+#endif -diff -bur ocaml-3.11.1/configure my_ocaml/configure ---- configure 2009-05-20 17:33:09.000000000 +0200 -+++ configure 2009-08-23 10:55:44.000000000 +0200 -@@ -40,7 +40,7 @@ - verbose=no - withcurses=yes - withsharedlibs=yes --gcc_warnings="-Wall" -+gcc_warnings="-W -Wall" - partialld="ld -r" - - # Try to turn internationalization off, can cause config.guess to malfunction! -@@ -292,6 +292,9 @@ - # (For those who want to force "cc -64") - # Turn off warning "unused library" - bytecclinkopts="-Wl,-woff,84";; -+ gcc*,mips64el-*) -+ bytecccompopts="" -+ bytecclinkopts="-fno-defer-pop $gcc_warnings -Wl,-O1 -Wl,--as-needed";; - *,alpha*-*-unicos*) - # For the Cray T3E - bytecccompopts="-DUMK";; -@@ -468,6 +471,8 @@ - echo "64-bit integers must be doubleword-aligned." - echo "#define ARCH_ALIGN_INT64" >> m.h - fi;; -+ mips64el-*) -+ echo "#define ARCH_ALIGN_INT64" >> m.h;; - *) - sh ./runtest int64align.c - case $? in -@@ -636,6 +641,7 @@ - fi;; - i[3456]86-*-gnu*) arch=i386; system=gnu;; - mips-*-irix6*) arch=mips; system=irix;; -+ mips*-gnu*) arch=mips; system=gnu;; - hppa1.1-*-hpux*) arch=hppa; system=hpux;; - hppa2.0*-*-hpux*) arch=hppa; system=hpux;; - hppa*-*-linux*) arch=hppa; system=linux;; -@@ -672,7 +678,7 @@ - if test -z "$ccoption"; then - case "$arch,$system,$cc" in - alpha,digital,gcc*) nativecc=cc;; -- mips,*,gcc*) nativecc=cc;; -+ mips,irix,gcc*) nativecc=cc;; - *) nativecc="$bytecc";; - esac - else -@@ -687,6 +693,9 @@ - alpha,cc*,digital,*) nativecccompopts=-std1;; - mips,cc*,irix,*) nativecccompopts=-n32 - nativecclinkopts="-n32 -Wl,-woff,84";; -+ mips,gcc*,gnu,mips64el-*) -+ nativecccompopts="$gcc_warnings -fPIC" -+ nativecclinkopts="--as-needed";; - *,*,nextstep,*) nativecccompopts="$gcc_warnings -U__GNUC__ -posix" - nativecclinkopts="-posix";; - *,*,rhapsody,*darwin[1-5].*) -@@ -725,6 +734,8 @@ - aspp='gcc -c -Wa,-xexplicit';; - mips,*,irix) as='as -n32 -O2 -nocpp -g0' - aspp='as -n32 -O2';; -+ mips,*,gnu) as='as -KPIC' -+ aspp='gcc -c -fPIC';; # got bus error without fPIC ? - power,*,elf) as='as -u -m ppc' - aspp='gcc -c';; - power,*,bsd) as='as' -@@ -756,6 +767,7 @@ - case "$nativecc" in gcc*) ;; *) cc_profile='-xpg';; esac;; - amd64,*,linux) profiling='prof';; - amd64,*,gnu) profiling='prof';; -+ mips,*,gnu) profiling='prof';; - *) profiling='noprof';; - esac - -diff -bur ocaml-3.11.1/asmcomp/mips/proc.ml my_ocaml/asmcomp/mips/proc.ml ---- asmcomp/mips/proc.ml 2007-10-30 13:37:16.000000000 +0100 -+++ asmcomp/mips/proc.ml 2010-03-18 08:08:06.000000000 +0100 -@@ -114,7 +114,7 @@ - incr int - end else begin - loc.(i) <- stack_slot (make_stack !ofs) ty; -- ofs := !ofs + size_int -+ ofs := !ofs + 8 - end - | Float -> - if !float <= last_float then begin -@@ -143,7 +143,7 @@ - or float regs $f12...$f19. Each argument "consumes" both one slot - in the int register file and one slot in the float register file. - Extra arguments are passed on stack, in a 64-bits slot, right-justified -- (i.e. at +4 from natural address). *) -+ (i.e. at +4 from natural address for big endians). *) - - let loc_external_arguments arg = - let loc = Array.create (Array.length arg) Reg.dummy in -@@ -158,7 +158,7 @@ - end else begin - begin match arg.(i).typ with - Float -> loc.(i) <- stack_slot (Outgoing !ofs) Float -- | ty -> loc.(i) <- stack_slot (Outgoing (!ofs + 4)) ty -+ | ty -> loc.(i) <- stack_slot (Outgoing (!ofs + (if big_endian then 4 else 0))) ty - end; - ofs := !ofs + 8 - end - From e82c2fc87809be4126d578f77f7e02bd4f06f4e3 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 16:21:05 +0200 Subject: [PATCH 134/323] ocaml: remove unused 4.00.1 --- pkgs/development/compilers/ocaml/4.00.1.nix | 67 --------------------- pkgs/top-level/aliases.nix | 3 +- pkgs/top-level/ocaml-packages.nix | 2 - 3 files changed, 1 insertion(+), 71 deletions(-) delete mode 100644 pkgs/development/compilers/ocaml/4.00.1.nix diff --git a/pkgs/development/compilers/ocaml/4.00.1.nix b/pkgs/development/compilers/ocaml/4.00.1.nix deleted file mode 100644 index a4b21251bd182..0000000000000 --- a/pkgs/development/compilers/ocaml/4.00.1.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ stdenv, fetchurl, ncurses, xlibsWrapper }: - -let - useX11 = !stdenv.isAarch32 && !stdenv.isMips; - useNativeCompilers = !stdenv.isMips; - inherit (stdenv.lib) optional optionals optionalString; -in - -stdenv.mkDerivation rec { - pname = "ocaml"; - version = "4.00.1"; - - src = fetchurl { - url = "https://caml.inria.fr/pub/distrib/ocaml-4.00/${pname}-${version}.tar.bz2"; - sha256 = "33c3f4acff51685f5bfd7c260f066645e767d4e865877bf1613c176a77799951"; - }; - - prefixKey = "-prefix "; - configureFlags = [ "-no-tk" ] ++ optionals useX11 [ "-x11lib" xlibsWrapper ]; - buildFlags = [ "world" ] ++ optionals useNativeCompilers [ "bootstrap" "world.opt" ]; - buildInputs = [ ncurses ] ++ optional useX11 xlibsWrapper; - installTargets = "install" + optionalString useNativeCompilers " installopt"; - preConfigure = '' - CAT=$(type -tp cat) - sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang - ''; - postBuild = '' - mkdir -p $out/include - ln -sv $out/lib/ocaml/caml $out/include/caml - ''; - - passthru = { - nativeCompilers = useNativeCompilers; - }; - - meta = with stdenv.lib; { - homepage = http://caml.inria.fr/ocaml; - branch = "4.00"; - license = with licenses; [ - qpl /* compiler */ - lgpl2 /* library */ - ]; - description = "Most popular variant of the Caml language"; - - longDescription = - '' - OCaml is the most popular variant of the Caml language. From a - language standpoint, it extends the core Caml language with a - fully-fledged object-oriented layer, as well as a powerful module - system, all connected by a sound, polymorphic type system featuring - type inference. - - The OCaml system is an industrial-strength implementation of this - language, featuring a high-performance native-code compiler (ocamlopt) - for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc, - Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc) - and an interactive read-eval-print loop (ocaml) for quick development - and portability. The OCaml distribution includes a comprehensive - standard library, a replay debugger (ocamldebug), lexer (ocamllex) and - parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4) - and a documentation generator (ocamldoc). - ''; - - platforms = with platforms; linux; - }; - -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 88e7d4d9e8445..0d4257dc73ec7 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -574,7 +574,7 @@ mapAliases ({ callPackage_i686 = pkgsi686Linux.callPackage; inherit (ocaml-ng) # added 2016-09-14 - ocamlPackages_4_00_1 ocamlPackages_4_01_0 ocamlPackages_4_02 + ocamlPackages_4_01_0 ocamlPackages_4_02 ocamlPackages_4_03 ocamlPackages_latest; @@ -597,7 +597,6 @@ mapAliases ({ # added 2019-09-06 zeroc_ice = pkgs.zeroc-ice; } // (with ocaml-ng; { # added 2016-09-14 - ocaml_4_00_1 = ocamlPackages_4_00_1.ocaml; ocaml_4_01_0 = ocamlPackages_4_01_0.ocaml; ocaml_4_02 = ocamlPackages_4_02.ocaml; ocaml_4_03 = ocamlPackages_4_03.ocaml; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 7e12a3db3f78d..f56bada41ef1d 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1208,8 +1208,6 @@ let in let inherit (pkgs) callPackage; in rec { - ocamlPackages_4_00_1 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.00.1.nix { }); - ocamlPackages_4_01_0 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.01.0.nix { }); ocamlPackages_4_02 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.02.nix { }); From fbfbb1db02cc86a1ac0a4736612b3e810135a1d5 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 16:29:46 +0200 Subject: [PATCH 135/323] ocaml: remove unused 4.03 --- pkgs/development/compilers/ocaml/4.03.nix | 6 ------ pkgs/top-level/aliases.nix | 2 -- pkgs/top-level/ocaml-packages.nix | 2 -- 3 files changed, 10 deletions(-) delete mode 100644 pkgs/development/compilers/ocaml/4.03.nix diff --git a/pkgs/development/compilers/ocaml/4.03.nix b/pkgs/development/compilers/ocaml/4.03.nix deleted file mode 100644 index 0bbe823304199..0000000000000 --- a/pkgs/development/compilers/ocaml/4.03.nix +++ /dev/null @@ -1,6 +0,0 @@ -import ./generic.nix { - major_version = "4"; - minor_version = "03"; - patch_version = "0"; - sha256 = "09p3iwwi55r6rbrpyp8f0wmkb0ppcgw67yxw6yfky60524wayp39"; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 0d4257dc73ec7..4cd13dca6f607 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -575,7 +575,6 @@ mapAliases ({ inherit (ocaml-ng) # added 2016-09-14 ocamlPackages_4_01_0 ocamlPackages_4_02 - ocamlPackages_4_03 ocamlPackages_latest; gst_all = { # added 2018-04-25 @@ -599,7 +598,6 @@ mapAliases ({ } // (with ocaml-ng; { # added 2016-09-14 ocaml_4_01_0 = ocamlPackages_4_01_0.ocaml; ocaml_4_02 = ocamlPackages_4_02.ocaml; - ocaml_4_03 = ocamlPackages_4_03.ocaml; }) // { # added 2019-10-28 diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index f56bada41ef1d..332c7414229e1 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1212,8 +1212,6 @@ in let inherit (pkgs) callPackage; in rec ocamlPackages_4_02 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.02.nix { }); - ocamlPackages_4_03 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.03.nix { }); - ocamlPackages_4_04 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.04.nix { }); ocamlPackages_4_05 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.05.nix { }); From 5f962038f261a70b2941b79065890f02842db297 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 16:30:13 +0200 Subject: [PATCH 136/323] ocaml: remove unused 4.04 --- pkgs/development/compilers/ocaml/4.04.nix | 9 --------- pkgs/top-level/ocaml-packages.nix | 2 -- 2 files changed, 11 deletions(-) delete mode 100644 pkgs/development/compilers/ocaml/4.04.nix diff --git a/pkgs/development/compilers/ocaml/4.04.nix b/pkgs/development/compilers/ocaml/4.04.nix deleted file mode 100644 index 4f49bcf807285..0000000000000 --- a/pkgs/development/compilers/ocaml/4.04.nix +++ /dev/null @@ -1,9 +0,0 @@ -import ./generic.nix { - major_version = "4"; - minor_version = "04"; - patch_version = "2"; - sha256 = "0bhgjzi78l10824qga85nlh18jg9lb6aiamf9dah1cs6jhzfsn6i"; - - # If the executable is stipped it does not work - dontStrip = true; -} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 332c7414229e1..4b09f04767070 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1212,8 +1212,6 @@ in let inherit (pkgs) callPackage; in rec ocamlPackages_4_02 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.02.nix { }); - ocamlPackages_4_04 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.04.nix { }); - ocamlPackages_4_05 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.05.nix { }); ocamlPackages_4_06 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.06.nix { }); From 9040bc011751a0de0ab7f21089adf930ec797d3e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 16:31:59 +0200 Subject: [PATCH 137/323] metaocaml_3_09: remove unused and broken package --- .../compilers/ocaml/metaocaml-3.09.nix | 34 ------------------- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 36 deletions(-) delete mode 100644 pkgs/development/compilers/ocaml/metaocaml-3.09.nix diff --git a/pkgs/development/compilers/ocaml/metaocaml-3.09.nix b/pkgs/development/compilers/ocaml/metaocaml-3.09.nix deleted file mode 100644 index 1f53c4f0e7829..0000000000000 --- a/pkgs/development/compilers/ocaml/metaocaml-3.09.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ stdenv, fetchurl, xlibsWrapper, ncurses }: - -stdenv.mkDerivation ({ - - pname = "metaocaml"; - version = "3.09-alpha-30"; - - src = fetchurl { - url = "http://www.metaocaml.org/dist/old/MetaOCaml_309_alpha_030.tar.gz"; - sha256 = "0migbn0zwfb7yb24dy7qfqi19sv3drqcv4369xi7xzpds2cs35fd"; - }; - - prefixKey = "-prefix "; - configureFlags = ["-no-tk" "-x11lib" xlibsWrapper]; - buildFlags = [ "world" "bootstrap" "world.opt" ]; - buildInputs = [xlibsWrapper ncurses]; - installTargets = "install installopt"; - patchPhase = '' - CAT=$(type -tp cat) - sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang - ''; - postBuild = '' - mkdir -p $out/include - ln -sv $out/lib/ocaml/caml $out/include/caml - ''; - - meta = { - homepage = http://www.metaocaml.org/; - license = with stdenv.lib.licenses; [ qpl lgpl2 ]; - description = "A compiled, type-safe, multi-stage programming language"; - broken = true; - }; - -}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3853d3cef3b20..59697e22838dd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8872,8 +8872,6 @@ in orc = callPackage ../development/compilers/orc { }; - metaocaml_3_09 = callPackage ../development/compilers/ocaml/metaocaml-3.09.nix { }; - ber_metaocaml = callPackage ../development/compilers/ocaml/ber-metaocaml.nix { }; ocaml_make = callPackage ../development/ocaml-modules/ocamlmake { }; From c3a54ba969eb8911836059b5136de6d84e2a795c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 22:49:34 +0200 Subject: [PATCH 138/323] treewide: cleanup prefixKey logic --- pkgs/applications/science/logic/coq/default.nix | 3 ++- pkgs/development/compilers/ocaml/4.01.0.nix | 2 ++ pkgs/development/compilers/ocaml/4.02.nix | 2 ++ pkgs/development/compilers/ocaml/4.05.nix | 2 ++ pkgs/development/compilers/ocaml/4.06.nix | 2 ++ pkgs/development/compilers/ocaml/4.07.nix | 2 ++ pkgs/development/compilers/ocaml/ber-metaocaml.nix | 3 ++- pkgs/development/compilers/ocaml/generic.nix | 1 - pkgs/development/libraries/liblastfm/default.nix | 1 - pkgs/development/libraries/qt-4.x/4.8/default.nix | 3 ++- pkgs/development/libraries/qt-5/modules/qtbase.nix | 2 -- pkgs/development/ocaml-modules/apron/default.nix | 2 +- pkgs/development/ocaml-modules/cil/default.nix | 1 - pkgs/development/ocaml-modules/elina/default.nix | 3 ++- pkgs/development/ocaml-modules/lwt/legacy.nix | 1 - pkgs/development/ocaml-modules/mlgmpidl/default.nix | 7 ++++--- pkgs/development/ocaml-modules/psmt2-frontend/default.nix | 2 -- pkgs/development/tools/analysis/eresi/default.nix | 3 +-- pkgs/development/tools/ocaml/camlp5/default.nix | 2 +- pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix | 5 ----- pkgs/stdenv/generic/setup.sh | 6 +++++- pkgs/tools/misc/rmlint/default.nix | 2 -- 22 files changed, 30 insertions(+), 27 deletions(-) diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix index 85c5d23ffcad5..b4416ad1c9079 100644 --- a/pkgs/applications/science/logic/coq/default.nix +++ b/pkgs/applications/science/logic/coq/default.nix @@ -141,7 +141,8 @@ self = stdenv.mkDerivation { ) ''; - prefixKey = "-prefix "; + prefixKey = "-prefix"; + prefixAsSeperateFlag = true; buildFlags = [ "revision" "coq" "coqide" "bin/votour" ]; diff --git a/pkgs/development/compilers/ocaml/4.01.0.nix b/pkgs/development/compilers/ocaml/4.01.0.nix index 6362f360f7dab..12694c4859417 100644 --- a/pkgs/development/compilers/ocaml/4.01.0.nix +++ b/pkgs/development/compilers/ocaml/4.01.0.nix @@ -4,4 +4,6 @@ import ./generic.nix { patch_version = "0"; patches = [ ./fix-clang-build-on-osx.diff ]; sha256 = "03d7ida94s1gpr3gadf4jyhmh5rrszd5s4m4z59daaib25rvfyv7"; + + prefixAsSeperateFlag = true; } diff --git a/pkgs/development/compilers/ocaml/4.02.nix b/pkgs/development/compilers/ocaml/4.02.nix index 4773f9f74a5a1..0c7e58e3a558d 100644 --- a/pkgs/development/compilers/ocaml/4.02.nix +++ b/pkgs/development/compilers/ocaml/4.02.nix @@ -4,4 +4,6 @@ import ./generic.nix { patch_version = "3"; patches = [ ./ocamlbuild.patch ]; sha256 = "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3"; + + prefixAsSeperateFlag = true; } diff --git a/pkgs/development/compilers/ocaml/4.05.nix b/pkgs/development/compilers/ocaml/4.05.nix index a63b06a9f6288..58ef2f3bcd437 100644 --- a/pkgs/development/compilers/ocaml/4.05.nix +++ b/pkgs/development/compilers/ocaml/4.05.nix @@ -6,4 +6,6 @@ import ./generic.nix { # If the executable is stipped it does not work dontStrip = true; + + prefixAsSeperateFlag = true; } diff --git a/pkgs/development/compilers/ocaml/4.06.nix b/pkgs/development/compilers/ocaml/4.06.nix index b54b8a6288fea..96ec9ff9e3626 100644 --- a/pkgs/development/compilers/ocaml/4.06.nix +++ b/pkgs/development/compilers/ocaml/4.06.nix @@ -6,4 +6,6 @@ import ./generic.nix { # If the executable is stipped it does not work dontStrip = true; + + prefixAsSeperateFlag = true; } diff --git a/pkgs/development/compilers/ocaml/4.07.nix b/pkgs/development/compilers/ocaml/4.07.nix index c1952f30ba688..dc967d58ef1c9 100644 --- a/pkgs/development/compilers/ocaml/4.07.nix +++ b/pkgs/development/compilers/ocaml/4.07.nix @@ -6,4 +6,6 @@ import ./generic.nix { # If the executable is stripped it does not work dontStrip = true; + + prefixAsSeperateFlag = true; } diff --git a/pkgs/development/compilers/ocaml/ber-metaocaml.nix b/pkgs/development/compilers/ocaml/ber-metaocaml.nix index bbaee35849028..4c5f78c0b7416 100644 --- a/pkgs/development/compilers/ocaml/ber-metaocaml.nix +++ b/pkgs/development/compilers/ocaml/ber-metaocaml.nix @@ -31,7 +31,8 @@ stdenv.mkDerivation rec { x11lib = "${x11env}/lib"; x11inc = "${x11env}/include"; - prefixKey = "-prefix "; + prefixAsSeperateFlag = true; + configureFlags = optionals useX11 [ "-x11lib" x11lib "-x11include" x11inc diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix index 12369ebcc6f11..36c5efdcb32c5 100644 --- a/pkgs/development/compilers/ocaml/generic.nix +++ b/pkgs/development/compilers/ocaml/generic.nix @@ -42,7 +42,6 @@ stdenv.mkDerivation (args // { inherit sha256; }; - prefixKey = "-prefix "; configureFlags = let flags = new: old: if stdenv.lib.versionAtLeast version "4.08" diff --git a/pkgs/development/libraries/liblastfm/default.nix b/pkgs/development/libraries/liblastfm/default.nix index ff1a39fc2049c..53dd21ce87c4f 100644 --- a/pkgs/development/libraries/liblastfm/default.nix +++ b/pkgs/development/libraries/liblastfm/default.nix @@ -14,7 +14,6 @@ stdenv.mkDerivation rec { sha256 = "1j34xc30vg7sfszm2jx9mlz9hy7p1l929fka9wnfcpbib8gfi43x"; }; - prefixKey = "--prefix "; propagatedBuildInputs = [ qt4 libsamplerate fftwSinglePrec ]; nativeBuildInputs = [ pkgconfig which cmake ]; buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.SystemConfiguration; diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index e28de9a5189df..a880a78cb250d 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -149,7 +149,8 @@ stdenv.mkDerivation rec { mkspecs/win32-g++/qmake.conf ''; - prefixKey = "-prefix "; + prefixKey = "-prefix"; + prefixAsSeperateFlag = true; configurePlatforms = []; configureFlags = let diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index 10979e834d94d..d5c0340f8be70 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -207,8 +207,6 @@ stdenv.mkDerivation { ] ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC"); - prefixKey = "-prefix "; - # PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag # if dependency paths contain the string "pq", which can occur in the hash. # To prevent these failures, we need to override PostgreSQL detection. diff --git a/pkgs/development/ocaml-modules/apron/default.nix b/pkgs/development/ocaml-modules/apron/default.nix index b462e10979aa9..4caf0e6416e18 100644 --- a/pkgs/development/ocaml-modules/apron/default.nix +++ b/pkgs/development/ocaml-modules/apron/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ perl gmp mpfr ppl ocaml findlib camlidl ]; propagatedBuildInputs = [ mlgmpidl ]; - prefixKey = "-prefix "; + prefixAsSeperateFlag = true; preBuild = "mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs"; meta = { diff --git a/pkgs/development/ocaml-modules/cil/default.nix b/pkgs/development/ocaml-modules/cil/default.nix index 5fbb141b6ccea..1ef2775c94f01 100644 --- a/pkgs/development/ocaml-modules/cil/default.nix +++ b/pkgs/development/ocaml-modules/cil/default.nix @@ -19,7 +19,6 @@ stdenv.mkDerivation { substituteInPlace Makefile.in --replace 'MACHDEPCC=gcc' 'MACHDEPCC=$(CC)' export FORCE_PERL_PREFIX=1 ''; - prefixKey = "-prefix="; meta = with stdenv.lib; { homepage = http://kerneis.github.io/cil/; diff --git a/pkgs/development/ocaml-modules/elina/default.nix b/pkgs/development/ocaml-modules/elina/default.nix index b41743f542d83..bdc700c654a16 100644 --- a/pkgs/development/ocaml-modules/elina/default.nix +++ b/pkgs/development/ocaml-modules/elina/default.nix @@ -12,7 +12,6 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ apron camlidl gmp mpfr ]; - prefixKey = "--prefix "; configureFlags = [ "--use-apron" "--use-opam" @@ -21,6 +20,8 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional stdenv.isDarwin "--absolute-dylibs" ; + prefixAsSeperateFlag = true; + createFindlibDestdir = true; meta = { diff --git a/pkgs/development/ocaml-modules/lwt/legacy.nix b/pkgs/development/ocaml-modules/lwt/legacy.nix index c540124d1049d..a34ac8151af7f 100644 --- a/pkgs/development/ocaml-modules/lwt/legacy.nix +++ b/pkgs/development/ocaml-modules/lwt/legacy.nix @@ -36,7 +36,6 @@ buildOcaml { ++ [ libev ]; configureScript = "ocaml setup.ml -configure"; - prefixKey = "--prefix "; configureFlags = optionals [ "--enable-glib" "--enable-ssl" "--enable-react" ] ++ [ "--enable-camlp4" ] diff --git a/pkgs/development/ocaml-modules/mlgmpidl/default.nix b/pkgs/development/ocaml-modules/mlgmpidl/default.nix index 674d9ec64120a..64270f7af5b0e 100644 --- a/pkgs/development/ocaml-modules/mlgmpidl/default.nix +++ b/pkgs/development/ocaml-modules/mlgmpidl/default.nix @@ -12,10 +12,11 @@ stdenv.mkDerivation rec { buildInputs = [ perl gmp mpfr ocaml findlib camlidl ]; - prefixKey = "-prefix "; + prefixAsSeperateFlag = true; + configureFlags = [ - "--gmp-prefix ${gmp.dev}" - "--mpfr-prefix ${mpfr.dev}" + "--gmp-prefix" gmp.dev + "--mpfr-prefix" mpfr.dev ]; postConfigure = '' diff --git a/pkgs/development/ocaml-modules/psmt2-frontend/default.nix b/pkgs/development/ocaml-modules/psmt2-frontend/default.nix index 485620514e453..f5fcfa250469e 100644 --- a/pkgs/development/ocaml-modules/psmt2-frontend/default.nix +++ b/pkgs/development/ocaml-modules/psmt2-frontend/default.nix @@ -15,8 +15,6 @@ stdenv.mkDerivation rec { sha256 = "097zmbrx4gp2gnrxdmsm9lkkp5450gwi0blpxqy3833m6k5brx3n"; }; - prefixKey = "-prefix "; - nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ ocaml findlib menhir ]; diff --git a/pkgs/development/tools/analysis/eresi/default.nix b/pkgs/development/tools/analysis/eresi/default.nix index b84eeae15dcaf..a991cddad4474 100644 --- a/pkgs/development/tools/analysis/eresi/default.nix +++ b/pkgs/development/tools/analysis/eresi/default.nix @@ -47,12 +47,11 @@ stdenv.mkDerivation rec { # The configure script is not generated by autoconf but is hand-rolled, so it # has --enable-static but no --disabled-static and also doesn't support the # equals sign in --prefix. - prefixKey = "--prefix "; + prefixAsSeperateFlag = true; dontDisableStatic = true; nativeBuildInputs = [ which ]; buildInputs = [ openssl readline ]; - enableParallelBuilding = true; installTargets = lib.singleton "install" ++ lib.optional stdenv.is64bit "install64"; diff --git a/pkgs/development/tools/ocaml/camlp5/default.nix b/pkgs/development/tools/ocaml/camlp5/default.nix index e0bd0e4ac6768..b544666470056 100644 --- a/pkgs/development/tools/ocaml/camlp5/default.nix +++ b/pkgs/development/tools/ocaml/camlp5/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation { buildInputs = [ ocaml ]; - prefixKey = "-prefix "; + prefixAsSeperateFlag = true; preConfigure = "configureFlagsArray=(--strict" + " --libdir $out/lib/ocaml/${ocaml.version}/site-lib)"; diff --git a/pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix b/pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix index 6a3c0c20d85f2..c171df626587b 100644 --- a/pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix +++ b/pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix @@ -28,11 +28,6 @@ stdenv.mkDerivation { make PREFIX=$out all make PREFIX=$out install ''; -# prefixKey = "-prefix "; -# -# configureFlags = if transitional then "--transitional" else "--strict"; -# -# buildFlags = [ "world.opt" ]; meta = { description = "Omake build system"; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 744dd7c008bb9..e21698c2971e8 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -963,7 +963,11 @@ configurePhase() { fi if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - configureFlags=("${prefixKey:---prefix=}$prefix" "${configureFlags[@]}") + if [[ -z "${prefixAsSeperateFlag:-}" ]]; then + configureFlags=("${prefixKey:---prefix=}$prefix" "${configureFlags[@]}") + else + configureFlags=("${prefixKey:---prefix}" "$prefix" "${configureFlags[@]}") + fi fi # Add --disable-dependency-tracking to speed up some builds. diff --git a/pkgs/tools/misc/rmlint/default.nix b/pkgs/tools/misc/rmlint/default.nix index 408660bf3d9a9..b4d50a7f9ca57 100644 --- a/pkgs/tools/misc/rmlint/default.nix +++ b/pkgs/tools/misc/rmlint/default.nix @@ -24,8 +24,6 @@ stdenv.mkDerivation rec { glib json-glib libelf utillinux ]; - prefixKey = "--prefix="; - meta = { description = "Extremely fast tool to remove duplicates and other lint from your filesystem"; homepage = https://rmlint.readthedocs.org; From 64b344d7c94c2f3b24235d8e774b6eb240969847 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 22:50:01 +0200 Subject: [PATCH 139/323] fetchurl: fix for structured attrs --- pkgs/build-support/fetchurl/builder.sh | 18 ++++++++++-------- pkgs/build-support/fetchurl/default.nix | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pkgs/build-support/fetchurl/builder.sh b/pkgs/build-support/fetchurl/builder.sh index 74fdc320835fb..8b983615f1ad6 100644 --- a/pkgs/build-support/fetchurl/builder.sh +++ b/pkgs/build-support/fetchurl/builder.sh @@ -1,3 +1,5 @@ +source .attrs.sh + source $stdenv/setup source $mirrorsFile @@ -17,7 +19,7 @@ curl=( --cookie-jar cookies --insecure --user-agent "curl/$curlVersion Nixpkgs/$nixpkgsVersion" - $curlOpts + "${curlOpts[@]}" $NIX_CURL_FLAGS ) @@ -85,10 +87,10 @@ tryHashedMirrors() { # URL list may contain ?. No glob expansion for that, please set -o noglob -urls2= -for url in $urls; do +declare -a urls2 +for url in "${urls[@]}"; do if test "${url:0:9}" != "mirror://"; then - urls2="$urls2 $url" + urls2+=("$url") else url2="${url:9}"; echo "${url2/\// }" > split; read site fileName < split #varName="mirror_$site" @@ -103,18 +105,18 @@ for url in $urls; do if test -n "${!varName}"; then mirrors="${!varName}"; fi for url3 in $mirrors; do - urls2="$urls2 $url3$fileName"; + urls2+=("$url3$fileName") done fi fi done -urls="$urls2" +urls=("${urls2[@]}") # Restore globbing settings set +o noglob if test -n "$showURLs"; then - echo "$urls" > $out + echo "${urls[@]}" > $out exit 0 fi @@ -126,7 +128,7 @@ fi set -o noglob success= -for url in $urls; do +for url in "${urls[@]}"; do if [ -z "$postFetch" ]; then case "$url" in https://github.com/*/archive/*) diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index 00215efd7527b..375dacfa95953 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -44,7 +44,7 @@ in urls ? [] , # Additional curl options needed for the download to succeed. - curlOpts ? "" + curlOpts ? [] , # Name of the file. If empty, use the basename of `url' (or of the # first element of `urls'). From 6860f87ae6e92bbf0cb3d062c50a3644d15328e2 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 22:50:57 +0200 Subject: [PATCH 140/323] treewide: fix CFLAGS for structured attrs --- pkgs/development/libraries/freetype/default.nix | 4 ++-- pkgs/development/libraries/gdal/default.nix | 5 ++--- pkgs/development/libraries/libspatialite/default.nix | 2 +- pkgs/development/libraries/ncurses/default.nix | 2 +- pkgs/development/ocaml-modules/zarith/default.nix | 2 +- pkgs/stdenv/generic/make-derivation.nix | 1 + pkgs/tools/misc/rmlint/default.nix | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix index 6eaf1bbcc2f4a..3693b13e4f6c7 100644 --- a/pkgs/development/libraries/freetype/default.nix +++ b/pkgs/development/libraries/freetype/default.nix @@ -53,10 +53,10 @@ in stdenv.mkDerivation rec { configureFlags = [ "--bindir=$(dev)/bin" "--enable-freetype-config" ]; # native compiler to generate building tool - CC_BUILD = "${buildPackages.stdenv.cc}/bin/cc"; + env.CC_BUILD = "${buildPackages.stdenv.cc}/bin/cc"; # The asm for armel is written with the 'asm' keyword. - CFLAGS = optionalString stdenv.isAarch32 "-std=gnu99"; + env.CFLAGS = optionalString stdenv.isAarch32 "-std=gnu99"; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix index 7f3e796bbf1b3..ac9033a687a3f 100644 --- a/pkgs/development/libraries/gdal/default.nix +++ b/pkgs/development/libraries/gdal/default.nix @@ -58,12 +58,11 @@ stdenv.mkDerivation rec { "--with-geos=${geos}/bin/geos-config" # optional "--with-hdf4=${hdf4.dev}" # optional "--with-xml2=${libxml2.dev}/bin/xml2-config" # optional - (if netcdfSupport then "--with-netcdf=${netcdf}" else "") - ]; + ] ++ stdenv.lib.optional netcdfSupport "--with-netcdf=${netcdf}"; hardeningDisable = [ "format" ]; - CXXFLAGS = "-fpermissive"; + env.CXXFLAGS = "-fpermissive"; # - Unset CC and CXX as they confuse libtool. # - teach gdal that libdf is the legacy name for libhdf diff --git a/pkgs/development/libraries/libspatialite/default.nix b/pkgs/development/libraries/libspatialite/default.nix index 7bd22248d8769..8ee4589f438e5 100644 --- a/pkgs/development/libraries/libspatialite/default.nix +++ b/pkgs/development/libraries/libspatialite/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - CFLAGS = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; + env.CFLAGS = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; postInstall = "" + optionalString stdenv.isDarwin '' ln -s $out/lib/mod_spatialite.{so,dylib} diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 8b91246b6fdc6..ff576fd0afb79 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -48,7 +48,7 @@ stdenv.mkDerivation rec { ]; # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris: - CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED"; + env.CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED"; depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ diff --git a/pkgs/development/ocaml-modules/zarith/default.nix b/pkgs/development/ocaml-modules/zarith/default.nix index f0cb5a5948585..b526281340ef4 100644 --- a/pkgs/development/ocaml-modules/zarith/default.nix +++ b/pkgs/development/ocaml-modules/zarith/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { patchPhase = "patchShebangs ./z_pp.pl"; dontAddPrefix = true; - configureFlags = [ "-installdir ${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib" ]; + configureFlags = [ "-installdir" "${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib" ]; preInstall = "mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs"; diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 2194f812cf61f..4e2d26d9e8fc5 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -101,6 +101,7 @@ in rec { assert lib.isList (attrs.patchFlags or []); assert lib.isList (attrs.installFlags or []); assert lib.isList (attrs.installTargets or []); + assert !(attrs ? CFLAGS); assert !(attrs ? CXXFLAGS); assert !(attrs ? NIX_LDFLAGS); assert !(attrs ? NIX_CFLAGS_COMPILE); diff --git a/pkgs/tools/misc/rmlint/default.nix b/pkgs/tools/misc/rmlint/default.nix index b4d50a7f9ca57..74bfc6c274980 100644 --- a/pkgs/tools/misc/rmlint/default.nix +++ b/pkgs/tools/misc/rmlint/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { sha256 = "1b5cziam14h80xrfb285fmfrzz2rligxcpsq1xsig14xf4l2875i"; }; - CFLAGS="-I${stdenv.lib.getDev utillinux}/include"; + env.CFLAGS = "-I${stdenv.lib.getDev utillinux}/include"; nativeBuildInputs = [ pkgconfig sphinx gettext scons From a08512f5efe08ca32e3bf8e99c8027e6e9ae24ad Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 22:51:53 +0200 Subject: [PATCH 141/323] qt4: fix for structured attrs --- .../libraries/qt-4.x/4.8/default.nix | 23 ++++++++++--------- .../libraries/qt-4.x/4.8/qmake-hook.sh | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index a880a78cb250d..68d802415ac72 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -126,17 +126,18 @@ stdenv.mkDerivation rec { preConfigure = '' export LD_LIBRARY_PATH="`pwd`/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" - configureFlags+=" - -docdir $out/share/doc/${name} - -plugindir $out/lib/qt4/plugins - -importdir $out/lib/qt4/imports - -examplesdir $TMPDIR/share/doc/${name}/examples - -demosdir $TMPDIR/share/doc/${name}/demos - -datadir $out/share/${name} - -translationdir $out/share/${name}/translations - --jobs=$NIX_BUILD_CORES - " unset LD # Makefile uses gcc for linking; setting LD interferes + + configureFlags+=( + "-docdir" "''${out}/share/doc/${name}" + "-plugindir" "''${out}/lib/qt4/plugins" + "-importdir" "''${out}/lib/qt4/imports" + "-examplesdir" "''${TMPDIR}/share/doc/${name}/examples" + "-demosdir" "''${TMPDIR}/share/doc/${name}/demos" + "-datadir" "''${out}/share/${name}" + "-translationdir" "''${out}/share/${name}/translations" + "--jobs=''${NIX_BUILD_CORES}" + ) '' + lib.optionalString stdenv.cc.isClang '' sed -i 's/QMAKE_CC = gcc/QMAKE_CC = clang/' mkspecs/common/g++-base.conf sed -i 's/QMAKE_CXX = g++/QMAKE_CXX = clang++/' mkspecs/common/g++-base.conf @@ -199,7 +200,7 @@ stdenv.mkDerivation rec { buildInputs = [ cups # Qt dlopen's libcups instead of linking to it postgresql sqlite libjpeg libmng libtiff icu ] - ++ lib.optionals (libmysqlclient != null) [ libmysqlclient ] + ++ lib.optional (libmysqlclient != null) libmysqlclient ++ lib.optionals gtkStyle [ gtk2 gdk-pixbuf ] ++ lib.optionals stdenv.isDarwin [ ApplicationServices OpenGL Cocoa AGL libcxx libobjc ]; diff --git a/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh b/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh index f288e99dd12ad..f6643747925b2 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh +++ b/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh @@ -1,7 +1,7 @@ qmakeConfigurePhase() { runHook preConfigure - $QMAKE PREFIX=$out $qmakeFlags + $QMAKE PREFIX=$out "${qmakeFlags[@]}" if ! [[ -v enableParallelBuilding ]]; then enableParallelBuilding=1 From c9038c050fb305be64778d9b03c1c6fc57289dec Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 22:52:18 +0200 Subject: [PATCH 142/323] qt5.qtbase: fix for structured attrs --- .../libraries/qt-5/hooks/move-qt-dev-tools.sh | 8 +++--- .../libraries/qt-5/hooks/qmake-hook.sh | 2 +- .../libraries/qt-5/hooks/qtbase-setup-hook.sh | 2 +- .../libraries/qt-5/hooks/wrap-qt-apps-hook.sh | 2 +- .../libraries/qt-5/modules/qtbase.nix | 28 +++++++++---------- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pkgs/development/libraries/qt-5/hooks/move-qt-dev-tools.sh b/pkgs/development/libraries/qt-5/hooks/move-qt-dev-tools.sh index 85489c85105bc..a8d653232a1be 100644 --- a/pkgs/development/libraries/qt-5/hooks/move-qt-dev-tools.sh +++ b/pkgs/development/libraries/qt-5/hooks/move-qt-dev-tools.sh @@ -10,14 +10,14 @@ updateToolPath() { } moveQtDevTools() { - if [ -n "$devTools" ]; then - for tool in $devTools; do + if [[ -n ${devTools[@]+"${devTools[@]}"} ]]; then + for tool in "${devTools[@]}"; do moveToOutput "$tool" "${!outputDev}" done if [ -d "${!outputDev}/mkspecs" ]; then find "${!outputDev}/mkspecs" -name '*.pr?' | while read pr_; do - for tool in $devTools; do + for tool in "${devTools[@]}"; do updateToolPath "$tool" "$pr_" done done @@ -25,7 +25,7 @@ moveQtDevTools() { if [ -d "${!outputDev}/lib/cmake" ]; then find "${!outputDev}/lib/cmake" -name '*.cmake' | while read cmake; do - for tool in $devTools; do + for tool in "${devTools[@]}"; do updateToolPath "$tool" "$cmake" done done diff --git a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh index 7f6ddb76ad571..069b1244883db 100644 --- a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh +++ b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh @@ -1,6 +1,6 @@ . @fix_qmake_libtool@ -qmakeFlags=( ${qmakeFlags-} ) +qmakeFlags=${qmakeFlags[@]+"${qmakeFlags[@]}"} qmakePrePhase() { qmakeFlags=( \ diff --git a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh index 9f2a9f06f1aba..4e67e77394f93 100644 --- a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh +++ b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh @@ -37,7 +37,7 @@ envBuildHostHooks+=(qmakePathHook) qtEnvHostTargetHook() { if providesQtRuntime "$1" && [ "z${!outputBin}" != "z${!outputDev}" ] then - propagatedBuildInputs+=" $1" + propagatedBuildInputs+=("$1") fi } envHostTargetHooks+=(qtEnvHostTargetHook) diff --git a/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh b/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh index 7356c8ee35605..addb4f2bea48b 100644 --- a/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh +++ b/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh @@ -1,5 +1,5 @@ # Inherit arguments given in mkDerivation -qtWrapperArgs=( ${qtWrapperArgs-} ) +qtWrapperArgs=(${qtWrapperArgs[@]+"${qtWrapperArgs[@]}"}) qtHostPathSeen=() diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index d5c0340f8be70..c131f21cd8b26 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -210,14 +210,14 @@ stdenv.mkDerivation { # PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag # if dependency paths contain the string "pq", which can occur in the hash. # To prevent these failures, we need to override PostgreSQL detection. - PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq"; + env.PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq"; # TODO Remove obsolete and useless flags once the build will be totally mastered configureFlags = [ - "-plugindir $(out)/$(qtPluginPrefix)" - "-qmldir $(out)/$(qtQmlPrefix)" - "-docdir $(out)/$(qtDocPrefix)" + "-plugindir" "$(out)/$(qtPluginPrefix)" + "-qmldir" "$(out)/$(qtQmlPrefix)" + "-docdir" "$(out)/$(qtDocPrefix)" "-verbose" "-confirm-license" @@ -233,7 +233,7 @@ stdenv.mkDerivation { "-gui" "-widgets" - "-opengl desktop" + "-opengl" "desktop" "-icu" "-L" "${icu.out}/lib" "-I" "${icu.dev}/include" @@ -286,13 +286,13 @@ stdenv.mkDerivation { "-L" "${openssl.out}/lib" "-I" "${openssl.dev}/include" "-system-sqlite" - ''-${if libmysqlclient != null then "plugin" else "no"}-sql-mysql'' - ''-${if postgresql != null then "plugin" else "no"}-sql-psql'' + "-${if libmysqlclient != null then "plugin" else "no"}-sql-mysql" + "-${if postgresql != null then "plugin" else "no"}-sql-psql" - "-make libs" - "-make tools" - ''-${lib.optionalString (!buildExamples) "no"}make examples'' - ''-${lib.optionalString (!buildTests) "no"}make tests'' + "-make" "libs" + "-make" "tools" + "-${lib.optionalString (!buildExamples) "no"}make" "examples" + "-${lib.optionalString (!buildTests) "no"}make" "tests" "-v" ] @@ -300,7 +300,7 @@ stdenv.mkDerivation { if stdenv.isDarwin then [ - "-platform macx-clang" + "-platform" "macx-clang" "-no-fontconfig" "-qt-freetype" "-qt-libpng" @@ -312,7 +312,7 @@ stdenv.mkDerivation { "-system-xcb" "-xcb" - "-qpa xcb" + "-qpa" "xcb" "-L" "${libX11.out}/lib" "-I" "${libX11.out}/include" "-L" "${libXext.out}/lib" @@ -322,7 +322,7 @@ stdenv.mkDerivation { "-libinput" - ''-${lib.optionalString (cups == null) "no-"}cups'' + "-${lib.optionalString (cups == null) "no-"}cups" "-dbus-linked" "-glib" "-system-libjpeg" From cead2193497274381eb41bc63ab7ce9bf49c0b89 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 23:00:16 +0200 Subject: [PATCH 143/323] fluid: temporary sourceRoot=. fix --- pkgs/data/soundfonts/fluid/default.nix | 1 + pkgs/development/libraries/qt-3/builder.sh | 38 ---------------------- 2 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 pkgs/development/libraries/qt-3/builder.sh diff --git a/pkgs/data/soundfonts/fluid/default.nix b/pkgs/data/soundfonts/fluid/default.nix index 18c4160014f63..e2a47d88df839 100644 --- a/pkgs/data/soundfonts/fluid/default.nix +++ b/pkgs/data/soundfonts/fluid/default.nix @@ -9,6 +9,7 @@ stdenv.mkDerivation { }; sourceRoot = "."; + dontMakeSourcesWritable = true; installPhase = '' install -Dm644 "FluidR3 GM2-2.SF2" $out/share/soundfonts/FluidR3_GM2-2.sf2 diff --git a/pkgs/development/libraries/qt-3/builder.sh b/pkgs/development/libraries/qt-3/builder.sh deleted file mode 100644 index 460ae17766af7..0000000000000 --- a/pkgs/development/libraries/qt-3/builder.sh +++ /dev/null @@ -1,38 +0,0 @@ -source $stdenv/setup - - -preConfigure() { - - # Patch some of the configure files a bit to get of global paths. - # (Buildings using stuff in those paths will fail anyway, but it - # will cause ./configure misdetections). - for i in config.tests/unix/checkavail config.tests/*/*.test mkspecs/*/qmake.conf; do - echo "patching $i..." - substituteInPlace "$i" \ - --replace " /lib" " /FOO" \ - --replace "/usr" "/FOO" - done -} - - -# !!! TODO: -system-libmng -configureFlags="-prefix $out $configureFlags" -dontAddPrefix=1 - -configureScript=configureScript -configureScript() { - echo yes | ./configure $configureFlags - export LD_LIBRARY_PATH=$(pwd)/lib -} - - -postInstall() { - # Qt's `make install' is broken; it copies ./bin/qmake, which - # is a symlink to ./qmake/qmake. So we end up with a dangling - # symlink. - rm $out/bin/qmake - cp -p qmake/qmake $out/bin -} - - -genericBuild From 8b8568804d26d3f671b66455301aae471f7ea562 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 23:05:38 +0200 Subject: [PATCH 144/323] taskjuggler: remove unreferenced files --- .../misc/taskjuggler/2.x/default.nix | 75 ------------------- .../misc/taskjuggler/2.x/timezone-glibc.patch | 48 ------------ 2 files changed, 123 deletions(-) delete mode 100644 pkgs/applications/misc/taskjuggler/2.x/default.nix delete mode 100644 pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch diff --git a/pkgs/applications/misc/taskjuggler/2.x/default.nix b/pkgs/applications/misc/taskjuggler/2.x/default.nix deleted file mode 100644 index a0dc7b7c71e31..0000000000000 --- a/pkgs/applications/misc/taskjuggler/2.x/default.nix +++ /dev/null @@ -1,75 +0,0 @@ -{stdenv, fetchurl, -zlib, libpng, libjpeg, perl, expat, qt3, -libX11, libXext, libSM, libICE, -}: - -stdenv.mkDerivation rec { - name = "taskjuggler-2.4.3"; - src = fetchurl { - url = "http://www.taskjuggler.org/download/${name}.tar.bz2"; - sha256 = "14gkxa2vwfih5z7fffbavps7m44z5bq950qndigw2icam5ks83jl"; - }; - - buildInputs = - [zlib libpng libX11 libXext libSM libICE perl expat libjpeg] - ; - - patches = [ ./timezone-glibc.patch ]; - - preConfigure = '' - for i in $(grep -R "/bin/bash" . | sed 's/:.*//'); do - substituteInPlace $i --replace /bin/bash $(type -Pp bash) - done - for i in $(grep -R "/usr/bin/perl" . | sed 's/:.*//'); do - substituteInPlace $i --replace /usr/bin/perl ${perl}/bin/perl - done - - # Fix install - for i in docs/en/Makefile.in Examples/BigProject/Common/Makefile.in Examples/BigProject/Makefile.in Examples/BigProject/Project1/Makefile.in Examples/BigProject/Project2/Makefile.in Examples/FirstProject/Makefile.in Examples/ShiftSchedule/Makefile.in; do - # Do not use variable substitution because there is some text after the last '@' - substituteInPlace $i --replace 'docprefix = @PACKAGES_DIR@' 'docprefix = $(docdir)/' - done - - # Comment because the ical export need the KDE support. - for i in Examples/FirstProject/AccountingSoftware.tjp; do - substituteInPlace $i --replace "icalreport" "# icalreport" - done - - for i in TestSuite/testdir TestSuite/createrefs \ - TestSuite/Scheduler/Correct/Expression.sh; do - substituteInPlace $i --replace '/bin/rm' 'rm' - done - - # Some tests require writing at $HOME - HOME=$TMPDIR - ''; - - configureFlags = [ - "--without-arts" "--disable-docs" - "--x-includes=${libX11.dev}/include" - "--x-libraries=${libX11.out}/lib" - "--with-qt-dir=${qt3}" - ]; - - preInstall = '' - mkdir -p $out/share/emacs/site-lisp/ - cp Contrib/emacs/taskjug.el $out/share/emacs/site-lisp/ - ''; - - # kde_locale is not defined when installing without kde. - installFlags = [ "kde_locale=\${out}/share/locale" ]; - - meta = { - homepage = http://www.taskjuggler.org; - license = stdenv.lib.licenses.gpl2; - description = "Project management tool"; - longDescription = '' - TaskJuggler is a modern and powerful, Open Source project management - tool. Its new approach to project planing and tracking is more - flexible and superior to the commonly used Gantt chart editing - tools. It has already been successfully used in many projects and - scales easily to projects with hundreds of resources and thousands of - tasks. - ''; - }; -} diff --git a/pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch b/pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch deleted file mode 100644 index f599e8a1730ce..0000000000000 --- a/pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch +++ /dev/null @@ -1,48 +0,0 @@ -From the discussion in http://groups.google.com/group/taskjuggler-users/browse_thread/thread/f65a3efd4dcae2fc/a44c711a9d28ebee?show_docid=a44c711a9d28ebee - -From: Chris Schlaeger -Date: Sat, 27 Feb 2010 06:33:35 +0000 (+0100) -Subject: Try to fix time zone check for glibc 2.11. -X-Git-Url: http://www.taskjuggler.org/cgi-bin/gitweb.cgi?p=taskjuggler.git;a=commitdiff_plain;h=2382ed54f90c3c899badb3f56aaa2b3b5dba361e;hp=c666c5068312fec7db75e17d1c567d94127d1dda - -Try to fix time zone check for glibc 2.11. - -Reported-by: Lee ---- - -diff --git a/taskjuggler/Utility.cpp b/taskjuggler/Utility.cpp -index 5e2bf21..9b7fce2 100644 ---- a/taskjuggler/Utility.cpp -+++ b/taskjuggler/Utility.cpp -@@ -206,16 +206,28 @@ setTimezone(const char* tZone) - - /* To validate the tZone value we call tzset(). It will convert the zone - * into a three-letter acronym in case the tZone value is good. If not, it -- * will just copy the wrong value to tzname[0] (glibc < 2.5) or fall back -- * to UTC. */ -+ * will -+ * - copy the wrong value to tzname[0] (glibc < 2.5) -+ * - or fall back to UTC (glibc >= 2.5 && < 2.11) -+ * - copy the part before the '/' to tzname[0] (glibc >= 2.11). -+ */ - tzset(); -+ char* region = new(char[strlen(tZone) + 1]); -+ region[0] = 0; -+ if (strchr(tZone, '/')) -+ { -+ strcpy(region, tZone); -+ *strchr(region, '/') = 0; -+ } - if (timezone2tz(tZone) == 0 && -- (strcmp(tzname[0], tZone) == 0 || -+ (strcmp(tzname[0], tZone) == 0 || strcmp(tzname[0], region) == 0 || - (strcmp(tZone, "UTC") != 0 && strcmp(tzname[0], "UTC") == 0))) - { - UtilityError = QString(i18n("Illegal timezone '%1'")).arg(tZone); -+ delete region; - return false; - } -+ delete region; - - if (!LtHashTab) - return true; From 35e4ad64fd94c16ab219a4ffab483816efff7f23 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 23:07:41 +0200 Subject: [PATCH 145/323] lprof: remove ancient, dead package last reference to qt3 --- pkgs/tools/graphics/lprof/default.nix | 37 ------------------- .../graphics/lprof/keep-environment.patch | 16 -------- pkgs/tools/graphics/lprof/lcms-1.17.patch | 13 ------- pkgs/top-level/all-packages.nix | 2 - 4 files changed, 68 deletions(-) delete mode 100644 pkgs/tools/graphics/lprof/default.nix delete mode 100644 pkgs/tools/graphics/lprof/keep-environment.patch delete mode 100644 pkgs/tools/graphics/lprof/lcms-1.17.patch diff --git a/pkgs/tools/graphics/lprof/default.nix b/pkgs/tools/graphics/lprof/default.nix deleted file mode 100644 index 42ccc4d5022e9..0000000000000 --- a/pkgs/tools/graphics/lprof/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ stdenv, fetchurl, sconsPackages, qt3, lcms1, libtiff, vigra }: - -/* how to calibrate your monitor: - Eg see https://wiki.archlinux.org/index.php/ICC_Profiles#Loading_ICC_Profiles -*/ -stdenv.mkDerivation { - name = "lprof-1.11.4.1"; - nativeBuildInputs = [ sconsPackages.scons_3_0_1 ]; - buildInputs = [ qt3 lcms1 libtiff vigra ]; - - hardeningDisable = [ "format" ]; - - preConfigure = '' - export QTDIR=${qt3} - export qt_directory=${qt3} - ''; - - src = fetchurl { - url = mirror://sourceforge/lprof/lprof/lprof-1.11.4/lprof-1.11.4.1.tar.gz; - sha256 = "0q8x24fm5yyvm151xrl3l03p7hvvciqnkbviprfnvlr0lyg9wsrn"; - }; - - sconsFlags = "SYSLIBS=1"; - preBuild = '' - export CXX=g++ - ''; - prefixKey = "PREFIX="; - - patches = [ ./lcms-1.17.patch ./keep-environment.patch ]; - - meta = { - description = "Little CMS ICC profile construction set"; - homepage = https://sourceforge.net/projects/lprof; - license = stdenv.lib.licenses.gpl2; - platforms = stdenv.lib.platforms.linux; - }; -} diff --git a/pkgs/tools/graphics/lprof/keep-environment.patch b/pkgs/tools/graphics/lprof/keep-environment.patch deleted file mode 100644 index 4dcb5b0448ddf..0000000000000 --- a/pkgs/tools/graphics/lprof/keep-environment.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- lprof-1.11.4.1.org/SConstruct 2006-06-06 02:11:32.000000000 +0100 -+++ lprof-1.11.4.1/SConstruct 2017-08-29 12:56:13.425654683 +0100 -@@ -22,12 +22,7 @@ - # opts.Add(BoolOption('qt-mt-lib', 'Flag used to set QT library to either qt-mt or qt. Value of 1 = qt-mt, 0 = qt.', 'yes')) - - # setup base environemnt --env = Environment( -- ENV = { -- 'PATH' : os.environ[ 'PATH' ], -- 'HOME' : os.environ[ 'HOME' ], # required for distcc -- 'LDFLAGS' : '' -- }, options = opts) -+env = Environment(ENV = os.environ, options = opts) - - opts.Update(env) - opts.Save('lprof.conf', env) # Save, so user doesn't have to diff --git a/pkgs/tools/graphics/lprof/lcms-1.17.patch b/pkgs/tools/graphics/lprof/lcms-1.17.patch deleted file mode 100644 index a88471e143fd8..0000000000000 --- a/pkgs/tools/graphics/lprof/lcms-1.17.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/liblprof/lcmsprf.h 2007-08-31 15:36:20.000000000 -0700 -+++ b/src/liblprof/lcmsprf.h 2007-08-31 15:37:39.000000000 -0700 -@@ -67,6 +67,9 @@ - #define mmax(a,b) ((a) > (b)?(a):(b)) - #endif - -+#if LCMS_VERSION > 116 -+typedef int BOOL; -+#endif - - /* Misc operations ------------------------------------------------------------------------ */ - - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 59697e22838dd..6dcf57885b448 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3401,8 +3401,6 @@ in lp_solve = callPackage ../applications/science/math/lp_solve { }; - lprof = callPackage ../tools/graphics/lprof { }; - fastlane = callPackage ../tools/admin/fastlane { }; fatresize = callPackage ../tools/filesystems/fatresize {}; From 2ef8d668a3e1dd79919790f72719612b7a90f5bc Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 23:08:58 +0200 Subject: [PATCH 146/323] qt3: remove, no refences left --- pkgs/development/libraries/qt-3/default.nix | 92 ------------------- pkgs/development/libraries/qt-3/qt-pwd.patch | 15 --- .../libraries/qt-3/qt3-gcc4.6.0.patch | 23 ----- pkgs/development/libraries/qt-3/setup-hook.sh | 1 - pkgs/development/libraries/qt-3/strip.patch | 18 ---- pkgs/development/libraries/qt-3/xrandr.patch | 42 --------- pkgs/top-level/all-packages.nix | 4 - 7 files changed, 195 deletions(-) delete mode 100644 pkgs/development/libraries/qt-3/default.nix delete mode 100644 pkgs/development/libraries/qt-3/qt-pwd.patch delete mode 100644 pkgs/development/libraries/qt-3/qt3-gcc4.6.0.patch delete mode 100644 pkgs/development/libraries/qt-3/setup-hook.sh delete mode 100644 pkgs/development/libraries/qt-3/strip.patch delete mode 100644 pkgs/development/libraries/qt-3/xrandr.patch diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix deleted file mode 100644 index 98519ae294a4e..0000000000000 --- a/pkgs/development/libraries/qt-3/default.nix +++ /dev/null @@ -1,92 +0,0 @@ -{ stdenv, fetchurl -, xftSupport ? true, libXft ? null -, xrenderSupport ? true, libXrender ? null -, xrandrSupport ? true, libXrandr ? null -, xineramaSupport ? true, libXinerama ? null -, cursorSupport ? true, libXcursor ? null -, threadSupport ? true -, mysqlSupport ? false, libmysqlclient ? null -, libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms -, openglSupport ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms -, libGL ? null, libGLU ? null, libXmu ? null -, xlibsWrapper, xorgproto, zlib, libjpeg, libpng, which -}: - -assert xftSupport -> libXft != null; -assert xrenderSupport -> xftSupport && libXrender != null; -assert xrandrSupport -> libXrandr != null; -assert cursorSupport -> libXcursor != null; -assert mysqlSupport -> libmysqlclient != null; -assert openglSupport -> libGL != null && libGLU != null && libXmu != null; - -stdenv.mkDerivation { - name = "qt-3.3.8"; - - builder = ./builder.sh; - - setupHook = ./setup-hook.sh; - - src = fetchurl { - url = http://download.qt.io/archive/qt/3/qt-x11-free-3.3.8.tar.bz2; - sha256 = "0jd4g3bwkgk2s4flbmgisyihm7cam964gzb3pawjlkhas01zghz8"; - }; - - nativeBuildInputs = [ which ]; - propagatedBuildInputs = [libpng xlibsWrapper libXft libXrender zlib libjpeg]; - - hardeningDisable = [ "format" ]; - - configureFlags = let - mk = cond: name: "-${stdenv.lib.optionalString (!cond) "no-"}${name}"; - in [ - "-v" - "-system-zlib" "-system-libpng" "-system-libjpeg" - "-qt-gif" - "-I${xorgproto}/include" - (mk threadSupport "thread") - (mk xrenderSupport "xrender") - (mk xrandrSupport "xrandr") - (mk xineramaSupport "xinerama") - (mk xrandrSupport "xrandr") - (mk xftSupport "xft") - ] ++ stdenv.lib.optionals openglSupport [ - "-dlopen-opengl" - "-L${libGL}/lib" "-I${libGLU}/include" - "-L${libXmu.out}/lib" "-I${libXmu.dev}/include" - ] ++ stdenv.lib.optionals xrenderSupport [ - "-L${libXrender.out}/lib" "-I${libXrender.dev}/include" - ] ++ stdenv.lib.optionals xrandrSupport [ - "-L${libXrandr.out}/lib" "-I${libXrandr.dev}/include" - ] ++ stdenv.lib.optionals xineramaSupport [ - "-L${libXinerama.out}/lib" "-I${libXinerama.dev}/include" - ] ++ stdenv.lib.optionals cursorSupport [ - "-L${libXcursor.out}/lib -I${libXcursor.dev}/include" - ] ++ stdenv.lib.optionals mysqlSupport [ - "-qt-sql-mysql" "-L${libmysqlclient}/lib/mysql" "-I${libmysqlclient}/include/mysql" - ] ++ stdenv.lib.optionals xftSupport [ - "-L${libXft.out}/lib" "-I${libXft.dev}/include" - "-L${libXft.freetype.out}/lib" "-I${libXft.freetype.dev}/include" - "-L${libXft.fontconfig.lib}/lib" "-I${libXft.fontconfig.dev}/include" - ]; - - patches = [ - # Don't strip everything so we can get useful backtraces. - ./strip.patch - - # Build on NixOS. - ./qt-pwd.patch - - # randr.h and Xrandr.h need not be in the same prefix. - ./xrandr.patch - - # Make it build with gcc 4.6.0 - ./qt3-gcc4.6.0.patch - ]; - - passthru = {inherit mysqlSupport;}; - - meta = with stdenv.lib; { - license = with licenses; [ gpl2 qpl ]; - platforms = platforms.linux; - }; -} diff --git a/pkgs/development/libraries/qt-3/qt-pwd.patch b/pkgs/development/libraries/qt-3/qt-pwd.patch deleted file mode 100644 index 763f785726b7c..0000000000000 --- a/pkgs/development/libraries/qt-3/qt-pwd.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -ruN qt-x11-free-3.3.3/configure qt-x11-free-3.3.3.new/configure ---- qt-x11-free-3.3.3/configure 2004-06-14 11:18:55.000000000 +0200 -+++ qt-x11-free-3.3.3.new/configure 2005-11-12 19:39:43.000000000 +0100 -@@ -16,9 +16,9 @@ - relconf=`basename $0` - # the directory of this script is the "source tree" - relpath=`dirname $0` --relpath=`(cd $relpath; /bin/pwd)` -+relpath=`(cd $relpath; pwd)` - # the current directory is the "build tree" or "object tree" --outpath=`/bin/pwd` -+outpath=`pwd` - - # later cache the command line in config.status - OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"` diff --git a/pkgs/development/libraries/qt-3/qt3-gcc4.6.0.patch b/pkgs/development/libraries/qt-3/qt3-gcc4.6.0.patch deleted file mode 100644 index c1a903c130c7d..0000000000000 --- a/pkgs/development/libraries/qt-3/qt3-gcc4.6.0.patch +++ /dev/null @@ -1,23 +0,0 @@ -I picked it here: -https://bugs.archlinux.org/task/23915 - ---- qt-x11-free-3.3.8b/src/tools/qmap.h~ 2008-01-15 19:09:13.000000000 +0000 -+++ qt-x11-free-3.3.8b/src/tools/qmap.h 2011-04-11 00:16:04.000000000 +0100 -@@ -50,6 +50,7 @@ - #endif // QT_H - - #ifndef QT_NO_STL -+#include - #include - #include - #endif ---- qt-x11-free-3.3.8b/src/tools/qvaluelist.h~ 2008-01-15 19:09:13.000000000 +0000 -+++ qt-x11-free-3.3.8b/src/tools/qvaluelist.h 2011-04-11 00:16:49.000000000 +0100 -@@ -48,6 +48,7 @@ - #endif // QT_H - - #ifndef QT_NO_STL -+#include - #include - #include - #endif diff --git a/pkgs/development/libraries/qt-3/setup-hook.sh b/pkgs/development/libraries/qt-3/setup-hook.sh deleted file mode 100644 index db1a2529ff542..0000000000000 --- a/pkgs/development/libraries/qt-3/setup-hook.sh +++ /dev/null @@ -1 +0,0 @@ -export QTDIR=@out@ diff --git a/pkgs/development/libraries/qt-3/strip.patch b/pkgs/development/libraries/qt-3/strip.patch deleted file mode 100644 index a0c9fa738898d..0000000000000 --- a/pkgs/development/libraries/qt-3/strip.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -rc qt-x11-free-3.3.3-orig/mkspecs/linux-g++/qmake.conf qt-x11-free-3.3.3/mkspecs/linux-g++/qmake.conf -*** qt-x11-free-3.3.3-orig/mkspecs/linux-g++/qmake.conf 2004-08-05 16:42:57.000000000 +0200 ---- qt-x11-free-3.3.3/mkspecs/linux-g++/qmake.conf 2005-03-02 12:25:55.000000000 +0100 -*************** -*** 85,90 **** - QMAKE_DEL_FILE = rm -f - QMAKE_DEL_DIR = rmdir - QMAKE_STRIP = strip -! QMAKE_STRIPFLAGS_LIB += --strip-unneeded - QMAKE_CHK_DIR_EXISTS = test -d - QMAKE_MKDIR = mkdir -p ---- 85,90 ---- - QMAKE_DEL_FILE = rm -f - QMAKE_DEL_DIR = rmdir - QMAKE_STRIP = strip -! QMAKE_STRIPFLAGS_LIB += --strip-debug - QMAKE_CHK_DIR_EXISTS = test -d - QMAKE_MKDIR = mkdir -p diff --git a/pkgs/development/libraries/qt-3/xrandr.patch b/pkgs/development/libraries/qt-3/xrandr.patch deleted file mode 100644 index 0389c7fdd068e..0000000000000 --- a/pkgs/development/libraries/qt-3/xrandr.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -rc qt-x11-free-3.3.6-orig/config.tests/x11/xrandr.test qt-x11-free-3.3.6/config.tests/x11/xrandr.test -*** qt-x11-free-3.3.6-orig/config.tests/x11/xrandr.test 2006-09-14 14:00:08.000000000 +0200 ---- qt-x11-free-3.3.6/config.tests/x11/xrandr.test 2006-09-14 14:10:39.000000000 +0200 -*************** -*** 52,69 **** - INCDIRS="$IN_INCDIRS $XDIRS /FOO/include /include" - F= - for INCDIR in $INCDIRS; do -! if [ -f $INCDIR/$INC -a -f $INCDIR/$INC2 ]; then - F=yes -! XRANDR_H=$INCDIR/$INC - RANDR_H=$INCDIR/$INC2 -! [ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR" - break - fi - done - if [ -z "$F" ] - then - XRANDR=no -! [ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS" - fi - fi - ---- 52,69 ---- - INCDIRS="$IN_INCDIRS $XDIRS /FOO/include /include" - F= - for INCDIR in $INCDIRS; do -! if [ -f $INCDIR/$INC2 ]; then - F=yes -! # XRANDR_H=$INCDIR/$INC - RANDR_H=$INCDIR/$INC2 -! [ "$VERBOSE" = "yes" ] && echo " Found $INC2 in $INCDIR" - break - fi - done - if [ -z "$F" ] - then - XRANDR=no -! [ "$VERBOSE" = "yes" ] && echo " Could not find $INC2 anywhere in $INCDIRS" - fi - fi - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6dcf57885b448..e8bb3997a70a6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13987,10 +13987,6 @@ in qolibri = libsForQt5.callPackage ../applications/misc/qolibri { }; - qt3 = callPackage ../development/libraries/qt-3 { - libpng = libpng12; - }; - qt4 = qt48; qt48 = callPackage ../development/libraries/qt-4.x/4.8 { From 0523429ff63ffa852dd27c96ff404c852941b11f Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 7 Apr 2020 23:38:23 +0200 Subject: [PATCH 147/323] treewide: add C{,XX}FLAGS to env attrs --- pkgs/applications/audio/eflite/default.nix | 2 +- pkgs/applications/editors/deadpixi-sam/default.nix | 2 +- pkgs/applications/editors/emacs/default.nix | 2 +- pkgs/applications/networking/browsers/chromium/common.nix | 2 +- pkgs/applications/networking/mailreaders/notmuch/default.nix | 2 +- pkgs/tools/graphics/gnuplot/default.nix | 2 +- pkgs/tools/misc/abduco/default.nix | 2 +- pkgs/tools/misc/dvtm/dvtm.nix | 2 +- pkgs/tools/networking/cjdns/default.nix | 4 +++- pkgs/tools/networking/dropbear/default.nix | 2 +- 10 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/audio/eflite/default.nix b/pkgs/applications/audio/eflite/default.nix index 2338c0ed376e9..71dfba5602738 100644 --- a/pkgs/applications/audio/eflite/default.nix +++ b/pkgs/applications/audio/eflite/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { ./format.patch ]; - CFLAGS = stdenv.lib.optionalString debug " -DDEBUG=2"; + env.CFLAGS = stdenv.lib.optionalString debug "-DDEBUG=2"; meta = { homepage = http://eflite.sourceforge.net; diff --git a/pkgs/applications/editors/deadpixi-sam/default.nix b/pkgs/applications/editors/deadpixi-sam/default.nix index 65ec439391278..ee5fd5d9d3251 100644 --- a/pkgs/applications/editors/deadpixi-sam/default.nix +++ b/pkgs/applications/editors/deadpixi-sam/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { --replace "CC=gcc" "" ''; - CFLAGS = "-D_DARWIN_C_SOURCE"; + env.CFLAGS = "-D_DARWIN_C_SOURCE"; makeFlags = [ "DESTDIR=$(out)" ]; buildInputs = [ libX11 libXi libXt libXft ]; diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index 2b40eb77e2cf3..b188679041524 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { rm -fr .git ''; - CFLAGS = "-DMAC_OS_X_VERSION_MAX_ALLOWED=101200"; + env.CFLAGS = "-DMAC_OS_X_VERSION_MAX_ALLOWED=101200"; nativeBuildInputs = [ pkgconfig ] ++ lib.optionals srcRepo [ autoconf automake texinfo ] diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 167fe072ee584..98a102477059e 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -295,7 +295,7 @@ let # Don't spam warnings about unknown warning options. This is useful because # our Clang is always older than Chromium's and the build logs have a size # of approx. 25 MB without this option (and this saves e.g. 66 %). - NIX_CFLAGS_COMPILE = "-Wno-unknown-warning-option"; + env.NIX_CFLAGS_COMPILE = "-Wno-unknown-warning-option"; buildPhase = let # Build paralelism: on Hydra the build was frequently running into memory diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix index 4e31f2b999687..c25538a2adb5e 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/default.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { pythonPackages.sphinx # (optional) documentation -> doc/INSTALL texinfo # (optional) documentation -> doc/INSTALL bash-completion # (optional) dependency to install bash completion - ] ++ optional withEmacs [ emacs ]; + ] ++ optional withEmacs emacs; buildInputs = [ gnupg # undefined dependencies diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix index c04101575c73d..9cc2649901869 100644 --- a/pkgs/tools/graphics/gnuplot/default.nix +++ b/pkgs/tools/graphics/gnuplot/default.nix @@ -48,7 +48,7 @@ in (if aquaterm then "--with-aquaterm" else "--without-aquaterm") ]; - CXXFLAGS = lib.optionalString (stdenv.isDarwin && withQt) "-std=c++11"; + env.CXXFLAGS = lib.optionalString (stdenv.isDarwin && withQt) "-std=c++11"; postInstall = lib.optionalString withX '' wrapProgram $out/bin/gnuplot \ diff --git a/pkgs/tools/misc/abduco/default.nix b/pkgs/tools/misc/abduco/default.nix index 8545d86427a4e..bd7727839944f 100644 --- a/pkgs/tools/misc/abduco/default.nix +++ b/pkgs/tools/misc/abduco/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { configFile = optionalString (conf!=null) (writeText "config.def.h" conf); preBuild = optionalString (conf!=null) "cp ${configFile} config.def.h"; - CFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-D_DARWIN_C_SOURCE"; + env.CFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-D_DARWIN_C_SOURCE"; meta = { homepage = http://brain-dump.org/projects/abduco; diff --git a/pkgs/tools/misc/dvtm/dvtm.nix b/pkgs/tools/misc/dvtm/dvtm.nix index df2e25c7ea33b..6a8cbac95ce30 100644 --- a/pkgs/tools/misc/dvtm/dvtm.nix +++ b/pkgs/tools/misc/dvtm/dvtm.nix @@ -3,7 +3,7 @@ stdenv.mkDerivation { inherit name src patches; - CFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-D_DARWIN_C_SOURCE"; + env.CFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-D_DARWIN_C_SOURCE"; postPatch = stdenv.lib.optionalString (customConfig != null) '' cp ${builtins.toFile "config.h" customConfig} ./config.h diff --git a/pkgs/tools/networking/cjdns/default.nix b/pkgs/tools/networking/cjdns/default.nix index 7dce5dc10443a..d2f631b0939a8 100644 --- a/pkgs/tools/networking/cjdns/default.nix +++ b/pkgs/tools/networking/cjdns/default.nix @@ -15,10 +15,12 @@ stdenv.mkDerivation { # for flock stdenv.lib.optional stdenv.isLinux utillinux; - CFLAGS = "-O2 -Wno-error=stringop-truncation"; + env.CFLAGS = "-O2 -Wno-error=stringop-truncation"; + buildPhase = stdenv.lib.optionalString stdenv.isAarch32 "Seccomp_NO=1 " + "bash do"; + installPhase = '' install -Dt "$out/bin/" cjdroute makekeys privatetopublic publictoip6 sed -i 's,/usr/bin/env node,'$(type -P node), \ diff --git a/pkgs/tools/networking/dropbear/default.nix b/pkgs/tools/networking/dropbear/default.nix index c51f0a4fdf02d..88b6138b4c872 100644 --- a/pkgs/tools/networking/dropbear/default.nix +++ b/pkgs/tools/networking/dropbear/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { configureFlags = lib.optional enableStatic "LDFLAGS=-static"; - CFLAGS = "-DSFTPSERVER_PATH=\\\"${sftpPath}\\\""; + env.CFLAGS = "-DSFTPSERVER_PATH=\\\"${sftpPath}\\\""; # https://www.gnu.org/software/make/manual/html_node/Libraries_002fSearch.html preConfigure = '' From 3c173269fa01fdcd816bdc82f284ac8632878cbd Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 9 Apr 2020 01:17:04 +0200 Subject: [PATCH 148/323] treewide: fix eval --- pkgs/desktops/plasma-5/plasma-desktop/default.nix | 2 +- pkgs/servers/sql/mariadb/default.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/desktops/plasma-5/plasma-desktop/default.nix b/pkgs/desktops/plasma-5/plasma-desktop/default.nix index 4183b38ba4935..3e80b384f20b9 100644 --- a/pkgs/desktops/plasma-5/plasma-desktop/default.nix +++ b/pkgs/desktops/plasma-5/plasma-desktop/default.nix @@ -34,7 +34,7 @@ mkDerivation { postPatch = '' sed '1i#include ' -i kcms/touchpad/src/backends/x11/synapticstouchpad.cpp ''; - CXXFLAGS = [ + env.CXXFLAGS = toString [ "-I${lib.getDev xorgserver}/include/xorg" ''-DNIXPKGS_HWCLOCK=\"${lib.getBin utillinux}/sbin/hwclock\"'' ]; diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index 9c23da852f5b4..76134d671bc35 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -40,8 +40,8 @@ common = rec { # attributes common to both builds ncurses openssl zlib pcre libiconv curl ] ++ optionals stdenv.hostPlatform.isLinux [ libaio systemd libkrb5 ] ++ optionals stdenv.hostPlatform.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ] - ++ optional (!stdenv.hostPlatform.isDarwin && withStorageToku) [ jemalloc450 ] - ++ optional (!stdenv.hostPlatform.isDarwin && !withStorageToku) [ jemalloc ]; + ++ optional (!stdenv.hostPlatform.isDarwin && withStorageToku) jemalloc450 + ++ optional (!stdenv.hostPlatform.isDarwin && !withStorageToku) jemalloc; prePatch = '' sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt @@ -202,6 +202,6 @@ server = stdenv.mkDerivation (common // { wrapProgram $out/bin/mytop --set PATH ${makeBinPath [ less ncurses ]} ''; - CXXFLAGS = optionalString stdenv.hostPlatform.isi686 "-fpermissive"; + env.CXXFLAGS = optionalString stdenv.hostPlatform.isi686 "-fpermissive"; }); in mariadb From e754ee60232754cee2988806ec6dbd76c72f6565 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 9 Apr 2020 01:17:25 +0200 Subject: [PATCH 149/323] kdeFrameworks.*: fix setupHooks --- .../libraries/kde-frameworks/default.nix | 2 +- .../extra-cmake-modules/setup-hook.sh | 78 +++++++++---------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/pkgs/development/libraries/kde-frameworks/default.nix b/pkgs/development/libraries/kde-frameworks/default.nix index 7ce3954e286c5..fc2d00ab317ef 100644 --- a/pkgs/development/libraries/kde-frameworks/default.nix +++ b/pkgs/development/libraries/kde-frameworks/default.nix @@ -48,7 +48,7 @@ let # Propagate $dev so that this setup hook is propagated # But only if there is a separate $dev output if [ "''${outputDev:?}" != out ]; then - propagatedBuildInputs="''${propagatedBuildInputs-} @dev@" + propagatedBuildInputs+=("@dev@") fi fi ''; diff --git a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh index 4135f6bfd7aa3..6a709afb82ca0 100644 --- a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh +++ b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh @@ -6,49 +6,49 @@ addEnvHooks "$targetOffset" ecmEnvHook ecmPostHook() { # Because we need to use absolute paths here, we must set *all* the paths. - cmakeFlags+=" -DKDE_INSTALL_EXECROOTDIR=${!outputBin}" - cmakeFlags+=" -DKDE_INSTALL_BINDIR=${!outputBin}/bin" - cmakeFlags+=" -DKDE_INSTALL_SBINDIR=${!outputBin}/sbin" - cmakeFlags+=" -DKDE_INSTALL_LIBDIR=${!outputLib}/lib" - cmakeFlags+=" -DKDE_INSTALL_LIBEXECDIR=${!outputLib}/libexec" - cmakeFlags+=" -DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake" - cmakeFlags+=" -DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include" - cmakeFlags+=" -DKDE_INSTALL_LOCALSTATEDIR=/var" - cmakeFlags+=" -DKDE_INSTALL_DATAROOTDIR=${!outputBin}/share" - cmakeFlags+=" -DKDE_INSTALL_DATADIR=${!outputBin}/share" - cmakeFlags+=" -DKDE_INSTALL_DOCBUNDLEDIR=${!outputBin}/share/doc/HTML" - cmakeFlags+=" -DKDE_INSTALL_KCFGDIR=${!outputBin}/share/config.kcfg" - cmakeFlags+=" -DKDE_INSTALL_KCONFUPDATEDIR=${!outputBin}/share/kconf_update" - cmakeFlags+=" -DKDE_INSTALL_KSERVICES5DIR=${!outputBin}/share/kservices5" - cmakeFlags+=" -DKDE_INSTALL_KSERVICETYPES5DIR=${!outputBin}/share/kservicetypes5" - cmakeFlags+=" -DKDE_INSTALL_KXMLGUI5DIR=${!outputBin}/share/kxmlgui5" - cmakeFlags+=" -DKDE_INSTALL_KNOTIFY5RCDIR=${!outputBin}/share/knotifications5" - cmakeFlags+=" -DKDE_INSTALL_ICONDIR=${!outputBin}/share/icons" - cmakeFlags+=" -DKDE_INSTALL_LOCALEDIR=${!outputLib}/share/locale" - cmakeFlags+=" -DKDE_INSTALL_SOUNDDIR=${!outputBin}/share/sounds" - cmakeFlags+=" -DKDE_INSTALL_TEMPLATEDIR=${!outputBin}/share/templates" - cmakeFlags+=" -DKDE_INSTALL_WALLPAPERDIR=${!outputBin}/share/wallpapers" - cmakeFlags+=" -DKDE_INSTALL_APPDIR=${!outputBin}/share/applications" - cmakeFlags+=" -DKDE_INSTALL_DESKTOPDIR=${!outputBin}/share/desktop-directories" - cmakeFlags+=" -DKDE_INSTALL_MIMEDIR=${!outputBin}/share/mime/packages" - cmakeFlags+=" -DKDE_INSTALL_METAINFODIR=${!outputBin}/share/appdata" - cmakeFlags+=" -DKDE_INSTALL_MANDIR=${!outputBin}/share/man" - cmakeFlags+=" -DKDE_INSTALL_INFODIR=${!outputBin}/share/info" - cmakeFlags+=" -DKDE_INSTALL_DBUSDIR=${!outputBin}/share/dbus-1" - cmakeFlags+=" -DKDE_INSTALL_DBUSINTERFACEDIR=${!outputBin}/share/dbus-1/interfaces" - cmakeFlags+=" -DKDE_INSTALL_DBUSSERVICEDIR=${!outputBin}/share/dbus-1/services" - cmakeFlags+=" -DKDE_INSTALL_DBUSSYSTEMSERVICEDIR=${!outputBin}/share/dbus-1/system-services" - cmakeFlags+=" -DKDE_INSTALL_SYSCONFDIR=${!outputBin}/etc" - cmakeFlags+=" -DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg" - cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart" + cmakeFlags+=("-DKDE_INSTALL_EXECROOTDIR=${!outputBin}") + cmakeFlags+=("-DKDE_INSTALL_BINDIR=${!outputBin}/bin") + cmakeFlags+=("-DKDE_INSTALL_SBINDIR=${!outputBin}/sbin") + cmakeFlags+=("-DKDE_INSTALL_LIBDIR=${!outputLib}/lib") + cmakeFlags+=("-DKDE_INSTALL_LIBEXECDIR=${!outputLib}/libexec") + cmakeFlags+=("-DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake") + cmakeFlags+=("-DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include") + cmakeFlags+=("-DKDE_INSTALL_LOCALSTATEDIR=/var") + cmakeFlags+=("-DKDE_INSTALL_DATAROOTDIR=${!outputBin}/share") + cmakeFlags+=("-DKDE_INSTALL_DATADIR=${!outputBin}/share") + cmakeFlags+=("-DKDE_INSTALL_DOCBUNDLEDIR=${!outputBin}/share/doc/HTML") + cmakeFlags+=("-DKDE_INSTALL_KCFGDIR=${!outputBin}/share/config.kcfg") + cmakeFlags+=("-DKDE_INSTALL_KCONFUPDATEDIR=${!outputBin}/share/kconf_update") + cmakeFlags+=("-DKDE_INSTALL_KSERVICES5DIR=${!outputBin}/share/kservices5") + cmakeFlags+=("-DKDE_INSTALL_KSERVICETYPES5DIR=${!outputBin}/share/kservicetypes5") + cmakeFlags+=("-DKDE_INSTALL_KXMLGUI5DIR=${!outputBin}/share/kxmlgui5") + cmakeFlags+=("-DKDE_INSTALL_KNOTIFY5RCDIR=${!outputBin}/share/knotifications5") + cmakeFlags+=("-DKDE_INSTALL_ICONDIR=${!outputBin}/share/icons") + cmakeFlags+=("-DKDE_INSTALL_LOCALEDIR=${!outputLib}/share/locale") + cmakeFlags+=("-DKDE_INSTALL_SOUNDDIR=${!outputBin}/share/sounds") + cmakeFlags+=("-DKDE_INSTALL_TEMPLATEDIR=${!outputBin}/share/templates") + cmakeFlags+=("-DKDE_INSTALL_WALLPAPERDIR=${!outputBin}/share/wallpapers") + cmakeFlags+=("-DKDE_INSTALL_APPDIR=${!outputBin}/share/applications") + cmakeFlags+=("-DKDE_INSTALL_DESKTOPDIR=${!outputBin}/share/desktop-directories") + cmakeFlags+=("-DKDE_INSTALL_MIMEDIR=${!outputBin}/share/mime/packages") + cmakeFlags+=("-DKDE_INSTALL_METAINFODIR=${!outputBin}/share/appdata") + cmakeFlags+=("-DKDE_INSTALL_MANDIR=${!outputBin}/share/man") + cmakeFlags+=("-DKDE_INSTALL_INFODIR=${!outputBin}/share/info") + cmakeFlags+=("-DKDE_INSTALL_DBUSDIR=${!outputBin}/share/dbus-1") + cmakeFlags+=("-DKDE_INSTALL_DBUSINTERFACEDIR=${!outputBin}/share/dbus-1/interfaces") + cmakeFlags+=("-DKDE_INSTALL_DBUSSERVICEDIR=${!outputBin}/share/dbus-1/services") + cmakeFlags+=("-DKDE_INSTALL_DBUSSYSTEMSERVICEDIR=${!outputBin}/share/dbus-1/system-services") + cmakeFlags+=("-DKDE_INSTALL_SYSCONFDIR=${!outputBin}/etc") + cmakeFlags+=("-DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg") + cmakeFlags+=("-DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart") if [ -n "${qtPluginPrefix-}" ]; then - cmakeFlags+=" -DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix" - cmakeFlags+=" -DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix" + cmakeFlags+=("-DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix") + cmakeFlags+=("-DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix") fi if [ -n "${qtQmlPrefix-}" ]; then - cmakeFlags+=" -DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix" + cmakeFlags+=("-DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix") fi } postHooks+=(ecmPostHook) @@ -106,7 +106,7 @@ ecmHostPathHook() { if [ -d "$1/dbus-1" ] then - propagatedUserEnvPkgs+=" $1" + propagatedUserEnvPkgs+=("$1") fi } addEnvHooks "$targetOffset" ecmHostPathHook From 482ee582ba7b1709a63d105fa57b62effa9a4429 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 9 Apr 2020 08:47:33 +0200 Subject: [PATCH 150/323] fetchurl: fix mirrorsFile --- pkgs/build-support/fetchurl/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index 375dacfa95953..11060697187f9 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -10,12 +10,14 @@ let # resulting store derivations (.drv files) much smaller, which in # turn makes nix-env/nix-instantiate faster. mirrorsFile = - buildPackages.runCommandNoCCLocal "mirrors-list" { + stdenvNoCC.mkDerivation { + name = "mirrors-list"; env = stdenvNoCC.lib.mapAttrs (k: m: toString m) mirrors; - } '' - # !!! this is kinda hacky. - set | grep -E '^[a-zA-Z]+=.*://' > $out - ''; + buildCommand = '' + # !!! this is kinda hacky. + set | grep -E '^[a-zA-Z]+=.*://' > $out + ''; + }; # Names of the master sites that are mirrored (i.e., "sourceforge", # "gnu", etc.). From 7acb003fcc942d8748d169f84d604c97aedd83d0 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 9 Apr 2020 08:48:03 +0200 Subject: [PATCH 151/323] symlinkJoin: replace passAsFile --- pkgs/build-support/trivial-builders.nix | 11 +++++------ pkgs/top-level/stage.nix | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index c67f5845135b3..64781ee1438f0 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, stdenvNoCC, lndir, runtimeShell }: +{ lib, stdenv, stdenvNoCC, lndir, runtimeShell, jq }: let @@ -287,15 +287,14 @@ rec { let args = removeAttrs args_ [ "name" "postBuild" ] // { - inherit preferLocalBuild allowSubstitutes; - passAsFile = [ "paths" ]; + inherit preferLocalBuild allowSubstitutes paths; }; # pass the defaults in runCommand name args '' mkdir -p $out - for i in $(cat $pathsPath); do - ${lndir}/bin/lndir -silent $i $out - done + while IFS= read path; do + ${lndir}/bin/lndir -silent $path $out + done < <(${jq}/bin/jq -r <.attrs.json '.paths[]') ${postBuild} ''; diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 9e07d2bf06146..792ff16558ebb 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -72,7 +72,7 @@ let trivialBuilders = self: super: import ../build-support/trivial-builders.nix { inherit lib; inherit (self) stdenv stdenvNoCC; inherit (self.pkgsBuildHost.xorg) lndir; - inherit (self) runtimeShell; + inherit (self) runtimeShell; inherit (self.pkgsBuildHost) jq; }; stdenvBootstappingAndPlatforms = self: super: let From ddc0bf288a09ec9759fb4e45161a4250db7b3624 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 9 Apr 2020 08:48:54 +0200 Subject: [PATCH 152/323] stdenv.mkDerivation: disallow LDFLAGS outside `env` --- pkgs/stdenv/generic/make-derivation.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 4e2d26d9e8fc5..19787038f87f3 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -103,6 +103,7 @@ in rec { assert lib.isList (attrs.installTargets or []); assert !(attrs ? CFLAGS); assert !(attrs ? CXXFLAGS); + assert !(attrs ? LDFLAGS); assert !(attrs ? NIX_LDFLAGS); assert !(attrs ? NIX_CFLAGS_COMPILE); assert !(attrs ? NIX_CFLAGS_LINK); From 0d7c433ab34baf6b56f21cd7c9a4494b99118044 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 9 Apr 2020 08:49:13 +0200 Subject: [PATCH 153/323] rxvt-unicode: fix eval --- pkgs/applications/misc/rxvt-unicode/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/rxvt-unicode/default.nix b/pkgs/applications/misc/rxvt-unicode/default.nix index 6512f402ffbd8..3dd9013b9b42e 100644 --- a/pkgs/applications/misc/rxvt-unicode/default.nix +++ b/pkgs/applications/misc/rxvt-unicode/default.nix @@ -55,8 +55,8 @@ stdenv.mkDerivation { (enableFeature unicode3Support "unicode3") ]; - LDFLAGS = [ "-lfontconfig" "-lXrender" "-lpthread" ]; - CFLAGS = [ "-I${freetype.dev}/include/freetype2" ]; + env.LDFLAGS = "-lfontconfig -lXrender -lpthread"; + env.CFLAGS = "-I${freetype.dev}/include/freetype2"; preConfigure = '' From 374284ed17f05e14a68cb2a9e0ec78ae1b9884ed Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 11 Apr 2020 12:52:12 +0200 Subject: [PATCH 154/323] fetchurl: use read correctly --- pkgs/build-support/trivial-builders.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 64781ee1438f0..7a0dc2f2fc5b4 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -292,7 +292,7 @@ rec { in runCommand name args '' mkdir -p $out - while IFS= read path; do + while IFS= read -r -d $'\0' path; do ${lndir}/bin/lndir -silent $path $out done < <(${jq}/bin/jq -r <.attrs.json '.paths[]') ${postBuild} From ff5baf8c0082370b04e5189c25b548e21dcd80ad Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 11 Apr 2020 12:52:58 +0200 Subject: [PATCH 155/323] treewide: structured-attrs eval fixes --- pkgs/development/interpreters/guile/2.0.nix | 2 +- pkgs/development/libraries/gettext/default.nix | 2 +- pkgs/tools/graphics/optipng/default.nix | 10 ++++------ pkgs/tools/networking/iftop/default.nix | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/pkgs/development/interpreters/guile/2.0.nix b/pkgs/development/interpreters/guile/2.0.nix index af71d5cc80d7b..e9614e0a546fd 100644 --- a/pkgs/development/interpreters/guile/2.0.nix +++ b/pkgs/development/interpreters/guile/2.0.nix @@ -59,7 +59,7 @@ # "libgcc_s.so.1 must be installed for pthread_cancel to work". # don't have "libgcc_s.so.1" on darwin - LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; + env.LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; configureFlags = [ "--with-libreadline-prefix" ] ++ stdenv.lib.optionals stdenv.isSunOS [ diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index c28afa174181f..bc44785d3240e 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - LDFLAGS = if stdenv.isSunOS then "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec" else ""; + env.LDFLAGS = lib.optionalString stdenv.isSunOS "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec"; configureFlags = [ "--disable-csharp" "--with-xz" diff --git a/pkgs/tools/graphics/optipng/default.nix b/pkgs/tools/graphics/optipng/default.nix index bc849b21117f6..9b323750bcd8b 100644 --- a/pkgs/tools/graphics/optipng/default.nix +++ b/pkgs/tools/graphics/optipng/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ libpng ]; - LDFLAGS = optional static "-static"; + env.LDFLAGS = optionalString static "-static"; # Workaround for crash in cexcept.h. See # https://github.com/NixOS/nixpkgs/issues/28106 preConfigure = '' @@ -25,15 +25,13 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-system-zlib" "--with-system-libpng" - ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - #"-prefix=$out" ]; - postInstall = if stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isWindows then '' + postInstall = optionalString (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isWindows) '' mv "$out"/bin/optipng{,.exe} - '' else null; + ''; - meta = with stdenv.lib; { + meta = { homepage = http://optipng.sourceforge.net/; description = "A PNG optimizer"; license = licenses.zlib; diff --git a/pkgs/tools/networking/iftop/default.nix b/pkgs/tools/networking/iftop/default.nix index bc6f657f3781e..747bb8e1f70e4 100644 --- a/pkgs/tools/networking/iftop/default.nix +++ b/pkgs/tools/networking/iftop/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { # Explicitly link against libgcc_s, to work around the infamous # "libgcc_s.so.1 must be installed for pthread_cancel to work". - LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; + env.LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; preConfigure = '' cp ${automake}/share/automake*/config.{sub,guess} config From 5a4fb8d501bfe53713407e5e594236cbf33c5697 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 11 Apr 2020 12:53:29 +0200 Subject: [PATCH 156/323] stdenv: properly fix sourceRoot=. --- pkgs/applications/science/logic/spass/default.nix | 1 - pkgs/data/misc/tzdata/default.nix | 1 - pkgs/data/soundfonts/fluid/default.nix | 1 - .../python-modules/bootstrapped-pip/default.nix | 1 - pkgs/stdenv/generic/setup.sh | 10 ++++++++++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/science/logic/spass/default.nix b/pkgs/applications/science/logic/spass/default.nix index d9ec4a5335a41..ece6f0b9f6a85 100644 --- a/pkgs/applications/science/logic/spass/default.nix +++ b/pkgs/applications/science/logic/spass/default.nix @@ -18,7 +18,6 @@ stdenv.mkDerivation { }; sourceRoot = "."; - dontMakeSourcesWritable = true; nativeBuildInputs = [ bison flex ]; diff --git a/pkgs/data/misc/tzdata/default.nix b/pkgs/data/misc/tzdata/default.nix index 51c5fab9a78bb..7f07ea0ce8088 100644 --- a/pkgs/data/misc/tzdata/default.nix +++ b/pkgs/data/misc/tzdata/default.nix @@ -16,7 +16,6 @@ stdenv.mkDerivation rec { ]; sourceRoot = "."; - dontMakeSourcesWritable = true; outputs = [ "out" "bin" "man" "dev" ]; propagatedBuildOutputs = []; diff --git a/pkgs/data/soundfonts/fluid/default.nix b/pkgs/data/soundfonts/fluid/default.nix index e2a47d88df839..18c4160014f63 100644 --- a/pkgs/data/soundfonts/fluid/default.nix +++ b/pkgs/data/soundfonts/fluid/default.nix @@ -9,7 +9,6 @@ stdenv.mkDerivation { }; sourceRoot = "."; - dontMakeSourcesWritable = true; installPhase = '' install -Dm644 "FluidR3 GM2-2.SF2" $out/share/soundfonts/FluidR3_GM2-2.sf2 diff --git a/pkgs/development/python-modules/bootstrapped-pip/default.nix b/pkgs/development/python-modules/bootstrapped-pip/default.nix index a9d4b399c6275..23f40526637e2 100644 --- a/pkgs/development/python-modules/bootstrapped-pip/default.nix +++ b/pkgs/development/python-modules/bootstrapped-pip/default.nix @@ -11,7 +11,6 @@ stdenv.mkDerivation rec { srcs = [ wheel.src pip.src setuptools.src ]; sourceRoot = "."; - dontMakeSourcesWritable = true; dontUseSetuptoolsBuild = true; dontUsePipInstall = true; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index e21698c2971e8..703e48a42814a 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -862,6 +862,11 @@ unpackPhase() { fi done + if [ "$sourceRoot" == "." ]; then + mkdir source + cd source + fi + # Unpack all source archives. for i in "${srcs[@]}"; do unpackFile "$i" @@ -897,6 +902,11 @@ unpackPhase() { exit 1 fi + if [ "$sourceRoot" == "." ]; then + cd .. + sourceRoot=source + fi + echo "source root is $sourceRoot" # By default, add write permission to the sources. This is often From 53cab74ff30ad2efb89dadfc91bbcbc136fd6b9a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 12 Apr 2020 19:49:57 +0200 Subject: [PATCH 157/323] aspellDicts: fix buildTxtDict --- .../libraries/aspell/dictionaries.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/aspell/dictionaries.nix b/pkgs/development/libraries/aspell/dictionaries.nix index 05a1c95c81f07..c8a43de5bfcd6 100644 --- a/pkgs/development/libraries/aspell/dictionaries.nix +++ b/pkgs/development/libraries/aspell/dictionaries.nix @@ -45,7 +45,10 @@ let dontAddPrefix = true; - preBuild = "makeFlagsArray=(dictdir=$out/lib/aspell datadir=$out/lib/aspell)"; + makeFlags = [ + "dictdir=${placeholder "out"}/lib/aspell" + "datadir=${placeholder "out"}/lib/aspell" + ]; meta = { description = "Aspell dictionary for ${fullName}"; @@ -108,6 +111,8 @@ let buildTxtDict = {langInputs ? [], ...}@args: buildDict ({ + dontUnpack = true; + propagatedUserEnvPackages = langInputs; preBuild = '' @@ -152,8 +157,6 @@ let done } ''; - - phases = [ "preBuild" "buildPhase" "installPhase" ]; } // args); in rec { @@ -905,7 +908,11 @@ in rec { langInputs = [ en ]; - buildPhase = "cat $src | aspell-affix en-computers --dont-validate-words --lang=en"; + buildPhase = '' + runHook preBuild + cat $src | aspell-affix en-computers --dont-validate-words --lang=en + runHook postBuild + ''; installPhase = "aspell-install en-computers"; meta = { @@ -930,8 +937,10 @@ in rec { langInputs = [ en ]; buildPhase = '' + runHook preBuild cat $src1 | aspell-plain en_US-science --dont-validate-words --lang=en cat $src2 | aspell-plain en_GB-science --dont-validate-words --lang=en + runHook postBuild ''; installPhase = "aspell-install en_US-science en_GB-science"; From 5c1086ff557cea3b2ea31d05c060c88e654d82f5 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 12 Apr 2020 20:16:31 +0200 Subject: [PATCH 158/323] fpc: fix build --- .../development/compilers/fpc/binary-builder.sh | 14 -------------- pkgs/development/compilers/fpc/binary.nix | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 16 deletions(-) delete mode 100755 pkgs/development/compilers/fpc/binary-builder.sh diff --git a/pkgs/development/compilers/fpc/binary-builder.sh b/pkgs/development/compilers/fpc/binary-builder.sh deleted file mode 100755 index 4308c1ed211ae..0000000000000 --- a/pkgs/development/compilers/fpc/binary-builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $stdenv/setup - -tar xf $src -cd */ -tarballdir=$(pwd) -for i in *.tar; do tar xvf $i; done -echo "Deploying binaries.." -mkdir $out -cd $out -for i in $tarballdir/*.gz; do tar xvf $i; done -echo 'Creating ppc* symlink..' -for i in $out/lib/fpc/*/ppc*; do - ln -fs $i $out/bin/$(basename $i) -done diff --git a/pkgs/development/compilers/fpc/binary.nix b/pkgs/development/compilers/fpc/binary.nix index f160150d8b53e..d902607a0327d 100644 --- a/pkgs/development/compilers/fpc/binary.nix +++ b/pkgs/development/compilers/fpc/binary.nix @@ -16,9 +16,22 @@ stdenv.mkDerivation { } else throw "Not supported on ${stdenv.hostPlatform.system}."; - builder = ./binary-builder.sh; + buildPhase = '' + tarballdir=$(pwd) + for i in *.tar; do tar xvf $i; done + ''; + + installPhase = '' + mkdir $out + cd $out + for i in $tarballdir/*.gz; do tar xvf $i; done + echo 'Creating ppc* symlink..' + for i in $out/lib/fpc/*/ppc*; do + ln -fs $i $out/bin/$(basename $i) + done + ''; meta = { description = "Free Pascal Compiler from a binary distribution"; }; -} +} From 7ca4297b3ebcafc1ae6bb7de142440e3370876f3 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 12 Apr 2020 20:20:37 +0200 Subject: [PATCH 159/323] httpunit: fix build --- pkgs/development/libraries/java/httpunit/builder.sh | 5 ----- pkgs/development/libraries/java/httpunit/default.nix | 10 +++++++--- 2 files changed, 7 insertions(+), 8 deletions(-) delete mode 100755 pkgs/development/libraries/java/httpunit/builder.sh diff --git a/pkgs/development/libraries/java/httpunit/builder.sh b/pkgs/development/libraries/java/httpunit/builder.sh deleted file mode 100755 index 2738500829580..0000000000000 --- a/pkgs/development/libraries/java/httpunit/builder.sh +++ /dev/null @@ -1,5 +0,0 @@ -source $stdenv/setup - -$unzip/bin/unzip $src -mkdir $out -mv $name/* $out/ diff --git a/pkgs/development/libraries/java/httpunit/default.nix b/pkgs/development/libraries/java/httpunit/default.nix index 500c575f73aa9..a6c9cc4765392 100644 --- a/pkgs/development/libraries/java/httpunit/default.nix +++ b/pkgs/development/libraries/java/httpunit/default.nix @@ -1,15 +1,19 @@ -{stdenv, fetchurl, unzip} : +{ stdenv, fetchurl, unzip }: stdenv.mkDerivation { name = "httpunit-1.7"; - builder = ./builder.sh; src = fetchurl { url = mirror://sourceforge/httpunit/httpunit-1.7.zip; sha256 = "09gnayqgizd8cjqayvdpkxrc69ipyxawc96aznfrgdhdiwv8l5zf"; }; - inherit unzip; + nativeBuildInputs = [ unzip ]; + + installPhase = '' + mkdir $out + cp -rv * $out/ + ''; meta = with stdenv.lib; { homepage = http://httpunit.sourceforge.net; From 2b3e68c84fac984313c19b730158348424cedde2 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 12 Apr 2020 20:37:07 +0200 Subject: [PATCH 160/323] monoDllFixer: fix build --- pkgs/build-support/mono-dll-fixer/builder.sh | 4 ---- pkgs/build-support/mono-dll-fixer/default.nix | 15 +++++++++++---- pkgs/build-support/mono-dll-fixer/dll-fixer.pl | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 pkgs/build-support/mono-dll-fixer/builder.sh diff --git a/pkgs/build-support/mono-dll-fixer/builder.sh b/pkgs/build-support/mono-dll-fixer/builder.sh deleted file mode 100644 index 67abc465a9bdd..0000000000000 --- a/pkgs/build-support/mono-dll-fixer/builder.sh +++ /dev/null @@ -1,4 +0,0 @@ -source $stdenv/setup - -substitute $dllFixer $out --subst-var-by perl $perl/bin/perl -chmod +x $out diff --git a/pkgs/build-support/mono-dll-fixer/default.nix b/pkgs/build-support/mono-dll-fixer/default.nix index 8f7d1e795d799..7fbf4b10f18b7 100644 --- a/pkgs/build-support/mono-dll-fixer/default.nix +++ b/pkgs/build-support/mono-dll-fixer/default.nix @@ -1,8 +1,15 @@ -{stdenv, perl}: +{ stdenv, perl }: stdenv.mkDerivation { name = "mono-dll-fixer"; - builder = ./builder.sh; - dllFixer = ./dll-fixer.pl; - inherit perl; + + src = ./dll-fixer.pl; + dontUnpack = true; + + buildInputs = [ perl ]; + + installPhase = '' + cp $src $out + chmod +x $out + ''; } diff --git a/pkgs/build-support/mono-dll-fixer/dll-fixer.pl b/pkgs/build-support/mono-dll-fixer/dll-fixer.pl index 4a8b468692f0c..58162512ac0d5 100644 --- a/pkgs/build-support/mono-dll-fixer/dll-fixer.pl +++ b/pkgs/build-support/mono-dll-fixer/dll-fixer.pl @@ -1,4 +1,4 @@ -#! @perl@ -w +#!/usr/bin/perl -w use strict; From 2b6bc1a00af7d21ae29c3e2e8b5a4e9acad87a1c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 12 Apr 2020 21:35:39 +0200 Subject: [PATCH 161/323] gtk-sharp: fix build --- pkgs/development/libraries/gtk-sharp/builder.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/gtk-sharp/builder.sh b/pkgs/development/libraries/gtk-sharp/builder.sh index 4b8f757540b55..8e4bd6332c8a7 100644 --- a/pkgs/development/libraries/gtk-sharp/builder.sh +++ b/pkgs/development/libraries/gtk-sharp/builder.sh @@ -1,3 +1,5 @@ +source .attrs.sh + source $stdenv/setup genericBuild From c94243f8cd3f91a9d801f3caf020ee29fc50d9e5 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 12 Apr 2020 21:43:50 +0200 Subject: [PATCH 162/323] nx-libs: fix build --- pkgs/tools/X11/nx-libs/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/X11/nx-libs/default.nix b/pkgs/tools/X11/nx-libs/default.nix index 07b58bcfad606..54ca55270e06a 100644 --- a/pkgs/tools/X11/nx-libs/default.nix +++ b/pkgs/tools/X11/nx-libs/default.nix @@ -1,8 +1,10 @@ { stdenv, autoconf, automake, fetchFromGitHub, libgcc, libjpeg_turbo, libpng, libtool, libxml2, pkgconfig, which, xorg }: + stdenv.mkDerivation rec { pname = "nx-libs"; version = "3.5.99.23"; + src = fetchFromGitHub { owner = "ArcticaProject"; repo = "nx-libs"; @@ -25,12 +27,12 @@ stdenv.mkDerivation rec { ln -s libNX_X11.so.6.3.0 ''; - PREFIX=""; # Don't install to $out/usr/local - installPhase = '' - make DESTDIR="$out" install - # See: - # - https://salsa.debian.org/debian-remote-team/nx-libs/blob/bcc152100617dc59156015a36603a15db530a64f/debian/rules#L66-72 - # - https://github.com/ArcticaProject/nx-libs/issues/652 + installFlags = [ "PREFIX=" "DESTDIR=${placeholder "out"}" ]; + + # See: + # - https://salsa.debian.org/debian-remote-team/nx-libs/blob/bcc152100617dc59156015a36603a15db530a64f/debian/rules#L66-72 + # - https://github.com/ArcticaProject/nx-libs/issues/652 + postFixup = '' patchelf --remove-needed "libX11.so.6" $out/bin/nxagent ''; From d251320f31f8d80c5808ee64ced405b11d1ae7a6 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 13 Apr 2020 18:15:20 +0200 Subject: [PATCH 163/323] acd_cli: fix build --- pkgs/applications/networking/sync/acd_cli/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/sync/acd_cli/default.nix b/pkgs/applications/networking/sync/acd_cli/default.nix index 669ab4d1e3e52..bd7e568d7d9ad 100644 --- a/pkgs/applications/networking/sync/acd_cli/default.nix +++ b/pkgs/applications/networking/sync/acd_cli/default.nix @@ -18,7 +18,7 @@ buildPythonApplication rec { propagatedBuildInputs = [ appdirs colorama dateutil fusepy requests requests_toolbelt sqlalchemy ]; - makeWrapperArgs = [ "--prefix LIBFUSE_PATH : ${fuse}/lib/libfuse.so" ]; + makeWrapperArgs = [ "--prefix" "LIBFUSE_PATH" ":" "${fuse}/lib/libfuse.so" ]; postFixup = '' function lnOverBin() { From c1d2266024c34e1679e539e7ba4aa03f02847ddf Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 13 Apr 2020 18:15:39 +0200 Subject: [PATCH 164/323] mplayer: fix build --- pkgs/applications/video/mplayer/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index 07c01c5bb1b73..03e26e1a07f60 100644 --- a/pkgs/applications/video/mplayer/default.nix +++ b/pkgs/applications/video/mplayer/default.nix @@ -139,7 +139,6 @@ stdenv.mkDerivation rec { configureFlags = with stdenv.lib; [ "--enable-freetype" (if fontconfigSupport then "--enable-fontconfig" else "--disable-fontconfig") - (if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl") (if xineramaSupport then "--enable-xinerama" else "--disable-xinerama") (if xvSupport then "--enable-xv" else "--disable-xv") (if alsaSupport then "--enable-alsa" else "--disable-alsa") @@ -150,21 +149,22 @@ stdenv.mkDerivation rec { (if bluraySupport then "--enable-bluray" else "--disable-bluray") (if amrSupport then "--enable-libopencore_amrnb" else "--disable-libopencore_amrnb") (if cacaSupport then "--enable-caca" else "--disable-caca") - (if lameSupport then "--enable-mp3lame --disable-mp3lame-lavc" else "--disable-mp3lame --enable-mp3lame-lavc") (if speexSupport then "--enable-speex" else "--disable-speex") (if theoraSupport then "--enable-theora" else "--disable-theora") - (if x264Support then "--enable-x264 --disable-x264-lavc" else "--disable-x264 --enable-x264-lavc") (if jackaudioSupport then "" else "--disable-jack") (if pulseSupport then "--enable-pulse" else "--disable-pulse") "--disable-xanim" "--disable-ivtv" - "--disable-xvid --disable-xvid-lavc" + "--disable-xvid" "--disable-xvid-lavc" "--disable-ossaudio" "--disable-ffmpeg_a" "--yasm=${buildPackages.yasm}/bin/yasm" # Note, the `target` vs `host` confusion is intensional. "--target=${stdenv.hostPlatform.config}" - ] ++ optional + ] ++ (if x11Support then [ "--enable-x11" "--enable-gl" ] else [ "--disable-x11" "--disable-gl" ]) + ++ (if lameSupport then [ "--enable-mp3lame" "--disable-mp3lame-lavc" ] else [ "--disable-mp3lame" "--enable-mp3lame-lavc" ]) + ++ (if x264Support then [ "--enable-x264" "--disable-x264-lavc" ] else [ "--disable-x264" "--enable-x264-lavc" ]) + ++ optional (useUnfreeCodecs && codecs != null && !crossBuild) "--codecsdir=${codecs}" ++ optional From db60e6205ea50c94953d3a71e8609ed0d81de508 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 13 Apr 2020 18:16:15 +0200 Subject: [PATCH 165/323] libf2c: fix build --- pkgs/development/libraries/libf2c/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libf2c/default.nix b/pkgs/development/libraries/libf2c/default.nix index 10a0d179d3e93..80c4732f9868c 100644 --- a/pkgs/development/libraries/libf2c/default.nix +++ b/pkgs/development/libraries/libf2c/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { unzip ${src} ''; - makeFlags = [ "-f" "makefile.u" ]; + makeFlags = [ "-f makefile.u" ]; installPhase = '' mkdir -p $out/include $out/lib From 9f60b1e441cdddba44f98adbcf82ea8f52b9b71d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 13 Apr 2020 18:16:28 +0200 Subject: [PATCH 166/323] qtwebengine: fix build --- pkgs/development/libraries/qt-5/modules/qtwebengine.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index 86a2f6e4c111a..7422aa0c8b272 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -135,7 +135,7 @@ EOF qmakeFlags = if stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64 then [ "--" "-system-ffmpeg" ] ++ optional enableProprietaryCodecs "-proprietary-codecs" - else optional enableProprietaryCodecs "-- -proprietary-codecs"; + else optionals enableProprietaryCodecs [ "--" "-proprietary-codecs" ]; propagatedBuildInputs = [ # Image formats From e2e8e1aaf09a8b1fcb7688353a725c64a28f80b4 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 13 Apr 2020 18:16:43 +0200 Subject: [PATCH 167/323] perlPackages.Mozilla-LDAP: fix build --- pkgs/development/perl-modules/Mozilla-LDAP/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/perl-modules/Mozilla-LDAP/default.nix b/pkgs/development/perl-modules/Mozilla-LDAP/default.nix index 6c3d01a346295..12808863bfe7b 100644 --- a/pkgs/development/perl-modules/Mozilla-LDAP/default.nix +++ b/pkgs/development/perl-modules/Mozilla-LDAP/default.nix @@ -3,13 +3,16 @@ buildPerlPackage rec { pname = "Mozilla-Ldap"; version = "1.5.3"; - USE_OPENLDAP = 1; - LDAPSDKDIR = openldap.dev; - LDAPSDKLIBDIR = "${openldap.out}/lib"; + src = fetchurl { url = "https://ftp.mozilla.org/pub/directory/perldap/releases/${version}/src/perl-mozldap-${version}.tar.gz"; sha256 = "0s0albdw0zvg3w37s7is7gddr4mqwicjxxsy400n1p96l7ipnw4x"; }; + + env.USE_OPENLDAP = 1; + env.LDAPSDKDIR = toString openldap.dev; + env.LDAPSDKLIBDIR = "${openldap.out}/lib"; + meta = { description = "Mozilla's ldap client library"; homepage = "https://metacpan.org/release/perldap"; From 81f4dfaac6965c800e7217417e53afcbbb7f72da Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 13 Apr 2020 18:16:58 +0200 Subject: [PATCH 168/323] anki: fix build --- pkgs/games/anki/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix index c1ba8851f5c4f..92cf072b2d644 100644 --- a/pkgs/games/anki/default.nix +++ b/pkgs/games/anki/default.nix @@ -47,7 +47,6 @@ let rev = rev-manual; sha256 = sha256-manual; }; - phases = [ "unpackPhase" "patchPhase" "buildPhase" ]; nativeBuildInputs = [ asciidoc ]; patchPhase = '' # rsync isnt needed @@ -67,6 +66,7 @@ let -i *.txt mkdir -p $out/share/doc/anki/html ''; + dontInstall = true; # happens in buildPhase }; in @@ -91,13 +91,13 @@ buildPythonApplication rec { markdown jsonschema setuptools ] ++ lib.optional plotsSupport matplotlib - ++ lib.optional stdenv.isDarwin [ CoreAudio ] + ++ lib.optional stdenv.isDarwin CoreAudio ; checkInputs = [ pytest glibcLocales nose ]; nativeBuildInputs = [ pyqtwebengine.wrapQtAppsHook ]; - buildInputs = [ lame mplayer libpulseaudio ]; + buildInputs = [ lame mplayer libpulseaudio ]; patches = [ # Disable updated version check. From 8f7dab9932cd4e455b2b63df749b8da5de1dd08d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 13 Apr 2020 18:21:55 +0200 Subject: [PATCH 169/323] buildPythonPackage: fix LANG handling --- pkgs/development/interpreters/python/mk-python-derivation.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 22938a455852c..7a243af9d5651 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -143,7 +143,7 @@ let inherit strictDeps; - LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8"; + env.LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8"; # Python packages don't have a checkPhase, only an installCheckPhase doCheck = false; From 4f17f7ceb4bc06bbf268fc6eb97e2eaac1542b97 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 13 Apr 2020 19:17:57 +0200 Subject: [PATCH 170/323] lemon: fix build --- pkgs/development/tools/parsing/lemon/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/parsing/lemon/default.nix b/pkgs/development/tools/parsing/lemon/default.nix index 009ebe8e2ff0c..30c8294b2cabe 100644 --- a/pkgs/development/tools/parsing/lemon/default.nix +++ b/pkgs/development/tools/parsing/lemon/default.nix @@ -19,7 +19,7 @@ in stdenv.mkDerivation { pname = "lemon"; version = "1.69"; - phases = [ "buildPhase" "installPhase" ]; + dontUnpack = true; buildPhase = '' sh -xc "$CC ${srcs.lemon} -o lemon" From 485957e579975a8da73eb981a66e4915852c814a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 13 Apr 2020 23:24:37 +0200 Subject: [PATCH 171/323] zathura: fix plugin builds --- pkgs/applications/misc/zathura/cb/default.nix | 2 +- pkgs/applications/misc/zathura/djvu/default.nix | 2 +- pkgs/applications/misc/zathura/pdf-mupdf/default.nix | 2 +- pkgs/applications/misc/zathura/pdf-poppler/default.nix | 2 +- pkgs/applications/misc/zathura/ps/default.nix | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/misc/zathura/cb/default.nix b/pkgs/applications/misc/zathura/cb/default.nix index 4e2d16819ba58..8260b769a0b06 100644 --- a/pkgs/applications/misc/zathura/cb/default.nix +++ b/pkgs/applications/misc/zathura/cb/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkgconfig gettext ]; buildInputs = [ libarchive zathura_core girara ]; - PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; + env.PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; meta = with lib; { homepage = "https://pwmt.org/projects/zathura-cb/"; diff --git a/pkgs/applications/misc/zathura/djvu/default.nix b/pkgs/applications/misc/zathura/djvu/default.nix index 954df5301e312..4834559fa4c1b 100644 --- a/pkgs/applications/misc/zathura/djvu/default.nix +++ b/pkgs/applications/misc/zathura/djvu/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkgconfig ]; buildInputs = [ djvulibre gettext zathura_core gtk girara ]; - PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; + env.PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; meta = with stdenv.lib; { homepage = "https://pwmt.org/projects/zathura-djvu/"; diff --git a/pkgs/applications/misc/zathura/pdf-mupdf/default.nix b/pkgs/applications/misc/zathura/pdf-mupdf/default.nix index 82c94d48068a9..b93ce7f75be0e 100644 --- a/pkgs/applications/misc/zathura/pdf-mupdf/default.nix +++ b/pkgs/applications/misc/zathura/pdf-mupdf/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { zathura_core girara mupdf cairo ] ++ lib.optional stdenv.isDarwin gtk-mac-integration; - PKG_CONFIG_ZATHURA_PLUGINDIR= "lib/zathura"; + env.PKG_CONFIG_ZATHURA_PLUGINDIR= "lib/zathura"; meta = with lib; { homepage = "https://pwmt.org/projects/zathura-pdf-mupdf/"; diff --git a/pkgs/applications/misc/zathura/pdf-poppler/default.nix b/pkgs/applications/misc/zathura/pdf-poppler/default.nix index bafa293ad9c3b..257740eba1ad2 100644 --- a/pkgs/applications/misc/zathura/pdf-poppler/default.nix +++ b/pkgs/applications/misc/zathura/pdf-poppler/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkgconfig zathura_core ]; buildInputs = [ poppler girara ]; - PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; + env.PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; meta = with lib; { homepage = "https://pwmt.org/projects/zathura-pdf-poppler/"; diff --git a/pkgs/applications/misc/zathura/ps/default.nix b/pkgs/applications/misc/zathura/ps/default.nix index 05cc570eb8f10..1e6138c555e17 100644 --- a/pkgs/applications/misc/zathura/ps/default.nix +++ b/pkgs/applications/misc/zathura/ps/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkgconfig gettext ]; buildInputs = [ libspectre zathura_core girara ]; - PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; + env.PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; meta = with lib; { homepage = "https://pwmt.org/projects/zathura-ps/"; From ebab7e9dde9f213abd8efb5f32192f65e9aa80b9 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 14 Apr 2020 01:03:52 +0200 Subject: [PATCH 172/323] python.pkgs.cryptography: fix build --- pkgs/development/python-modules/cryptography/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index 8d655de97b898..c14ca639f3a8e 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -15,6 +15,7 @@ , iso8601 , pytz , hypothesis +, ipaddress }: buildPythonPackage rec { @@ -33,6 +34,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ packaging six + ipaddress ] ++ stdenv.lib.optional (!isPyPy) cffi; checkInputs = [ From 9191139d0fb267dcba8bdd94f1ad3ad5074ec69a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 14 Apr 2020 01:22:19 +0200 Subject: [PATCH 173/323] python.pkgs.paramiko: fix build --- pkgs/development/python-modules/paramiko/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/paramiko/default.nix b/pkgs/development/python-modules/paramiko/default.nix index 2fefbde744856..6a5a9fcda6a3d 100644 --- a/pkgs/development/python-modules/paramiko/default.nix +++ b/pkgs/development/python-modules/paramiko/default.nix @@ -9,6 +9,7 @@ , pytest , pytest-relaxed , mock +, enum34 }: buildPythonPackage rec { @@ -21,7 +22,7 @@ buildPythonPackage rec { }; checkInputs = [ invoke pytest mock pytest-relaxed ]; - propagatedBuildInputs = [ bcrypt cryptography pynacl pyasn1 ]; + propagatedBuildInputs = [ bcrypt cryptography pynacl pyasn1 enum34 ]; __darwinAllowLocalNetworking = true; From daaffb152eb313db6c684d4c0691f9221db8bb72 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 14 Apr 2020 01:39:24 +0200 Subject: [PATCH 174/323] mariadb: fix build --- pkgs/servers/sql/mariadb/default.nix | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index 76134d671bc35..14fbc55d026a5 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -104,7 +104,7 @@ common = rec { # attributes common to both builds meta = { description = "An enhanced, drop-in replacement for MySQL"; - homepage = https://mariadb.org/; + homepage = "https://mariadb.org/"; license = licenses.gpl2; maintainers = with maintainers; [ thoughtpolice ]; platforms = platforms.all; @@ -167,21 +167,20 @@ server = stdenv.mkDerivation (common // { "-DWITH_INNODB_DISALLOW_WRITES=ON" "-DWITHOUT_EXAMPLE=1" "-DWITHOUT_FEDERATED=1" - ] ++ optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32) [ + ] ++ optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32) "-DWITH_NUMA=ON" - ] ++ optional (!withStorageMroonga) [ + ++ optional (!withStorageMroonga) "-DWITHOUT_MROONGA=1" - ] ++ optional (!withStorageRocks) [ + ++ optional (!withStorageRocks) "-DWITHOUT_ROCKSDB=1" - ] ++ optional (!stdenv.hostPlatform.isDarwin && withStorageRocks) [ + ++ optional (!stdenv.hostPlatform.isDarwin && withStorageRocks) "-DWITH_ROCKSDB_JEMALLOC=ON" - ] ++ optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isMusl || !withStorageToku) [ + ++ optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isMusl || !withStorageToku) "-DWITHOUT_TOKUDB=1" - ] ++ optional (!stdenv.hostPlatform.isDarwin && withStorageToku) [ + ++ optional (!stdenv.hostPlatform.isDarwin && withStorageToku) "-DWITH_JEMALLOC=static" - ] ++ optional stdenv.hostPlatform.isDarwin [ - "-DWITHOUT_OQGRAPH=1" - ]; + ++ optional stdenv.hostPlatform.isDarwin + "-DWITHOUT_OQGRAPH=1"; preConfigure = optionalString (!stdenv.hostPlatform.isDarwin) '' patchShebangs scripts/mytop.sh From c0f47104e31d9c0df24cb659fdc3763d0685c1ec Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 14 Apr 2020 04:32:59 +0200 Subject: [PATCH 175/323] containerd: fix build --- pkgs/applications/virtualization/containerd/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/virtualization/containerd/default.nix b/pkgs/applications/virtualization/containerd/default.nix index 7b48d8c19345b..bdfd61aa2b196 100644 --- a/pkgs/applications/virtualization/containerd/default.nix +++ b/pkgs/applications/virtualization/containerd/default.nix @@ -22,8 +22,7 @@ buildGoPackage rec { buildFlags = [ "VERSION=v${version}" ]; - BUILDTAGS = [] - ++ optional (btrfs-progs == null) "no_btrfs"; + env.BUILDTAGS = optionalString (btrfs-progs == null) "no_btrfs"; buildPhase = '' cd go/src/${goPackagePath} From b4e85bd1c03d700ee1a0ab27ca58c5b9f9b27d50 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 14 Apr 2020 04:33:16 +0200 Subject: [PATCH 176/323] docker: fix build --- pkgs/applications/virtualization/docker/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index ccea4452cab9b..070e176021aaf 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -60,11 +60,11 @@ rec { inherit docker-runc docker-containerd docker-proxy docker-tini; - DOCKER_BUILDTAGS = [] - ++ optional (systemd != null) [ "journald" ] + env.DOCKER_BUILDTAGS = toString ([] + ++ optional (systemd != null) "journald" ++ optional (btrfs-progs == null) "exclude_graphdriver_btrfs" ++ optional (lvm2 == null) "exclude_graphdriver_devicemapper" - ++ optional (libseccomp != null) "seccomp"; + ++ optional (libseccomp != null) "seccomp"); }) // { inherit version rev; From 245d2f3725a858836faaaea834edf10ee3789863 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 14 Apr 2020 04:35:00 +0200 Subject: [PATCH 177/323] phonon: fix build --- pkgs/development/libraries/phonon/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/phonon/default.nix b/pkgs/development/libraries/phonon/default.nix index d32c3a0113440..14f31c2d3d79e 100644 --- a/pkgs/development/libraries/phonon/default.nix +++ b/pkgs/development/libraries/phonon/default.nix @@ -59,9 +59,9 @@ stdenv.mkDerivation rec { ]; preConfigure = '' - cmakeFlags+=" -DPHONON_QT_MKSPECS_INSTALL_DIR=''${!outputDev}/mkspecs" - cmakeFlags+=" -DPHONON_QT_IMPORTS_INSTALL_DIR=''${!outputBin}/$qtQmlPrefix" - cmakeFlags+=" -DPHONON_QT_PLUGIN_INSTALL_DIR=''${!outputBin}/$qtPluginPrefix/designer" + cmakeFlags+=("-DPHONON_QT_MKSPECS_INSTALL_DIR=''${!outputDev}/mkspecs") + cmakeFlags+=("-DPHONON_QT_IMPORTS_INSTALL_DIR=''${!outputBin}/$qtQmlPrefix") + cmakeFlags+=("-DPHONON_QT_PLUGIN_INSTALL_DIR=''${!outputBin}/$qtPluginPrefix/designer") ''; postPatch = '' From 77197d872b5fe8749c3efe5c1ec6749bf9242389 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 14 Apr 2020 04:35:13 +0200 Subject: [PATCH 178/323] luarocks: fix build --- pkgs/development/tools/misc/luarocks/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/luarocks/default.nix b/pkgs/development/tools/misc/luarocks/default.nix index fa19b2494076c..c13fc4bda36dd 100644 --- a/pkgs/development/tools/misc/luarocks/default.nix +++ b/pkgs/development/tools/misc/luarocks/default.nix @@ -23,12 +23,12 @@ stdenv.mkDerivation rec { lua -e "" || { luajit -e "" && { export LUA_SUFFIX=jit - configureFlags="$configureFlags --lua-suffix=$LUA_SUFFIX" + configureFlags+=("--lua-suffix=$LUA_SUFFIX") } } lua_inc="$(echo "${lua}/include"/*/)" if test -n "$lua_inc"; then - configureFlags="$configureFlags --with-lua-include=$lua_inc" + configureFlags+=("--with-lua-include=$lua_inc") fi ''; From c0d015e372848b868f5ec068b3d0f149f215a516 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 14 Apr 2020 04:35:57 +0200 Subject: [PATCH 179/323] borg: fix build --- pkgs/tools/backup/borg/default.nix | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/backup/borg/default.nix b/pkgs/tools/backup/borg/default.nix index a12cc368ee589..c92733451529f 100644 --- a/pkgs/tools/backup/borg/default.nix +++ b/pkgs/tools/backup/borg/default.nix @@ -28,7 +28,7 @@ python3.pkgs.buildPythonApplication rec { ''; makeWrapperArgs = [ - ''--prefix PATH ':' "${openssh}/bin"'' + "--prefix" "PATH" ":" "${openssh}/bin" ]; postInstall = '' @@ -50,15 +50,7 @@ python3.pkgs.buildPythonApplication rec { cp scripts/shell_completions/zsh/_borg $out/share/zsh/site-functions/ ''; - checkInputs = with python3.pkgs; [ - pytest - ]; - - checkPhase = '' - HOME=$(mktemp -d) py.test --pyargs borg.testsuite - ''; - - # 64 failures, needs pytest-benchmark + # tries to fuse mount and create directories in /var/tmp doCheck = false; meta = with stdenv.lib; { From 5428f06b9eaae10546eb201c294810b925201122 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 14 Apr 2020 04:38:27 +0200 Subject: [PATCH 180/323] youtube-dl: fix build --- pkgs/tools/misc/youtube-dl/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/misc/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix index 7b58ccfa85314..f0484b21921ec 100644 --- a/pkgs/tools/misc/youtube-dl/default.nix +++ b/pkgs/tools/misc/youtube-dl/default.nix @@ -39,7 +39,7 @@ buildPythonPackage rec { ++ lib.optional ffmpegSupport ffmpeg_4 ++ lib.optional rtmpSupport rtmpdump ++ lib.optional phantomjsSupport phantomjs2; - in [ ''--prefix PATH : "${lib.makeBinPath packagesToBinPath}"'' ]; + in [ "--prefix" "PATH" ":" (lib.makeBinPath packagesToBinPath) ]; setupPyBuildFlags = [ "build_lazy_extractors" From 4e944c591dcd6c1de6ed877ef7941bdd66e24911 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 14 Apr 2020 18:11:24 +0200 Subject: [PATCH 181/323] treewide: fix passAsFile occurences --- pkgs/build-support/trivial-builders.nix | 20 +++++++---------- pkgs/development/haskell-modules/hoogle.nix | 6 ++++-- pkgs/development/tools/jq/default.nix | 24 +++++++++++++-------- pkgs/misc/uboot/default.nix | 4 +--- pkgs/stdenv/generic/setup.sh | 4 ---- pkgs/top-level/stage.nix | 11 ++++++---- 6 files changed, 35 insertions(+), 34 deletions(-) diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 7a0dc2f2fc5b4..47b6ff78d3e60 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -2,10 +2,12 @@ let - runCommand' = runLocal: stdenv: name: env: buildCommand: + runCommand' = runLocal: stdenv: name: env: buildScript: stdenv.mkDerivation ({ - inherit name buildCommand; - passAsFile = [ "buildCommand" ]; + inherit name buildScript; + buildCommand = '' + source <(${jq}/bin/jq -r <.attrs.json '.buildScript') + ''; } // (lib.optionalAttrs runLocal { preferLocalBuild = true; @@ -80,7 +82,6 @@ rec { }: runCommand name { inherit text executable; - passAsFile = [ "text" ]; # Pointless to do this on a remote machine. preferLocalBuild = true; allowSubstitutes = false; @@ -89,11 +90,7 @@ rec { n=$out${destination} mkdir -p "$(dirname "$n")" - if [ -e "$textPath" ]; then - mv "$textPath" "$n" - else - echo -n "$text" > "$n" - fi + cp <(${jq}/bin/jq -r <.attrs.json '.text') $n ${checkPhase} @@ -221,7 +218,6 @@ rec { { inherit name code; executable = true; - passAsFile = ["code"]; # Pointless to do this on a remote machine. preferLocalBuild = true; allowSubstitutes = false; @@ -229,7 +225,7 @@ rec { '' n=$out/bin/$name mkdir -p "$(dirname "$n")" - mv "$codePath" code.c + cp <(${jq}/bin/jq -r <.attrs.json '.code') code.c $CC -x c code.c -o "$n" ''; @@ -292,7 +288,7 @@ rec { in runCommand name args '' mkdir -p $out - while IFS= read -r -d $'\0' path; do + while IFS= read -r path; do ${lndir}/bin/lndir -silent $path $out done < <(${jq}/bin/jq -r <.attrs.json '.paths[]') ${postBuild} diff --git a/pkgs/development/haskell-modules/hoogle.nix b/pkgs/development/haskell-modules/hoogle.nix index 0f620d46cccde..336d2da5f6bb0 100644 --- a/pkgs/development/haskell-modules/hoogle.nix +++ b/pkgs/development/haskell-modules/hoogle.nix @@ -60,9 +60,11 @@ buildPackages.stdenv.mkDerivation { inherit docPackages; - passAsFile = ["buildCommand"]; - buildCommand = '' + source <(${buildPackages.jq}/bin/jq -r <.attrs.json '.buildScript') + ''; + + buildScript = '' ${lib.optionalString (packages != [] -> docPackages == []) ("echo WARNING: localHoogle package list empty, even though" + " the following were specified: " diff --git a/pkgs/development/tools/jq/default.nix b/pkgs/development/tools/jq/default.nix index 8605ef398a1c4..879d37ec9b7d1 100644 --- a/pkgs/development/tools/jq/default.nix +++ b/pkgs/development/tools/jq/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, oniguruma }: +{ stdenv, fetchurl, oniguruma, minimal ? false }: stdenv.mkDerivation rec { pname = "jq"; @@ -9,21 +9,27 @@ stdenv.mkDerivation rec { sha256="0wmapfskhzfwranf6515nzmm84r7kwljgfs7dg6bjgxakbicis2x"; }; - outputs = [ "bin" "doc" "man" "dev" "lib" "out" ]; + outputs = if minimal then [ "out" ] else [ "bin" "doc" "man" "dev" "lib" "out" ]; - buildInputs = [ oniguruma ]; + buildInputs = stdenv.lib.optional (!minimal) oniguruma; configureFlags = - [ - "--bindir=\${bin}/bin" - "--sbindir=\${bin}/bin" - "--datadir=\${doc}/share" - "--mandir=\${man}/share/man" + if minimal then [ "--with-oniguruma=no" "--enable-all-static" ] + else [ + "--bindir=\${bin}/bin" + "--sbindir=\${bin}/bin" + "--datadir=\${doc}/share" + "--mandir=\${man}/share/man" ] # jq is linked to libjq: ++ stdenv.lib.optional (!stdenv.isDarwin) "LDFLAGS=-Wl,-rpath,\\\${libdir}"; - doInstallCheck = true; + preFixup = stdenv.lib.optionalString minimal '' + rm -r .libs $out/{include,share} + patchelf --shrink-rpath $out/bin/jq + ''; + + doInstallCheck = !minimal; installCheckTarget = "check"; postInstallCheck = '' diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 29dfb6558a9f9..e30a8c9222b6b 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -53,14 +53,12 @@ let "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ] ++ extraMakeFlags; - passAsFile = [ "extraConfig" ]; - configurePhase = '' runHook preConfigure make ${defconfig} - cat $extraConfigPath >> .config + cat <(${buildPackages.jq}/bin/jq -r <.attrs.json .extraConfig) >> .config runHook postConfigure ''; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 703e48a42814a..5195f110401d9 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1258,10 +1258,6 @@ showPhaseHeader() { genericBuild() { - if [ -f "${buildCommandPath:-}" ]; then - source "$buildCommandPath" - return - fi if [ -n "${buildCommand:-}" ]; then eval "$buildCommand" return diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 792ff16558ebb..f4053fbf6736c 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -70,10 +70,13 @@ let }; trivialBuilders = self: super: - import ../build-support/trivial-builders.nix { - inherit lib; inherit (self) stdenv stdenvNoCC; inherit (self.pkgsBuildHost.xorg) lndir; - inherit (self) runtimeShell; inherit (self.pkgsBuildHost) jq; - }; + let + jq = self.pkgsBuildHost.jq.override { minimal = true; }; + in + import ../build-support/trivial-builders.nix { + inherit lib; inherit (self) stdenv stdenvNoCC; inherit (self.pkgsBuildHost.xorg) lndir; + inherit (self) runtimeShell; inherit jq; + }; stdenvBootstappingAndPlatforms = self: super: let withFallback = thisPkgs: From 3d8d0f53ba6e249d0b8715468416c48feb685b8d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 15 Apr 2020 01:32:29 +0200 Subject: [PATCH 182/323] nodePackages: fix build --- pkgs/development/node-packages/composition-v10.nix | 4 ++-- pkgs/development/node-packages/composition-v12.nix | 4 ++-- pkgs/development/node-packages/composition-v13.nix | 4 ++-- pkgs/development/node-packages/node-env.nix | 12 ++++-------- pkgs/tools/networking/airfield/node.nix | 4 ++-- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/pkgs/development/node-packages/composition-v10.nix b/pkgs/development/node-packages/composition-v10.nix index ecb9e54132376..90e5915f75717 100644 --- a/pkgs/development/node-packages/composition-v10.nix +++ b/pkgs/development/node-packages/composition-v10.nix @@ -6,7 +6,7 @@ let nodeEnv = import ./node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -14,4 +14,4 @@ in import ./node-packages-v10.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv; -} \ No newline at end of file +} diff --git a/pkgs/development/node-packages/composition-v12.nix b/pkgs/development/node-packages/composition-v12.nix index a3a7bc256772d..2bfa0d76a6f41 100644 --- a/pkgs/development/node-packages/composition-v12.nix +++ b/pkgs/development/node-packages/composition-v12.nix @@ -6,7 +6,7 @@ let nodeEnv = import ./node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -14,4 +14,4 @@ in import ./node-packages-v12.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv; -} \ No newline at end of file +} diff --git a/pkgs/development/node-packages/composition-v13.nix b/pkgs/development/node-packages/composition-v13.nix index 6eddeb468dbbd..d526441485a83 100644 --- a/pkgs/development/node-packages/composition-v13.nix +++ b/pkgs/development/node-packages/composition-v13.nix @@ -6,7 +6,7 @@ let nodeEnv = import ./node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -14,4 +14,4 @@ in import ./node-packages-v13.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv; -} \ No newline at end of file +} diff --git a/pkgs/development/node-packages/node-env.nix b/pkgs/development/node-packages/node-env.nix index e1abf53049350..f6dc7d1cd76df 100644 --- a/pkgs/development/node-packages/node-env.nix +++ b/pkgs/development/node-packages/node-env.nix @@ -1,6 +1,6 @@ # This file originates from node2nix -{stdenv, nodejs, python2, utillinux, libtool, runCommand, writeTextFile}: +{stdenv, nodejs, python2, utillinux, libtool, runCommand, writeTextFile, jq}: let python = if nodejs ? python then nodejs.python else python2; @@ -324,7 +324,7 @@ let '' # Pinpoint the versions of all dependencies to the ones that are actually being used echo "pinpointing versions of dependencies..." - source $pinpointDependenciesScriptPath + source <(${jq}/bin/jq -r <$NIX_BUILD_TOP/.attrs.json '.pinpointDependenciesScript') # Patch the shebangs of the bundled modules to prevent them from # calling executables outside the Nix store as much as possible @@ -408,15 +408,13 @@ let compositionScript = composePackage args; pinpointDependenciesScript = pinpointDependenciesOfPackage args; - passAsFile = [ "compositionScript" "pinpointDependenciesScript" ]; - installPhase = '' # Create and enter a root node_modules/ folder mkdir -p $out/lib/node_modules cd $out/lib/node_modules # Compose the package and all its dependencies - source $compositionScriptPath + source <(${jq}/bin/jq -r <$NIX_BUILD_TOP/.attrs.json '.compositionScript') ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} @@ -480,13 +478,11 @@ let includeScript = includeDependencies { inherit dependencies; }; pinpointDependenciesScript = pinpointDependenciesOfPackage args; - passAsFile = [ "includeScript" "pinpointDependenciesScript" ]; - installPhase = '' mkdir -p $out/${packageName} cd $out/${packageName} - source $includeScriptPath + source <(${jq}/bin/jq -r <$NIX_BUILD_TOP/.attrs.json '.includeScript') # Create fake package.json to make the npm commands work properly cp ${src}/package.json . diff --git a/pkgs/tools/networking/airfield/node.nix b/pkgs/tools/networking/airfield/node.nix index e306e49c84982..3a7cfa6eeea07 100644 --- a/pkgs/tools/networking/airfield/node.nix +++ b/pkgs/tools/networking/airfield/node.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../../development/node-packages/node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -14,4 +14,4 @@ in import ./node-packages.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv; -} \ No newline at end of file +} From ef6447d4077e7691555927fe6cb5eaa119dda142 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 15 Apr 2020 05:34:02 +0200 Subject: [PATCH 183/323] pytest-check-hoo: fix array quoting --- .../interpreters/python/hooks/pytest-check-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh b/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh index 18f05b6d218cd..8c0e44083cf24 100644 --- a/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh +++ b/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh @@ -19,7 +19,7 @@ function _concatSep { function _pytestComputeDisabledTestsString () { declare -a tests - local tests=($1) + local tests=("$@") local prefix="not " prefixed=( "${tests[@]/#/$prefix}" ) result=$(_concatSep "and" prefixed) @@ -32,7 +32,7 @@ function pytestCheckPhase() { # Compose arguments args=" -m pytest" - if [ -n "$disabledTests" ]; then + if [[ -n "${disabledTests[@]-}" ]]; then disabledTestsString=$(_pytestComputeDisabledTestsString "${disabledTests[@]}") args+=" -k \""$disabledTestsString"\"" fi From 143f3908752b12113d5afe6c011859d356b2754d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 15 Apr 2020 05:34:37 +0200 Subject: [PATCH 184/323] python.pkgs.cryptography: fix missing dep --- pkgs/development/python-modules/cryptography/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index c14ca639f3a8e..c0729d9351f9a 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -16,6 +16,7 @@ , pytz , hypothesis , ipaddress +, enum34 }: buildPythonPackage rec { @@ -35,6 +36,7 @@ buildPythonPackage rec { packaging six ipaddress + enum34 ] ++ stdenv.lib.optional (!isPyPy) cffi; checkInputs = [ From e03fbb457e7eecb96b58cf258e7fb613435ffda8 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 15 Apr 2020 05:35:04 +0200 Subject: [PATCH 185/323] transfig: fix array quoting --- pkgs/tools/graphics/transfig/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/graphics/transfig/default.nix b/pkgs/tools/graphics/transfig/default.nix index db204113226e2..40f08259f5054 100644 --- a/pkgs/tools/graphics/transfig/default.nix +++ b/pkgs/tools/graphics/transfig/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation { cp tmpsed transfig/Imakefile } - for i in $patches; do + for i in "''${patches[@]}"; do header "applying patch $i" 3 patch -p0 < $i stopNest From 1ada23e3fb9914924ef292f47a41cfb0f0a5c43c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 15 Apr 2020 06:04:55 +0200 Subject: [PATCH 186/323] librsvg: fix eval --- pkgs/development/libraries/librsvg/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix index fb06f7689c4b2..b910b69067726 100644 --- a/pkgs/development/libraries/librsvg/default.nix +++ b/pkgs/development/libraries/librsvg/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { buildInputs = [ libxml2 bzip2 pango libintl ] ++ lib.optionals stdenv.isDarwin [ darwin.libobjc ]; - NIX_LDFLAGS = if stdenv.isDarwin then "-lobjc" else null; + env.NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lobjc"; propagatedBuildInputs = [ glib gdk-pixbuf cairo ]; From 01bda6d9dece9868ec5dd3d4274746b5ad8ceb1e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 15 Apr 2020 06:11:26 +0200 Subject: [PATCH 187/323] python.pkgs.cryptography: fix merge --- pkgs/development/python-modules/cryptography/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index 8f1a0288f9a08..e3b453ce2a0e8 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -17,7 +17,6 @@ , iso8601 , pytz , hypothesis -, ipaddress , enum34 }: From 826527810312c7eb88ecd4bd5b5de0fed2f510ad Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 16 Apr 2020 11:17:10 +0200 Subject: [PATCH 188/323] dconf: format with nixpkgs-fmt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also: * use pname + version instead of name * reorder attributes * change platforms linux + darwin → unix --- pkgs/development/libraries/dconf/default.nix | 63 ++++++++++++++------ 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/pkgs/development/libraries/dconf/default.nix b/pkgs/development/libraries/dconf/default.nix index d4e303b67af70..7ba2146a7d18a 100644 --- a/pkgs/development/libraries/dconf/default.nix +++ b/pkgs/development/libraries/dconf/default.nix @@ -1,28 +1,51 @@ -{ stdenv, fetchurl, meson, ninja, python3, vala, libxslt, pkgconfig, glib, bash-completion, dbus, gnome3 -, libxml2, gtk-doc, docbook_xsl, docbook_xml_dtd_42 }: +{ stdenv +, fetchurl +, meson +, ninja +, python3 +, vala +, libxslt +, pkg-config +, glib +, bash-completion +, dbus +, gnome3 +, libxml2 +, gtk-doc +, docbook-xsl-nons +, docbook_xml_dtd_42 +}: -let - pname = "dconf"; -in stdenv.mkDerivation rec { - name = "${pname}-${version}"; + pname = "dconf"; version = "0.36.0"; + outputs = [ "out" "lib" "dev" "devdoc" ]; + src = fetchurl { - url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz"; + url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "0bfs069pjv6lhp7xrzmrhz3876ay2ryqxzc6mlva1hhz34ibprlz"; }; - postPatch = '' - chmod +x meson_post_install.py tests/test-dconf.py - patchShebangs meson_post_install.py - patchShebangs tests/test-dconf.py - ''; - - outputs = [ "out" "lib" "dev" "devdoc" ]; + nativeBuildInputs = [ + meson + ninja + vala + pkg-config + python3 + libxslt + libxml2 + glib + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_42 + ]; - nativeBuildInputs = [ meson ninja vala pkgconfig python3 libxslt libxml2 glib gtk-doc docbook_xsl docbook_xml_dtd_42 ]; - buildInputs = [ glib bash-completion dbus ]; + buildInputs = [ + glib + bash-completion + dbus + ]; mesonFlags = [ "--sysconfdir=/etc" @@ -31,6 +54,12 @@ stdenv.mkDerivation rec { doCheck = !stdenv.isAarch32 && !stdenv.isAarch64 && !stdenv.isDarwin; + postPatch = '' + chmod +x meson_post_install.py tests/test-dconf.py + patchShebangs meson_post_install.py + patchShebangs tests/test-dconf.py + ''; + passthru = { updateScript = gnome3.updateScript { packageName = pname; @@ -40,7 +69,7 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { homepage = "https://wiki.gnome.org/Projects/dconf"; license = licenses.lgpl21Plus; - platforms = platforms.linux ++ platforms.darwin; + platforms = platforms.unix; maintainers = teams.gnome.members; }; } From e5c8f881abd3e0e2af9621f57f40f2c4d1edb794 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 16 Apr 2020 11:29:27 +0200 Subject: [PATCH 189/323] dconf: fix build --- pkgs/development/libraries/dconf/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/libraries/dconf/default.nix b/pkgs/development/libraries/dconf/default.nix index 7ba2146a7d18a..1612b0986006a 100644 --- a/pkgs/development/libraries/dconf/default.nix +++ b/pkgs/development/libraries/dconf/default.nix @@ -1,5 +1,6 @@ { stdenv , fetchurl +, fetchpatch , meson , ninja , python3 @@ -27,6 +28,15 @@ stdenv.mkDerivation rec { sha256 = "0bfs069pjv6lhp7xrzmrhz3876ay2ryqxzc6mlva1hhz34ibprlz"; }; + patches = [ + # Fix bash-completion installation + # https://gitlab.gnome.org/GNOME/dconf/merge_requests/58 + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/dconf/commit/b3c9423c6151f3c28e526083ea2f04987a780fdf.patch"; + sha256 = "zrIPKmgEpa1iIGUKv03+z+GNwJwgdf2hDATgP3i8qk0="; + }) + ]; + nativeBuildInputs = [ meson ninja From 2aadcc5dfbfbc355799957c50c293c83fb5a627f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 16 Apr 2020 16:46:13 +0200 Subject: [PATCH 190/323] gst_all_1.gstreamer: fix build --- pkgs/development/libraries/gstreamer/core/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix index 67a0aa9f3f890..88bf77a638cc1 100644 --- a/pkgs/development/libraries/gstreamer/core/default.nix +++ b/pkgs/development/libraries/gstreamer/core/default.nix @@ -37,6 +37,13 @@ stdenv.mkDerivation rec { patches = [ ./fix_pkgconfig_includedir.patch + + # Fix build with bash-completion 2.10 + # https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/436 + (fetchpatch { + url = "https://gitlab.freedesktop.org/gstreamer/gstreamer/commit/dd2ec3681e2d38e13e01477efa36e851650690fb.patch"; + sha256 = "CMYQF2MTsC5A0btMpLVLemkwsMtEbzhDXVE3u49xHB4="; + }) ]; nativeBuildInputs = [ From 0d5a35b51e1ba15013005b328b75ef4cb203c667 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 01:46:29 +0200 Subject: [PATCH 191/323] php: fix eval --- pkgs/development/interpreters/php/default.nix | 4 ++-- pkgs/top-level/php-packages.nix | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index d7747d3d9a776..04dfff5f89d15 100644 --- a/pkgs/development/interpreters/php/default.nix +++ b/pkgs/development/interpreters/php/default.nix @@ -46,7 +46,7 @@ let [ pcre' ] # Enable sapis - ++ lib.optional pearSupport [ libxml2.dev ] + ++ lib.optional pearSupport libxml2.dev # Misc deps ++ lib.optional apxs2Support apacheHttpd @@ -72,7 +72,7 @@ let ++ lib.optional (!cgiSupport) "--disable-cgi" ++ lib.optional (!cliSupport) "--disable-cli" ++ lib.optional fpmSupport "--enable-fpm" - ++ lib.optional pearSupport [ "--with-pear=$(out)/lib/php/pear" "--enable-xml" "--with-libxml" ] + ++ lib.optionals pearSupport [ "--with-pear=$(out)/lib/php/pear" "--enable-xml" "--with-libxml" ] ++ lib.optional (pearSupport && (lib.versionOlder version "7.4")) "--enable-libxml" ++ lib.optional pharSupport "--enable-phar" ++ lib.optional phpdbgSupport "--enable-phpdbg" diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 0cda058459df5..5ff8e8de32113 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -802,7 +802,7 @@ in buildInputs = [ libxml2 ]; configureFlags = [ "--enable-dom" ] # Required to build on darwin. - ++ lib.optional (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; } + ++ lib.optional (lib.versionOlder php.version "7.4") "--with-libxml-dir=${libxml2.dev}"; } { name = "enchant"; buildInputs = [ enchant1 ]; configureFlags = [ "--with-enchant=${enchant1}" ]; @@ -840,7 +840,7 @@ in { name = "gettext"; buildInputs = [ gettext ]; postPhpize = ''substituteInPlace configure --replace 'as_fn_error $? "Cannot locate header file libintl.h" "$LINENO" 5' ':' ''; - configureFlags = "--with-gettext=${gettext}"; } + configureFlags = [ "--with-gettext=${gettext}" ]; } { name = "gmp"; buildInputs = [ gmp ]; configureFlags = [ "--with-gmp=${gmp.dev}" ]; } @@ -1011,7 +1011,7 @@ in doCheck = false; } { name = "xmlreader"; buildInputs = [ libxml2 ]; - configureFlags = [ "--enable-xmlreader CFLAGS=-I../.." ] + configureFlags = [ "--enable-xmlreader" "CFLAGS=-I../.." ] # Required to build on darwin. ++ lib.optional (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; } { name = "xmlrpc"; From e67383f0122cde0911ab1f4c1fce90e1da7c16f4 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 01:46:44 +0200 Subject: [PATCH 192/323] libdv: fix eval --- pkgs/development/libraries/libdv/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libdv/default.nix b/pkgs/development/libraries/libdv/default.nix index ed1e2cd74a3b5..d2e6926a01620 100644 --- a/pkgs/development/libraries/libdv/default.nix +++ b/pkgs/development/libraries/libdv/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { # This fixes an undefined symbol: _sched_setscheduler error on compile. # See the apple docs: http://cl.ly/2HeF bottom of the "Finding Imported Symbols" section - LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-undefined dynamic_lookup"; + env.LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-undefined dynamic_lookup"; configureFlags = [ "--disable-asm" From 3a42179402b09202e69505b5c2c86781abc75a3a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 01:46:55 +0200 Subject: [PATCH 193/323] libvpx: fix eval --- pkgs/development/libraries/libvpx/1_8.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/development/libraries/libvpx/1_8.nix b/pkgs/development/libraries/libvpx/1_8.nix index c82b7a674accd..f2fdc0d03d83b 100644 --- a/pkgs/development/libraries/libvpx/1_8.nix +++ b/pkgs/development/libraries/libvpx/1_8.nix @@ -165,9 +165,7 @@ stdenv.mkDerivation rec { buildInputs = [ ] ++ optionals unitTestsSupport [ coreutils curl ]; - NIX_LDFLAGS = [ - "-lpthread" # fixes linker errors - ]; + env.NIX_LDFLAGS = "-lpthread"; # fixes linker errors enableParallelBuilding = true; From fef6d50f19e8f72787cabe4cf48f0bd80fb78f53 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:50:28 +0200 Subject: [PATCH 194/323] azureus: fix build --- pkgs/tools/networking/p2p/azureus/builder.sh | 19 -------------- pkgs/tools/networking/p2p/azureus/default.nix | 26 ++++++++++++++++--- 2 files changed, 23 insertions(+), 22 deletions(-) delete mode 100644 pkgs/tools/networking/p2p/azureus/builder.sh diff --git a/pkgs/tools/networking/p2p/azureus/builder.sh b/pkgs/tools/networking/p2p/azureus/builder.sh deleted file mode 100644 index 9d41dba2e439e..0000000000000 --- a/pkgs/tools/networking/p2p/azureus/builder.sh +++ /dev/null @@ -1,19 +0,0 @@ -source $stdenv/setup - -mkdir -p $out/jars -cp $src $out/jars/azureus.jar - -mkdir -p $out/bin -cat > $out/bin/azureus < $out/bin/azureus < Date: Fri, 17 Apr 2020 21:50:49 +0200 Subject: [PATCH 195/323] ardour: fix eval --- pkgs/applications/audio/ardour/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix index fadfedf5384f4..52667b4379305 100644 --- a/pkgs/applications/audio/ardour/default.nix +++ b/pkgs/applications/audio/ardour/default.nix @@ -121,7 +121,7 @@ in stdenv.mkDerivation rec { "--with-backends=jack,alsa,dummy" ]; - NIX_CFLAGS_COMPILE = "-I${qm-dsp}/include/qm-dsp"; + env.NIX_CFLAGS_COMPILE = "-I${qm-dsp}/include/qm-dsp"; # ardour's wscript has a "tarball" target but that required the git revision # be available. Since this is an unzipped tarball fetched from github we From 04ce99995e9b28e6bcdbc7facaefd98be6535bbc Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:51:06 +0200 Subject: [PATCH 196/323] evolution: fix build --- pkgs/desktops/gnome-3/apps/evolution/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/gnome-3/apps/evolution/default.nix b/pkgs/desktops/gnome-3/apps/evolution/default.nix index c1901110b5854..2f967071342eb 100644 --- a/pkgs/desktops/gnome-3/apps/evolution/default.nix +++ b/pkgs/desktops/gnome-3/apps/evolution/default.nix @@ -122,7 +122,7 @@ stdenv.mkDerivation rec { }; }; - PKG_CONFIG_LIBEDATASERVERUI_1_2_UIMODULEDIR = "${placeholder "out"}/lib/evolution-data-server/ui-modules"; + env.PKG_CONFIG_LIBEDATASERVERUI_1_2_UIMODULEDIR = "${placeholder "out"}/lib/evolution-data-server/ui-modules"; meta = with stdenv.lib; { homepage = "https://wiki.gnome.org/Apps/Evolution"; From 5a91b086f4711d55f24c5e5f561208e312b8f8c2 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:51:20 +0200 Subject: [PATCH 197/323] evolution-data-server: fix build --- pkgs/desktops/gnome-3/core/evolution-data-server/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/gnome-3/core/evolution-data-server/default.nix b/pkgs/desktops/gnome-3/core/evolution-data-server/default.nix index f5d60ee917ce3..3c6593c719282 100644 --- a/pkgs/desktops/gnome-3/core/evolution-data-server/default.nix +++ b/pkgs/desktops/gnome-3/core/evolution-data-server/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { prePatch = '' substitute ${./hardcode-gsettings.patch} hardcode-gsettings.patch --subst-var-by ESD_GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"} \ --subst-var-by GDS_GSETTINGS_PATH ${glib.getSchemaPath gsettings-desktop-schemas} - patches="$patches $PWD/hardcode-gsettings.patch" + patches+=("$PWD/hardcode-gsettings.patch") ''; nativeBuildInputs = [ From 3119af35365a26deef807463afc45c08698f87d9 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:51:33 +0200 Subject: [PATCH 198/323] gnustep-make: fix build --- pkgs/desktops/gnustep/make/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/gnustep/make/default.nix b/pkgs/desktops/gnustep/make/default.nix index 9b8692f0da5f7..85dc55470c503 100644 --- a/pkgs/desktops/gnustep/make/default.nix +++ b/pkgs/desktops/gnustep/make/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { ]; preConfigure = '' - configureFlags="$configureFlags --with-config-file=$out/etc/GNUstep/GNUstep.conf" + configureFlags+=("--with-config-file=$out/etc/GNUstep/GNUstep.conf") ''; makeFlags = [ From 6ec22bccb66622193d60479f3be60af01aa233b9 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:51:49 +0200 Subject: [PATCH 199/323] llvm6.compiler-rt: fix eval --- pkgs/development/compilers/llvm/6/compiler-rt.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/development/compilers/llvm/6/compiler-rt.nix b/pkgs/development/compilers/llvm/6/compiler-rt.nix index 1bdba107d7dd1..bdb3ae2ef2e8a 100644 --- a/pkgs/development/compilers/llvm/6/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/6/compiler-rt.nix @@ -16,9 +16,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake python3 llvm ]; buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi; - NIX_CFLAGS_COMPILE = [ - "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" - ]; + env.NIX_CFLAGS_COMPILE = "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"; cmakeFlags = [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" From f83a0722cbd3d4425ff08a4c1bc5a193ea9b7e33 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:52:08 +0200 Subject: [PATCH 200/323] guile: fix eval --- pkgs/development/interpreters/guile/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix index 68df200835fa3..13ab8b263fd87 100644 --- a/pkgs/development/interpreters/guile/default.nix +++ b/pkgs/development/interpreters/guile/default.nix @@ -52,7 +52,7 @@ # "libgcc_s.so.1 must be installed for pthread_cancel to work". # don't have "libgcc_s.so.1" on darwin - LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; + env.LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; configureFlags = [ "--with-libreadline-prefix=${readline.dev}" ] ++ stdenv.lib.optionals stdenv.isSunOS [ From cb7feb310d586c8598083e7bcc70a3da646a3088 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:52:21 +0200 Subject: [PATCH 201/323] qm-dsp: fix eval --- pkgs/development/libraries/audio/qm-dsp/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/audio/qm-dsp/default.nix b/pkgs/development/libraries/audio/qm-dsp/default.nix index d363a559042b7..9e3bd006229eb 100644 --- a/pkgs/development/libraries/audio/qm-dsp/default.nix +++ b/pkgs/development/libraries/audio/qm-dsp/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { "LIBDIR=${placeholder "out"}/lib" ]; - NIX_CFLAGS_COMPILE = "-I${kissfft}/include/kissfft"; + env.NIX_CFLAGS_COMPILE = "-I${kissfft}/include/kissfft"; meta = with stdenv.lib; { description = "A C++ library of functions for DSP and Music Informatics purposes"; From 1ad6dea3c1a6688280f4c8184a48a0f6c64eb0f7 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:52:32 +0200 Subject: [PATCH 202/323] kinit: fix eval --- pkgs/development/libraries/kde-frameworks/kinit/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/kde-frameworks/kinit/default.nix b/pkgs/development/libraries/kde-frameworks/kinit/default.nix index 116f475e2f8c5..0c2038c6746ac 100644 --- a/pkgs/development/libraries/kde-frameworks/kinit/default.nix +++ b/pkgs/development/libraries/kde-frameworks/kinit/default.nix @@ -20,7 +20,7 @@ mkDerivation { ./0003-kdeinit-extra-libs.patch ./0004-start_kdeinit-environ-hard-limit.patch ]; - CXXFLAGS = [ + env.CXXFLAGS = toString [ ''-DNIXPKGS_KF5_KIOCORE=\"${getLib kio}/lib/libKF5KIOCore.so.5\"'' ''-DNIXPKGS_KF5_PARTS=\"${getLib kparts}/lib/libKF5Parts.so.5\"'' ''-DNIXPKGS_KF5_PLASMA=\"${getLib plasma-framework}/lib/libKF5Plasma.so.5\"'' From b2531b38602f3c41a1703b2fb1622b2c5707b73c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:52:51 +0200 Subject: [PATCH 203/323] sword: fix eval --- pkgs/development/libraries/sword/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/sword/default.nix b/pkgs/development/libraries/sword/default.nix index bdbed724b20cf..419634f1e050f 100644 --- a/pkgs/development/libraries/sword/default.nix +++ b/pkgs/development/libraries/sword/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { ]; configureFlags = [ "--without-conf" "--enable-tests=no" ]; - CXXFLAGS = [ + env.CXXFLAGS = toString [ "-Wno-unused-but-set-variable" # compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554 "-DU_USING_ICU_NAMESPACE=1" From f9cf8a5307b1c346e5224fba339d888ccd1ae2ca Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:53:08 +0200 Subject: [PATCH 204/323] base16-builder: fix eval --- pkgs/misc/base16-builder/node-packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/base16-builder/node-packages.nix b/pkgs/misc/base16-builder/node-packages.nix index 052339d11ea04..4577d782d44f8 100644 --- a/pkgs/misc/base16-builder/node-packages.nix +++ b/pkgs/misc/base16-builder/node-packages.nix @@ -10,7 +10,7 @@ let inherit (pkgs) fetchurl fetchgit; }); nodeEnv = import ../../development/node-packages/node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -18,4 +18,4 @@ in import ./node-packages-generated.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv globalBuildInputs; -} \ No newline at end of file +} From bc15f27ad9df05667a9f23ea2a2d72ff1b17e2cc Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 17 Apr 2020 21:53:25 +0200 Subject: [PATCH 205/323] texlive.dvisvgm: fix build --- pkgs/tools/typesetting/tex/texlive/bin.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index c1b45c0410e8b..73c2db0d0d8e8 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -287,7 +287,7 @@ dvisvgm = stdenv.mkDerivation { # configure script has a bug: it refers to $HAVE_LIBGS but sets $have_libgs # TODO: remove for texlive 2020? - HAVE_LIBGS = 1; + env.HAVE_LIBGS = 1; configureFlags = common.configureFlags ++ [ "--with-system-kpathsea" ]; From 1e21d7bcd510f657f075e0acd9b7b6853bc8080e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 19 Apr 2020 16:36:22 +0200 Subject: [PATCH 206/323] treewide: fix structured-attrs related failures --- pkgs/applications/audio/helm/default.nix | 2 +- pkgs/applications/audio/pianobar/default.nix | 4 +-- pkgs/applications/gis/saga/default.nix | 2 +- pkgs/applications/kde/kdenlive.nix | 2 +- pkgs/applications/misc/klayout/default.nix | 2 +- .../misc/prusa-slicer/default.nix | 4 +-- .../misc/redis-desktop-manager/default.nix | 2 +- .../cluster/spacegun/node-composition.nix | 4 +-- .../cluster/terraform-providers/default.nix | 2 +- .../networking/compactor/default.nix | 2 +- .../instant-messengers/centerim/default.nix | 2 +- .../mailreaders/thunderbird/default.nix | 5 +--- pkgs/applications/radio/unixcw/default.nix | 2 +- .../science/biology/strelka/default.nix | 5 +--- .../machine-learning/shogun/default.nix | 6 ++-- .../science/physics/sherpa/default.nix | 2 +- .../robotics/qgroundcontrol/default.nix | 2 +- pkgs/applications/video/kodi/default.nix | 8 ++--- .../applications/video/mkvtoolnix/default.nix | 2 +- pkgs/applications/video/shotcut/default.nix | 8 ++--- pkgs/applications/video/vdr/plugins.nix | 8 ++--- .../virtualization/spice-vdagent/default.nix | 2 +- .../cinnamon-settings-daemon/default.nix | 2 +- .../onlineaccounts/default.nix | 6 ++-- .../pantheon/apps/switchboard/wrapper.nix | 4 +-- .../pantheon/desktop/wingpanel/wrapper.nix | 4 +-- pkgs/desktops/plasma-5/kwin/default.nix | 4 +-- .../plasma-5/plasma-vault/default.nix | 2 +- .../bower-modules/generic/default.nix | 6 ++-- .../elm/packages/node-composition.nix | 4 +-- pkgs/development/compilers/ghc/8.10.1.nix | 6 ++-- pkgs/development/compilers/ghc/8.8.2.nix | 6 ++-- pkgs/development/compilers/llvm/10/lldb.nix | 2 +- .../compilers/llvm/5/compiler-rt.nix | 4 +-- .../compilers/llvm/5/libc++abi.nix | 2 +- pkgs/development/compilers/llvm/9/lldb.nix | 2 +- pkgs/development/compilers/ponyc/default.nix | 2 +- .../libraries/ffmpeg-full/default.nix | 18 +++++------ .../development/libraries/galario/default.nix | 2 +- pkgs/development/libraries/gdal/2.4.0.nix | 2 +- .../kde-frameworks/kimageformats.nix | 2 +- .../libraries/libeatmydata/default.nix | 2 +- .../libraries/libwebsockets/default.nix | 2 +- pkgs/development/libraries/mlt/qt-5.nix | 3 +- pkgs/development/libraries/movit/default.nix | 2 +- .../libraries/physics/mcgrid/default.nix | 2 +- pkgs/development/libraries/pipewire/2.nix | 4 +-- pkgs/development/libraries/poppler/0.61.nix | 2 +- .../science/networking/ns-3/default.nix | 2 +- .../libraries/sqlcipher/default.nix | 4 +-- pkgs/development/libraries/vtk/default.nix | 10 +++---- .../misc/google-clasp/google-clasp.nix | 4 +-- pkgs/development/pharo/vm/build-vm.nix | 4 +-- .../python-modules/fiona/default.nix | 2 +- .../python-modules/jaraco_text/default.nix | 2 +- .../python-modules/tensorflow/2/default.nix | 30 +++++++++---------- .../build-managers/redo-apenwarr/default.nix | 3 +- .../development/tools/misc/igprof/default.nix | 2 +- pkgs/development/tools/node-webkit/nw12.nix | 2 -- pkgs/development/tools/nwjs/default.nix | 2 -- pkgs/development/tools/simavr/default.nix | 2 +- pkgs/games/keeperrl/default.nix | 4 +-- pkgs/games/xonotic/default.nix | 4 +-- pkgs/misc/emulators/uae/default.nix | 2 +- pkgs/os-specific/linux/irqbalance/default.nix | 2 +- pkgs/os-specific/linux/pam_u2f/default.nix | 2 +- .../linux/xf86-input-wacom/default.nix | 9 ++++-- .../linux/xf86-video-nested/default.nix | 2 +- pkgs/servers/dns/knot-dns/default.nix | 2 +- .../node-composition.nix | 4 +-- pkgs/servers/search/sphinxsearch/default.nix | 2 +- .../web-apps/cryptpad/node-packages.nix | 4 +-- pkgs/stdenv/generic/make-derivation.nix | 24 +++++++-------- pkgs/tools/X11/xmousepasteblock/default.nix | 2 +- .../tools/filesystems/darling-dmg/default.nix | 2 +- pkgs/tools/graphics/gifsicle/default.nix | 2 +- pkgs/tools/misc/colord/default.nix | 10 +++---- pkgs/tools/misc/wimboot/default.nix | 2 +- pkgs/tools/networking/mosh/default.nix | 2 +- pkgs/tools/networking/snabb/default.nix | 2 +- pkgs/tools/networking/trickle/default.nix | 2 +- pkgs/tools/package-management/nixui/nixui.nix | 4 +-- pkgs/tools/security/krunner-pass/default.nix | 4 +-- pkgs/tools/security/nasty/default.nix | 2 +- pkgs/tools/security/tboot/default.nix | 2 +- pkgs/tools/system/vboot_reference/default.nix | 2 +- pkgs/top-level/php-packages.nix | 18 +++++------ 87 files changed, 170 insertions(+), 191 deletions(-) diff --git a/pkgs/applications/audio/helm/default.nix b/pkgs/applications/audio/helm/default.nix index 8459967a363c5..a5b7ee80c88b2 100644 --- a/pkgs/applications/audio/helm/default.nix +++ b/pkgs/applications/audio/helm/default.nix @@ -18,7 +18,7 @@ freetype alsaLib curl libjack2 pkgconfig libGLU libGL lv2 ]; - CXXFLAGS = "-DHAVE_LROUND"; + env.CXXFLAGS = "-DHAVE_LROUND"; patchPhase = '' sed -i 's|usr/||g' Makefile diff --git a/pkgs/applications/audio/pianobar/default.nix b/pkgs/applications/audio/pianobar/default.nix index 28173d34b78d1..5c56c825f0c07 100644 --- a/pkgs/applications/audio/pianobar/default.nix +++ b/pkgs/applications/audio/pianobar/default.nix @@ -15,8 +15,8 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out)" ]; - CC = "gcc"; - CFLAGS = "-std=c99"; + env.CC = "gcc"; + env.CFLAGS = "-std=c99"; meta = with stdenv.lib; { description = "A console front-end for Pandora.com"; diff --git a/pkgs/applications/gis/saga/default.nix b/pkgs/applications/gis/saga/default.nix index 05f895bdee15c..1c0d3494619c9 100644 --- a/pkgs/applications/gis/saga/default.nix +++ b/pkgs/applications/gis/saga/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation { enableParallelBuilding = true; - CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11 -Wno-narrowing"; + env.CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11 -Wno-narrowing"; src = fetchurl { url = "https://sourceforge.net/projects/saga-gis/files/SAGA%20-%207/SAGA%20-%207.6.2/saga-7.6.2.tar.gz"; diff --git a/pkgs/applications/kde/kdenlive.nix b/pkgs/applications/kde/kdenlive.nix index 95496f90e0437..43bfb4629bfe9 100644 --- a/pkgs/applications/kde/kdenlive.nix +++ b/pkgs/applications/kde/kdenlive.nix @@ -86,7 +86,7 @@ mkDerivation { # https://github.com/NixOS/nixpkgs/issues/83885 # https://github.com/NixOS/nixpkgs/issues/29614#issuecomment-488849325 qtWrapperArgs = [ - "--set FREI0R_PATH ${frei0r}/lib/frei0r-1" + "--set" "FREI0R_PATH" "${frei0r}/lib/frei0r-1" ]; meta = { license = with lib.licenses; [ gpl2Plus ]; diff --git a/pkgs/applications/misc/klayout/default.nix b/pkgs/applications/misc/klayout/default.nix index 78b32f7fca15a..60efad402f388 100644 --- a/pkgs/applications/misc/klayout/default.nix +++ b/pkgs/applications/misc/klayout/default.nix @@ -44,7 +44,7 @@ mkDerivation rec { mv $out/lib/klayout $out/bin/ ''; - NIX_CFLAGS_COMPILE = [ "-Wno-parentheses" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-parentheses"; dontInstall = true; # Installation already happens as part of "build.sh" diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index 4a87fc130649d..1090fb99826d7 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { # cmake/modules/FindNLopt.cmake in the package source - for finding the nlopt # library, which doesn't pick up the package in the nix store. We # additionally need to set the path via the NLOPT environment variable. - NLOPT = nlopt; + env.NLOPT = toString nlopt; # Disable compiler warnings that clutter the build log. # It seems to be a known issue for Eigen: @@ -48,7 +48,7 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = "-Wno-ignored-attributes"; # prusa-slicer uses dlopen on `libudev.so` at runtime - NIX_LDFLAGS = "-ludev"; + env.NIX_LDFLAGS = "-ludev"; prePatch = '' # In nix ioctls.h isn't available from the standard kernel-headers package diff --git a/pkgs/applications/misc/redis-desktop-manager/default.nix b/pkgs/applications/misc/redis-desktop-manager/default.nix index ec40347cbcb33..3ac9149826dc3 100644 --- a/pkgs/applications/misc/redis-desktop-manager/default.nix +++ b/pkgs/applications/misc/redis-desktop-manager/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { dontUseQmakeConfigure = true; - NIX_CFLAGS_COMPILE = [ "-Wno-error=deprecated" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated"; # Disable annoying update reminder postPatch = '' diff --git a/pkgs/applications/networking/cluster/spacegun/node-composition.nix b/pkgs/applications/networking/cluster/spacegun/node-composition.nix index 47cdb6942cecc..6d32d74e2567d 100644 --- a/pkgs/applications/networking/cluster/spacegun/node-composition.nix +++ b/pkgs/applications/networking/cluster/spacegun/node-composition.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../../../development/node-packages/node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -14,4 +14,4 @@ in import ./node-packages.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv; -} \ No newline at end of file +} diff --git a/pkgs/applications/networking/cluster/terraform-providers/default.nix b/pkgs/applications/networking/cluster/terraform-providers/default.nix index c3c44160c1b75..023c79c4d3e6f 100644 --- a/pkgs/applications/networking/cluster/terraform-providers/default.nix +++ b/pkgs/applications/networking/cluster/terraform-providers/default.nix @@ -27,7 +27,7 @@ let # goPackage derivation so it can install the top-level. patchGoModVendor = drv: drv.overrideAttrs (attrs: { - buildFlags = "-mod=vendor"; + buildFlags = [ "-mod=vendor" ]; # override configurePhase to not move the source into GOPATH configurePhase = '' diff --git a/pkgs/applications/networking/compactor/default.nix b/pkgs/applications/networking/compactor/default.nix index 5d9a658972c36..1f13cae9b8dd9 100644 --- a/pkgs/applications/networking/compactor/default.nix +++ b/pkgs/applications/networking/compactor/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { substituteInPlace configure \ --replace "/usr/bin/file" "${file}/bin/file" ''; - CXXFLAGS = "-std=c++11"; + env.CXXFLAGS = "-std=c++11"; configureFlags = [ "--with-boost-libdir=${boost.out}/lib" "--with-boost=${boost.dev}" diff --git a/pkgs/applications/networking/instant-messengers/centerim/default.nix b/pkgs/applications/networking/instant-messengers/centerim/default.nix index 52d8178764c5a..03f895e1062fc 100644 --- a/pkgs/applications/networking/instant-messengers/centerim/default.nix +++ b/pkgs/applications/networking/instant-messengers/centerim/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "0viz86jflp684vfginhl6aaw4gh2qvalc25anlwljjl3kkmibklk"; }; - CXXFLAGS = "-std=gnu++98"; + env.CXXFLAGS = "-std=gnu++98"; buildInputs = [ openssl curl ncurses libjpeg ] ++ stdenv.lib.optional withGpg gpgme; diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix index 797d7b17ec2d6..977e065d226e7 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix @@ -143,10 +143,7 @@ stdenv.mkDerivation rec { ++ lib.optional pulseaudioSupport libpulseaudio ++ lib.optional waylandSupport libxkbcommon; - NIX_CFLAGS_COMPILE =[ - "-I${glib.dev}/include/gio-unix-2.0" - "-I${nss.dev}/include/nss" - ]; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0 -I${nss.dev}/include/nss"; patches = [ ./no-buildconfig.patch diff --git a/pkgs/applications/radio/unixcw/default.nix b/pkgs/applications/radio/unixcw/default.nix index fe31fd133e798..06f1abdcd4e91 100644 --- a/pkgs/applications/radio/unixcw/default.nix +++ b/pkgs/applications/radio/unixcw/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { ./remove-use-of-dlopen.patch ]; buildInputs = [libpulseaudio alsaLib pkgconfig qt5.qtbase]; - CFLAGS ="-lasound -lpulse-simple"; + env.CFLAGS ="-lasound -lpulse-simple"; meta = with stdenv.lib; { description = "sound characters as Morse code on the soundcard or console speaker"; diff --git a/pkgs/applications/science/biology/strelka/default.nix b/pkgs/applications/science/biology/strelka/default.nix index a32eddcb1cd93..c45584adea7cd 100644 --- a/pkgs/applications/science/biology/strelka/default.nix +++ b/pkgs/applications/science/biology/strelka/default.nix @@ -14,10 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ zlib python2 ]; - NIX_CFLAGS_COMPILE = [ - "-Wno-error=maybe-uninitialized" - "-Wno-error=pessimizing-move" - ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=maybe-uninitialized -Wno-error=pessimizing-move"; preConfigure = '' sed -i 's|/usr/bin/env python|${python2}/bin/python|' src/python/lib/makeRunScript.py diff --git a/pkgs/applications/science/machine-learning/shogun/default.nix b/pkgs/applications/science/machine-learning/shogun/default.nix index 988ea8c855c01..e9a56e5cd4114 100644 --- a/pkgs/applications/science/machine-learning/shogun/default.nix +++ b/pkgs/applications/science/machine-learning/shogun/default.nix @@ -60,8 +60,8 @@ stdenv.mkDerivation rec { }) ]; - CCACHE_DISABLE="1"; - CCACHE_DIR=".ccache"; + env.CCACHE_DISABLE="1"; + env.CCACHE_DIR=".ccache"; buildInputs = with lib; [ openblasCompat bzip2 cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo @@ -70,7 +70,7 @@ stdenv.mkDerivation rec { ++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ]) ++ optional (opencvSupport) opencv; - NIX_CFLAGS_COMPILE="-faligned-new"; + env.NIX_CFLAGS_COMPILE="-faligned-new"; cmakeFlags = let diff --git a/pkgs/applications/science/physics/sherpa/default.nix b/pkgs/applications/science/physics/sherpa/default.nix index 85b2ddd4d07ac..5a89e04159bda 100644 --- a/pkgs/applications/science/physics/sherpa/default.nix +++ b/pkgs/applications/science/physics/sherpa/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { "--enable-rivet=${rivet}" ]; - CXXFLAGS = "-std=c++11"; # needed for rivet on OSX + env.CXXFLAGS = "-std=c++11"; # needed for rivet on OSX meta = { description = "Simulation of High-Energy Reactions of PArticles in lepton-lepton, lepton-photon, photon-photon, lepton-hadron and hadron-hadron collisions"; diff --git a/pkgs/applications/science/robotics/qgroundcontrol/default.nix b/pkgs/applications/science/robotics/qgroundcontrol/default.nix index c17ffb001182f..af767377a14ec 100644 --- a/pkgs/applications/science/robotics/qgroundcontrol/default.nix +++ b/pkgs/applications/science/robotics/qgroundcontrol/default.nix @@ -27,7 +27,7 @@ mkDerivation rec { cd build ''; - NIX_CFLAGS_COMPILE = [ "-Wno-address-of-packed-member" ]; # Don't litter logs with these warnings + env.NIX_CFLAGS_COMPILE = "-Wno-address-of-packed-member"; # Don't litter logs with these warnings qmakeFlags = [ # Default install tries to copy Qt files into package diff --git a/pkgs/applications/video/kodi/default.nix b/pkgs/applications/video/kodi/default.nix index 6d02bcefb0846..27462d6a11aa4 100644 --- a/pkgs/applications/video/kodi/default.nix +++ b/pkgs/applications/video/kodi/default.nix @@ -178,7 +178,7 @@ in stdenv.mkDerivation { lirc # libdvdcss libdvdnav libdvdread ] - ++ lib.optional x11Support [ + ++ lib.optionals x11Support [ libX11 xorgproto libXt libXmu libXext libXdmcp libXinerama libXrandr libXtst libXfixes ] @@ -196,7 +196,7 @@ in stdenv.mkDerivation { # Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise libxkbcommon.dev ] - ++ lib.optional useGbm [ + ++ lib.optionals useGbm [ libxkbcommon.dev mesa.dev libinput.dev @@ -231,11 +231,11 @@ in stdenv.mkDerivation { "-DSWIG_EXECUTABLE=${buildPackages.swig}/bin/swig" "-DFLATBUFFERS_FLATC_EXECUTABLE=${buildPackages.flatbuffers}/bin/flatc" "-DPYTHON_EXECUTABLE=${buildPackages.python2Packages.python}/bin/python" - ] ++ lib.optional useWayland [ + ] ++ lib.optionals useWayland [ "-DCORE_PLATFORM_NAME=wayland" "-DWAYLAND_RENDER_SYSTEM=gl" "-DWAYLANDPP_SCANNER=${buildPackages.waylandpp}/bin/wayland-scanner++" - ] ++ lib.optional useGbm [ + ] ++ lib.optionals useGbm [ "-DCORE_PLATFORM_NAME=gbm" "-DGBM_RENDER_SYSTEM=gles" ]; diff --git a/pkgs/applications/video/mkvtoolnix/default.nix b/pkgs/applications/video/mkvtoolnix/default.nix index 2e97505f3f166..5d5dd5f1a7b5f 100644 --- a/pkgs/applications/video/mkvtoolnix/default.nix +++ b/pkgs/applications/video/mkvtoolnix/default.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { (enableFeature withGUI "qt") ]; - CXXFLAGS = optional stdenv.cc.isClang "-std=c++14"; + env.CXXFLAGS = optionalString stdenv.cc.isClang "-std=c++14"; dontWrapQtApps = true; postFixup = optionalString withGUI '' diff --git a/pkgs/applications/video/shotcut/default.nix b/pkgs/applications/video/shotcut/default.nix index 34392faa7c1dd..5eb66910674d4 100644 --- a/pkgs/applications/video/shotcut/default.nix +++ b/pkgs/applications/video/shotcut/default.nix @@ -39,10 +39,10 @@ mkDerivation rec { ''; qtWrapperArgs = [ - "--prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1" - "--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [jack1 SDL2]}" - "--prefix PATH : ${mlt}/bin" - ]; + "--prefix" "FREI0R_PATH" ":" "${frei0r}/lib/frei0r-1" + "--prefix" "LD_LIBRARY_PATH" ":" (stdenv.lib.makeLibraryPath [jack1 SDL2]) + "--prefix" "PATH" ":" "${mlt}/bin" + ]; postInstall = '' mkdir -p $out/share/shotcut diff --git a/pkgs/applications/video/vdr/plugins.nix b/pkgs/applications/video/vdr/plugins.nix index 6c1e79c42debd..95878cf960f37 100644 --- a/pkgs/applications/video/vdr/plugins.nix +++ b/pkgs/applications/video/vdr/plugins.nix @@ -239,7 +239,7 @@ in { libconvpp = stdenv.mkDerivation { name = "jowi24-libconv++-20130216"; propagatedBuildInputs = [ libiconv ]; - CXXFLAGS = "-std=gnu++11 -Os"; + env.CXXFLAGS = "-std=gnu++11 -Os"; src = fetchFromGitHub { owner = "jowi24"; repo = "libconvpp"; @@ -255,7 +255,7 @@ in { liblogpp = stdenv.mkDerivation { name = "jowi24-liblogpp-20130216"; - CXXFLAGS = "-std=gnu++11 -Os"; + env.CXXFLAGS = "-std=gnu++11 -Os"; src = fetchFromGitHub { owner = "jowi24"; repo = "liblogpp"; @@ -271,7 +271,7 @@ in { libnetpp = stdenv.mkDerivation { name = "jowi24-libnet++-20180628"; - CXXFLAGS = "-std=gnu++11 -Os"; + env.CXXFLAGS = "-std=gnu++11 -Os"; src = fetchFromGitHub { owner = "jowi24"; repo = "libnetpp"; @@ -288,7 +288,7 @@ in { libfritzpp = stdenv.mkDerivation { name = "jowi24-libfritzpp-20131201"; - CXXFLAGS = "-std=gnu++11 -Os"; + env.CXXFLAGS = "-std=gnu++11 -Os"; src = fetchFromGitHub { owner = "jowi24"; repo = "libfritzpp"; diff --git a/pkgs/applications/virtualization/spice-vdagent/default.nix b/pkgs/applications/virtualization/spice-vdagent/default.nix index 22aa31a6dea3d..c2456489aa949 100644 --- a/pkgs/applications/virtualization/spice-vdagent/default.nix +++ b/pkgs/applications/virtualization/spice-vdagent/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation rec { url = "https://www.spice-space.org/download/releases/${name}.tar.bz2"; sha256 = "0n9k2kna2gd1zi6jv45zsp2jlv439nz5l5jjijirxqaycwi74srf"; }; - NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=address-of-packed-member"; postPatch = '' substituteInPlace data/spice-vdagent.desktop --replace /usr $out ''; diff --git a/pkgs/desktops/cinnamon/cinnamon-settings-daemon/default.nix b/pkgs/desktops/cinnamon/cinnamon-settings-daemon/default.nix index 1dc58e3c3b5b8..b049ecf8c6291 100644 --- a/pkgs/desktops/cinnamon/cinnamon-settings-daemon/default.nix +++ b/pkgs/desktops/cinnamon/cinnamon-settings-daemon/default.nix @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { ./csd-backlight-helper-fix.patch ]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; # TODO: https://github.com/NixOS/nixpkgs/issues/36468 + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; # TODO: https://github.com/NixOS/nixpkgs/issues/36468 buildInputs = [ cinnamon-desktop diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/onlineaccounts/default.nix b/pkgs/desktops/pantheon/apps/switchboard-plugs/onlineaccounts/default.nix index 902703bc75e54..05b0666f03a81 100644 --- a/pkgs/desktops/pantheon/apps/switchboard-plugs/onlineaccounts/default.nix +++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/onlineaccounts/default.nix @@ -63,9 +63,9 @@ stdenv.mkDerivation rec { }) ]; - PKG_CONFIG_LIBACCOUNTS_GLIB_PROVIDERFILESDIR = "${placeholder "out"}/share/accounts/providers"; - PKG_CONFIG_LIBACCOUNTS_GLIB_SERVICEFILESDIR = "${placeholder "out"}/share/accounts/services"; - PKG_CONFIG_SWITCHBOARD_2_0_PLUGSDIR = "${placeholder "out"}/lib/switchboard"; + env.PKG_CONFIG_LIBACCOUNTS_GLIB_PROVIDERFILESDIR = "${placeholder "out"}/share/accounts/providers"; + env.PKG_CONFIG_LIBACCOUNTS_GLIB_SERVICEFILESDIR = "${placeholder "out"}/share/accounts/services"; + env.PKG_CONFIG_SWITCHBOARD_2_0_PLUGSDIR = "${placeholder "out"}/lib/switchboard"; meta = with stdenv.lib; { diff --git a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix index 67f4105ff3d15..a864aab09dfb3 100644 --- a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix +++ b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix @@ -31,8 +31,8 @@ stdenv.mkDerivation rec { wrapGAppsHook ]; - buildInputs = lib.forEach selectedPlugs (x: x.buildInputs) - ++ selectedPlugs; + buildInputs = lib.flatten (lib.forEach selectedPlugs (x: x.buildInputs) + ++ selectedPlugs); dontUnpack = true; dontConfigure = true; diff --git a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix index ca887d45dc398..32ce4a0551469 100644 --- a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix +++ b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix @@ -32,8 +32,8 @@ stdenv.mkDerivation rec { wrapGAppsHook ]; - buildInputs = lib.forEach selectedIndicators (x: x.buildInputs) - ++ selectedIndicators; + buildInputs = lib.flatten (lib.forEach selectedIndicators (x: x.buildInputs) + ++ selectedIndicators); dontUnpack = true; dontConfigure = true; diff --git a/pkgs/desktops/plasma-5/kwin/default.nix b/pkgs/desktops/plasma-5/kwin/default.nix index 0e1709d8245c7..403ddb1a456d3 100644 --- a/pkgs/desktops/plasma-5/kwin/default.nix +++ b/pkgs/desktops/plasma-5/kwin/default.nix @@ -37,9 +37,7 @@ mkDerivation { ./0001-follow-symlinks.patch ./0002-xwayland.patch ]; - CXXFLAGS = [ - ''-DNIXPKGS_XWAYLAND=\"${lib.getBin xwayland}/bin/Xwayland\"'' - ]; + env.CXXFLAGS = ''-DNIXPKGS_XWAYLAND=\"${lib.getBin xwayland}/bin/Xwayland\"''; cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" ]; postInstall = '' # Some package(s) refer to these service types by the wrong name. diff --git a/pkgs/desktops/plasma-5/plasma-vault/default.nix b/pkgs/desktops/plasma-5/plasma-vault/default.nix index e016944be4563..caabe85c25da8 100644 --- a/pkgs/desktops/plasma-5/plasma-vault/default.nix +++ b/pkgs/desktops/plasma-5/plasma-vault/default.nix @@ -28,7 +28,7 @@ mkDerivation { networkmanager-qt ]; - CXXFLAGS = [ + env.CXXFLAGS = toString [ ''-DNIXPKGS_ENCFS=\"${lib.getBin encfs}/bin/encfs\"'' ''-DNIXPKGS_ENCFSCTL=\"${lib.getBin encfs}/bin/encfsctl\"'' diff --git a/pkgs/development/bower-modules/generic/default.nix b/pkgs/development/bower-modules/generic/default.nix index ba15b58816020..8ed5f8abd5e51 100644 --- a/pkgs/development/bower-modules/generic/default.nix +++ b/pkgs/development/bower-modules/generic/default.nix @@ -17,16 +17,14 @@ in pkgs.stdenv.mkDerivation ( inherit bowerPackages; - builder = builtins.toFile "builder.sh" '' - source $stdenv/setup - + buildCommand = '' # The project's bower.json is required cp $src/bower.json . # Dereference symlinks -- bower doesn't like them cp --recursive --reflink=auto \ --dereference --no-preserve=mode \ - $bowerPackages bc + "''${bowerPackages[@]}" bc # Bower install in offline mode -- links together the fetched # bower packages. diff --git a/pkgs/development/compilers/elm/packages/node-composition.nix b/pkgs/development/compilers/elm/packages/node-composition.nix index 4add754b59994..2f76bec60314e 100644 --- a/pkgs/development/compilers/elm/packages/node-composition.nix +++ b/pkgs/development/compilers/elm/packages/node-composition.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../../node-packages/node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -14,4 +14,4 @@ in import ./node-packages.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv; -} \ No newline at end of file +} diff --git a/pkgs/development/compilers/ghc/8.10.1.nix b/pkgs/development/compilers/ghc/8.10.1.nix index 01e10b04d2709..2dc4124206ee9 100644 --- a/pkgs/development/compilers/ghc/8.10.1.nix +++ b/pkgs/development/compilers/ghc/8.10.1.nix @@ -73,7 +73,7 @@ let ''; # Splicer will pull out correct variations - libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] + libDeps = platform: stdenv.lib.optional enableTerminfo ncurses ++ [libffi] ++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; @@ -160,10 +160,10 @@ stdenv.mkDerivation (rec { "--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [ + ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ + ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ diff --git a/pkgs/development/compilers/ghc/8.8.2.nix b/pkgs/development/compilers/ghc/8.8.2.nix index 9039b1fa7467b..b4ccd18ae9409 100644 --- a/pkgs/development/compilers/ghc/8.8.2.nix +++ b/pkgs/development/compilers/ghc/8.8.2.nix @@ -73,7 +73,7 @@ let ''; # Splicer will pull out correct variations - libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] + libDeps = platform: stdenv.lib.optional enableTerminfo ncurses ++ [libffi] ++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; @@ -160,10 +160,10 @@ stdenv.mkDerivation (rec { "--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [ + ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ + ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ diff --git a/pkgs/development/compilers/llvm/10/lldb.nix b/pkgs/development/compilers/llvm/10/lldb.nix index 90716f67f836f..cdc05153b861f 100644 --- a/pkgs/development/compilers/llvm/10/lldb.nix +++ b/pkgs/development/compilers/llvm/10/lldb.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation (rec { darwin.apple_sdk.frameworks.Cocoa ]; - CXXFLAGS = "-fno-rtti"; + env.CXXFLAGS = "-fno-rtti"; hardeningDisable = [ "format" ]; cmakeFlags = [ diff --git a/pkgs/development/compilers/llvm/5/compiler-rt.nix b/pkgs/development/compilers/llvm/5/compiler-rt.nix index 55f4eb94e9284..90d275a4dbf4e 100644 --- a/pkgs/development/compilers/llvm/5/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/5/compiler-rt.nix @@ -16,9 +16,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake python3 llvm ]; buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi; - NIX_CFLAGS_COMPILE = [ - "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" - ]; + env.NIX_CFLAGS_COMPILE = "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"; cmakeFlags = [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" diff --git a/pkgs/development/compilers/llvm/5/libc++abi.nix b/pkgs/development/compilers/llvm/5/libc++abi.nix index 96d6e78e01e4a..1a5e5de7936e9 100644 --- a/pkgs/development/compilers/llvm/5/libc++abi.nix +++ b/pkgs/development/compilers/llvm/5/libc++abi.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { postUnpack = '' unpackFile ${libcxx.src} unpackFile ${llvm.src} - export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)" + export cmakeFlags=("-DLLVM_PATH=$PWD/$(ls -d llvm-*)" "-DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)") '' + stdenv.lib.optionalString stdenv.isDarwin '' export TRIPLE=x86_64-apple-darwin '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' diff --git a/pkgs/development/compilers/llvm/9/lldb.nix b/pkgs/development/compilers/llvm/9/lldb.nix index a8e193c27b173..74517b512519a 100644 --- a/pkgs/development/compilers/llvm/9/lldb.nix +++ b/pkgs/development/compilers/llvm/9/lldb.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { darwin.apple_sdk.frameworks.Cocoa ]; - CXXFLAGS = "-fno-rtti"; + env.CXXFLAGS = "-fno-rtti"; hardeningDisable = [ "format" ]; cmakeFlags = [ diff --git a/pkgs/development/compilers/ponyc/default.nix b/pkgs/development/compilers/ponyc/default.nix index e48e454a0a402..741f87493055c 100644 --- a/pkgs/development/compilers/ponyc/default.nix +++ b/pkgs/development/compilers/ponyc/default.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation ( rec { checkTarget = "test-ci"; - NIX_CFLAGS_COMPILE = [ "-Wno-error=redundant-move" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=redundant-move"; preCheck = '' export PONYPATH="$out/lib:${stdenv.lib.makeLibraryPath [ pcre2 libressl ]}" diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix index 120a309b65610..4c5ceee9e571a 100644 --- a/pkgs/development/libraries/ffmpeg-full/default.nix +++ b/pkgs/development/libraries/ffmpeg-full/default.nix @@ -275,7 +275,6 @@ stdenv.mkDerivation rec { # On some ARM platforms --enable-thumb "--enable-shared" (enableFeature true "pic") - (if stdenv.cc.isClang then "--cc=clang" else null) (enableFeature smallBuild "small") (enableFeature runtimeCpuDetectBuild "runtime-cpudetect") (enableFeature enableLto "lto") @@ -283,13 +282,6 @@ stdenv.mkDerivation rec { (enableFeature swscaleAlphaBuild "swscale-alpha") (enableFeature hardcodedTablesBuild "hardcoded-tables") (enableFeature safeBitstreamReaderBuild "safe-bitstream-reader") - (if multithreadBuild then ( - if isCygwin then - "--disable-pthreads --enable-w32threads" - else # Use POSIX threads by default - "--enable-pthreads --disable-w32threads") - else - "--disable-pthreads --disable-w32threads") "--disable-os2threads" # We don't support OS/2 (enableFeature networkBuild "network") (enableFeature pixelutilsBuild "pixelutils") @@ -411,7 +403,15 @@ stdenv.mkDerivation rec { (enableFeature optimizationsDeveloper "optimizations") (enableFeature extraWarningsDeveloper "extra-warnings") (enableFeature strippingDeveloper "stripping") - ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ optional stdenv.cc.isClang "--cc=clang" + ++ (if multithreadBuild then ( + if isCygwin then + [ "--disable-pthreads" "--enable-w32threads" ] + else # Use POSIX threads by default + [ "--enable-pthreads" "--disable-w32threads" ]) + else + [ "--disable-pthreads" "--disable-w32threads" ]) + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-prefix=${stdenv.cc.targetPrefix}" "--enable-cross-compile" ]; diff --git a/pkgs/development/libraries/galario/default.nix b/pkgs/development/libraries/galario/default.nix index 08450e5698301..074c48363f1f6 100644 --- a/pkgs/development/libraries/galario/default.nix +++ b/pkgs/development/libraries/galario/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional stdenv.isDarwin llvmPackages.openmp ; - propagatedBuildInputs = stdenv.lib.optional enablePython [ + propagatedBuildInputs = stdenv.lib.optionals enablePython [ pythonPackages.numpy pythonPackages.cython pythonPackages.pytest diff --git a/pkgs/development/libraries/gdal/2.4.0.nix b/pkgs/development/libraries/gdal/2.4.0.nix index 201bec30e2220..6563c2c080e47 100644 --- a/pkgs/development/libraries/gdal/2.4.0.nix +++ b/pkgs/development/libraries/gdal/2.4.0.nix @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - CXXFLAGS = "-fpermissive"; + env.CXXFLAGS = "-fpermissive"; postPatch = '' sed -i '/ifdef bool/i\ diff --git a/pkgs/development/libraries/kde-frameworks/kimageformats.nix b/pkgs/development/libraries/kde-frameworks/kimageformats.nix index 29748a5f7f424..b0c22a553c478 100644 --- a/pkgs/development/libraries/kde-frameworks/kimageformats.nix +++ b/pkgs/development/libraries/kde-frameworks/kimageformats.nix @@ -12,5 +12,5 @@ mkDerivation { nativeBuildInputs = [ extra-cmake-modules ]; buildInputs = [ karchive openexr qtbase ]; outputs = [ "out" ]; # plugins only - CXXFLAGS = "-I${getDev ilmbase}/include/OpenEXR"; + env.CXXFLAGS = "-I${getDev ilmbase}/include/OpenEXR"; } diff --git a/pkgs/development/libraries/libeatmydata/default.nix b/pkgs/development/libraries/libeatmydata/default.nix index aeaa45a7905e5..79b3be92df24b 100644 --- a/pkgs/development/libraries/libeatmydata/default.nix +++ b/pkgs/development/libraries/libeatmydata/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { }; patches = [ ./find-shell-lib.patch ]; - patchFlags = "-p0"; + patchFlags = [ "-p0" ]; postPatch = '' substituteInPlace eatmydata.in --replace NIX_OUT_DIR $out ''; diff --git a/pkgs/development/libraries/libwebsockets/default.nix b/pkgs/development/libraries/libwebsockets/default.nix index ddafc9bc65940..04479a872c15d 100644 --- a/pkgs/development/libraries/libwebsockets/default.nix +++ b/pkgs/development/libraries/libwebsockets/default.nix @@ -17,7 +17,7 @@ let nativeBuildInputs = [ cmake ]; cmakeFlags = [ "-DLWS_WITH_PLUGINS=ON" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable"; meta = with stdenv.lib; { description = "Light, portable C library for websockets"; diff --git a/pkgs/development/libraries/mlt/qt-5.nix b/pkgs/development/libraries/mlt/qt-5.nix index 53265caead26f..1d9e7387f5d7e 100644 --- a/pkgs/development/libraries/mlt/qt-5.nix +++ b/pkgs/development/libraries/mlt/qt-5.nix @@ -34,8 +34,7 @@ stdenv.mkDerivation rec { # mlt is unable to cope with our multi-prefix Qt build # because it does not use CMake or qmake. env.NIX_CFLAGS_COMPILE = "-I${getDev qtsvg}/include/QtSvg"; - - CXXFLAGS = "-std=c++11"; + env.CXXFLAGS = "-std=c++11"; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/movit/default.nix b/pkgs/development/libraries/movit/default.nix index 901d299728fa5..25a5a02bd6740 100644 --- a/pkgs/development/libraries/movit/default.nix +++ b/pkgs/development/libraries/movit/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - GTEST_DIR = "${gtest.src}/googletest"; + env.GTEST_DIR = "${gtest.src}/googletest"; propagatedBuildInputs = [ eigen epoxy ]; diff --git a/pkgs/development/libraries/physics/mcgrid/default.nix b/pkgs/development/libraries/physics/mcgrid/default.nix index 27d8197a4362f..55d9039678fb6 100644 --- a/pkgs/development/libraries/physics/mcgrid/default.nix +++ b/pkgs/development/libraries/physics/mcgrid/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { --replace "Cflags:" "Cflags: -std=c++11" ''; - CXXFLAGS = "-std=c++11"; + env.CXXFLAGS = "-std=c++11"; enableParallelBuilding = true; meta = { diff --git a/pkgs/development/libraries/pipewire/2.nix b/pkgs/development/libraries/pipewire/2.nix index e9656ee23ec53..10c5179013104 100644 --- a/pkgs/development/libraries/pipewire/2.nix +++ b/pkgs/development/libraries/pipewire/2.nix @@ -33,9 +33,9 @@ in stdenv.mkDerivation rec { "-Dgstreamer=enabled" ]; - PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user"; + env.PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user"; - FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file + env.FONTCONFIG_FILE = toString fontsConf; # Fontconfig error: Cannot load default config file doCheck = true; diff --git a/pkgs/development/libraries/poppler/0.61.nix b/pkgs/development/libraries/poppler/0.61.nix index 0603f49fad41f..71b84a407dcef 100644 --- a/pkgs/development/libraries/poppler/0.61.nix +++ b/pkgs/development/libraries/poppler/0.61.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ninja pkgconfig ]; # Not sure when and how to pass it. It seems an upstream bug anyway. - CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11"; + env.CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11"; cmakeFlags = [ (mkFlag true "XPDF_HEADERS") diff --git a/pkgs/development/libraries/science/networking/ns-3/default.nix b/pkgs/development/libraries/science/networking/ns-3/default.nix index 73be2a8ca6c2b..358538b836157 100644 --- a/pkgs/development/libraries/science/networking/ns-3/default.nix +++ b/pkgs/development/libraries/science/networking/ns-3/default.nix @@ -78,7 +78,7 @@ stdenv.mkDerivation rec { + lib.optionalString withManual "sphinx"; # to prevent fatal error: 'backward_warning.h' file not found - CXXFLAGS = "-D_GLIBCXX_PERMIT_BACKWARD_HASH"; + env.CXXFLAGS = "-D_GLIBCXX_PERMIT_BACKWARD_HASH"; postBuild = with stdenv.lib; let flags = concatStringsSep ";" ( optional enableDoxygen "./waf doxygen" diff --git a/pkgs/development/libraries/sqlcipher/default.nix b/pkgs/development/libraries/sqlcipher/default.nix index 66d30e26a0d89..05146e8fe2e64 100644 --- a/pkgs/development/libraries/sqlcipher/default.nix +++ b/pkgs/development/libraries/sqlcipher/default.nix @@ -17,8 +17,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-threadsafe" "--disable-tcl" ]; - CFLAGS = [ "-DSQLITE_ENABLE_COLUMN_METADATA=1" "-DSQLITE_SECURE_DELETE=1" "-DSQLITE_ENABLE_UNLOCK_NOTIFY=1" "-DSQLITE_HAS_CODEC" ]; - LDFLAGS = lib.optional (readline != null) "-lncurses"; + env.CFLAGS = "-DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_HAS_CODEC"; + env.LDFLAGS = lib.optionalString (readline != null) "-lncurses"; doCheck = false; # fails. requires tcl? diff --git a/pkgs/development/libraries/vtk/default.nix b/pkgs/development/libraries/vtk/default.nix index a7e1bc4329040..d17ab87052a97 100644 --- a/pkgs/development/libraries/vtk/default.nix +++ b/pkgs/development/libraries/vtk/default.nix @@ -37,9 +37,7 @@ stdenv.mkDerivation rec { ++ optionals stdenv.isDarwin [ xpc Cocoa CoreServices DiskArbitration IOKit CFNetwork Security ApplicationServices CoreText IOSurface ImageIO OpenGL GLUT ] - ++ optional enablePython [ - python - ]; + ++ optional enablePython python; propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ libobjc ]; preBuild = '' @@ -52,9 +50,9 @@ stdenv.mkDerivation rec { # At least, we use -fPIC for other packages to be able to use this in shared # objects. cmakeFlags = [ "-DCMAKE_C_FLAGS=-fPIC" "-DCMAKE_CXX_FLAGS=-fPIC" "-DVTK_USE_SYSTEM_TIFF=1" "-DOPENGL_INCLUDE_DIR=${libGL}/include" ] - ++ optional (qtLib != null) [ "-DVTK_USE_QT:BOOL=ON" ] - ++ optional stdenv.isDarwin [ "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" ] - ++ optional enablePython [ "-DVTK_WRAP_PYTHON:BOOL=ON" ]; + ++ optional (qtLib != null) "-DVTK_USE_QT:BOOL=ON" + ++ optional stdenv.isDarwin "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" + ++ optional enablePython "-DVTK_WRAP_PYTHON:BOOL=ON"; postPatch = stdenv.lib.optionalString stdenv.isDarwin '' sed -i 's|COMMAND vtkHashSource|COMMAND "DYLD_LIBRARY_PATH=''${VTK_BINARY_DIR}/lib" ''${VTK_BINARY_DIR}/bin/vtkHashSource-7.0|' ./Parallel/Core/CMakeLists.txt diff --git a/pkgs/development/misc/google-clasp/google-clasp.nix b/pkgs/development/misc/google-clasp/google-clasp.nix index a527491777bc4..c12efc1afc9ce 100644 --- a/pkgs/development/misc/google-clasp/google-clasp.nix +++ b/pkgs/development/misc/google-clasp/google-clasp.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../node-packages/node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -14,4 +14,4 @@ in import ./node-packages.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv; -} \ No newline at end of file +} diff --git a/pkgs/development/pharo/vm/build-vm.nix b/pkgs/development/pharo/vm/build-vm.nix index 4bc60dde410f5..01a6a698631f3 100644 --- a/pkgs/development/pharo/vm/build-vm.nix +++ b/pkgs/development/pharo/vm/build-vm.nix @@ -59,8 +59,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--without-npsqueak" "--with-vmversion=5.0" "--with-src=${vm}" ]; - CFLAGS = "-DPharoVM -DIMMUTABILITY=1 -msse2 -D_GNU_SOURCE -DCOGMTVM=0 -g -O2 -DNDEBUG -DDEBUGVM=0"; - LDFLAGS = "-Wl,-z,now"; + env.CFLAGS = "-DPharoVM -DIMMUTABILITY=1 -msse2 -D_GNU_SOURCE -DCOGMTVM=0 -g -O2 -DNDEBUG -DDEBUGVM=0"; + env.LDFLAGS = "-Wl,-z,now"; # VM sources require some patching before build. prePatch = '' diff --git a/pkgs/development/python-modules/fiona/default.nix b/pkgs/development/python-modules/fiona/default.nix index cd4ed57d792cb..7d6ffbc437544 100644 --- a/pkgs/development/python-modules/fiona/default.nix +++ b/pkgs/development/python-modules/fiona/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { sha256 = "00366f2j21b5r4r8310sadf7jjhdr44s0381dhjqkw2nzpwjnhqs"; }; - CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11"; + env.CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11"; nativeBuildInputs = [ gdal_2 # for gdal-config diff --git a/pkgs/development/python-modules/jaraco_text/default.nix b/pkgs/development/python-modules/jaraco_text/default.nix index 9b3821edd7a0d..6cf51f0bc2b5d 100644 --- a/pkgs/development/python-modules/jaraco_text/default.nix +++ b/pkgs/development/python-modules/jaraco_text/default.nix @@ -16,7 +16,7 @@ buildPythonPackage rec { nativeBuildInputs =[ setuptools_scm ]; propagatedBuildInputs = [ jaraco_functools - ] ++ lib.optional (pythonOlder "3.7") [ importlib-resources ]; + ] ++ lib.optional (pythonOlder "3.7") importlib-resources; # no tests in pypi package doCheck = false; diff --git a/pkgs/development/python-modules/tensorflow/2/default.nix b/pkgs/development/python-modules/tensorflow/2/default.nix index 089d377ec2416..8afd620f0e27b 100644 --- a/pkgs/development/python-modules/tensorflow/2/default.nix +++ b/pkgs/development/python-modules/tensorflow/2/default.nix @@ -174,12 +174,12 @@ let ]; # arbitrarily set to the current latest bazel version, overly careful - TF_IGNORE_MAX_BAZEL_VERSION = true; + env.TF_IGNORE_MAX_BAZEL_VERSION = true; # Take as many libraries from the system as possible. Keep in sync with # list of valid syslibs in # https://github.com/tensorflow/tensorflow/blob/master/third_party/systemlibs/syslibs_configure.bzl - TF_SYSTEM_LIBS = lib.concatStringsSep "," [ + env.TF_SYSTEM_LIBS = lib.concatStringsSep "," [ "absl_py" "astor_archive" "boringssl" @@ -215,24 +215,24 @@ let "zlib_archive" ]; - INCLUDEDIR = "${includes_joined}/include"; + env.INCLUDEDIR = "${includes_joined}/include"; - PYTHON_BIN_PATH = pythonEnv.interpreter; + env.PYTHON_BIN_PATH = toString pythonEnv.interpreter; - TF_NEED_GCP = true; - TF_NEED_HDFS = true; - TF_ENABLE_XLA = tfFeature xlaSupport; + env.TF_NEED_GCP = true; + env.TF_NEED_HDFS = true; + env.TF_ENABLE_XLA = tfFeature xlaSupport; - CC_OPT_FLAGS = " "; + env.CC_OPT_FLAGS = " "; # https://github.com/tensorflow/tensorflow/issues/14454 - TF_NEED_MPI = tfFeature cudaSupport; + env.TF_NEED_MPI = tfFeature cudaSupport; - TF_NEED_CUDA = tfFeature cudaSupport; - TF_CUDA_PATHS = lib.optionalString cudaSupport "${cudatoolkit_joined},${cudnn},${nccl}"; - GCC_HOST_COMPILER_PREFIX = lib.optionalString cudaSupport "${cudatoolkit_cc_joined}/bin"; - GCC_HOST_COMPILER_PATH = lib.optionalString cudaSupport "${cudatoolkit_cc_joined}/bin/gcc"; - TF_CUDA_COMPUTE_CAPABILITIES = lib.concatStringsSep "," cudaCapabilities; + env.TF_NEED_CUDA = tfFeature cudaSupport; + env.TF_CUDA_PATHS = lib.optionalString cudaSupport "${cudatoolkit_joined},${cudnn},${nccl}"; + env.GCC_HOST_COMPILER_PREFIX = lib.optionalString cudaSupport "${cudatoolkit_cc_joined}/bin"; + env.GCC_HOST_COMPILER_PATH = lib.optionalString cudaSupport "${cudatoolkit_cc_joined}/bin/gcc"; + env.TF_CUDA_COMPUTE_CAPABILITIES = lib.concatStringsSep "," cudaCapabilities; postPatch = '' # https://github.com/tensorflow/tensorflow/issues/20919 @@ -273,7 +273,7 @@ let ''; # FIXME: Tensorflow uses dlopen() for CUDA libraries. - NIX_LDFLAGS = lib.optionalString cudaSupport "-lcudart -lcublas -lcufft -lcurand -lcusolver -lcusparse -lcudnn"; + env.NIX_LDFLAGS = lib.optionalString cudaSupport "-lcudart -lcublas -lcufft -lcurand -lcusolver -lcusparse -lcudnn"; hardeningDisable = [ "format" ]; diff --git a/pkgs/development/tools/build-managers/redo-apenwarr/default.nix b/pkgs/development/tools/build-managers/redo-apenwarr/default.nix index 79707fc64db55..691cdd144c2ed 100644 --- a/pkgs/development/tools/build-managers/redo-apenwarr/default.nix +++ b/pkgs/development/tools/build-managers/redo-apenwarr/default.nix @@ -50,10 +50,9 @@ nativeBuildInputs = [ python3 - (with python3.pkgs; [ beautifulsoup4 markdown ]) which findutils - ]; + ] ++ (with python3.pkgs; [ beautifulsoup4 markdown ]); meta = with lib; { description = "Smaller, easier, more powerful, and more reliable than make. An implementation of djb's redo."; diff --git a/pkgs/development/tools/misc/igprof/default.nix b/pkgs/development/tools/misc/igprof/default.nix index 0780672cc0202..687e30cfa1f57 100644 --- a/pkgs/development/tools/misc/igprof/default.nix +++ b/pkgs/development/tools/misc/igprof/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { buildInputs = [libunwind gdb pcre]; nativeBuildInputs = [cmake]; - CXXFLAGS = ["-fPIC" "-O2" "-w" "-fpermissive"]; + env.CXXFLAGS = "-fPIC -O2 -w -fpermissive"; meta = { description = "The Ignominous Profiler"; diff --git a/pkgs/development/tools/node-webkit/nw12.nix b/pkgs/development/tools/node-webkit/nw12.nix index 307e123bf77db..5dfd3aa156c59 100644 --- a/pkgs/development/tools/node-webkit/nw12.nix +++ b/pkgs/development/tools/node-webkit/nw12.nix @@ -30,8 +30,6 @@ in stdenv.mkDerivation rec { "117gx6yjbcya64yg2vybcfyp591sid209pg8a33k9afbsmgz684c"; }; - phases = [ "unpackPhase" "installPhase" ]; - installPhase = '' mkdir -p $out/share/nwjs cp -R * $out/share/nwjs diff --git a/pkgs/development/tools/nwjs/default.nix b/pkgs/development/tools/nwjs/default.nix index 463642988a8f5..ef50a67a0428a 100644 --- a/pkgs/development/tools/nwjs/default.nix +++ b/pkgs/development/tools/nwjs/default.nix @@ -47,8 +47,6 @@ in stdenv.mkDerivation rec { "0nlpdz76k1p1pq4xygfr2an91m0d7p5fjyg2xhiggyy8b7sp4964"; }; - phases = [ "unpackPhase" "installPhase" ]; - # we have runtime deps like sqlite3 that should remain dontPatchELF = true; diff --git a/pkgs/development/tools/simavr/default.nix b/pkgs/development/tools/simavr/default.nix index 83ae00ce7b665..b0349a7353641 100644 --- a/pkgs/development/tools/simavr/default.nix +++ b/pkgs/development/tools/simavr/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { "AVR=avr-" ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-truncation" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=stringop-truncation"; nativeBuildInputs = [ which pkgconfig avrgcc ]; buildInputs = [ libelf freeglut libGLU libGL ] diff --git a/pkgs/games/keeperrl/default.nix b/pkgs/games/keeperrl/default.nix index 68426a4aedfd0..7879bf2f158a6 100644 --- a/pkgs/games/keeperrl/default.nix +++ b/pkgs/games/keeperrl/default.nix @@ -43,9 +43,7 @@ stdenv.mkDerivation rec { openal curl libogg libvorbis SDL2 SDL2_image zlib ]; - NIX_CFLAGS_COMPILE = [ - "-I${SDL2.dev}/include/SDL2" - ]; + env.NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2"; enableParallelBuilding = true; diff --git a/pkgs/games/xonotic/default.nix b/pkgs/games/xonotic/default.nix index ab6ac022b6c25..29163ca118b1f 100644 --- a/pkgs/games/xonotic/default.nix +++ b/pkgs/games/xonotic/default.nix @@ -63,8 +63,8 @@ let }; buildInputs = [ unzip libjpeg zlib libvorbis curl ] - ++ lib.optional withGLX [ libX11.dev libGLU.dev libGL.dev libXpm.dev libXext.dev libXxf86vm.dev alsaLib.dev ] - ++ lib.optional withSDL [ SDL2.dev ]; + ++ lib.optionals withGLX [ libX11.dev libGLU.dev libGL.dev libXpm.dev libXext.dev libXxf86vm.dev alsaLib.dev ] + ++ lib.optionals withSDL [ SDL2.dev ]; sourceRoot = "Xonotic/source/darkplaces"; diff --git a/pkgs/misc/emulators/uae/default.nix b/pkgs/misc/emulators/uae/default.nix index 7b52430aa0151..b3c57b2e01791 100644 --- a/pkgs/misc/emulators/uae/default.nix +++ b/pkgs/misc/emulators/uae/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { buildInputs = [ gtk2 alsaLib SDL ]; hardeningDisable = [ "format" ]; - LDFLAGS = [ "-lm" ]; + env.LDFLAGS = "-lm"; meta = { description = "Ultimate/Unix/Unusable Amiga Emulator"; diff --git a/pkgs/os-specific/linux/irqbalance/default.nix b/pkgs/os-specific/linux/irqbalance/default.nix index 4c4e1ff025d97..0cde2225b757a 100644 --- a/pkgs/os-specific/linux/irqbalance/default.nix +++ b/pkgs/os-specific/linux/irqbalance/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkgconfig ]; buildInputs = [ glib ncurses libcap_ng ]; - LDFLAGS = "-lncurses"; + env.LDFLAGS = "-lncurses"; postInstall = '' diff --git a/pkgs/os-specific/linux/pam_u2f/default.nix b/pkgs/os-specific/linux/pam_u2f/default.nix index 30acb86d860e1..5017d14ccd92e 100644 --- a/pkgs/os-specific/linux/pam_u2f/default.nix +++ b/pkgs/os-specific/linux/pam_u2f/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ libu2f-host libu2f-server pam ]; # Fix the broken include in 1.0.1 - CFLAGS = "-I${libu2f-host}/include/u2f-host"; + env.CFLAGS = "-I${libu2f-host}/include/u2f-host"; preConfigure = '' configureFlagsArray+=("--with-pam-dir=$out/lib/security") diff --git a/pkgs/os-specific/linux/xf86-input-wacom/default.nix b/pkgs/os-specific/linux/xf86-input-wacom/default.nix index 8a7541afa692d..c9042f91bdd47 100644 --- a/pkgs/os-specific/linux/xf86-input-wacom/default.nix +++ b/pkgs/os-specific/linux/xf86-input-wacom/default.nix @@ -15,11 +15,14 @@ stdenv.mkDerivation rec { preConfigure = '' mkdir -p $out/share/X11/xorg.conf.d - configureFlags="--with-xorg-module-dir=$out/lib/xorg/modules - --with-sdkdir=$out/include/xorg --with-xorg-conf-dir=$out/share/X11/xorg.conf.d" + configureFlags+=( + "--with-xorg-module-dir=$out/lib/xorg/modules" + "--with-sdkdir=$out/include/xorg" + "--with-xorg-conf-dir=$out/share/X11/xorg.conf.d" + ) ''; - CFLAGS = "-I${pixman}/include/pixman-1"; + env.CFLAGS = "-I${pixman}/include/pixman-1"; meta = with stdenv.lib; { maintainers = [ maintainers.goibhniu ]; diff --git a/pkgs/os-specific/linux/xf86-video-nested/default.nix b/pkgs/os-specific/linux/xf86-video-nested/default.nix index c117293d3ad18..5662b7dc09f4a 100644 --- a/pkgs/os-specific/linux/xf86-video-nested/default.nix +++ b/pkgs/os-specific/linux/xf86-video-nested/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation { hardeningDisable = [ "fortify" ]; - CFLAGS = "-I${pixman}/include/pixman-1"; + env.CFLAGS = "-I${pixman}/include/pixman-1"; meta = { homepage = "https://cgit.freedesktop.org/xorg/driver/xf86-video-nested"; diff --git a/pkgs/servers/dns/knot-dns/default.nix b/pkgs/servers/dns/knot-dns/default.nix index 73881ff1092d5..0f01c03998873 100644 --- a/pkgs/servers/dns/knot-dns/default.nix +++ b/pkgs/servers/dns/knot-dns/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - CFLAGS = [ "-O2" "-DNDEBUG" ]; + env.CFLAGS = "-O2 -DNDEBUG"; doCheck = true; doInstallCheck = false; # needs pykeymgr? diff --git a/pkgs/servers/matrix-synapse/matrix-appservice-slack/node-composition.nix b/pkgs/servers/matrix-synapse/matrix-appservice-slack/node-composition.nix index 36da6132423c1..cb5db4953469c 100644 --- a/pkgs/servers/matrix-synapse/matrix-appservice-slack/node-composition.nix +++ b/pkgs/servers/matrix-synapse/matrix-appservice-slack/node-composition.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../../development/node-packages/node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -14,4 +14,4 @@ in import ./node-packages.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv; -} \ No newline at end of file +} diff --git a/pkgs/servers/search/sphinxsearch/default.nix b/pkgs/servers/search/sphinxsearch/default.nix index 47547f07fb49a..297c4d7585135 100644 --- a/pkgs/servers/search/sphinxsearch/default.nix +++ b/pkgs/servers/search/sphinxsearch/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { expat ]; - CXXFLAGS = with stdenv.lib; concatStringsSep " " (optionals stdenv.isDarwin [ + env.CXXFLAGS = with stdenv.lib; concatStringsSep " " (optionals stdenv.isDarwin [ # see upstream bug: http://sphinxsearch.com/bugs/view.php?id=2578 # workaround for "error: invalid suffix on literal "-Wno-reserved-user-defined-literal" diff --git a/pkgs/servers/web-apps/cryptpad/node-packages.nix b/pkgs/servers/web-apps/cryptpad/node-packages.nix index 3eecf3c90999a..c0ab661847940 100644 --- a/pkgs/servers/web-apps/cryptpad/node-packages.nix +++ b/pkgs/servers/web-apps/cryptpad/node-packages.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../../development/node-packages/node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -14,4 +14,4 @@ in import ./node-packages-generated.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv; -} \ No newline at end of file +} diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 19787038f87f3..f0c6645cc7d3c 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -252,52 +252,52 @@ in rec { depsBuildBuild = let deps = lib.elemAt (lib.elemAt dependencies 0) 0; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; nativeBuildInputs = let deps = lib.elemAt (lib.elemAt dependencies 0) 1; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; depsBuildTarget = let deps = lib.elemAt (lib.elemAt dependencies 0) 2; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; depsHostHost = let deps = lib.elemAt (lib.elemAt dependencies 1) 0; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; buildInputs = let deps = lib.elemAt (lib.elemAt dependencies 1) 1; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; depsTargetTarget = let deps = lib.elemAt (lib.elemAt dependencies 2) 0; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; depsBuildBuildPropagated = let deps = lib.elemAt (lib.elemAt propagatedDependencies 0) 0; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; propagatedNativeBuildInputs = let deps = lib.elemAt (lib.elemAt propagatedDependencies 0) 1; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; depsBuildTargetPropagated = let deps = lib.elemAt (lib.elemAt propagatedDependencies 0) 2; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; depsHostHostPropagated = let deps = lib.elemAt (lib.elemAt propagatedDependencies 1) 0; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; propagatedBuildInputs = let deps = lib.elemAt (lib.elemAt propagatedDependencies 1) 1; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; depsTargetTargetPropagated = let deps = lib.elemAt (lib.elemAt propagatedDependencies 2) 0; in - assert lib.all (v: lib.isDerivation v || builtins.isPath v) deps; + assert lib.all (v: lib.isDerivation v || builtins.isPath v || builtins.isString v) deps; deps; # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck diff --git a/pkgs/tools/X11/xmousepasteblock/default.nix b/pkgs/tools/X11/xmousepasteblock/default.nix index 094b26d1f55cf..5089a62a2f521 100644 --- a/pkgs/tools/X11/xmousepasteblock/default.nix +++ b/pkgs/tools/X11/xmousepasteblock/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "0vidckfp277cg2gsww8a8q5b18m10iy4ppyp2qipr89771nrcmns"; rev = version; }; - makeFlags = "PREFIX=$(out)"; + makeFlags = [ "PREFIX=$(out)" ]; buildInputs = with xorg; [ libX11 libXext libXi libev ]; nativeBuildInputs = [ pkgconfig ]; meta = with stdenv.lib; { diff --git a/pkgs/tools/filesystems/darling-dmg/default.nix b/pkgs/tools/filesystems/darling-dmg/default.nix index 3548cf0a3dcad..9494fd4632652 100644 --- a/pkgs/tools/filesystems/darling-dmg/default.nix +++ b/pkgs/tools/filesystems/darling-dmg/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ fuse openssl zlib bzip2 libxml2 icu ]; # compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554 - CXXFLAGS = [ "-DU_USING_ICU_NAMESPACE=1" ]; + env.CXXFLAGS = "-DU_USING_ICU_NAMESPACE=1"; meta = { homepage = "http://www.darlinghq.org/"; diff --git a/pkgs/tools/graphics/gifsicle/default.nix b/pkgs/tools/graphics/gifsicle/default.nix index 007ba0f99720a..4620f563f308d 100644 --- a/pkgs/tools/graphics/gifsicle/default.nix +++ b/pkgs/tools/graphics/gifsicle/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { configureFlags = optional (!gifview) "--disable-gifview"; - LDFLAGS = optionalString static "-static"; + env.LDFLAGS = optionalString static "-static"; doCheck = true; checkPhase = '' diff --git a/pkgs/tools/misc/colord/default.nix b/pkgs/tools/misc/colord/default.nix index 79d27129173a8..c60128412d16f 100644 --- a/pkgs/tools/misc/colord/default.nix +++ b/pkgs/tools/misc/colord/default.nix @@ -92,11 +92,11 @@ stdenv.mkDerivation rec { glib-compile-schemas $out/share/glib-2.0/schemas ''; - PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system"; - PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user"; - PKG_CONFIG_SYSTEMD_TMPFILESDIR = "${placeholder "out"}/lib/tmpfiles.d"; - PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR= "${placeholder "out"}/share/bash-completion/completions"; - PKG_CONFIG_UDEV_UDEVDIR = "${placeholder "out"}/lib/udev"; + env.PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system"; + env.PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user"; + env.PKG_CONFIG_SYSTEMD_TMPFILESDIR = "${placeholder "out"}/lib/tmpfiles.d"; + env.PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR= "${placeholder "out"}/share/bash-completion/completions"; + env.PKG_CONFIG_UDEV_UDEVDIR = "${placeholder "out"}/lib/udev"; passthru = { tests = { diff --git a/pkgs/tools/misc/wimboot/default.nix b/pkgs/tools/misc/wimboot/default.nix index a63fa4106345e..b5a536292e572 100644 --- a/pkgs/tools/misc/wimboot/default.nix +++ b/pkgs/tools/misc/wimboot/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "134wqqr147az5vbj4szd0xffwa99b4rar7w33zm3119zsn7sd79k"; }; - NIX_CFLAGS_COMPILE = "-Wno-address-of-packed-member"; # Fails on gcc9 + env.NIX_CFLAGS_COMPILE = "-Wno-address-of-packed-member"; # Fails on gcc9 patches = [ # Fix for newer binutils diff --git a/pkgs/tools/networking/mosh/default.nix b/pkgs/tools/networking/mosh/default.nix index 648fdb9d20e8f..525191565225d 100644 --- a/pkgs/tools/networking/mosh/default.nix +++ b/pkgs/tools/networking/mosh/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/mosh --prefix PERL5LIB : $PERL5LIB ''; - CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11"; + env.CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11"; meta = { homepage = "https://mosh.org/"; diff --git a/pkgs/tools/networking/snabb/default.nix b/pkgs/tools/networking/snabb/default.nix index 52ad14c1d110d..66a53d792c5f7 100644 --- a/pkgs/tools/networking/snabb/default.nix +++ b/pkgs/tools/networking/snabb/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { buildInputs = [ makeWrapper ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-truncation" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=stringop-truncation"; patchPhase = '' patchShebangs . diff --git a/pkgs/tools/networking/trickle/default.nix b/pkgs/tools/networking/trickle/default.nix index f97d3c8576210..cd50ff4193740 100644 --- a/pkgs/tools/networking/trickle/default.nix +++ b/pkgs/tools/networking/trickle/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { sed -i '/#define in_addr_t/ s:^://:' config.h ''; - LDFLAGS = "-levent"; + env.LDFLAGS = "-levent"; configureFlags = [ "--with-libevent" ]; diff --git a/pkgs/tools/package-management/nixui/nixui.nix b/pkgs/tools/package-management/nixui/nixui.nix index e306e49c84982..3a7cfa6eeea07 100644 --- a/pkgs/tools/package-management/nixui/nixui.nix +++ b/pkgs/tools/package-management/nixui/nixui.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../../development/node-packages/node-env.nix { - inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile; + inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile jq; inherit nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; @@ -14,4 +14,4 @@ in import ./node-packages.nix { inherit (pkgs) fetchurl fetchgit; inherit nodeEnv; -} \ No newline at end of file +} diff --git a/pkgs/tools/security/krunner-pass/default.nix b/pkgs/tools/security/krunner-pass/default.nix index 7904235b86a47..305d03f125a6e 100644 --- a/pkgs/tools/security/krunner-pass/default.nix +++ b/pkgs/tools/security/krunner-pass/default.nix @@ -29,9 +29,7 @@ mkDerivation rec { ./pass-path.patch ]; - CXXFLAGS = [ - ''-DNIXPKGS_PASS=\"${lib.getBin pass}/bin/pass\"'' - ]; + env.CXXFLAGS = ''-DNIXPKGS_PASS=\"${lib.getBin pass}/bin/pass\"''; meta = with lib; { description = "Integrates krunner with pass the unix standard password manager (https://www.passwordstore.org/)"; diff --git a/pkgs/tools/security/nasty/default.nix b/pkgs/tools/security/nasty/default.nix index 7f423860100be..b4eaf0296bab1 100644 --- a/pkgs/tools/security/nasty/default.nix +++ b/pkgs/tools/security/nasty/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { # does not apply cleanly with patchPhase/fetchpatch # https://sources.debian.net/src/nasty/0.6-3/debian/patches/02_add_largefile_support.patch - CFLAGS = "-D_FILE_OFFSET_BITS=64"; + env.CFLAGS = "-D_FILE_OFFSET_BITS=64"; buildInputs = [ gpgme ]; diff --git a/pkgs/tools/security/tboot/default.nix b/pkgs/tools/security/tboot/default.nix index 38f467fb441f1..950d2f99cda73 100644 --- a/pkgs/tools/security/tboot/default.nix +++ b/pkgs/tools/security/tboot/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" "stackprotector" ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=address-of-packed-member"; configurePhase = '' for a in lcptools utils tb_polgen; do diff --git a/pkgs/tools/system/vboot_reference/default.nix b/pkgs/tools/system/vboot_reference/default.nix index 1391a2a5ed236..b265652b2897c 100644 --- a/pkgs/tools/system/vboot_reference/default.nix +++ b/pkgs/tools/system/vboot_reference/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { patches = [ ./dont_static_link.patch ]; # fix build with gcc9 - NIX_CFLAGS_COMPILE = [ "-Wno-error" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; postPatch = '' substituteInPlace Makefile \ diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 5ff8e8de32113..39842d007d286 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -976,7 +976,7 @@ in buildInputs = [ libxml2 pcre' ]; configureFlags = [ "--enable-simplexml" ] # Required to build on darwin. - ++ lib.optional (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; } + ++ lib.optional (lib.versionOlder php.version "7.4") "--with-libxml-dir=${libxml2.dev}"; } { name = "snmp"; buildInputs = [ net-snmp openssl ]; configureFlags = [ "--with-snmp" ]; @@ -987,7 +987,7 @@ in buildInputs = [ libxml2 ]; configureFlags = [ "--enable-soap" ] # Required to build on darwin. - ++ lib.optional (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; + ++ lib.optional (lib.versionOlder php.version "7.4") "--with-libxml-dir=${libxml2.dev}"; doCheck = false; } { name = "sockets"; doCheck = false; } { name = "sodium"; buildInputs = [ libsodium ]; } @@ -1007,23 +1007,23 @@ in buildInputs = [ libxml2 ]; configureFlags = [ "--enable-xml" ] # Required to build on darwin. - ++ lib.optional (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; + ++ lib.optional (lib.versionOlder php.version "7.4") "--with-libxml-dir=${libxml2.dev}"; doCheck = false; } { name = "xmlreader"; buildInputs = [ libxml2 ]; configureFlags = [ "--enable-xmlreader" "CFLAGS=-I../.." ] # Required to build on darwin. - ++ lib.optional (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; } + ++ lib.optional (lib.versionOlder php.version "7.4") "--with-libxml-dir=${libxml2.dev}"; } { name = "xmlrpc"; buildInputs = [ libxml2 libiconv ]; configureFlags = [ "--with-xmlrpc" ] # Required to build on darwin. - ++ lib.optional (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; } + ++ lib.optional (lib.versionOlder php.version "7.4") "--with-libxml-dir=${libxml2.dev}"; } { name = "xmlwriter"; buildInputs = [ libxml2 ]; configureFlags = [ "--enable-xmlwriter" ] # Required to build on darwin. - ++ lib.optional (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; } + ++ lib.optional (lib.versionOlder php.version "7.4") "--with-libxml-dir=${libxml2.dev}"; } { name = "xsl"; buildInputs = [ libxslt libxml2 ]; doCheck = !(lib.versionOlder php.version "7.4"); @@ -1032,13 +1032,13 @@ in { name = "zip"; buildInputs = [ libzip pcre' ]; configureFlags = [ "--with-zip" ] - ++ lib.optional (lib.versionOlder php.version "7.4") [ "--with-zlib-dir=${zlib.dev}" ] - ++ lib.optional (lib.versionOlder php.version "7.3") [ "--with-libzip" ]; + ++ lib.optional (lib.versionOlder php.version "7.4") "--with-zlib-dir=${zlib.dev}" + ++ lib.optional (lib.versionOlder php.version "7.3") "--with-libzip"; doCheck = false; } { name = "zlib"; buildInputs = [ zlib ]; configureFlags = [ "--with-zlib" ] - ++ lib.optional (lib.versionOlder php.version "7.4") [ "--with-zlib-dir=${zlib.dev}" ]; } + ++ lib.optional (lib.versionOlder php.version "7.4") "--with-zlib-dir=${zlib.dev}"; } ]; # Convert the list of attrs: From 01144006a1182d0bc76616edae684fa60fd4307f Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 28 Apr 2020 23:23:08 +0200 Subject: [PATCH 207/323] dmd: fix build --- pkgs/development/compilers/dmd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/dmd/default.nix b/pkgs/development/compilers/dmd/default.nix index 9281e01ad3e29..d8d641e64c2ed 100644 --- a/pkgs/development/compilers/dmd/default.nix +++ b/pkgs/development/compilers/dmd/default.nix @@ -83,7 +83,7 @@ stdenv.mkDerivation rec { "osx" else stdenv.hostPlatform.parsed.kernel.name; - top = "$(echo $NIX_BUILD_TOP)"; + top = "$(echo $NIX_BUILD_TOP/$sourceRoot)"; pathToDmd = "${top}/dmd/generated/${osname}/release/${bits}/dmd"; # Buid and install are based on http://wiki.dlang.org/Building_DMD From 9d6f7fdc772ad218edc17dd47a1dc8b514e2429b Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 28 Apr 2020 23:23:24 +0200 Subject: [PATCH 208/323] objc4-osx: fix build --- pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix b/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix index a7cedaaea114b..792f0a026ff79 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix @@ -1,8 +1,6 @@ { appleDerivation }: appleDerivation { - phases = [ "unpackPhase" "installPhase" ]; - # Not strictly necessary, since libSystem depends on it, but it's nice to be explicit so we # can easily find out what's impure. __propagatedImpureHostDeps = [ From 879260e7cc41acb7c5d2b94f3633c2236f5c5d00 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 28 Apr 2020 23:53:03 +0200 Subject: [PATCH 209/323] waf: fix for structured-attrs --- .../tools/build-managers/wafHook/setup-hook.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/development/tools/build-managers/wafHook/setup-hook.sh b/pkgs/development/tools/build-managers/wafHook/setup-hook.sh index 439350c3abc28..efbab2754ea28 100644 --- a/pkgs/development/tools/build-managers/wafHook/setup-hook.sh +++ b/pkgs/development/tools/build-managers/wafHook/setup-hook.sh @@ -7,12 +7,12 @@ wafConfigurePhase() { fi if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then - wafConfigureFlags="${prefixKey:---prefix=}$prefix $wafConfigureFlags" + wafConfigureFlags=("${prefixKey:---prefix=}$prefix" "${wafConfigureFlags[@]}") fi local flagsArray=( "${flagsArray[@]}" - $wafConfigureFlags "${wafConfigureFlagsArray[@]}" + "${wafConfigureFlags[@]}" "${wafConfigureFlagsArray[@]}" ${configureTargets:-configure} ) if [ -z "${dontAddWafCrossFlags:-}" ]; then @@ -32,12 +32,12 @@ wafBuildPhase () { runHook preBuild # set to empty if unset - : ${wafFlags=} + wafFlags=(${wafFlags+"${wafFlags[@]}"}) local flagsArray=( ${enableParallelBuilding:+-j ${NIX_BUILD_CORES}} - $wafFlags ${wafFlagsArray[@]} - $buildFlags ${buildFlagsArray[@]} + "${wafFlags[@]}" "${wafFlagsArray[@]}" + "${buildFlags[@]}" "${buildFlagsArray[@]}" ${buildTargets:-build} ) @@ -59,8 +59,8 @@ wafInstallPhase() { fi local flagsArray=( - $wafFlags ${wafFlagsArray[@]} - $installFlags ${installFlagsArray[@]} + "${wafFlags[@]}" "${wafFlagsArray[@]}" + "${installFlags[@]}" "${installFlagsArray[@]}" ${installTargets:-install} ) From b11b4a8fea42ee5b7e6d27f4a3068e0164c837ac Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 30 Apr 2020 17:03:56 +0200 Subject: [PATCH 210/323] ns-3: fix build --- .../libraries/science/networking/ns-3/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/science/networking/ns-3/default.nix b/pkgs/development/libraries/science/networking/ns-3/default.nix index 358538b836157..50cc73adf8a2c 100644 --- a/pkgs/development/libraries/science/networking/ns-3/default.nix +++ b/pkgs/development/libraries/science/networking/ns-3/default.nix @@ -67,15 +67,15 @@ stdenv.mkDerivation rec { "--with-python=${pythonEnv.interpreter}" ] ++ optional (build_profile != null) "--build-profile=${build_profile}" - ++ optional withExamples " --enable-examples " - ++ optional doCheck " --enable-tests " + ++ optional withExamples "--enable-examples" + ++ optional doCheck "--enable-tests" ; doCheck = true; buildTargets = "build" + lib.optionalString enableDoxygen " doxygen" - + lib.optionalString withManual "sphinx"; + + lib.optionalString withManual " sphinx"; # to prevent fatal error: 'backward_warning.h' file not found env.CXXFLAGS = "-D_GLIBCXX_PERMIT_BACKWARD_HASH"; From 2f1ba315f40be44b68943f6231fe934b660cfa4e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 30 Apr 2020 17:29:27 +0200 Subject: [PATCH 211/323] python.buildPython*: fix env handling --- pkgs/development/interpreters/python/mk-python-derivation.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 7a243af9d5651..776d14092f76d 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -85,6 +85,8 @@ , meta ? {} +, env ? {} + , passthru ? {} , doCheck ? config.doCheckByDefault or false @@ -143,7 +145,7 @@ let inherit strictDeps; - env.LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8"; + env = { LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8"; } // env; # Python packages don't have a checkPhase, only an installCheckPhase doCheck = false; From 53c7cefae4ae343d59b4708ca7f9b436a46ca630 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 30 Apr 2020 17:29:59 +0200 Subject: [PATCH 212/323] python.pkgs.python-dbusmock: fix build --- pkgs/development/python-modules/python-dbusmock/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/python-dbusmock/default.nix b/pkgs/development/python-modules/python-dbusmock/default.nix index d643603a0679e..e53f5d89c49ed 100644 --- a/pkgs/development/python-modules/python-dbusmock/default.nix +++ b/pkgs/development/python-modules/python-dbusmock/default.nix @@ -24,7 +24,7 @@ buildPythonPackage rec { # TODO: Get the rest of these tests running? # This is a mocking library used as a check dependency for a single derivation. # That derivation's tests pass. Maybe not worth the effort to fix these... - NOSE_EXCLUDE = lib.concatStringsSep "," [ + env.NOSE_EXCLUDE = lib.concatStringsSep "," [ "test_bluez4" # NixOS ships BlueZ5 # These appear to fail because they're expecting to run in an Ubuntu chroot? "test_everything" # BlueZ5 OBEX From ca28500d27a59752fa0f811df97afa92a43b17ce Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 30 Apr 2020 17:30:34 +0200 Subject: [PATCH 213/323] bolt: fix build --- pkgs/os-specific/linux/bolt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/bolt/default.nix b/pkgs/os-specific/linux/bolt/default.nix index 114a90129ac22..836f5cd87585e 100644 --- a/pkgs/os-specific/linux/bolt/default.nix +++ b/pkgs/os-specific/linux/bolt/default.nix @@ -48,8 +48,8 @@ stdenv.mkDerivation rec { "-Dlocalstatedir=/var" ]; - PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system"; - PKG_CONFIG_UDEV_UDEVDIR = "${placeholder "out"}/lib/udev"; + env.PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system"; + env.PKG_CONFIG_UDEV_UDEVDIR = "${placeholder "out"}/lib/udev"; meta = with stdenv.lib; { description = "Thunderbolt 3 device management daemon"; From 26704dd9890efd3c2a2084015ac6cef4c2eb32e2 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 30 Apr 2020 17:33:40 +0200 Subject: [PATCH 214/323] qmake: fix hook quoting --- pkgs/development/libraries/qt-5/hooks/qmake-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh index 069b1244883db..656494d2365e3 100644 --- a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh +++ b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh @@ -1,6 +1,6 @@ . @fix_qmake_libtool@ -qmakeFlags=${qmakeFlags[@]+"${qmakeFlags[@]}"} +qmakeFlags=(${qmakeFlags[@]+"${qmakeFlags[@]}"}) qmakePrePhase() { qmakeFlags=( \ From 05fabbbcfbd10e66cca47525da31f3da0cc05cf7 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 4 Mar 2021 18:22:19 -0600 Subject: [PATCH 215/323] treewide: stdenv.lib -> lib --- pkgs/build-support/fetchurl/default.nix | 2 +- pkgs/development/compilers/gcc/4.8/default.nix | 2 +- pkgs/development/compilers/gcc/4.9/default.nix | 2 +- pkgs/development/compilers/gcc/6/default.nix | 2 +- pkgs/development/compilers/go/1.12.nix | 12 ++++++------ pkgs/development/compilers/go/1.13.nix | 12 ++++++------ pkgs/development/libraries/libunistring/default.nix | 2 +- pkgs/development/libraries/serf/default.nix | 2 +- pkgs/development/tools/jq/default.nix | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index e0e0649dad669..ef4bc92e684b2 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -14,7 +14,7 @@ let mirrorsFile = stdenvNoCC.mkDerivation { name = "mirrors-list"; - env = stdenvNoCC.lib.mapAttrs (k: m: toString m) mirrors; + env = lib.mapAttrs (k: m: toString m) mirrors; buildCommand = '' # !!! this is kinda hacky. set | grep -E '^[a-zA-Z]+=.*://' > $out diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index cc3330fee0942..d0b5e74c387a3 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -277,7 +277,7 @@ stdenv.mkDerivation ({ EXTRA_FLAGS_FOR_TARGET EXTRA_LDFLAGS_FOR_TARGET ; - NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = "gcc -m64"; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 28bcf6baaaaf2..cb0a813790831 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -290,7 +290,7 @@ stdenv.mkDerivation ({ EXTRA_FLAGS_FOR_TARGET EXTRA_LDFLAGS_FOR_TARGET ; - NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = "gcc -m64"; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 086dbdddae975..5d29876e47182 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -311,7 +311,7 @@ stdenv.mkDerivation ({ EXTRA_FLAGS_FOR_TARGET EXTRA_LDFLAGS_FOR_TARGET ; - NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; + NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; } // optionalAttrs (hostPlatform.system == "x86_64-solaris") { # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = "gcc -m64"; diff --git a/pkgs/development/compilers/go/1.12.nix b/pkgs/development/compilers/go/1.12.nix index 9964681f79b49..98514d1193700 100644 --- a/pkgs/development/compilers/go/1.12.nix +++ b/pkgs/development/compilers/go/1.12.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, tzdata, iana-etc, runCommand +{ stdenv, lib, fetchurl, tzdata, iana-etc, runCommand , perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation , mailcap, runtimeShell , buildPackages, pkgsTargetTarget @@ -6,7 +6,7 @@ let - inherit (stdenv.lib) optionals optionalString; + inherit (lib) optionals optionalString; goBootstrap = runCommand "go-bootstrap" {} '' mkdir $out @@ -162,12 +162,12 @@ stdenv.mkDerivation rec { # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those # to be different from CC/CXX - CC_FOR_TARGET = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + CC_FOR_TARGET = optionalString (stdenv.buildPlatform != stdenv.targetPlatform) "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"; - CXX_FOR_TARGET = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + CXX_FOR_TARGET = optionalString (stdenv.buildPlatform != stdenv.targetPlatform) "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"; - GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); + GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); GO386 = 387; # from Arch: don't assume sse2 on i686 CGO_ENABLED = 1; # Hopefully avoids test timeouts on Hydra @@ -234,7 +234,7 @@ stdenv.mkDerivation rec { disallowedReferences = [ goBootstrap ]; - meta = with stdenv.lib; { + meta = with lib; { branch = "1.12"; homepage = "http://golang.org/"; description = "The Go Programming language"; diff --git a/pkgs/development/compilers/go/1.13.nix b/pkgs/development/compilers/go/1.13.nix index 6b5304f97464b..e13859696663a 100644 --- a/pkgs/development/compilers/go/1.13.nix +++ b/pkgs/development/compilers/go/1.13.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, tzdata, iana-etc, runCommand +{ stdenv, lib, fetchurl, tzdata, iana-etc, runCommand , perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation , mailcap, runtimeShell , buildPackages, pkgsTargetTarget @@ -6,7 +6,7 @@ let - inherit (stdenv.lib) optionals optionalString; + inherit (lib) optionals optionalString; goBootstrap = runCommand "go-bootstrap" {} '' mkdir $out @@ -159,12 +159,12 @@ stdenv.mkDerivation rec { # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those # to be different from CC/CXX - CC_FOR_TARGET = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + CC_FOR_TARGET = lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"; - CXX_FOR_TARGET = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + CXX_FOR_TARGET = lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"; - GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); + GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); GO386 = 387; # from Arch: don't assume sse2 on i686 CGO_ENABLED = 1; # Hopefully avoids test timeouts on Hydra @@ -231,7 +231,7 @@ stdenv.mkDerivation rec { disallowedReferences = [ goBootstrap ]; - meta = with stdenv.lib; { + meta = with lib; { branch = "1.13"; homepage = "http://golang.org/"; description = "The Go Programming language"; diff --git a/pkgs/development/libraries/libunistring/default.nix b/pkgs/development/libraries/libunistring/default.nix index e5ba36dcc63bb..ab2a5bd97703a 100644 --- a/pkgs/development/libraries/libunistring/default.nix +++ b/pkgs/development/libraries/libunistring/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = lib.optional (!stdenv.isLinux) libiconv; - configureFlags = stdenv.lib.optional (!stdenv.isLinux) "--with-libiconv-prefix=${libiconv}"; + configureFlags = lib.optional (!stdenv.isLinux) "--with-libiconv-prefix=${libiconv}"; doCheck = false; diff --git a/pkgs/development/libraries/serf/default.nix b/pkgs/development/libraries/serf/default.nix index 8b0db017756cf..781d71af4d2ba 100644 --- a/pkgs/development/libraries/serf/default.nix +++ b/pkgs/development/libraries/serf/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { sconsFlags = [ "OPENSSL=${openssl}" "ZLIB=${zlib}" - ] ++ stdenv.lib.optional (!stdenv.isCygwin) + ] ++ lib.optional (!stdenv.isCygwin) "GSSAPI=${kerberos.dev}"; preConfigure = '' diff --git a/pkgs/development/tools/jq/default.nix b/pkgs/development/tools/jq/default.nix index 6459cc5deac61..b73c4b01e28ec 100644 --- a/pkgs/development/tools/jq/default.nix +++ b/pkgs/development/tools/jq/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { outputs = if minimal then [ "out" ] else [ "bin" "doc" "man" "dev" "lib" "out" ]; - buildInputs = stdenv.lib.optional (!minimal) oniguruma; + buildInputs = lib.optional (!minimal) oniguruma; configureFlags = if minimal then [ "--with-oniguruma=no" "--enable-all-static" ] @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { # jq is linked to libjq: ++ lib.optional (!stdenv.isDarwin) "LDFLAGS=-Wl,-rpath,\\\${libdir}"; - preFixup = stdenv.lib.optionalString minimal '' + preFixup = lib.optionalString minimal '' rm -r .libs $out/{include,share} patchelf --shrink-rpath $out/bin/jq ''; From d7ae8cb8087b6d5f985453000950a30d78496347 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 8 Mar 2021 13:49:13 -0600 Subject: [PATCH 216/323] treewide: eval fixes --- pkgs/development/compilers/go/1.14.nix | 4 ++-- pkgs/servers/web-apps/whitebophir/node-packages.nix | 2 +- pkgs/tools/graphics/ldgallery/viewer/node-composition.nix | 2 +- pkgs/top-level/all-packages.nix | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/go/1.14.nix b/pkgs/development/compilers/go/1.14.nix index 9fc2412c2b100..ae451e6b5c609 100644 --- a/pkgs/development/compilers/go/1.14.nix +++ b/pkgs/development/compilers/go/1.14.nix @@ -185,9 +185,9 @@ stdenv.mkDerivation rec { # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those # to be different from CC/CXX CC_FOR_TARGET = lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) - "${targetCC}/bin/${targetCC.targetPrefix}cc" + "${targetCC}/bin/${targetCC.targetPrefix}cc"; CXX_FOR_TARGET = lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) - "${targetCC}/bin/${targetCC.targetPrefix}c++" + "${targetCC}/bin/${targetCC.targetPrefix}c++"; GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); GO386 = 387; # from Arch: don't assume sse2 on i686 diff --git a/pkgs/servers/web-apps/whitebophir/node-packages.nix b/pkgs/servers/web-apps/whitebophir/node-packages.nix index 76d5cf6a202f1..2720ef776a5b9 100644 --- a/pkgs/servers/web-apps/whitebophir/node-packages.nix +++ b/pkgs/servers/web-apps/whitebophir/node-packages.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../../development/node-packages/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile; + inherit (pkgs) stdenv lib python2 runCommand writeTextFile jq; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/pkgs/tools/graphics/ldgallery/viewer/node-composition.nix b/pkgs/tools/graphics/ldgallery/viewer/node-composition.nix index aaf54a05c8843..7fab15f4164c3 100644 --- a/pkgs/tools/graphics/ldgallery/viewer/node-composition.nix +++ b/pkgs/tools/graphics/ldgallery/viewer/node-composition.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../../../development/node-packages/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile; + inherit (pkgs) stdenv lib python2 runCommand writeTextFile jq; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bb3c04f1758b8..bc035643dfefb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10771,8 +10771,6 @@ in orocos-kdl = callPackage ../development/libraries/orocos-kdl { }; - metaocaml_3_09 = callPackage ../development/compilers/ocaml/metaocaml-3.09.nix { }; - ber_metaocaml = callPackage ../development/compilers/ocaml/ber-metaocaml.nix { }; ocaml_make = callPackage ../development/ocaml-modules/ocamlmake { }; From 567cbce2dc5bab61473b175bb4edeb941d3f9609 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 8 Mar 2021 16:00:19 -0600 Subject: [PATCH 217/323] treewide: eval fixes --- .../networking/cluster/terraform/default.nix | 3 +- .../irc/weechat/scripts/wee-slack/default.nix | 2 +- .../weechat/scripts/wee-slack/libpath.patch | 2 +- .../weechat/scripts/weechat-otr/default.nix | 2 +- .../weechat/scripts/weechat-otr/libpath.patch | 2 +- pkgs/development/compilers/go/1.12.nix | 245 ------------------ pkgs/development/compilers/go/1.13.nix | 242 ----------------- pkgs/development/compilers/go/1.16.nix | 66 +++-- pkgs/development/compilers/go/2-dev.nix | 66 +++-- .../go-packages/generic/default.nix | 18 +- pkgs/top-level/all-packages.nix | 2 +- 11 files changed, 81 insertions(+), 569 deletions(-) delete mode 100644 pkgs/development/compilers/go/1.12.nix delete mode 100644 pkgs/development/compilers/go/1.13.nix diff --git a/pkgs/applications/networking/cluster/terraform/default.nix b/pkgs/applications/networking/cluster/terraform/default.nix index 4a6e95057a4d1..0e9261f9f5dba 100644 --- a/pkgs/applications/networking/cluster/terraform/default.nix +++ b/pkgs/applications/networking/cluster/terraform/default.nix @@ -64,7 +64,8 @@ let # Make providers available in Terraform 0.13 and 0.12 search paths. pluginDir = lib.concatMapStrings (pl: let - inherit (pl) version GOOS GOARCH; + inherit (pl) version; + inherit (pl.env) GOOS GOARCH; pname = pl.pname or (throw "${pl.name} is missing a pname attribute"); diff --git a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix index 679e278c8a09d..c5895866aa57a 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { patches = [ (substituteAll { src = ./libpath.patch; - env = "${buildEnv { + envPath = "${buildEnv { name = "wee-slack-env"; paths = with python3Packages; [ websocket_client six ]; }}/${python3Packages.python.sitePackages}"; diff --git a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/libpath.patch b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/libpath.patch index af2dd36b41c51..d2ebf9def3a5b 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/libpath.patch +++ b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/libpath.patch @@ -6,7 +6,7 @@ index dbe6446..d1b7546 100644 import socket import string -+sys.path.append('@env@') ++sys.path.append('@envPath@') + from websocket import ABNF, create_connection, WebSocketConnectionClosedException diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix index 987271e4ffa29..08f1ba473f6fb 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix @@ -47,7 +47,7 @@ in stdenv.mkDerivation rec { patches = [ (substituteAll { src = ./libpath.patch; - env = "${buildEnv { + envPath = "${buildEnv { name = "weechat-otr-env"; paths = [ potr pycrypto ]; }}/${python3Packages.python.sitePackages}"; diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/libpath.patch b/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/libpath.patch index a7b77ed9b6026..17ff524494ced 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/libpath.patch +++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/libpath.patch @@ -6,7 +6,7 @@ index 0ccfb35..c42bebf 100644 import shutil import sys -+sys.path.append('@env@') ++sys.path.append('@envPath@') + import potr import weechat diff --git a/pkgs/development/compilers/go/1.12.nix b/pkgs/development/compilers/go/1.12.nix deleted file mode 100644 index 98514d1193700..0000000000000 --- a/pkgs/development/compilers/go/1.12.nix +++ /dev/null @@ -1,245 +0,0 @@ -{ stdenv, lib, fetchurl, tzdata, iana-etc, runCommand -, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation -, mailcap, runtimeShell -, buildPackages, pkgsTargetTarget -}: - -let - - inherit (lib) optionals optionalString; - - goBootstrap = runCommand "go-bootstrap" {} '' - mkdir $out - cp -rf ${buildPackages.go_bootstrap}/* $out/ - chmod -R u+w $out - find $out -name "*.c" -delete - cp -rf $out/bin/* $out/share/go/bin/ - ''; - - goarch = platform: { - i686 = "386"; - x86_64 = "amd64"; - aarch64 = "arm64"; - arm = "arm"; - armv5tel = "arm"; - armv6l = "arm"; - armv7l = "arm"; - }.${platform.parsed.cpu.name} or (throw "Unsupported system"); - -in - -stdenv.mkDerivation rec { - pname = "go"; - version = "1.12.17"; - - src = fetchurl { - url = "https://dl.google.com/go/go${version}.src.tar.gz"; - sha256 = "09cbl90maxry713wd18jdqrms3ivbvcm472csnxc78rsqhc851yy"; - }; - - # perl is used for testing go vet - nativeBuildInputs = [ perl which pkgconfig patch procps ]; - buildInputs = [ cacert pcre ] - ++ optionals stdenv.isLinux [ stdenv.cc.libc.out ] - ++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ]; - - depsTargetTargetPropagated = optionals stdenv.isDarwin [ Security Foundation ]; - - hardeningDisable = [ "all" ]; - - prePatch = '' - patchShebangs ./ # replace /bin/bash - - # This source produces shell script at run time, - # and thus it is not corrected by patchShebangs. - substituteInPlace misc/cgo/testcarchive/carchive_test.go \ - --replace '#!/usr/bin/env bash' '#!${runtimeShell}' - - # Patch the mimetype database location which is missing on NixOS. - substituteInPlace src/mime/type_unix.go \ - --replace '/etc/mime.types' '${mailcap}/etc/mime.types' - - # Disabling the 'os/http/net' tests (they want files not available in - # chroot builds) - rm src/net/{listen,parse}_test.go - rm src/syscall/exec_linux_test.go - - # !!! substituteInPlace does not seems to be effective. - # The os test wants to read files in an existing path. Just don't let it be /usr/bin. - sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go - sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go - # Disable the unix socket test - sed -i '/TestShutdownUnix/areturn' src/net/net_test.go - # Disable the hostname test - sed -i '/TestHostname/areturn' src/os/os_test.go - # ParseInLocation fails the test - sed -i '/TestParseInSydney/areturn' src/time/format_test.go - # Remove the api check as it never worked - sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go - # Remove the coverage test as we have removed this utility - sed -i '/TestCoverageWithCgo/areturn' src/cmd/go/go_test.go - # Remove the timezone naming test - sed -i '/TestLoadFixed/areturn' src/time/time_test.go - # Remove disable setgid test - sed -i '/TestRespectSetgidDir/areturn' src/cmd/go/internal/work/build_test.go - # Remove cert tests that conflict with NixOS's cert resolution - sed -i '/TestEnvVars/areturn' src/crypto/x509/root_unix_test.go - # TestWritevError hangs sometimes - sed -i '/TestWritevError/areturn' src/net/writev_test.go - # TestVariousDeadlines fails sometimes - sed -i '/TestVariousDeadlines/areturn' src/net/timeout_test.go - - sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go - sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go - - # Disable cgo lookup tests not works, they depend on resolver - rm src/net/cgo_unix_test.go - - # Disable TestGcSys because it's flakey in our tests, but the failure is not - # reproducible by multiple people in other environments. - # See https://github.com/NixOS/nixpkgs/issues/68361#issuecomment-537849272 and following - # NOTE: Try re-enabling for releases newer than 1.12.9 - sed -i '/TestGcSys/areturn' src/runtime/gc_test.go - - '' + optionalString stdenv.isLinux '' - sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go - '' + optionalString stdenv.isAarch32 '' - echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash - '' + optionalString stdenv.isDarwin '' - substituteInPlace src/race.bash --replace \ - "sysctl machdep.cpu.extfeatures | grep -qv EM64T" true - sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go - sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go - sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go - - sed -i '/TestChdirAndGetwd/areturn' src/os/os_test.go - sed -i '/TestCredentialNoSetGroups/areturn' src/os/exec/exec_posix_test.go - sed -i '/TestRead0/areturn' src/os/os_test.go - sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go - - sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/areturn' src/cmd/go/go_test.go - sed -i '/TestBuildDashIInstallsDependencies/areturn' src/cmd/go/go_test.go - - sed -i '/TestDisasmExtld/areturn' src/cmd/objdump/objdump_test.go - - sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go - - # TestCurrent fails because Current is not implemented on Darwin - sed -i 's/TestCurrent/testCurrent/g' src/os/user/user_test.go - sed -i 's/TestLookup/testLookup/g' src/os/user/user_test.go - - touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd - ''; - - patches = [ - ./remove-tools-1.11.patch - ./ssl-cert-file-1.12.1.patch - ./remove-test-pie.patch - ./creds-test.patch - ./go-1.9-skip-flaky-19608.patch - ./go-1.9-skip-flaky-20072.patch - ./skip-external-network-tests.patch - ./skip-nohup-tests.patch - ] ++ [ - # breaks under load: https://github.com/golang/go/issues/25628 - (if stdenv.isAarch32 - then ./skip-test-extra-files-on-aarch32.patch - else ./skip-test-extra-files-on-386.patch) - ]; - - postPatch = '' - find . -name '*.orig' -exec rm {} ';' - ''; - - env = { - GOOS = stdenv.targetPlatform.parsed.kernel.name; - GOARCH = goarch stdenv.targetPlatform; - # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. - # Go will nevertheless build a for host system that we will copy over in - # the install phase. - GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; - GOHOSTARCH = goarch stdenv.buildPlatform; - - # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those - # to be different from CC/CXX - CC_FOR_TARGET = optionalString (stdenv.buildPlatform != stdenv.targetPlatform) - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"; - CXX_FOR_TARGET = optionalString (stdenv.buildPlatform != stdenv.targetPlatform) - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"; - - GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); - GO386 = 387; # from Arch: don't assume sse2 on i686 - CGO_ENABLED = 1; - # Hopefully avoids test timeouts on Hydra - GO_TEST_TIMEOUT_SCALE = 3; - - # Indicate that we are running on build infrastructure - # Some tests assume things like home directories and users exists - GO_BUILDER_NAME = "nix"; - - GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; - }; - - postConfigure = '' - export GOCACHE=$TMPDIR/go-cache - # this is compiled into the binary - export GOROOT_FINAL=$out/share/go - - export PATH=$(pwd)/bin:$PATH - - # Independent from host/target, CC should produce code for the building system. - export CC=${buildPackages.stdenv.cc}/bin/cc - ulimit -a - ''; - - postBuild = '' - (cd src && ./make.bash) - ''; - - doCheck = stdenv.hostPlatform == stdenv.targetPlatform && !stdenv.isDarwin; - - checkPhase = '' - runHook preCheck - (cd src && HOME=$TMPDIR GOCACHE=$TMPDIR/go-cache ./run.bash --no-rebuild) - runHook postCheck - ''; - - preInstall = '' - rm -r pkg/{bootstrap,obj} - # Contains the wrong perl shebang when cross compiling, - # since it is not used for anything we can deleted as well. - rm src/regexp/syntax/make_perl_groups.pl - '' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then '' - mv bin/*_*/* bin - rmdir bin/*_* - ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' - rm -rf pkg/${env.GOHOSTOS}_${env.GOHOSTARCH} pkg/tool/${env.GOHOSTOS}_${env.GOHOSTARCH} - ''} - '' else if (stdenv.hostPlatform != stdenv.targetPlatform) then '' - rm -rf bin/*_* - ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' - rm -rf pkg/${env.GOOS}_${env.GOARCH} pkg/tool/${env.GOOS}_${env.GOARCH} - ''} - '' else ""); - - installPhase = '' - runHook preInstall - mkdir -p $GOROOT_FINAL - cp -a bin pkg src lib misc api doc $GOROOT_FINAL - ln -s $GOROOT_FINAL/bin $out/bin - runHook postInstall - ''; - - setupHook = ./setup-hook.sh; - - disallowedReferences = [ goBootstrap ]; - - meta = with lib; { - branch = "1.12"; - homepage = "http://golang.org/"; - description = "The Go Programming language"; - license = licenses.bsd3; - maintainers = with maintainers; [ cstrahan orivej mic92 rvolosatovs Frostman ]; - platforms = platforms.linux ++ platforms.darwin; - }; -} diff --git a/pkgs/development/compilers/go/1.13.nix b/pkgs/development/compilers/go/1.13.nix deleted file mode 100644 index e13859696663a..0000000000000 --- a/pkgs/development/compilers/go/1.13.nix +++ /dev/null @@ -1,242 +0,0 @@ -{ stdenv, lib, fetchurl, tzdata, iana-etc, runCommand -, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation -, mailcap, runtimeShell -, buildPackages, pkgsTargetTarget -}: - -let - - inherit (lib) optionals optionalString; - - goBootstrap = runCommand "go-bootstrap" {} '' - mkdir $out - cp -rf ${buildPackages.go_bootstrap}/* $out/ - chmod -R u+w $out - find $out -name "*.c" -delete - cp -rf $out/bin/* $out/share/go/bin/ - ''; - - goarch = platform: { - "i686" = "386"; - "x86_64" = "amd64"; - "aarch64" = "arm64"; - "arm" = "arm"; - "armv5tel" = "arm"; - "armv6l" = "arm"; - "armv7l" = "arm"; - }.${platform.parsed.cpu.name} or (throw "Unsupported system"); - -in - -stdenv.mkDerivation rec { - pname = "go"; - version = "1.13.8"; - - src = fetchurl { - url = "https://dl.google.com/go/go${version}.src.tar.gz"; - sha256 = "0d7cxffk72568h46srzswrxd0bsdip7amgkf499wzn6l6d3g0fxi"; - }; - - # perl is used for testing go vet - nativeBuildInputs = [ perl which pkgconfig patch procps ]; - buildInputs = [ cacert pcre ] - ++ optionals stdenv.isLinux [ stdenv.cc.libc.out ] - ++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ]; - - depsTargetTargetPropagated = optionals stdenv.isDarwin [ Security Foundation ]; - - hardeningDisable = [ "all" ]; - - prePatch = '' - patchShebangs ./ # replace /bin/bash - - # This source produces shell script at run time, - # and thus it is not corrected by patchShebangs. - substituteInPlace misc/cgo/testcarchive/carchive_test.go \ - --replace '#!/usr/bin/env bash' '#!${runtimeShell}' - - # Patch the mimetype database location which is missing on NixOS. - # but also allow static binaries built with NixOS to run outside nix - sed -i 's,\"/etc/mime.types,"${mailcap}/etc/mime.types\"\,\n\t&,' src/mime/type_unix.go - - # Disabling the 'os/http/net' tests (they want files not available in - # chroot builds) - rm src/net/{listen,parse}_test.go - rm src/syscall/exec_linux_test.go - - # !!! substituteInPlace does not seems to be effective. - # The os test wants to read files in an existing path. Just don't let it be /usr/bin. - sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go - sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go - # Disable the unix socket test - sed -i '/TestShutdownUnix/aif true \{ return\; \}' src/net/net_test.go - # Disable the hostname test - sed -i '/TestHostname/aif true \{ return\; \}' src/os/os_test.go - # ParseInLocation fails the test - sed -i '/TestParseInSydney/aif true \{ return\; \}' src/time/format_test.go - # Remove the api check as it never worked - sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go - # Remove the coverage test as we have removed this utility - sed -i '/TestCoverageWithCgo/aif true \{ return\; \}' src/cmd/go/go_test.go - # Remove the timezone naming test - sed -i '/TestLoadFixed/aif true \{ return\; \}' src/time/time_test.go - # Remove disable setgid test - sed -i '/TestRespectSetgidDir/aif true \{ return\; \}' src/cmd/go/internal/work/build_test.go - # Remove cert tests that conflict with NixOS's cert resolution - sed -i '/TestEnvVars/aif true \{ return\; \}' src/crypto/x509/root_unix_test.go - # TestWritevError hangs sometimes - sed -i '/TestWritevError/aif true \{ return\; \}' src/net/writev_test.go - # TestVariousDeadlines fails sometimes - sed -i '/TestVariousDeadlines/aif true \{ return\; \}' src/net/timeout_test.go - - sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go - sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go - - # Disable cgo lookup tests not works, they depend on resolver - rm src/net/cgo_unix_test.go - - '' + optionalString stdenv.isLinux '' - # prepend the nix path to the zoneinfo files but also leave the original value for static binaries - # that run outside a nix server - sed -i 's,\"/usr/share/zoneinfo/,"${tzdata}/share/zoneinfo/\"\,\n\t&,' src/time/zoneinfo_unix.go - - '' + optionalString stdenv.isAarch32 '' - echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash - '' + optionalString stdenv.isDarwin '' - substituteInPlace src/race.bash --replace \ - "sysctl machdep.cpu.extfeatures | grep -qv EM64T" true - sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go - sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go - sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go - - sed -i '/TestChdirAndGetwd/aif true \{ return\; \}' src/os/os_test.go - sed -i '/TestCredentialNoSetGroups/aif true \{ return\; \}' src/os/exec/exec_posix_test.go - sed -i '/TestRead0/aif true \{ return\; \}' src/os/os_test.go - sed -i '/TestSystemRoots/aif true \{ return\; \}' src/crypto/x509/root_darwin_test.go - - sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/aif true \{ return\; \}' src/cmd/go/go_test.go - sed -i '/TestBuildDashIInstallsDependencies/aif true \{ return\; \}' src/cmd/go/go_test.go - - sed -i '/TestDisasmExtld/aif true \{ return\; \}' src/cmd/objdump/objdump_test.go - - sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go - - # TestCurrent fails because Current is not implemented on Darwin - sed -i 's/TestCurrent/testCurrent/g' src/os/user/user_test.go - sed -i 's/TestLookup/testLookup/g' src/os/user/user_test.go - - touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd - ''; - - patches = [ - ./remove-tools-1.11.patch - ./ssl-cert-file-1.13.patch - ./remove-test-pie-1.13.patch - ./creds-test.patch - ./go-1.9-skip-flaky-19608.patch - ./go-1.9-skip-flaky-20072.patch - ./skip-external-network-tests.patch - ./skip-nohup-tests.patch - ] ++ [ - # breaks under load: https://github.com/golang/go/issues/25628 - (if stdenv.isAarch32 - then ./skip-test-extra-files-on-aarch32.patch - else ./skip-test-extra-files-on-386.patch) - ]; - - postPatch = '' - find . -name '*.orig' -exec rm {} ';' - ''; - - env = { - GOOS = stdenv.targetPlatform.parsed.kernel.name; - GOARCH = goarch stdenv.targetPlatform; - # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. - # Go will nevertheless build a for host system that we will copy over in - # the install phase. - GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; - GOHOSTARCH = goarch stdenv.buildPlatform; - - # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those - # to be different from CC/CXX - CC_FOR_TARGET = lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"; - CXX_FOR_TARGET = lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"; - - GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); - GO386 = 387; # from Arch: don't assume sse2 on i686 - CGO_ENABLED = 1; - # Hopefully avoids test timeouts on Hydra - GO_TEST_TIMEOUT_SCALE = 3; - - # Indicate that we are running on build infrastructure - # Some tests assume things like home directories and users exists - GO_BUILDER_NAME = "nix"; - - GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; - }; - - postConfigure = '' - export GOCACHE=$TMPDIR/go-cache - # this is compiled into the binary - export GOROOT_FINAL=$out/share/go - - export PATH=$(pwd)/bin:$PATH - - # Independent from host/target, CC should produce code for the building system. - export CC=${buildPackages.stdenv.cc}/bin/cc - ulimit -a - ''; - - postBuild = '' - (cd src && ./make.bash) - ''; - - doCheck = stdenv.hostPlatform == stdenv.targetPlatform && !stdenv.isDarwin; - - checkPhase = '' - runHook preCheck - (cd src && HOME=$TMPDIR GOCACHE=$TMPDIR/go-cache ./run.bash --no-rebuild) - runHook postCheck - ''; - - preInstall = '' - rm -r pkg/obj - # Contains the wrong perl shebang when cross compiling, - # since it is not used for anything we can deleted as well. - rm src/regexp/syntax/make_perl_groups.pl - '' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then '' - mv bin/*_*/* bin - rmdir bin/*_* - ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' - rm -rf pkg/${env.GOHOSTOS}_${env.GOHOSTARCH} pkg/tool/${env.GOHOSTOS}_${env.GOHOSTARCH} - ''} - '' else if (stdenv.hostPlatform != stdenv.targetPlatform) then '' - rm -rf bin/*_* - ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' - rm -rf pkg/${env.GOOS}_${env.GOARCH} pkg/tool/${env.GOOS}_${env.GOARCH} - ''} - '' else ""); - - installPhase = '' - runHook preInstall - mkdir -p $GOROOT_FINAL - cp -a bin pkg src lib misc api doc $GOROOT_FINAL - ln -s $GOROOT_FINAL/bin $out/bin - runHook postInstall - ''; - - setupHook = ./setup-hook.sh; - - disallowedReferences = [ goBootstrap ]; - - meta = with lib; { - branch = "1.13"; - homepage = "http://golang.org/"; - description = "The Go Programming language"; - license = licenses.bsd3; - maintainers = with maintainers; [ cstrahan orivej mic92 rvolosatovs kalbasit Frostman ]; - platforms = platforms.linux ++ platforms.darwin; - }; -} diff --git a/pkgs/development/compilers/go/1.16.nix b/pkgs/development/compilers/go/1.16.nix index 8267e9745dc13..2a60f58e95ec8 100644 --- a/pkgs/development/compilers/go/1.16.nix +++ b/pkgs/development/compilers/go/1.16.nix @@ -171,36 +171,34 @@ stdenv.mkDerivation rec { find . -name '*.orig' -exec rm {} ';' ''; - GOOS = stdenv.targetPlatform.parsed.kernel.name; - GOARCH = goarch stdenv.targetPlatform; - # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. - # Go will nevertheless build a for host system that we will copy over in - # the install phase. - GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; - GOHOSTARCH = goarch stdenv.buildPlatform; - - # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those - # to be different from CC/CXX - CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${targetCC}/bin/${targetCC.targetPrefix}cc" - else - null; - CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${targetCC}/bin/${targetCC.targetPrefix}c++" - else - null; - - GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); - GO386 = "softfloat"; # from Arch: don't assume sse2 on i686 - CGO_ENABLED = 1; - # Hopefully avoids test timeouts on Hydra - GO_TEST_TIMEOUT_SCALE = 3; - - # Indicate that we are running on build infrastructure - # Some tests assume things like home directories and users exists - GO_BUILDER_NAME = "nix"; - - GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; + env = { + GOOS = stdenv.targetPlatform.parsed.kernel.name; + GOARCH = goarch stdenv.targetPlatform; + # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. + # Go will nevertheless build a for host system that we will copy over in + # the install phase. + GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; + GOHOSTARCH = goarch stdenv.buildPlatform; + + # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those + # to be different from CC/CXX + CC_FOR_TARGET = optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + "${targetCC}/bin/${targetCC.targetPrefix}cc"; + CXX_FOR_TARGET = optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + "${targetCC}/bin/${targetCC.targetPrefix}c++"; + + GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); + GO386 = "softfloat"; # from Arch: don't assume sse2 on i686 + CGO_ENABLED = 1; + # Hopefully avoids test timeouts on Hydra + GO_TEST_TIMEOUT_SCALE = 3; + + # Indicate that we are running on build infrastructure + # Some tests assume things like home directories and users exists + GO_BUILDER_NAME = "nix"; + + GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; + }; postConfigure = '' export GOCACHE=$TMPDIR/go-cache @@ -237,13 +235,13 @@ stdenv.mkDerivation rec { '' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then '' mv bin/*_*/* bin rmdir bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOHOSTOS}_${GOHOSTARCH} pkg/tool/${GOHOSTOS}_${GOHOSTARCH} + ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' + rm -rf pkg/${env.GOHOSTOS}_${env.GOHOSTARCH} pkg/tool/${env.GOHOSTOS}_${env.GOHOSTARCH} ''} '' else if (stdenv.hostPlatform != stdenv.targetPlatform) then '' rm -rf bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOOS}_${GOARCH} pkg/tool/${GOOS}_${GOARCH} + ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' + rm -rf pkg/${env.GOOS}_${env.GOARCH} pkg/tool/${env.GOOS}_${env.GOARCH} ''} '' else ""); diff --git a/pkgs/development/compilers/go/2-dev.nix b/pkgs/development/compilers/go/2-dev.nix index 2bdf6a4950ccd..db01257b4b232 100644 --- a/pkgs/development/compilers/go/2-dev.nix +++ b/pkgs/development/compilers/go/2-dev.nix @@ -168,36 +168,34 @@ stdenv.mkDerivation rec { find . -name '*.orig' -exec rm {} ';' ''; - GOOS = stdenv.targetPlatform.parsed.kernel.name; - GOARCH = goarch stdenv.targetPlatform; - # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. - # Go will nevertheless build a for host system that we will copy over in - # the install phase. - GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; - GOHOSTARCH = goarch stdenv.buildPlatform; - - # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those - # to be different from CC/CXX - CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${targetCC}/bin/${targetCC.targetPrefix}cc" - else - null; - CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${targetCC}/bin/${targetCC.targetPrefix}c++" - else - null; - - GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); - GO386 = 387; # from Arch: don't assume sse2 on i686 - CGO_ENABLED = 1; - # Hopefully avoids test timeouts on Hydra - GO_TEST_TIMEOUT_SCALE = 3; - - # Indicate that we are running on build infrastructure - # Some tests assume things like home directories and users exists - GO_BUILDER_NAME = "nix"; - - GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; + env = { + GOOS = stdenv.targetPlatform.parsed.kernel.name; + GOARCH = goarch stdenv.targetPlatform; + # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. + # Go will nevertheless build a for host system that we will copy over in + # the install phase. + GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; + GOHOSTARCH = goarch stdenv.buildPlatform; + + # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those + # to be different from CC/CXX + CC_FOR_TARGET = optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + "${targetCC}/bin/${targetCC.targetPrefix}cc"; + CXX_FOR_TARGET = optionalString (stdenv.buildPlatform != stdenv.targetPlatform) + "${targetCC}/bin/${targetCC.targetPrefix}c++"; + + GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); + GO386 = 387; # from Arch: don't assume sse2 on i686 + CGO_ENABLED = 1; + # Hopefully avoids test timeouts on Hydra + GO_TEST_TIMEOUT_SCALE = 3; + + # Indicate that we are running on build infrastructure + # Some tests assume things like home directories and users exists + GO_BUILDER_NAME = "nix"; + + GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; + }; postConfigure = '' export GOCACHE=$TMPDIR/go-cache @@ -234,13 +232,13 @@ stdenv.mkDerivation rec { '' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then '' mv bin/*_*/* bin rmdir bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOHOSTOS}_${GOHOSTARCH} pkg/tool/${GOHOSTOS}_${GOHOSTARCH} + ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' + rm -rf pkg/${env.GOHOSTOS}_${env.GOHOSTARCH} pkg/tool/${env.GOHOSTOS}_${env.GOHOSTARCH} ''} '' else if (stdenv.hostPlatform != stdenv.targetPlatform) then '' rm -rf bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOOS}_${GOARCH} pkg/tool/${GOOS}_${GOARCH} + ${optionalString (!(env.GOHOSTARCH == env.GOARCH && env.GOOS == env.GOHOSTOS)) '' + rm -rf pkg/${env.GOOS}_${env.GOARCH} pkg/tool/${env.GOOS}_${env.GOARCH} ''} '' else ""); diff --git a/pkgs/development/go-packages/generic/default.nix b/pkgs/development/go-packages/generic/default.nix index d23b161aae5a6..2ec3ffb607f8e 100644 --- a/pkgs/development/go-packages/generic/default.nix +++ b/pkgs/development/go-packages/generic/default.nix @@ -35,7 +35,7 @@ # IE: programs coupled with the compiler , allowGoReference ? false -, CGO_ENABLED ? go.CGO_ENABLED +, CGO_ENABLED ? go.env.CGO_ENABLED , meta ? {}, ... } @ args: @@ -77,17 +77,19 @@ let ++ (lib.optional (!dontRenameImports) govers) ++ nativeBuildInputs; buildInputs = buildInputs; - inherit (go.env) GOOS GOARCH GO386; + env = { + inherit (go.env) GOOS GOARCH GO386; - GOHOSTARCH = go.env.GOHOSTARCH or null; - GOHOSTOS = go.env.GOHOSTOS or null; + GOHOSTARCH = go.env.GOHOSTARCH or null; + GOHOSTOS = go.env.GOHOSTOS or null; - inherit CGO_ENABLED; + inherit CGO_ENABLED; - GO111MODULE = "off"; - GOFLAGS = lib.optionals (!allowGoReference) [ "-trimpath" ]; + GO111MODULE = "off"; + GOFLAGS = lib.optionalString (!allowGoReference) "-trimpath"; - GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); + GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); + }; configurePhase = args.configurePhase or '' runHook preConfigure diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0d9dee385b5a6..2bf27171bff3c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10787,7 +10787,7 @@ in ocsigen-i18n = callPackage ../development/tools/ocaml/ocsigen-i18n { }; opa = callPackage ../development/compilers/opa { - ocamlPackages = ocaml-ng.ocamlPackages_4_03; + ocamlPackages = ocaml-ng.ocamlPackages_4_05; }; opaline = callPackage ../development/tools/ocaml/opaline { }; From db58cb0e86ee6dc025e161266e977817b694ed01 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 11 Mar 2021 16:25:15 -0600 Subject: [PATCH 218/323] openldap: fix {make,install}Flags handling --- pkgs/development/libraries/openldap/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/openldap/default.nix b/pkgs/development/libraries/openldap/default.nix index 44a0e017a2ab5..3be442271066f 100644 --- a/pkgs/development/libraries/openldap/default.nix +++ b/pkgs/development/libraries/openldap/default.nix @@ -44,8 +44,8 @@ stdenv.mkDerivation rec { ++ lib.optional stdenv.isFreeBSD "--with-pic"; postBuild = '' - make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/sha2 - make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/pbkdf2 + make "''${makeFlags[@]}" CC=$CC -C contrib/slapd-modules/passwd/sha2 + make "''${makeFlags[@]}" CC=$CC -C contrib/slapd-modules/passwd/pbkdf2 ''; doCheck = false; # needs a running LDAP server @@ -74,8 +74,8 @@ stdenv.mkDerivation rec { ''; postInstall = '' - make $installFlags install -C contrib/slapd-modules/passwd/sha2 - make $installFlags install -C contrib/slapd-modules/passwd/pbkdf2 + make "''${installFlags[@]}" install -C contrib/slapd-modules/passwd/sha2 + make "''${installFlags[@]}" install -C contrib/slapd-modules/passwd/pbkdf2 chmod +x "$out"/lib/*.{so,dylib} ''; From d9af113571114f397bda7f0ecbc018036ae82281 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 16 Mar 2021 14:55:37 -0600 Subject: [PATCH 219/323] treewide: structured-attrs eval fixes --- pkgs/applications/audio/ardour/5.nix | 2 +- pkgs/applications/audio/ecasound/default.nix | 2 +- pkgs/applications/audio/ft2-clone/default.nix | 4 ++-- pkgs/applications/audio/hivelytracker/default.nix | 2 +- pkgs/applications/audio/littlegptracker/default.nix | 6 +++--- pkgs/applications/audio/mixxx/default.nix | 2 +- pkgs/applications/audio/mp3blaster/default.nix | 2 +- pkgs/applications/audio/musescore/default.nix | 2 +- pkgs/applications/audio/picoloop/default.nix | 2 +- pkgs/applications/audio/pragha/default.nix | 4 ++-- .../blockchains/openethereum/default.nix | 4 ++-- pkgs/applications/editors/cudatext/default.nix | 2 +- pkgs/applications/editors/ht/default.nix | 2 +- pkgs/applications/graphics/lazpaint/default.nix | 2 +- pkgs/applications/graphics/photoflare/default.nix | 2 +- pkgs/applications/kde/kio-extras.nix | 2 +- pkgs/applications/misc/krename/default.nix | 2 +- pkgs/applications/misc/lutris/default.nix | 2 +- pkgs/applications/networking/bee/bee.nix | 4 ++-- .../networking/browsers/netsurf/libcss.nix | 2 +- .../networking/browsers/netsurf/libwapcaplet.nix | 2 +- .../cluster/node-problem-detector/default.nix | 4 ++-- .../networking/mailreaders/claws-mail/default.nix | 2 +- .../networking/sniffers/wireshark/default.nix | 2 +- pkgs/applications/office/libreoffice/default.nix | 2 +- .../science/electronics/magic-vlsi/default.nix | 2 +- pkgs/applications/science/logic/ott/default.nix | 2 +- pkgs/applications/science/math/gfm/default.nix | 2 +- pkgs/applications/science/misc/gplates/default.nix | 2 +- .../applications/terminal-emulators/foot/default.nix | 2 +- .../terminal-emulators/mlterm/default.nix | 2 +- .../terminal-emulators/xterm/default.nix | 2 +- .../virtualization/libnvidia-container/default.nix | 4 ++-- .../virtualization/looking-glass-client/default.nix | 2 +- pkgs/build-support/coq/default.nix | 2 +- .../gnome-3/core/gnome-online-miners/default.nix | 5 ++--- pkgs/development/compilers/gcc/10/default.nix | 2 +- pkgs/development/compilers/ghdl/default.nix | 4 ++-- pkgs/development/coq-modules/mathcomp/default.nix | 2 +- pkgs/development/coq-modules/metalib/default.nix | 2 +- pkgs/development/interpreters/acl2/default.nix | 2 +- pkgs/development/interpreters/j/default.nix | 2 +- pkgs/development/interpreters/php/generic.nix | 6 +++--- pkgs/development/libraries/ace/default.nix | 4 +--- pkgs/development/libraries/cxxopts/default.nix | 6 +++--- pkgs/development/libraries/g2o/default.nix | 2 +- pkgs/development/libraries/gdal/2.4.nix | 2 +- pkgs/development/libraries/gtk/4.x.nix | 2 +- pkgs/development/libraries/libchop/default.nix | 4 ++-- pkgs/development/libraries/libgaminggear/default.nix | 2 +- pkgs/development/libraries/libiscsi/default.nix | 2 +- pkgs/development/libraries/libnixxml/default.nix | 2 +- .../development/libraries/libpam-wrapper/default.nix | 2 +- .../libraries/mapbox-gl-native/default.nix | 2 +- pkgs/development/libraries/mapbox-gl-qml/default.nix | 2 +- pkgs/development/libraries/mp4v2/default.nix | 2 +- pkgs/development/libraries/nss/3.44.nix | 2 +- pkgs/development/libraries/precice/default.nix | 2 +- .../libraries/qt-5/modules/qtserialport.nix | 4 ++-- .../libraries/qt-5/modules/qtwebengine.nix | 4 ++-- pkgs/development/libraries/qt-5/modules/qtwebkit.nix | 4 ++-- pkgs/development/ocaml-modules/ounit/default.nix | 2 +- pkgs/development/octave-modules/io/default.nix | 4 +--- .../python-modules/google-crc32c/default.nix | 4 ++-- .../development/python-modules/shiboken2/default.nix | 2 +- pkgs/development/tools/misc/dbench/default.nix | 4 ++-- pkgs/games/blobwars/default.nix | 2 +- pkgs/games/freeciv/default.nix | 2 +- pkgs/games/gimx/default.nix | 2 +- pkgs/games/iortcw/sp.nix | 7 ++----- pkgs/games/liquidwar/5.nix | 2 +- pkgs/games/openmw/tes3mp.nix | 2 +- pkgs/misc/emulators/mame/default.nix | 2 +- pkgs/misc/emulators/wine/builder-wow.sh | 6 ++++-- pkgs/os-specific/linux/autofs/default.nix | 2 +- pkgs/os-specific/linux/gobi_loader/default.nix | 2 +- pkgs/os-specific/linux/libbpf/default.nix | 2 +- pkgs/os-specific/linux/libsemanage/default.nix | 2 +- pkgs/os-specific/linux/pktgen/default.nix | 4 ++-- .../os-specific/linux/rtl88xxau-aircrack/default.nix | 2 +- pkgs/os-specific/linux/virtualbox/default.nix | 2 +- pkgs/servers/misc/oven-media-engine/default.nix | 5 ++++- pkgs/servers/monitoring/grafana-agent/default.nix | 2 +- pkgs/servers/monitoring/nagios/default.nix | 2 +- pkgs/servers/monitoring/prometheus/default.nix | 4 ++-- pkgs/shells/bash/5.1.nix | 2 +- pkgs/tools/X11/find-cursor/default.nix | 2 +- pkgs/tools/filesystems/fuseiso/default.nix | 2 +- pkgs/tools/graphics/exifprobe/default.nix | 2 +- pkgs/tools/misc/fluent-bit/default.nix | 2 +- pkgs/tools/networking/argus-clients/default.nix | 2 +- .../networking/network-manager/sstp/default.nix | 2 +- pkgs/tools/package-management/apk-tools/default.nix | 2 +- pkgs/tools/security/pcsc-cyberjack/default.nix | 2 +- pkgs/tools/system/efivar/default.nix | 2 +- pkgs/tools/virtualization/cloud-init/default.nix | 2 +- pkgs/top-level/perl-packages.nix | 12 ++++++------ pkgs/top-level/php-packages.nix | 2 +- 98 files changed, 132 insertions(+), 135 deletions(-) diff --git a/pkgs/applications/audio/ardour/5.nix b/pkgs/applications/audio/ardour/5.nix index 4a0656ed9ce27..751b8d9c5c8fd 100644 --- a/pkgs/applications/audio/ardour/5.nix +++ b/pkgs/applications/audio/ardour/5.nix @@ -120,7 +120,7 @@ in stdenv.mkDerivation rec { "--with-backends=jack,alsa,dummy" ]; - NIX_CFLAGS_COMPILE = "-I${qm-dsp}/include/qm-dsp"; + env.NIX_CFLAGS_COMPILE = "-I${qm-dsp}/include/qm-dsp"; # ardour's wscript has a "tarball" target but that required the git revision # be available. Since this is an unzipped tarball fetched from github we diff --git a/pkgs/applications/audio/ecasound/default.nix b/pkgs/applications/audio/ecasound/default.nix index 0de66b24e70e0..e4e66a7bd91ee 100644 --- a/pkgs/applications/audio/ecasound/default.nix +++ b/pkgs/applications/audio/ecasound/default.nix @@ -48,7 +48,7 @@ stdenv.mkDerivation rec { strictDeps = true; - configureFlags = "--enable-liblilv --with-extra-cppflags=-Dnullptr=0"; + configureFlags = [ "--enable-liblilv" "--with-extra-cppflags=-Dnullptr=0" ]; postPatch = '' sed -i -e ' diff --git a/pkgs/applications/audio/ft2-clone/default.nix b/pkgs/applications/audio/ft2-clone/default.nix index 2ebff030b4e3e..219a0b7ac83d7 100644 --- a/pkgs/applications/audio/ft2-clone/default.nix +++ b/pkgs/applications/audio/ft2-clone/default.nix @@ -38,12 +38,12 @@ stdenv.mkDerivation rec { Cocoa ]; - NIX_LDFLAGS = lib.optionalString stdenv.isDarwin [ + env.NIX_LDFLAGS = lib.optionalString stdenv.isDarwin (toString [ "-framework CoreAudio" "-framework CoreMIDI" "-framework CoreServices" "-framework Cocoa" - ]; + ]); passthru.tests = { ft2-clone-starts = nixosTests.ft2-clone; diff --git a/pkgs/applications/audio/hivelytracker/default.nix b/pkgs/applications/audio/hivelytracker/default.nix index 4cf20e3c89852..0ffb3b9e17d0b 100644 --- a/pkgs/applications/audio/hivelytracker/default.nix +++ b/pkgs/applications/audio/hivelytracker/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { ]; # TODO: try to exclude gtk and glib from darwin builds - NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = toString [ "-I${SDL}/include/SDL" "-I${SDL_image}/include/SDL" "-I${SDL_ttf}/include/SDL" diff --git a/pkgs/applications/audio/littlegptracker/default.nix b/pkgs/applications/audio/littlegptracker/default.nix index 638f54da5150e..7b807148c57d6 100644 --- a/pkgs/applications/audio/littlegptracker/default.nix +++ b/pkgs/applications/audio/littlegptracker/default.nix @@ -35,10 +35,10 @@ stdenv.mkDerivation rec { ++ lib.optionals stdenv.isLinux [ "PLATFORM=DEB" ] ++ lib.optionals stdenv.isDarwin [ "PLATFORM=OSX" ]; - NIX_CFLAGS_COMPILE = [ "-fpermissive" ] ++ - lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing"; + env.NIX_CFLAGS_COMPILE = "-fpermissive" + + lib.optionalString stdenv.hostPlatform.isAarch64 " -Wno-error=narrowing"; - NIX_LDFLAGS = lib.optional stdenv.isDarwin "-framework Foundation"; + env.NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework Foundation"; installPhase = let extension = if stdenv.isDarwin then "app" else "deb-exe"; in "install -Dm555 lgpt.${extension} $out/bin/lgpt"; diff --git a/pkgs/applications/audio/mixxx/default.nix b/pkgs/applications/audio/mixxx/default.nix index 7af4b585adfad..cf4413c123329 100644 --- a/pkgs/applications/audio/mixxx/default.nix +++ b/pkgs/applications/audio/mixxx/default.nix @@ -45,7 +45,7 @@ mkDerivation rec { ]; qtWrapperArgs = [ - "--set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive" + "--set" "LOCALE_ARCHIVE" "${glibcLocales}/lib/locale/locale-archive" ]; meta = with lib; { diff --git a/pkgs/applications/audio/mp3blaster/default.nix b/pkgs/applications/audio/mp3blaster/default.nix index d7dd5f102dbd8..b6580a9c3710d 100644 --- a/pkgs/applications/audio/mp3blaster/default.nix +++ b/pkgs/applications/audio/mp3blaster/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { libvorbis ] ++ lib.optional stdenv.isDarwin SDL; - NIX_CFLAGS_COMPILE = toString ([ + env.NIX_CFLAGS_COMPILE = toString ([ "-Wno-narrowing" ] ++ lib.optionals stdenv.cc.isClang [ "-Wno-reserved-user-defined-literal" diff --git a/pkgs/applications/audio/musescore/default.nix b/pkgs/applications/audio/musescore/default.nix index 6a5dbebeca010..1ba34a0212b24 100644 --- a/pkgs/applications/audio/musescore/default.nix +++ b/pkgs/applications/audio/musescore/default.nix @@ -29,7 +29,7 @@ mkDerivation rec { qtWrapperArgs = [ # Work around crash on update from 3.4.2 to 3.5.0 # https://bugreports.qt.io/browse/QTBUG-85967 - "--set QML_DISABLE_DISK_CACHE 1" + "--set" "QML_DISABLE_DISK_CACHE" "1" ]; nativeBuildInputs = [ cmake pkg-config ]; diff --git a/pkgs/applications/audio/picoloop/default.nix b/pkgs/applications/audio/picoloop/default.nix index 519888982ce4f..502294923ec85 100644 --- a/pkgs/applications/audio/picoloop/default.nix +++ b/pkgs/applications/audio/picoloop/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { makeFlags = [ "-f Makefile.PatternPlayer_debian_RtAudio_sdl20" ]; - NIX_CFLAGS_COMPILE = [ "-I${SDL2.dev}/include/SDL2" ]; + env.NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2"; hardeningDisable = [ "format" ]; diff --git a/pkgs/applications/audio/pragha/default.nix b/pkgs/applications/audio/pragha/default.nix index da5a64f708eb0..15fd96041d963 100644 --- a/pkgs/applications/audio/pragha/default.nix +++ b/pkgs/applications/audio/pragha/default.nix @@ -81,9 +81,9 @@ mkDerivation rec { # ++ lib.optional withRygel rygel ; - CFLAGS = [ "-DHAVE_PARANOIA_NEW_INCLUDES" ]; + env.CFLAGS = "-DHAVE_PARANOIA_NEW_INCLUDES"; - NIX_CFLAGS_COMPILE = "-I${lib.getDev gst_all_1.gst-plugins-base}/include/gstreamer-1.0"; + env.NIX_CFLAGS_COMPILE = "-I${lib.getDev gst_all_1.gst-plugins-base}/include/gstreamer-1.0"; postInstall = '' qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0") diff --git a/pkgs/applications/blockchains/openethereum/default.nix b/pkgs/applications/blockchains/openethereum/default.nix index 5dc35e996bec4..cc804b42d19b1 100644 --- a/pkgs/applications/blockchains/openethereum/default.nix +++ b/pkgs/applications/blockchains/openethereum/default.nix @@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-b+winsCzU0sXGDX6nUtWq4JrIyTcJ3uva7RlV5VsXfk="; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + env.LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; nativeBuildInputs = [ cmake llvmPackages.clang @@ -44,7 +44,7 @@ rustPlatform.buildRustPackage rec { # Exclude some tests that don't work in the sandbox # - Nat test requires network access - checkFlags = "--skip configuration::tests::should_resolve_external_nat_hosts"; + checkFlags = [ "--skip configuration::tests::should_resolve_external_nat_hosts" ]; meta = with lib; { description = "Fast, light, robust Ethereum implementation"; diff --git a/pkgs/applications/editors/cudatext/default.nix b/pkgs/applications/editors/cudatext/default.nix index 2d9138bc32e3a..0bea53b72c51b 100644 --- a/pkgs/applications/editors/cudatext/default.nix +++ b/pkgs/applications/editors/cudatext/default.nix @@ -63,7 +63,7 @@ stdenv.mkDerivation rec { ++ lib.optional (widgetset == "gtk3") gtk3 ++ lib.optional (widgetset == "qt5") libqt5pas; - NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; + env.NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; buildPhase = lib.concatStringsSep "\n" (lib.mapAttrsToList (name: dep: '' cp -r --no-preserve=mode ${dep} ${name} diff --git a/pkgs/applications/editors/ht/default.nix b/pkgs/applications/editors/ht/default.nix index 2f1ea40359d50..79bcf5179cb85 100644 --- a/pkgs/applications/editors/ht/default.nix +++ b/pkgs/applications/editors/ht/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { patches = [ ./gcc7.patch ]; - NIX_CFLAGS_COMPILE = [ "-Wno-narrowing" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-narrowing"; meta = with lib; { description = "File editor/viewer/analyzer for executables"; diff --git a/pkgs/applications/graphics/lazpaint/default.nix b/pkgs/applications/graphics/lazpaint/default.nix index 4dae4dd3f9aa3..24508c477fbb1 100644 --- a/pkgs/applications/graphics/lazpaint/default.nix +++ b/pkgs/applications/graphics/lazpaint/default.nix @@ -31,7 +31,7 @@ in stdenv.mkDerivation rec { buildInputs = [ pango cairo glib atk gtk2 libX11 gdk-pixbuf ]; - NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; + env.NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; buildPhase = '' cp -r --no-preserve=mode ${bgrabitmap} bgrabitmap diff --git a/pkgs/applications/graphics/photoflare/default.nix b/pkgs/applications/graphics/photoflare/default.nix index 0c25364b76aa3..c3ccbcf23ae92 100644 --- a/pkgs/applications/graphics/photoflare/default.nix +++ b/pkgs/applications/graphics/photoflare/default.nix @@ -17,7 +17,7 @@ mkDerivation rec { qmakeFlags = [ "PREFIX=${placeholder "out"}" ]; - NIX_CFLAGS_COMPILE = "-I${graphicsmagick}/include/GraphicsMagick"; + env.NIX_CFLAGS_COMPILE = "-I${graphicsmagick}/include/GraphicsMagick"; enableParallelBuilding = true; diff --git a/pkgs/applications/kde/kio-extras.nix b/pkgs/applications/kde/kio-extras.nix index fdc531d5d12d1..6590d8ac08403 100644 --- a/pkgs/applications/kde/kio-extras.nix +++ b/pkgs/applications/kde/kio-extras.nix @@ -19,5 +19,5 @@ mkDerivation { kdelibs4support kpty syntax-highlighting libmtp libssh openexr openslp phonon qtsvg samba solid gperf ]; - CXXFLAGS = [ "-I${ilmbase.dev}/include/OpenEXR" ]; + env.CXXFLAGS = "-I${ilmbase.dev}/include/OpenEXR"; } diff --git a/pkgs/applications/misc/krename/default.nix b/pkgs/applications/misc/krename/default.nix index c1e031b7277de..cd56ae829442d 100644 --- a/pkgs/applications/misc/krename/default.nix +++ b/pkgs/applications/misc/krename/default.nix @@ -23,7 +23,7 @@ in mkDerivation rec { propagatedBuildInputs = [ kconfig kcrash kinit kjsembed ]; - NIX_LDFLAGS = "-ltag"; + env.NIX_LDFLAGS = "-ltag"; meta = with lib; { description = "A powerful batch renamer for KDE"; diff --git a/pkgs/applications/misc/lutris/default.nix b/pkgs/applications/misc/lutris/default.nix index bacaf88e5cf53..54abb5cdfe968 100644 --- a/pkgs/applications/misc/lutris/default.nix +++ b/pkgs/applications/misc/lutris/default.nix @@ -100,7 +100,7 @@ in buildPythonApplication rec { # avoid double wrapping dontWrapGApps = true; makeWrapperArgs = [ - "--prefix PATH : ${binPath}" + "--prefix" "PATH" ":" binPath "\${gappsWrapperArgs[@]}" ]; # needed for glib-schemas to work correctly (will crash on dialogues otherwise) diff --git a/pkgs/applications/networking/bee/bee.nix b/pkgs/applications/networking/bee/bee.nix index b0d05d928c050..4c1dddce53028 100644 --- a/pkgs/applications/networking/bee/bee.nix +++ b/pkgs/applications/networking/bee/bee.nix @@ -44,8 +44,8 @@ buildGoModule { subPackages = [ "cmd/bee" ]; # no symbol table, no debug info, and pass the commit for the version string - buildFlags = lib.optionalString ( lib.hasAttr "goVersionString" versionSpec) - "-ldflags -s -ldflags -w -ldflags -X=github.com/ethersphere/bee.commit=${versionSpec.goVersionString}"; + buildFlags = lib.optionals ( lib.hasAttr "goVersionString" versionSpec) + [ "-ldflags" "-s" "-ldflags" "-w" "-ldflags" "-X=github.com/ethersphere/bee.commit=${versionSpec.goVersionString}" ]; # Mimic the bee Makefile: without disabling CGO, two (transitive and # unused) dependencies would fail to compile. diff --git a/pkgs/applications/networking/browsers/netsurf/libcss.nix b/pkgs/applications/networking/browsers/netsurf/libcss.nix index 7777bb243fa62..9e44f7aae3e68 100644 --- a/pkgs/applications/networking/browsers/netsurf/libcss.nix +++ b/pkgs/applications/networking/browsers/netsurf/libcss.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { "NSSHARED=${buildsystem}/share/netsurf-buildsystem" ]; - NIX_CFLAGS_COMPILE= [ "-Wno-error=implicit-fallthrough" "-Wno-error=maybe-uninitialized" ]; + env.NIX_CFLAGS_COMPILE= "-Wno-error=implicit-fallthrough -Wno-error=maybe-uninitialized"; meta = with lib; { homepage = "https://www.netsurf-browser.org/projects/${libname}/"; diff --git a/pkgs/applications/networking/browsers/netsurf/libwapcaplet.nix b/pkgs/applications/networking/browsers/netsurf/libwapcaplet.nix index 318885bd27214..6a2918fa7d950 100644 --- a/pkgs/applications/networking/browsers/netsurf/libwapcaplet.nix +++ b/pkgs/applications/networking/browsers/netsurf/libwapcaplet.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { "NSSHARED=${buildsystem}/share/netsurf-buildsystem" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type"; meta = with lib; { homepage = "https://www.netsurf-browser.org/projects/${libname}/"; diff --git a/pkgs/applications/networking/cluster/node-problem-detector/default.nix b/pkgs/applications/networking/cluster/node-problem-detector/default.nix index e53a9c39ea7e4..bc2e3aa66064c 100644 --- a/pkgs/applications/networking/cluster/node-problem-detector/default.nix +++ b/pkgs/applications/networking/cluster/node-problem-detector/default.nix @@ -28,8 +28,8 @@ buildGoModule rec { buildInputs = lib.optionals stdenv.isLinux [ systemd ]; - buildFlags = "-mod vendor" + - lib.optionalString stdenv.isLinux " -tags journald"; + buildFlags = [ "-mod" "vendor" ] ++ + lib.optionals stdenv.isLinux [ "-tags" "journald" ]; buildFlagsArray = [ "-ldflags=" diff --git a/pkgs/applications/networking/mailreaders/claws-mail/default.nix b/pkgs/applications/networking/mailreaders/claws-mail/default.nix index 4a13cf68a8829..e7f16346065e8 100644 --- a/pkgs/applications/networking/mailreaders/claws-mail/default.nix +++ b/pkgs/applications/networking/mailreaders/claws-mail/default.nix @@ -156,7 +156,7 @@ in stdenv.mkDerivation rec { "--disable-gdata-plugin" # Complains about missing libgdata, even when provided ] ++ - (map (feature: map (flag: strings.enableFeature feature.enabled flag) feature.flags) features); + flatten (map (feature: map (flag: strings.enableFeature feature.enabled flag) feature.flags) features); enableParallelBuilding = true; diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index 5c5bb1ff96e15..b18a7a4e3df91 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -31,7 +31,7 @@ in stdenv.mkDerivation { ]; # Avoid referencing -dev paths because of debug assertions. - NIX_CFLAGS_COMPILE = [ "-DQT_NO_DEBUG" ]; + env.NIX_CFLAGS_COMPILE = "-DQT_NO_DEBUG"; nativeBuildInputs = [ bison cmake flex pkg-config diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix index 54188382c65eb..242add9ce7239 100644 --- a/pkgs/applications/office/libreoffice/default.nix +++ b/pkgs/applications/office/libreoffice/default.nix @@ -406,7 +406,7 @@ in (mkDrv rec { gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav ]) - ++ lib.optional kdeIntegration [ qtbase qtx11extras kcoreaddons kio ]; + ++ lib.optionals kdeIntegration [ qtbase qtx11extras kcoreaddons kio ]; passthru = { inherit srcs jdk; diff --git a/pkgs/applications/science/electronics/magic-vlsi/default.nix b/pkgs/applications/science/electronics/magic-vlsi/default.nix index 82d8dbd2ddc44..c04f9f3c5b1fe 100644 --- a/pkgs/applications/science/electronics/magic-vlsi/default.nix +++ b/pkgs/applications/science/electronics/magic-vlsi/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { patchShebangs scripts/* ''; - NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration"; + env.NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration"; patches = [ ./0001-strip-bin-prefix.patch diff --git a/pkgs/applications/science/logic/ott/default.nix b/pkgs/applications/science/logic/ott/default.nix index 8752c4ef59d43..c01325e9b7673 100644 --- a/pkgs/applications/science/logic/ott/default.nix +++ b/pkgs/applications/science/logic/ott/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config opaline ]; buildInputs = [ ocaml ]; - installTargets = "ott.install"; + installTargets = [ "ott.install" ]; postInstall = '' opaline -prefix $out diff --git a/pkgs/applications/science/math/gfm/default.nix b/pkgs/applications/science/math/gfm/default.nix index a8031b3e8a3d3..c2496afc79766 100644 --- a/pkgs/applications/science/math/gfm/default.nix +++ b/pkgs/applications/science/math/gfm/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { libticonv ]; - NIX_CFLAGS_COMPILE = "-I${libticables2}/include/tilp2"; + env.NIX_CFLAGS_COMPILE = "-I${libticables2}/include/tilp2"; meta = with lib; { changelog = "http://lpg.ticalc.org/prj_tilp/news.html"; diff --git a/pkgs/applications/science/misc/gplates/default.nix b/pkgs/applications/science/misc/gplates/default.nix index d0315d1596742..69d4f5633cb1c 100644 --- a/pkgs/applications/science/misc/gplates/default.nix +++ b/pkgs/applications/science/misc/gplates/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { }) ]; - NIX_CFLAGS_LINK="-ldl -lpthread -lutil"; + env.NIX_CFLAGS_LINK = "-ldl -lpthread -lutil"; meta = with lib; { description = "Desktop software for the interactive visualisation of plate-tectonics"; diff --git a/pkgs/applications/terminal-emulators/foot/default.nix b/pkgs/applications/terminal-emulators/foot/default.nix index 63642af708f69..5ebab79d24d6a 100644 --- a/pkgs/applications/terminal-emulators/foot/default.nix +++ b/pkgs/applications/terminal-emulators/foot/default.nix @@ -111,7 +111,7 @@ stdenv.mkDerivation rec { # recommended build flags for performance optimized foot builds # https://codeberg.org/dnkl/foot/src/branch/master/INSTALL.md#release-build - CFLAGS = + env.CFLAGS = if !doPgo then "-O3 -fno-plt" else pgoCflags; diff --git a/pkgs/applications/terminal-emulators/mlterm/default.nix b/pkgs/applications/terminal-emulators/mlterm/default.nix index 94629314341de..c92edd4719729 100644 --- a/pkgs/applications/terminal-emulators/mlterm/default.nix +++ b/pkgs/applications/terminal-emulators/mlterm/default.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { --replace "-m 2755 -g utmp" " " \ --replace "-m 4755 -o root" " " ''; - NIX_LDFLAGS = lib.optionalString (!stdenv.isDarwin) " + env.NIX_LDFLAGS = lib.optionalString (!stdenv.isDarwin) " -L${stdenv.cc.cc.lib}/lib -lX11 -lgdk_pixbuf-2.0 -lcairo -lfontconfig -lfreetype -lXft -lvte-2.91 -lgtk-3 -lharfbuzz -lfribidi -lm17n diff --git a/pkgs/applications/terminal-emulators/xterm/default.nix b/pkgs/applications/terminal-emulators/xterm/default.nix index 8983b3d99043f..7d0f889f049be 100644 --- a/pkgs/applications/terminal-emulators/xterm/default.nix +++ b/pkgs/applications/terminal-emulators/xterm/default.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { ] ++ lib.optional enableDecLocator "--enable-dec-locator"; # Work around broken "plink.sh". - NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig"; + env.NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig"; # Hack to get xterm built with the feature of releasing a possible setgid of 'utmp', # decided by the sysadmin to allow the xterm reporting to /var/run/utmp diff --git a/pkgs/applications/virtualization/libnvidia-container/default.nix b/pkgs/applications/virtualization/libnvidia-container/default.nix index 3ce493c617895..d9f46110ac3ee 100644 --- a/pkgs/applications/virtualization/libnvidia-container/default.nix +++ b/pkgs/applications/virtualization/libnvidia-container/default.nix @@ -70,8 +70,8 @@ stdenv.mkDerivation rec { --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:/run/opengl-driver-32/lib ''; - NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; - NIX_LDFLAGS = [ "-L${libtirpc.dev}/lib" "-ltirpc" ]; + env.NIX_CFLAGS_COMPILE = "-I${libtirpc.dev}/include/tirpc"; + env.NIX_LDFLAGS = "-L${libtirpc.dev}/lib -ltirpc"; nativeBuildInputs = [ pkg-config rpcsvc-proto makeWrapper ]; diff --git a/pkgs/applications/virtualization/looking-glass-client/default.nix b/pkgs/applications/virtualization/looking-glass-client/default.nix index 720f684f44c90..4bba6683ae062 100644 --- a/pkgs/applications/virtualization/looking-glass-client/default.nix +++ b/pkgs/applications/virtualization/looking-glass-client/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { ]; sourceRoot = "source/client"; - NIX_CFLAGS_COMPILE = "-mavx"; # Fix some sort of AVX compiler problem. + env.NIX_CFLAGS_COMPILE = "-mavx"; # Fix some sort of AVX compiler problem. meta = with lib; { description = "A KVM Frame Relay (KVMFR) implementation"; diff --git a/pkgs/build-support/coq/default.nix b/pkgs/build-support/coq/default.nix index 8d86602bf38e8..2854e031ab9f1 100644 --- a/pkgs/build-support/coq/default.nix +++ b/pkgs/build-support/coq/default.nix @@ -78,7 +78,7 @@ stdenv.mkDerivation (removeAttrs ({ (optionalAttrs (!args?installPhase && !args?useMelquiondRemake) { installFlags = [ "${var-coqlib-install}=$(out)/lib/coq/${coq.coq-version}/" ] ++ - optional (match ".*doc$" (args.installTargets or "") != null) + optional (elem "doc" (args.installTargets or [])) "DOCDIR=$(out)/share/coq/${coq.coq-version}/" ++ extraInstallFlags; }) // diff --git a/pkgs/desktops/gnome-3/core/gnome-online-miners/default.nix b/pkgs/desktops/gnome-3/core/gnome-online-miners/default.nix index 3cc85053bcef9..70a4255687019 100644 --- a/pkgs/desktops/gnome-3/core/gnome-online-miners/default.nix +++ b/pkgs/desktops/gnome-3/core/gnome-online-miners/default.nix @@ -93,9 +93,8 @@ stdenv.mkDerivation rec { dleyna-server ]; - NIX_CFLAGS_COMPILE = [ - "-Wno-error=format-security" # https://gitlab.gnome.org/GNOME/gnome-online-miners/merge_requests/3/diffs#note_942747 - ]; + env.NIX_CFLAGS_COMPILE = + "-Wno-error=format-security"; # https://gitlab.gnome.org/GNOME/gnome-online-miners/merge_requests/3/diffs#note_942747 enableParallelBuilding = true; diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 6d1571bd341f5..41b5867f8ffc7 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -294,7 +294,7 @@ stdenv.mkDerivation ({ // optionalAttrs (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt" && crossStageStatic) { makeFlags = [ "all-gcc" "all-target-libgcc" ]; - installTargets = "install-gcc install-target-libgcc"; + installTargets = [ "install-gcc" "install-target-libgcc" ]; } // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } diff --git a/pkgs/development/compilers/ghdl/default.nix b/pkgs/development/compilers/ghdl/default.nix index e733243943943..b0321939c89c1 100644 --- a/pkgs/development/compilers/ghdl/default.nix +++ b/pkgs/development/compilers/ghdl/default.nix @@ -14,9 +14,9 @@ stdenv.mkDerivation rec { sha256 = "1gyh0xckwbzgslbpw9yrpj4gqs9fm1a2qpbzl0sh143fk1kwjlly"; }; - LIBRARY_PATH = "${stdenv.cc.libc}/lib"; + env.LIBRARY_PATH = "${stdenv.cc.libc}/lib"; - buildInputs = [ gnat zlib ] ++ lib.optional (backend == "llvm") [ llvm ]; + buildInputs = [ gnat zlib ] ++ lib.optional (backend == "llvm") llvm; preConfigure = '' # If llvm 7.0 works, 7.x releases should work too. diff --git a/pkgs/development/coq-modules/mathcomp/default.nix b/pkgs/development/coq-modules/mathcomp/default.nix index 5b3501516e154..dcd31d96fd0af 100644 --- a/pkgs/development/coq-modules/mathcomp/default.nix +++ b/pkgs/development/coq-modules/mathcomp/default.nix @@ -68,7 +68,7 @@ let cd ${pkgpath} '' + optionalString (package == "all") pkgallMake; - installTargets = "install" + optionalString withDoc " doc"; + installTargets = [ "install" ] ++ optional withDoc "doc"; meta = { homepage = "https://math-comp.github.io/"; diff --git a/pkgs/development/coq-modules/metalib/default.nix b/pkgs/development/coq-modules/metalib/default.nix index 3ce3c625d268d..138f077a518f9 100644 --- a/pkgs/development/coq-modules/metalib/default.nix +++ b/pkgs/development/coq-modules/metalib/default.nix @@ -9,7 +9,7 @@ with lib; mkCoqDerivation { release."20200527".sha256 = "0wbypc05d2lqfm9qaw98ynr5yc1p0ipsvyc3bh1rk9nz7zwirmjs"; sourceRoot = "source/Metalib"; - installFlags = "COQMF_COQLIB=$(out)/lib/coq/${coq.coq-version}"; + installFlags = [ "COQMF_COQLIB=$(out)/lib/coq/${coq.coq-version}" ]; meta = { license = licenses.mit; diff --git a/pkgs/development/interpreters/acl2/default.nix b/pkgs/development/interpreters/acl2/default.nix index c089916158bdc..30d2b40e02c91 100644 --- a/pkgs/development/interpreters/acl2/default.nix +++ b/pkgs/development/interpreters/acl2/default.nix @@ -71,7 +71,7 @@ in stdenv.mkDerivation rec { ''; preBuild = "mkdir -p $HOME"; - makeFlags="LISP=${sbcl}/bin/sbcl"; + makeFlags = [ "LISP=${sbcl}/bin/sbcl" ]; doCheck = true; checkTarget = "mini-proveall"; diff --git a/pkgs/development/interpreters/j/default.nix b/pkgs/development/interpreters/j/default.nix index 8875a9cf55eb1..a6befcea7f242 100644 --- a/pkgs/development/interpreters/j/default.nix +++ b/pkgs/development/interpreters/j/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { # Causes build failure due to warning # https://github.com/jsoftware/jsource/issues/16 - NIX_CFLAGS_COMPILE = "-Wno-error=return-local-addr"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=return-local-addr"; buildPhase = '' export SOURCE_DIR=$(pwd) diff --git a/pkgs/development/interpreters/php/generic.nix b/pkgs/development/interpreters/php/generic.nix index 659157e24c4a4..b844bedcf0659 100644 --- a/pkgs/development/interpreters/php/generic.nix +++ b/pkgs/development/interpreters/php/generic.nix @@ -158,7 +158,7 @@ let [ pcre' ] # Enable sapis - ++ lib.optional pearSupport [ libxml2.dev ] + ++ lib.optional pearSupport libxml2.dev # Misc deps ++ lib.optional apxs2Support apacheHttpd @@ -167,7 +167,7 @@ let ++ lib.optional valgrindSupport valgrind ; - CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11"; + env.CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11"; configureFlags = # Disable all extensions @@ -184,7 +184,7 @@ let ++ lib.optional (!cgiSupport) "--disable-cgi" ++ lib.optional (!cliSupport) "--disable-cli" ++ lib.optional fpmSupport "--enable-fpm" - ++ lib.optional pearSupport [ "--with-pear" "--enable-xml" "--with-libxml" ] + ++ lib.optionals pearSupport [ "--with-pear" "--enable-xml" "--with-libxml" ] ++ lib.optionals (pearSupport && (lib.versionOlder version "7.4")) [ "--enable-libxml" "--with-libxml-dir=${libxml2.dev}" diff --git a/pkgs/development/libraries/ace/default.nix b/pkgs/development/libraries/ace/default.nix index 85df0b4335394..56be3a3ba6b7a 100644 --- a/pkgs/development/libraries/ace/default.nix +++ b/pkgs/development/libraries/ace/default.nix @@ -14,9 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config libtool ]; buildInputs = [ perl ]; - NIX_CFLAGS_COMPILE = [ - "-Wno-error=format-security" - ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-security"; patchPhase = ''substituteInPlace ./MPC/prj_install.pl \ --replace /usr/bin/perl "${perl}/bin/perl"''; diff --git a/pkgs/development/libraries/cxxopts/default.nix b/pkgs/development/libraries/cxxopts/default.nix index ddbc845e3b493..595f6264d472b 100644 --- a/pkgs/development/libraries/cxxopts/default.nix +++ b/pkgs/development/libraries/cxxopts/default.nix @@ -11,9 +11,9 @@ stdenv.mkDerivation rec { sha256 = "0d3y747lsh1wkalc39nxd088rbypxigm991lk3j91zpn56whrpha"; }; - buildInputs = lib.optional enableUnicodeHelp [ icu.dev ]; - cmakeFlags = lib.optional enableUnicodeHelp [ "-DCXXOPTS_USE_UNICODE_HELP=TRUE" ]; - nativeBuildInputs = [ cmake ] ++ lib.optional enableUnicodeHelp [ pkg-config ]; + buildInputs = lib.optional enableUnicodeHelp icu.dev; + cmakeFlags = lib.optional enableUnicodeHelp "-DCXXOPTS_USE_UNICODE_HELP=TRUE"; + nativeBuildInputs = [ cmake ] ++ lib.optional enableUnicodeHelp pkg-config; doCheck = true; diff --git a/pkgs/development/libraries/g2o/default.nix b/pkgs/development/libraries/g2o/default.nix index 0536ec95c6ff1..775409871df92 100644 --- a/pkgs/development/libraries/g2o/default.nix +++ b/pkgs/development/libraries/g2o/default.nix @@ -21,7 +21,7 @@ mkDerivation rec { buildInputs = [ eigen suitesparse blas lapack libGLU qtbase libqglviewer ]; # Silence noisy warning - CXXFLAGS = "-Wno-deprecated-copy"; + env.CXXFLAGS = "-Wno-deprecated-copy"; dontWrapQtApps = true; diff --git a/pkgs/development/libraries/gdal/2.4.nix b/pkgs/development/libraries/gdal/2.4.nix index 5df29b38a2632..46a6206bcce3a 100644 --- a/pkgs/development/libraries/gdal/2.4.nix +++ b/pkgs/development/libraries/gdal/2.4.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - CXXFLAGS = "-fpermissive"; + env.CXXFLAGS = "-fpermissive"; postPatch = '' sed -i '/ifdef bool/i\ diff --git a/pkgs/development/libraries/gtk/4.x.nix b/pkgs/development/libraries/gtk/4.x.nix index b05e9ea03933f..6dc4b29ec9c95 100644 --- a/pkgs/development/libraries/gtk/4.x.nix +++ b/pkgs/development/libraries/gtk/4.x.nix @@ -152,7 +152,7 @@ stdenv.mkDerivation rec { # These are the defines that'd you'd get with --enable-debug=minimum (default). # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options - NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"; + env.NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"; postPatch = '' files=( diff --git a/pkgs/development/libraries/libchop/default.nix b/pkgs/development/libraries/libchop/default.nix index f02ac04621fc3..0239c0185b1f8 100644 --- a/pkgs/development/libraries/libchop/default.nix +++ b/pkgs/development/libraries/libchop/default.nix @@ -15,8 +15,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config gperf rpcsvc-proto ]; - NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; - NIX_LDFLAGS = [ "-ltirpc" ]; + env.NIX_CFLAGS_COMPILE = "-I${libtirpc.dev}/include/tirpc"; + env.NIX_LDFLAGS = "-ltirpc"; buildInputs = [ zlib bzip2 lzo diff --git a/pkgs/development/libraries/libgaminggear/default.nix b/pkgs/development/libraries/libgaminggear/default.nix index f059d6c73a2fd..f76a285be33cb 100644 --- a/pkgs/development/libraries/libgaminggear/default.nix +++ b/pkgs/development/libraries/libgaminggear/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { ]; # https://sourceforge.net/p/libgaminggear/discussion/general/thread/b43a776b3a/ - NIX_CFLAGS_COMPILE = [ "-I${harfbuzz.dev}/include/harfbuzz" ]; + env.NIX_CFLAGS_COMPILE = "-I${harfbuzz.dev}/include/harfbuzz"; postFixup = '' moveToOutput bin "$bin" diff --git a/pkgs/development/libraries/libiscsi/default.nix b/pkgs/development/libraries/libiscsi/default.nix index adc721bc6d076..62e8d8cf49fc4 100644 --- a/pkgs/development/libraries/libiscsi/default.nix +++ b/pkgs/development/libraries/libiscsi/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; # This problem is gone on libiscsi master. - NIX_CFLAGS_COMPILE = if stdenv.hostPlatform.is32bit then "-Wno-error=sign-compare" else null; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.is32bit "-Wno-error=sign-compare"; meta = with lib; { description = "iscsi client library and utilities"; diff --git a/pkgs/development/libraries/libnixxml/default.nix b/pkgs/development/libraries/libnixxml/default.nix index 40459dbca22a6..a2a04ca835be1 100644 --- a/pkgs/development/libraries/libnixxml/default.nix +++ b/pkgs/development/libraries/libnixxml/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation { ''; configureFlags = [ "--with-gd" "--with-glib" ]; - CFLAGS = "-Wall"; + env.CFLAGS = "-Wall"; nativeBuildInputs = [ autoreconfHook pkg-config ]; buildInputs = [ libxml2 gd.dev glib getopt libxslt nix ]; diff --git a/pkgs/development/libraries/libpam-wrapper/default.nix b/pkgs/development/libraries/libpam-wrapper/default.nix index 7d026eb5a0915..6088fa4ba0c38 100644 --- a/pkgs/development/libraries/libpam-wrapper/default.nix +++ b/pkgs/development/libraries/libpam-wrapper/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { sha256 = "00mqhsashx7njrvxz085d0b88nizhdy7m3x17ip5yhvwsl63km6p"; }; - nativeBuildInputs = [ cmake ] ++ lib.optional enablePython [ python ]; + nativeBuildInputs = [ cmake ] ++ lib.optional enablePython python; # We must use linux-pam, using openpam will result in broken fprintd. buildInputs = [ linux-pam ]; diff --git a/pkgs/development/libraries/mapbox-gl-native/default.nix b/pkgs/development/libraries/mapbox-gl-native/default.nix index e98903e3a83e0..51eb02c6fd302 100644 --- a/pkgs/development/libraries/mapbox-gl-native/default.nix +++ b/pkgs/development/libraries/mapbox-gl-native/default.nix @@ -21,7 +21,7 @@ mkDerivation rec { "-DMBGL_WITH_QT_LIB_ONLY=ON" "-DMBGL_WITH_QT_HEADLESS=OFF" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations -Wno-error=type-limits"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations -Wno-error=type-limits"; meta = with lib; { description = "Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL"; diff --git a/pkgs/development/libraries/mapbox-gl-qml/default.nix b/pkgs/development/libraries/mapbox-gl-qml/default.nix index 1740b9ae580de..4999ad8c49a68 100644 --- a/pkgs/development/libraries/mapbox-gl-qml/default.nix +++ b/pkgs/development/libraries/mapbox-gl-qml/default.nix @@ -20,7 +20,7 @@ mkDerivation rec { ''; # Package expects qt5 subdirectory of mapbox-gl-native to be in the include path - NIX_CFLAGS_COMPILE = "-I${mapbox-gl-native}/include/qt5"; + env.NIX_CFLAGS_COMPILE = "-I${mapbox-gl-native}/include/qt5"; meta = with lib; { description = "Unofficial Mapbox GL Native bindings for Qt QML"; diff --git a/pkgs/development/libraries/mp4v2/default.nix b/pkgs/development/libraries/mp4v2/default.nix index 7a6bbb552027d..c1040d9382f8c 100644 --- a/pkgs/development/libraries/mp4v2/default.nix +++ b/pkgs/development/libraries/mp4v2/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { ./fix-build-clang.patch ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=narrowing" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=narrowing"; # `faac' expects `mp4.h'. postInstall = "ln -s mp4v2/mp4v2.h $out/include/mp4.h"; diff --git a/pkgs/development/libraries/nss/3.44.nix b/pkgs/development/libraries/nss/3.44.nix index b08b8b3ed2a75..2e644ba2035cb 100644 --- a/pkgs/development/libraries/nss/3.44.nix +++ b/pkgs/development/libraries/nss/3.44.nix @@ -72,7 +72,7 @@ in stdenv.mkDerivation rec { ] ++ lib.optional stdenv.is64bit "USE_64=1" ++ lib.optional stdenv.isDarwin "CCC=clang++"; - NIX_CFLAGS_COMPILE = "-Wno-error"; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; # TODO(@oxij): investigate this: `make -n check` works but `make # check` fails with "no rule", same for "installcheck". diff --git a/pkgs/development/libraries/precice/default.nix b/pkgs/development/libraries/precice/default.nix index c3c75e2413f06..24a7f7ab0ccc2 100644 --- a/pkgs/development/libraries/precice/default.nix +++ b/pkgs/development/libraries/precice/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { "-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}" ]; - NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin [ "-D_GNU_SOURCE" ]; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-D_GNU_SOURCE"; nativeBuildInputs = [ cmake gcc ]; buildInputs = [ boost eigen libxml2 mpi python3 python3.pkgs.numpy ]; diff --git a/pkgs/development/libraries/qt-5/modules/qtserialport.nix b/pkgs/development/libraries/qt-5/modules/qtserialport.nix index c339ee200885f..a9016938793ac 100644 --- a/pkgs/development/libraries/qt-5/modules/qtserialport.nix +++ b/pkgs/development/libraries/qt-5/modules/qtserialport.nix @@ -1,11 +1,11 @@ { qtModule, stdenv, lib, qtbase, systemd }: -let inherit (lib) getLib optional; in +let inherit (lib) getLib optionalString; in qtModule { name = "qtserialport"; qtInputs = [ qtbase ]; env.NIX_CFLAGS_COMPILE = - optional stdenv.isLinux + optionalString stdenv.isLinux ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"''; } diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index e694ed0a41c64..2d218a529aaf2 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -96,7 +96,7 @@ qtModule { --replace 'libs = [ "sandbox" ]' 'libs = [ "/usr/lib/libsandbox.1.dylib" ]' ''); - env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ + env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [ # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit "-Wno-class-memaccess" ] ++ lib.optionals (stdenv.hostPlatform.gcc.arch or "" == "sandybridge") [ @@ -116,7 +116,7 @@ qtModule { # TODO remove when new Apple SDK is in # "-fno-objc-arc" - ]; + ]); preConfigure = '' export NINJAFLAGS=-j$NIX_BUILD_CORES diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix index 78d22198eb7e5..e10b2c458eba4 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix @@ -49,7 +49,7 @@ qtModule { export qmakeFlags="$qmakeFlags CONFIG+=silent" ''; - env.NIX_CFLAGS_COMPILE = [ + env.NIX_CFLAGS_COMPILE = toString ([ # with gcc7 this warning blows the log over Hydra's limit "-Wno-expansion-to-defined" ] @@ -57,7 +57,7 @@ qtModule { ++ optional stdenv.cc.isGNU "-Wno-class-memaccess" # with clang this warning blows the log over Hydra's limit ++ optional stdenv.isDarwin "-Wno-inconsistent-missing-override" - ++ optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"''; + ++ optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"''); doCheck = false; # fails 13 out of 13 tests (ctest) diff --git a/pkgs/development/ocaml-modules/ounit/default.nix b/pkgs/development/ocaml-modules/ounit/default.nix index 2f4a4f0437a2a..e705dc93ed1bc 100644 --- a/pkgs/development/ocaml-modules/ounit/default.nix +++ b/pkgs/development/ocaml-modules/ounit/default.nix @@ -11,6 +11,6 @@ stdenv.mkDerivation { createFindlibDestdir = true; - installTargets = "install-ounit version='${ounit2.version}'"; + installTargets = [ "install-ounit" "version='${ounit2.version}'" ]; } diff --git a/pkgs/development/octave-modules/io/default.nix b/pkgs/development/octave-modules/io/default.nix index 57058c5f95de5..56481e38f35ff 100644 --- a/pkgs/development/octave-modules/io/default.nix +++ b/pkgs/development/octave-modules/io/default.nix @@ -15,9 +15,7 @@ buildOctavePackage rec { sha256 = "044y8lfp93fx0592mv6x2ss0nvjkjgvlci3c3ahav76pk1j3rikb"; }; - buildInputs = [ - (lib.optional enableJava jdk) - ]; + buildInputs = lib.optional enableJava jdk; propagatedBuildInputs = [ unzip diff --git a/pkgs/development/python-modules/google-crc32c/default.nix b/pkgs/development/python-modules/google-crc32c/default.nix index b36635654a9d5..0ec10ab075a28 100644 --- a/pkgs/development/python-modules/google-crc32c/default.nix +++ b/pkgs/development/python-modules/google-crc32c/default.nix @@ -15,8 +15,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ cffi ]; - LDFLAGS = "-L${crc32c}/lib"; - CFLAGS = "-I${crc32c}/include"; + env.LDFLAGS = "-L${crc32c}/lib"; + env.CFLAGS = "-I${crc32c}/include"; checkInputs = [ pytestCheckHook crc32c ]; diff --git a/pkgs/development/python-modules/shiboken2/default.nix b/pkgs/development/python-modules/shiboken2/default.nix index 23836addd0ca9..b96699c6c524a 100644 --- a/pkgs/development/python-modules/shiboken2/default.nix +++ b/pkgs/development/python-modules/shiboken2/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation { cd sources/shiboken2 ''; - CLANG_INSTALL_DIR = llvmPackages.libclang.out; + env.CLANG_INSTALL_DIR = toString llvmPackages.libclang.out; nativeBuildInputs = [ cmake ]; buildInputs = [ llvmPackages.libclang python qt5.qtbase qt5.qtxmlpatterns ]; diff --git a/pkgs/development/tools/misc/dbench/default.nix b/pkgs/development/tools/misc/dbench/default.nix index 9565eaa362622..629e97a024be9 100644 --- a/pkgs/development/tools/misc/dbench/default.nix +++ b/pkgs/development/tools/misc/dbench/default.nix @@ -11,8 +11,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ autoconf rpcsvc-proto ]; buildInputs = [ popt zlib libtirpc ]; - NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; - NIX_LDFLAGS = [ "-ltirpc" ]; + env.NIX_CFLAGS_COMPILE = "-I${libtirpc.dev}/include/tirpc"; + env.NIX_LDFLAGS = "-ltirpc"; patches = [ # patch has been also sent upstream and might be included in future versions diff --git a/pkgs/games/blobwars/default.nix b/pkgs/games/blobwars/default.nix index b99c9f2b8e360..a58d6fcbf8acb 100644 --- a/pkgs/games/blobwars/default.nix +++ b/pkgs/games/blobwars/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config gettext ]; buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_net SDL2_ttf zlib ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; makeFlags = [ "PREFIX=$(out)" "RELEASE=1" ]; diff --git a/pkgs/games/freeciv/default.nix b/pkgs/games/freeciv/default.nix index dea159f53bf7b..9c353543bb9b6 100644 --- a/pkgs/games/freeciv/default.nix +++ b/pkgs/games/freeciv/default.nix @@ -29,7 +29,7 @@ in stdenv.mkDerivation rec { ''; nativeBuildInputs = [ autoreconfHook pkg-config ] - ++ optional qtClient [ qt5.wrapQtAppsHook ]; + ++ optionals qtClient [ qt5.wrapQtAppsHook ]; buildInputs = [ lua5_3 zlib bzip2 curl lzma gettext libiconv ] ++ optionals sdlClient [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx freetype fluidsynth ] diff --git a/pkgs/games/gimx/default.nix b/pkgs/games/gimx/default.nix index 727945ff2b465..0ef05c6452070 100644 --- a/pkgs/games/gimx/default.nix +++ b/pkgs/games/gimx/default.nix @@ -31,7 +31,7 @@ in stdenv.mkDerivation rec { prePatch = (if gimxAuth == "afterglow" then (import ./variant.nix).afterglow else ""); - makeFlags = "build-core"; + makeFlags = [ "build-core" ]; installPhase = '' runHook preInstall diff --git a/pkgs/games/iortcw/sp.nix b/pkgs/games/iortcw/sp.nix index fc1976b0fb175..774a8e02d9cf8 100644 --- a/pkgs/games/iortcw/sp.nix +++ b/pkgs/games/iortcw/sp.nix @@ -30,11 +30,8 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ makeWrapper ]; - NIX_CFLAGS_COMPILE = [ - "-I${SDL2.dev}/include/SDL2" - "-I${opusfile}/include/opus" - ]; - NIX_CFLAGS_LINK = [ "-lSDL2" ]; + env.NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2 -I${opusfile}/include/opus"; + env.NIX_CFLAGS_LINK = "-lSDL2"; postInstall = '' for i in `find $out/opt/iortcw -maxdepth 1 -type f -executable`; do diff --git a/pkgs/games/liquidwar/5.nix b/pkgs/games/liquidwar/5.nix index ff179c95c7960..059fd76b71c50 100644 --- a/pkgs/games/liquidwar/5.nix +++ b/pkgs/games/liquidwar/5.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - env.NIX_CFLAGS_COMPILE = [ "-lm" ]; + env.NIX_CFLAGS_COMPILE = "-lm"; meta = with lib; { description = "The classic version of a quick tactics game LiquidWar"; diff --git a/pkgs/games/openmw/tes3mp.nix b/pkgs/games/openmw/tes3mp.nix index 95659e5a088e1..172e4aa1afa26 100644 --- a/pkgs/games/openmw/tes3mp.nix +++ b/pkgs/games/openmw/tes3mp.nix @@ -67,7 +67,7 @@ in openmw.overrideAttrs (oldAttrs: rec { patches = [ ./tes3mp.patch ]; - NIX_CFLAGS_COMPILE = "-fpermissive"; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; preConfigure = '' substituteInPlace files/version.in \ diff --git a/pkgs/misc/emulators/mame/default.nix b/pkgs/misc/emulators/mame/default.nix index c58ec83ae89f8..f7ab38506d688 100644 --- a/pkgs/misc/emulators/mame/default.nix +++ b/pkgs/misc/emulators/mame/default.nix @@ -28,7 +28,7 @@ in mkDerivation { }; hardeningDisable = [ "fortify" ]; - env.NIX_CFLAGS_COMPILE = [ "-Wno-error=maybe-uninitialized" "-Wno-error=missing-braces" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=maybe-uninitialized -Wno-error=missing-braces"; makeFlags = [ "TOOLS=1" diff --git a/pkgs/misc/emulators/wine/builder-wow.sh b/pkgs/misc/emulators/wine/builder-wow.sh index c006db3116b59..b045ec3051c9f 100644 --- a/pkgs/misc/emulators/wine/builder-wow.sh +++ b/pkgs/misc/emulators/wine/builder-wow.sh @@ -1,5 +1,7 @@ ## build described at http://wiki.winehq.org/Wine64 +source .attrs.sh + source $stdenv/setup unpackPhase @@ -11,14 +13,14 @@ mkdir -p $TMP/wine-wow $TMP/wine64 cd $TMP/wine64 sourceRoot=`pwd` -configureFlags="--enable-win64" +configureFlags=("--enable-win64") configurePhase buildPhase # checkPhase cd $TMP/wine-wow sourceRoot=`pwd` -configureFlags="--with-wine64=../wine64" +configureFlags=("--with-wine64=../wine64") configurePhase buildPhase # checkPhase diff --git a/pkgs/os-specific/linux/autofs/default.nix b/pkgs/os-specific/linux/autofs/default.nix index f7ca3f71d4345..0bde35080e8b0 100644 --- a/pkgs/os-specific/linux/autofs/default.nix +++ b/pkgs/os-specific/linux/autofs/default.nix @@ -29,7 +29,7 @@ in stdenv.mkDerivation { ''; # configure script is not finding the right path - NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; + env.NIX_CFLAGS_COMPILE = "-I${libtirpc.dev}/include/tirpc"; installPhase = '' make install SUBDIRS="lib daemon modules man" # all but samples diff --git a/pkgs/os-specific/linux/gobi_loader/default.nix b/pkgs/os-specific/linux/gobi_loader/default.nix index b7972007719c9..2b251242119c8 100644 --- a/pkgs/os-specific/linux/gobi_loader/default.nix +++ b/pkgs/os-specific/linux/gobi_loader/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { substituteInPlace 60-gobi.rules --replace "/lib/firmware" "/run/current-system/firmware" ''; - makeFlags = "prefix=${placeholder "out"}"; + makeFlags = [ "prefix=${placeholder "out"}" ]; meta = with lib; { description = "Firmware loader for Qualcomm Gobi USB chipsets"; diff --git a/pkgs/os-specific/linux/libbpf/default.nix b/pkgs/os-specific/linux/libbpf/default.nix index 2e497584fab87..a0b9445ce04eb 100644 --- a/pkgs/os-specific/linux/libbpf/default.nix +++ b/pkgs/os-specific/linux/libbpf/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { sha256 = "17mvjrs7s727drz013a8qlyj0345ldi2kph6pazcmxv6kl1qrz2z"; }) ]; - patchFlags = "-p2"; + patchFlags = [ "-p2" ]; # https://github.com/libbpf/libbpf/pull/201#issuecomment-689174740 postPatch = '' substituteInPlace ../scripts/check-reallocarray.sh \ diff --git a/pkgs/os-specific/linux/libsemanage/default.nix b/pkgs/os-specific/linux/libsemanage/default.nix index 11a6f2755d4cd..35e7d6932cfbb 100644 --- a/pkgs/os-specific/linux/libsemanage/default.nix +++ b/pkgs/os-specific/linux/libsemanage/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { # 1278 | int i; # | ^ # cc1: all warnings being treated as errors - NIX_CFLAGS_COMPILE = [ "-Wno-error=clobbered" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=clobbered"; installTargets = [ "install" ] ++ optionals enablePython [ "install-pywrap" ]; diff --git a/pkgs/os-specific/linux/pktgen/default.nix b/pkgs/os-specific/linux/pktgen/default.nix index b857e80cdc2a9..2ebb694dc87cb 100644 --- a/pkgs/os-specific/linux/pktgen/default.nix +++ b/pkgs/os-specific/linux/pktgen/default.nix @@ -18,8 +18,8 @@ stdenv.mkDerivation rec { [ dpdk libbsd libpcap lua5_3 numactl which ] ++ lib.optionals withGtk [gtk2]; - RTE_SDK = dpdk; - GUI = lib.optionalString withGtk "true"; + env.RTE_SDK = toString dpdk; + env.GUI = lib.optionalString withGtk "true"; env.NIX_CFLAGS_COMPILE = "-msse3"; diff --git a/pkgs/os-specific/linux/rtl88xxau-aircrack/default.nix b/pkgs/os-specific/linux/rtl88xxau-aircrack/default.nix index c37c9502d2db1..a32e5b249bc75 100644 --- a/pkgs/os-specific/linux/rtl88xxau-aircrack/default.nix +++ b/pkgs/os-specific/linux/rtl88xxau-aircrack/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - NIX_CFLAGS_COMPILE="-Wno-error=incompatible-pointer-types"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; prePatch = '' substituteInPlace ./Makefile \ diff --git a/pkgs/os-specific/linux/virtualbox/default.nix b/pkgs/os-specific/linux/virtualbox/default.nix index f795d36207a8c..5414f788e2324 100644 --- a/pkgs/os-specific/linux/virtualbox/default.nix +++ b/pkgs/os-specific/linux/virtualbox/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation { nativeBuildInputs = kernel.moduleBuildDependencies; - KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; + env.KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; makeFlags = [ "INSTALL_MOD_PATH=$(out)" ]; installTargets = [ "install" ]; diff --git a/pkgs/servers/misc/oven-media-engine/default.nix b/pkgs/servers/misc/oven-media-engine/default.nix index 6a63292301b50..c2c35f013aa24 100644 --- a/pkgs/servers/misc/oven-media-engine/default.nix +++ b/pkgs/servers/misc/oven-media-engine/default.nix @@ -48,7 +48,10 @@ stdenv.mkDerivation rec { ]; sourceRoot = "source/src"; - makeFlags = "release CONFIG_LIBRARY_PATHS= CONFIG_PKG_PATHS= GLOBAL_CC=$(CC) GLOBAL_CXX=$(CXX) GLOBAL_LD=$(CXX) SHELL=${stdenv.shell}"; + makeFlags = [ + "release" "CONFIG_LIBRARY_PATHS=" "CONFIG_PKG_PATHS=" "GLOBAL_CC=$(CC)" + "GLOBAL_CXX=$(CXX)" "GLOBAL_LD=$(CXX)" "SHELL=${stdenv.shell}" + ]; enableParallelBuilding = true; nativeBuildInputs = [ bc pkg-config perl ]; diff --git a/pkgs/servers/monitoring/grafana-agent/default.nix b/pkgs/servers/monitoring/grafana-agent/default.nix index 7ad518308df5d..b07d67cd58d0b 100644 --- a/pkgs/servers/monitoring/grafana-agent/default.nix +++ b/pkgs/servers/monitoring/grafana-agent/default.nix @@ -15,7 +15,7 @@ buildGoModule rec { # uses go-systemd, which uses libsystemd headers # https://github.com/coreos/go-systemd/issues/351 - NIX_CFLAGS_COMPILE = [ "-I${lib.getDev systemd}/include" ]; + env.NIX_CFLAGS_COMPILE = "-I${lib.getDev systemd}/include"; # tries to access /sys: https://github.com/grafana/agent/issues/333 preBuild = '' diff --git a/pkgs/servers/monitoring/nagios/default.nix b/pkgs/servers/monitoring/nagios/default.nix index 15d844a3f4fa8..27cb886af6d0b 100644 --- a/pkgs/servers/monitoring/nagios/default.nix +++ b/pkgs/servers/monitoring/nagios/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--localstatedir=/var/lib/nagios" ]; buildFlags = [ "all" ]; - CFLAGS = "-ldl"; + env.CFLAGS = "-ldl"; # Do not create /var directories preInstall = '' diff --git a/pkgs/servers/monitoring/prometheus/default.nix b/pkgs/servers/monitoring/prometheus/default.nix index 2852fb2afc29c..145e3e5b7b417 100644 --- a/pkgs/servers/monitoring/prometheus/default.nix +++ b/pkgs/servers/monitoring/prometheus/default.nix @@ -44,10 +44,10 @@ in buildGoPackage rec { ln -s ${webui} web/ui/static/react ''; - buildFlags = "-tags=builtinassets"; - buildFlagsArray = let + buildFlags = let t = "${goPackagePath}/vendor/github.com/prometheus/common/version"; in [ + "-tags=builtinassets" '' -ldflags= -X ${t}.Version=${version} diff --git a/pkgs/shells/bash/5.1.nix b/pkgs/shells/bash/5.1.nix index 5dd060db7efbc..b9fbc94ca54ab 100644 --- a/pkgs/shells/bash/5.1.nix +++ b/pkgs/shells/bash/5.1.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "man" "doc" "info" ]; - NIX_CFLAGS_COMPILE = '' + env.NIX_CFLAGS_COMPILE = '' -DSYS_BASHRC="/etc/bashrc" -DSYS_BASH_LOGOUT="/etc/bash_logout" -DDEFAULT_PATH_VALUE="/no-such-path" diff --git a/pkgs/tools/X11/find-cursor/default.nix b/pkgs/tools/X11/find-cursor/default.nix index 9e3b779d686b5..a9550104b78aa 100644 --- a/pkgs/tools/X11/find-cursor/default.nix +++ b/pkgs/tools/X11/find-cursor/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ installShellFiles git ]; buildInputs = [ libX11 libXdamage libXrender libXcomposite libXext ]; preInstall = "mkdir -p $out/share/man/man1"; - installFlags = "PREFIX=${placeholder "out"}"; + installFlags = [ "PREFIX=${placeholder "out"}" ]; meta = with lib; { description = "Simple XLib program to highlight the cursor position"; diff --git a/pkgs/tools/filesystems/fuseiso/default.nix b/pkgs/tools/filesystems/fuseiso/default.nix index 7e44e7c15f9cb..814f7e8bc5369 100644 --- a/pkgs/tools/filesystems/fuseiso/default.nix +++ b/pkgs/tools/filesystems/fuseiso/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { # after autoreconfHook, glib and zlib are not found, so force link against # them - NIX_LDFLAGS = "-lglib-2.0 -lz"; + env.NIX_LDFLAGS = "-lglib-2.0 -lz"; enableParallelBuilding = true; diff --git a/pkgs/tools/graphics/exifprobe/default.nix b/pkgs/tools/graphics/exifprobe/default.nix index 7331ac69185ae..53e89ac57acdc 100644 --- a/pkgs/tools/graphics/exifprobe/default.nix +++ b/pkgs/tools/graphics/exifprobe/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "1c1fhc0v1m452lgnfcijnvrc0by06qfbhn3zkliqi60kv8l2isbp"; }; - CFLAGS = [ "-O2" ]; + env.CFLAGS = "-O2"; installFlags = [ "DESTDIR=$(out)" ]; diff --git a/pkgs/tools/misc/fluent-bit/default.nix b/pkgs/tools/misc/fluent-bit/default.nix index a504efbf1eb23..828d47ec5f645 100644 --- a/pkgs/tools/misc/fluent-bit/default.nix +++ b/pkgs/tools/misc/fluent-bit/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { patches = lib.optionals stdenv.isDarwin [ ./fix-luajit-darwin.patch ]; # _FORTIFY_SOURCE requires compiling with optimization (-O) - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-O"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-O"; postPatch = '' substituteInPlace src/CMakeLists.txt \ diff --git a/pkgs/tools/networking/argus-clients/default.nix b/pkgs/tools/networking/argus-clients/default.nix index cd935a5f5d7d7..4534cccae192d 100644 --- a/pkgs/tools/networking/argus-clients/default.nix +++ b/pkgs/tools/networking/argus-clients/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "1c9vj6ma00gqq9h92fg71sxcsjzz912166sdg90ahvnmvmh3l1rj"; }; - NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; + env.NIX_CFLAGS_COMPILE = "-I${libtirpc.dev}/include/tirpc"; postPatch = '' for file in ./examples/*/*.pl; do diff --git a/pkgs/tools/networking/network-manager/sstp/default.nix b/pkgs/tools/networking/network-manager/sstp/default.nix index d00c0e3e55f8a..aff6819146b07 100644 --- a/pkgs/tools/networking/network-manager/sstp/default.nix +++ b/pkgs/tools/networking/network-manager/sstp/default.nix @@ -40,7 +40,7 @@ in stdenv.mkDerivation { ''; # glib-2.62 deprecations - NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; preConfigure = "intltoolize"; configureFlags = [ diff --git a/pkgs/tools/package-management/apk-tools/default.nix b/pkgs/tools/package-management/apk-tools/default.nix index fed7de01b98ec..87819a525517b 100644 --- a/pkgs/tools/package-management/apk-tools/default.nix +++ b/pkgs/tools/package-management/apk-tools/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { "PKGCONFIGDIR=$(out)/lib/pkgconfig" ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=unused-result" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-result"; enableParallelBuilding = true; diff --git a/pkgs/tools/security/pcsc-cyberjack/default.nix b/pkgs/tools/security/pcsc-cyberjack/default.nix index 40736cdc86bad..b420263c209b2 100644 --- a/pkgs/tools/security/pcsc-cyberjack/default.nix +++ b/pkgs/tools/security/pcsc-cyberjack/default.nix @@ -23,7 +23,7 @@ in stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = "-Wno-error=narrowing"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=narrowing"; configureFlags = [ "--with-usbdropdir=${placeholder "out"}/pcsc/drivers" diff --git a/pkgs/tools/system/efivar/default.nix b/pkgs/tools/system/efivar/default.nix index c92b28e7f5eaf..b30f653e9388e 100644 --- a/pkgs/tools/system/efivar/default.nix +++ b/pkgs/tools/system/efivar/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { ]; # We have no LTO here since commit 22284b07. With GCC 10 that triggers a warning. postPatch = "sed '/^OPTIMIZE /s/-flto//' -i Make.defaults"; - NIX_CFLAGS_COMPILE = "-Wno-error=stringop-truncation"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=stringop-truncation"; nativeBuildInputs = [ pkg-config ]; buildInputs = [ popt ]; diff --git a/pkgs/tools/virtualization/cloud-init/default.nix b/pkgs/tools/virtualization/cloud-init/default.nix index dfd3321b6b62d..550acdf05c044 100644 --- a/pkgs/tools/virtualization/cloud-init/default.nix +++ b/pkgs/tools/virtualization/cloud-init/default.nix @@ -59,7 +59,7 @@ buildPythonApplication rec { ]; makeWrapperArgs = [ - "--prefix PATH : ${lib.makeBinPath [ + "--prefix" "PATH" ":" "${lib.makeBinPath [ dmidecode cloud-utils.guest ]}/bin" ]; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 149f97c1e4b57..9b47c724bbbea 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -655,7 +655,7 @@ let }; buildInputs = [ PodParser ]; propagatedBuildInputs = [ AppPackager FileLoadLines IOString ImageInfo PDFAPI2 StringInterpolateNamed TextLayout ] - ++ lib.optional (!stdenv.isDarwin) [ Wx ]; + ++ lib.optional (!stdenv.isDarwin) Wx; nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang; postInstall = lib.optionalString stdenv.isDarwin '' shortenPerlShebang $out/bin/chordpro @@ -4272,8 +4272,8 @@ let url = "mirror://cpan/authors/id/M/MG/MGREGORO/Crypt-Sodium-0.11.tar.gz"; sha256 = "0y3c24zv4iwnvlf9zwxambk8ddram54fm6l1m5yhbskc0nhp6z4h"; }; - NIX_CFLAGS_COMPILE = "-I${pkgs.libsodium.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.libsodium.out}/lib -lsodium"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.libsodium.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.libsodium.out}/lib -lsodium"; meta = { homepage = "https://metacpan.org/release/Crypt-Sodium"; description = "Perl bindings for libsodium (NaCL)"; @@ -12393,7 +12393,7 @@ let sha256 = "f4459ed32fb9bb793e2504fd442c515fd468a4a34d2a1f98e46ca41e275c73cb"; }; buildInputs = [ pkgs.gmp ]; - NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp"; + env.NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp"; meta = { homepage = "https://github.com/sisyphus/math-gmpz"; description = "Perl interface to the GMP integer functions"; @@ -12497,8 +12497,8 @@ let sha256 = "2697c7fd5c7e35fdec7f50ed56a67be807a2f22657589e637dad3592744003be"; }; buildInputs = [ pkgs.gmp ]; - NIX_CFLAGS_COMPILE = "-I${pkgs.gmp.dev}/include"; - NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp"; + env.NIX_CFLAGS_COMPILE = "-I${pkgs.gmp.dev}/include"; + env.NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp"; meta = { homepage = "https://github.com/danaj/Math-Prime-Util-GMP"; description = "Utilities related to prime numbers, using GMP"; diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 05d42146ba158..233010bff0afa 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -504,7 +504,7 @@ lib.makeScope pkgs.newScope (self: with self; { { name = "xmlreader"; buildInputs = [ libxml2 ]; internalDeps = [ php.extensions.dom ]; - env.NIX_CFLAGS_COMPILE = [ "-I../.." "-DHAVE_DOM" ]; + env.NIX_CFLAGS_COMPILE = "-I../.. -DHAVE_DOM"; configureFlags = [ "--enable-xmlreader" ] # Required to build on darwin. ++ lib.optional (lib.versionOlder php.version "7.4") "--with-libxml-dir=${libxml2.dev}"; } From 7989a10f29c124d8da8819b30047267d7fda0f74 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 20 Mar 2021 14:25:14 -0600 Subject: [PATCH 220/323] treewide: fix structured-attrs related failures --- pkgs/applications/graphics/xournalpp/default.nix | 2 +- pkgs/applications/networking/ids/snort/default.nix | 2 +- pkgs/applications/science/physics/xfitter/default.nix | 4 ++-- .../terminal-emulators/rxvt-unicode/default.nix | 4 ++-- pkgs/applications/video/kodi/unwrapped.nix | 4 ++-- pkgs/build-support/rust/hooks/cargo-check-hook.sh | 2 +- pkgs/development/gnuradio-modules/osmosdr/default.nix | 2 +- pkgs/development/libraries/galario/default.nix | 4 ++-- pkgs/development/libraries/gdcm/default.nix | 7 +++---- pkgs/development/libraries/librsb/default.nix | 4 ++-- pkgs/development/libraries/prime-server/default.nix | 2 +- pkgs/development/libraries/vtk/generic.nix | 2 +- pkgs/development/python-modules/datatable/default.nix | 2 +- pkgs/development/tools/misc/xxdiff/default.nix | 2 +- pkgs/development/tools/pxview/default.nix | 2 +- pkgs/development/tools/py-spy/default.nix | 2 +- pkgs/development/tools/rust/cbindgen/default.nix | 10 +++++----- pkgs/development/tools/shadered/default.nix | 2 +- pkgs/development/tools/tracy/default.nix | 5 ++--- pkgs/misc/emulators/tilem/default.nix | 2 +- pkgs/os-specific/linux/roccat-tools/default.nix | 2 +- pkgs/servers/nosql/redis/default.nix | 4 ++-- pkgs/servers/pulseaudio/pali.nix | 4 ++-- pkgs/servers/xinetd/default.nix | 4 ++-- pkgs/tools/filesystems/wiimms-iso-tools/default.nix | 4 ++-- 25 files changed, 41 insertions(+), 43 deletions(-) diff --git a/pkgs/applications/graphics/xournalpp/default.nix b/pkgs/applications/graphics/xournalpp/default.nix index 1810a6c6b8ebe..5911d354de616 100644 --- a/pkgs/applications/graphics/xournalpp/default.nix +++ b/pkgs/applications/graphics/xournalpp/default.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { ] ++ lib.optional withLua lua; - buildFlags = "translations"; + buildFlags = [ "translations" ]; hardeningDisable = [ "format" ]; diff --git a/pkgs/applications/networking/ids/snort/default.nix b/pkgs/applications/networking/ids/snort/default.nix index 714ca1c8990f3..d46742758066e 100644 --- a/pkgs/applications/networking/ids/snort/default.nix +++ b/pkgs/applications/networking/ids/snort/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; buildInputs = [ pkg-config luajit openssl libpcap pcre libdnet daq zlib flex bison libtirpc ]; - NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; + env.NIX_CFLAGS_COMPILE = "-I${libtirpc.dev}/include/tirpc"; enableParallelBuilding = true; diff --git a/pkgs/applications/science/physics/xfitter/default.nix b/pkgs/applications/science/physics/xfitter/default.nix index d0a0585e69f18..ac713641f4ea5 100644 --- a/pkgs/applications/science/physics/xfitter/default.nix +++ b/pkgs/applications/science/physics/xfitter/default.nix @@ -49,8 +49,8 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; - NIX_LDFLAGS = [ "-ltirpc" ]; + env.NIX_CFLAGS_COMPILE = "-I${libtirpc.dev}/include/tirpc"; + env.NIX_LDFLAGS = "-ltirpc"; meta = with lib; { description = "The xFitter project is an open source QCD fit framework ready to extract PDFs and assess the impact of new data"; diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix index 82536e4b873a6..774811e2a2d0f 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix @@ -55,8 +55,8 @@ stdenv.mkDerivation { (enableFeature unicode3Support "unicode3") ]; - LDFLAGS = [ "-lfontconfig" "-lXrender" "-lpthread" ]; - CFLAGS = [ "-I${freetype.dev}/include/freetype2" ]; + env.LDFLAGS = "-lfontconfig -lXrender -lpthread"; + env.CFLAGS = "-I${freetype.dev}/include/freetype2"; preConfigure = '' diff --git a/pkgs/applications/video/kodi/unwrapped.nix b/pkgs/applications/video/kodi/unwrapped.nix index 2a713324c3fbf..2d5b57ba46df3 100644 --- a/pkgs/applications/video/kodi/unwrapped.nix +++ b/pkgs/applications/video/kodi/unwrapped.nix @@ -128,7 +128,7 @@ in stdenv.mkDerivation { ffmpeg flatbuffers fmt fstrcmp rapidjson lirc ] - ++ lib.optional x11Support [ + ++ lib.optionals x11Support [ libX11 xorgproto libXt libXmu libXext.dev libXdmcp libXinerama libXrandr.dev libXtst libXfixes ] @@ -148,7 +148,7 @@ in stdenv.mkDerivation { # Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise libxkbcommon.dev ] - ++ lib.optional gbmSupport [ + ++ lib.optionals gbmSupport [ libxkbcommon.dev mesa.dev libinput.dev diff --git a/pkgs/build-support/rust/hooks/cargo-check-hook.sh b/pkgs/build-support/rust/hooks/cargo-check-hook.sh index 8c5b1a13219a3..2cd6e7c32f63f 100644 --- a/pkgs/build-support/rust/hooks/cargo-check-hook.sh +++ b/pkgs/build-support/rust/hooks/cargo-check-hook.sh @@ -23,7 +23,7 @@ cargoCheckHook() { -j $NIX_BUILD_CORES \ ${argstr} -- \ --test-threads=${threads} \ - ${checkFlags} \ + "${checkFlags[@]}" \ ${checkFlagsArray+"${checkFlagsArray[@]}"} ) diff --git a/pkgs/development/gnuradio-modules/osmosdr/default.nix b/pkgs/development/gnuradio-modules/osmosdr/default.nix index 0e1cf244c8fce..635974edc1208 100644 --- a/pkgs/development/gnuradio-modules/osmosdr/default.nix +++ b/pkgs/development/gnuradio-modules/osmosdr/default.nix @@ -52,7 +52,7 @@ in mkDerivation { libbladeRF rtl-sdr soapysdr-with-plugins - ] ++ lib.optional (gnuradio.hasFeature "gr-uhd" gnuradio.features) [ + ] ++ lib.optionals (gnuradio.hasFeature "gr-uhd" gnuradio.features) [ uhd ]; cmakeFlags = [ diff --git a/pkgs/development/libraries/galario/default.nix b/pkgs/development/libraries/galario/default.nix index 888f26f2da7d8..f30226ef60809 100644 --- a/pkgs/development/libraries/galario/default.nix +++ b/pkgs/development/libraries/galario/default.nix @@ -34,13 +34,13 @@ stdenv.mkDerivation rec { ++ lib.optional stdenv.isDarwin llvmPackages.openmp ; - propagatedBuildInputs = lib.optional enablePython [ + propagatedBuildInputs = lib.optionals enablePython [ pythonPackages.numpy pythonPackages.cython pythonPackages.pytest ]; - checkInputs = lib.optional enablePython [ pythonPackages.scipy pythonPackages.pytestcov ]; + checkInputs = lib.optionals enablePython [ pythonPackages.scipy pythonPackages.pytestcov ]; preConfigure = '' mkdir -p build/external/src diff --git a/pkgs/development/libraries/gdcm/default.nix b/pkgs/development/libraries/gdcm/default.nix index 75ce95e0e46bb..444b9e31a062d 100644 --- a/pkgs/development/libraries/gdcm/default.nix +++ b/pkgs/development/libraries/gdcm/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { "-DGDCM_BUILD_SHARED_LIBS=ON" "-DGDCM_USE_VTK=ON" ] - ++ lib.optional enablePython [ + ++ lib.optionals enablePython [ "-DGDCM_WRAP_PYTHON:BOOL=ON" "-DGDCM_INSTALL_PYTHONMODULE_DIR=${placeholder "out"}/${python.sitePackages}" ]; @@ -30,11 +30,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ vtk_7 ] - ++ lib.optional stdenv.isDarwin [ + ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.ApplicationServices darwin.apple_sdk.frameworks.Cocoa - ] ++ lib.optional enablePython [ swig python ]; - propagatedBuildInputs = [ ]; + ] ++ lib.optionals enablePython [ swig python ]; meta = with lib; { description = "The grassroots cross-platform DICOM implementation"; diff --git a/pkgs/development/libraries/librsb/default.nix b/pkgs/development/libraries/librsb/default.nix index ef8b9ee441d30..1c75d469bc760 100644 --- a/pkgs/development/libraries/librsb/default.nix +++ b/pkgs/development/libraries/librsb/default.nix @@ -39,8 +39,8 @@ stdenv.mkDerivation rec { ]; # Ensure C/Fortran code is position-independent. - NIX_CFLAGS_COMPILE = [ "-fPIC" "-Ofast" ]; - FCFLAGS = [ "-fPIC" "-Ofast" ]; + env.NIX_CFLAGS_COMPILE = "-fPIC -Ofast"; + env.FCFLAGS = "-fPIC -Ofast"; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/prime-server/default.nix b/pkgs/development/libraries/prime-server/default.nix index 4f30a9f005c92..7dea5b880ff81 100644 --- a/pkgs/development/libraries/prime-server/default.nix +++ b/pkgs/development/libraries/prime-server/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { buildInputs = [ curl zeromq czmq libsodium ]; # https://github.com/kevinkreiser/prime_server/issues/95 - NIX_CFLAGS_COMPILE = [ "-Wno-error=unused-variable" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-variable"; meta = with lib; { description = "Non-blocking (web)server API for distributed computing and SOA based on zeromq"; diff --git a/pkgs/development/libraries/vtk/generic.nix b/pkgs/development/libraries/vtk/generic.nix index 482e6be7bbcf5..13fa257167eaf 100644 --- a/pkgs/development/libraries/vtk/generic.nix +++ b/pkgs/development/libraries/vtk/generic.nix @@ -46,7 +46,7 @@ in stdenv.mkDerivation rec { ImageIO OpenGL GLUT - ] ++ optional enablePython [ + ] ++ optionals enablePython [ pythonInterpreter ]; propagatedBuildInputs = optionals stdenv.isDarwin [ libobjc ]; diff --git a/pkgs/development/python-modules/datatable/default.nix b/pkgs/development/python-modules/datatable/default.nix index c5271e473e3ed..1519dc905de65 100644 --- a/pkgs/development/python-modules/datatable/default.nix +++ b/pkgs/development/python-modules/datatable/default.nix @@ -39,7 +39,7 @@ buildPythonPackage rec { checkInputs = [ docutils pytestCheckHook ]; LLVM = llvm; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${libcxx}/include/c++/v1"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${libcxx}/include/c++/v1"; pytestFlagsArray = let # ini file (not included in tarball) required to change python_files setting, diff --git a/pkgs/development/tools/misc/xxdiff/default.nix b/pkgs/development/tools/misc/xxdiff/default.nix index 42665a00b1478..4f2b42bb09708 100644 --- a/pkgs/development/tools/misc/xxdiff/default.nix +++ b/pkgs/development/tools/misc/xxdiff/default.nix @@ -20,7 +20,7 @@ mkDerivation rec { dontUseQmakeConfigure = true; # c++11 and above is needed for building with Qt 5.9+ - env.NIX_CFLAGS_COMPILE = [ "-std=c++14" ]; + env.NIX_CFLAGS_COMPILE = "-std=c++14"; sourceRoot = "source/src"; diff --git a/pkgs/development/tools/pxview/default.nix b/pkgs/development/tools/pxview/default.nix index 20049215a70d8..a718603e77f96 100644 --- a/pkgs/development/tools/pxview/default.nix +++ b/pkgs/development/tools/pxview/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-pxlib=${pxlib.out}" ]; # https://sourceforge.net/p/pxlib/bugs/12/ - LDFLAGS = "-lm"; + env.LDFLAGS = "-lm"; hardeningDisable = [ "format" ]; meta = with lib; { diff --git a/pkgs/development/tools/py-spy/default.nix b/pkgs/development/tools/py-spy/default.nix index 7a93d5ecbe03e..bf48e038f80a4 100644 --- a/pkgs/development/tools/py-spy/default.nix +++ b/pkgs/development/tools/py-spy/default.nix @@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec { sha256 = "sha256-7282DGLNHpKorNTHvpMLmqF2DrEVMIiQIzf5nTuJ7lc="; }; - NIX_CFLAGS_COMPILE = "-L${libunwind}/lib"; + env.NIX_CFLAGS_COMPILE = "-L${libunwind}/lib"; # error: linker `arm-linux-gnueabihf-gcc` not found preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' diff --git a/pkgs/development/tools/rust/cbindgen/default.nix b/pkgs/development/tools/rust/cbindgen/default.nix index da552600cdc2b..f9dfb08f9cf85 100644 --- a/pkgs/development/tools/rust/cbindgen/default.nix +++ b/pkgs/development/tools/rust/cbindgen/default.nix @@ -22,11 +22,11 @@ rustPlatform.buildRustPackage rec { checkFlags = [ # Disable tests that require rust unstable features # https://github.com/eqrion/cbindgen/issues/338 - "--skip test_expand" - "--skip test_bitfield" - "--skip lib_default_uses_debug_build" - "--skip lib_explicit_debug_build" - "--skip lib_explicit_release_build" + "--skip" "test_expand" + "--skip" "test_bitfield" + "--skip" "lib_default_uses_debug_build" + "--skip" "lib_explicit_debug_build" + "--skip" "lib_explicit_release_build" ]; meta = with lib; { diff --git a/pkgs/development/tools/shadered/default.nix b/pkgs/development/tools/shadered/default.nix index 01c16b1394685..0e0ea5d28269a 100644 --- a/pkgs/development/tools/shadered/default.nix +++ b/pkgs/development/tools/shadered/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { sfml ]; - NIX_CFLAGS_COMPILE = "-Wno-error=format-security"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-security"; meta = with lib; { description = "Lightweight, cross-platform & full-featured shader IDE"; diff --git a/pkgs/development/tools/tracy/default.nix b/pkgs/development/tools/tracy/default.nix index 4f0fad54c1b62..0e1c68cc537f8 100644 --- a/pkgs/development/tools/tracy/default.nix +++ b/pkgs/development/tools/tracy/default.nix @@ -17,9 +17,8 @@ stdenv.mkDerivation rec { ++ lib.optionals stdenv.isDarwin [ Carbon AppKit freetype ] ++ lib.optionals stdenv.isLinux [ gtk3 tbb ]; - NIX_CFLAGS_COMPILE = [ ] - ++ lib.optional stdenv.isLinux "-ltbb" - ++ lib.optional stdenv.cc.isClang "-faligned-allocation"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-ltbb" + + lib.optionalString stdenv.cc.isClang " -faligned-allocation"; buildPhase = '' make -j $NIX_BUILD_CORES -C profiler/build/unix release diff --git a/pkgs/misc/emulators/tilem/default.nix b/pkgs/misc/emulators/tilem/default.nix index d2252563d0a56..57884e24865ed 100644 --- a/pkgs/misc/emulators/tilem/default.nix +++ b/pkgs/misc/emulators/tilem/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ]; buildInputs = [ glib gnome2.gtk libticonv libtifiles2 libticables2 libticalcs2 ]; - NIX_CFLAGS_COMPILE = [ "-lm" ]; + env.NIX_CFLAGS_COMPILE = "-lm"; meta = with lib; { homepage = "http://lpg.ticalc.org/prj_tilem/"; description = "Emulator and debugger for Texas Instruments Z80-based graphing calculators"; diff --git a/pkgs/os-specific/linux/roccat-tools/default.nix b/pkgs/os-specific/linux/roccat-tools/default.nix index 1eba2511b9877..459a939389bea 100644 --- a/pkgs/os-specific/linux/roccat-tools/default.nix +++ b/pkgs/os-specific/linux/roccat-tools/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { "-DLIBDIR=lib" ]; - NIX_CFLAGS_COMPILE = [ "-I${harfbuzz.dev}/include/harfbuzz" ]; + env.NIX_CFLAGS_COMPILE = "-I${harfbuzz.dev}/include/harfbuzz"; meta = { description = "Tools to configure ROCCAT devices"; diff --git a/pkgs/servers/nosql/redis/default.nix b/pkgs/servers/nosql/redis/default.nix index b9809a9a105a1..a0cd8a2b2b823 100644 --- a/pkgs/servers/nosql/redis/default.nix +++ b/pkgs/servers/nosql/redis/default.nix @@ -31,12 +31,12 @@ stdenv.mkDerivation rec { # It's weird that the build isn't failing because of failure to compile dependencies, it's from failure to link them! makeFlags = [ "PREFIX=$(out)" ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" "MALLOC=libc" ] - ++ lib.optional (stdenv.isLinux && !stdenv.hostPlatform.isMusl) ["USE_SYSTEMD=yes"] + ++ lib.optionals (stdenv.isLinux && !stdenv.hostPlatform.isMusl) ["USE_SYSTEMD=yes"] ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [ "-std=c11" ]; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-std=c11"; doCheck = false; # needs tcl diff --git a/pkgs/servers/pulseaudio/pali.nix b/pkgs/servers/pulseaudio/pali.nix index cc11f98a82903..29c9db1ffe26c 100644 --- a/pkgs/servers/pulseaudio/pali.nix +++ b/pkgs/servers/pulseaudio/pali.nix @@ -180,9 +180,9 @@ stdenv.mkDerivation rec { # the alternative is to copy the files from /usr/include to src, but there are # probably a large number of files that would need to be copied (I stopped # after the seventh) - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I/usr/include"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I/usr/include"; - NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreServices -framework Cocoa -framework AudioUnit"; + env.NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreServices -framework Cocoa -framework AudioUnit"; postInstall = '' moveToOutput lib/cmake "$dev" diff --git a/pkgs/servers/xinetd/default.nix b/pkgs/servers/xinetd/default.nix index 3d130c93b784b..beeaa7bbbd608 100644 --- a/pkgs/servers/xinetd/default.nix +++ b/pkgs/servers/xinetd/default.nix @@ -18,8 +18,8 @@ stdenv.mkDerivation rec { buildInputs = [ libtirpc ]; - NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; - NIX_LDFLAGS = [ "-ltirpc" ]; + env.NIX_CFLAGS_COMPILE = "-I${libtirpc.dev}/include/tirpc"; + env.NIX_LDFLAGS = "-ltirpc"; meta = { description = "Secure replacement for inetd"; diff --git a/pkgs/tools/filesystems/wiimms-iso-tools/default.nix b/pkgs/tools/filesystems/wiimms-iso-tools/default.nix index 70c4450140987..98117c05fdf51 100644 --- a/pkgs/tools/filesystems/wiimms-iso-tools/default.nix +++ b/pkgs/tools/filesystems/wiimms-iso-tools/default.nix @@ -18,8 +18,8 @@ stdenv.mkDerivation rec { patchShebangs gen-text-file.sh ''; - NIX_CFLAGS_COMPILE = "-Wno-error=format-security"; - INSTALL_PATH = "$out"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-security"; + env.INSTALL_PATH = "$out"; installPhase = '' mkdir "$out" From 1f2c2a3680d9d209902c76a71e4eeed9c938f517 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 20 Mar 2021 16:39:16 -0600 Subject: [PATCH 221/323] uhd: fix cmake flags with structured-attrs --- pkgs/applications/radio/uhd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/radio/uhd/default.nix b/pkgs/applications/radio/uhd/default.nix index 9f2f39aab2c5d..d5ca04c3e73fe 100644 --- a/pkgs/applications/radio/uhd/default.nix +++ b/pkgs/applications/radio/uhd/default.nix @@ -82,7 +82,7 @@ stdenv.mkDerivation rec { # TODO: Check if this still needed # ABI differences GCC 7.1 # /nix/store/wd6r25miqbk9ia53pp669gn4wrg9n9cj-gcc-7.3.0/include/c++/7.3.0/bits/vector.tcc:394:7: note: parameter passing for argument of type 'std::vector::iterator {aka __gnu_cxx::__normal_iterator >}' changed in GCC 7.1 - ++ [ (lib.optionalString stdenv.isAarch32 "-DCMAKE_CXX_FLAGS=-Wno-psabi") ] + ++ lib.optional stdenv.isAarch32 "-DCMAKE_CXX_FLAGS=-Wno-psabi" ; # Python + Mako are always required for the build itself but not necessary for runtime. From 995e50f6b7cb41ac20c70f3a4a98d129ec96ffa9 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 20 Mar 2021 16:42:25 -0600 Subject: [PATCH 222/323] crystal: fix package builds with structured-attrs --- pkgs/development/compilers/crystal/build-package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/crystal/build-package.nix b/pkgs/development/compilers/crystal/build-package.nix index 67c8128f6b5d7..2d2eaf0a4638b 100644 --- a/pkgs/development/compilers/crystal/build-package.nix +++ b/pkgs/development/compilers/crystal/build-package.nix @@ -54,9 +54,9 @@ stdenv.mkDerivation (mkDerivationArgs // { ++ [ "runHook postConfigure" ] ); - CRFLAGS = lib.concatStringsSep " " defaultOptions; + env.CRFLAGS = lib.concatStringsSep " " defaultOptions; - PREFIX = placeholder "out"; + env.PREFIX = placeholder "out"; buildInputs = args.buildInputs or [ ] ++ [ crystal ] ++ lib.optional (format != "crystal") shards; @@ -66,7 +66,7 @@ stdenv.mkDerivation (mkDerivationArgs // { buildPhase = args.buildPhase or (lib.concatStringsSep "\n" ([ "runHook preBuild" ] ++ lib.optional (format == "make") - "make \${buildTargets:-build} $makeFlags" + "make \${buildTargets:-build} \"\${makeFlags[@]}\"" ++ lib.optionals (format == "crystal") (lib.mapAttrsToList (bin: attrs: '' crystal ${lib.escapeShellArgs ([ @@ -84,7 +84,7 @@ stdenv.mkDerivation (mkDerivationArgs // { installPhase = args.installPhase or (lib.concatStringsSep "\n" ([ "runHook preInstall" ] ++ lib.optional (format == "make") - "make \${installTargets:-install} $installFlags" + "make \${installTargets:-install} \"\${installFlags[@]}\"" ++ lib.optionals (format == "crystal") (map (bin: '' install -Dm555 ${lib.escapeShellArgs [ bin "${placeholder "out"}/bin/${bin}" ]} @@ -111,9 +111,9 @@ stdenv.mkDerivation (mkDerivationArgs // { checkPhase = args.checkPhase or (lib.concatStringsSep "\n" ([ "runHook preCheck" ] ++ lib.optional (format == "make") - "make \${checkTarget:-test} $checkFlags" + "make \${checkTarget:-test} \"\${checkFlags[@]}\"" ++ lib.optional (format != "make") - "crystal \${checkTarget:-spec} $checkFlags" + "crystal \${checkTarget:-spec} \"\${checkFlags[@]}\"" ++ [ "runHook postCheck" ])); doInstallCheck = args.doInstallCheck or true; From 74890f439c10b1bc5347a8ec2d38367beaa337a3 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 22 Mar 2021 09:49:59 -0600 Subject: [PATCH 223/323] treewide: fix package builds with structured-attrs --- pkgs/applications/audio/audacious/default.nix | 3 +- pkgs/applications/misc/barrier/default.nix | 2 +- .../evolution/evolution/default.nix | 2 +- pkgs/data/documentation/anarchism/default.nix | 2 +- pkgs/development/compilers/aspectj/builder.sh | 2 + .../compilers/graalvm/community-edition.nix | 11 ++-- pkgs/development/compilers/rust/rustfmt.nix | 6 +- .../go-modules/generic/default.nix | 2 +- .../libraries/appindicator-sharp/default.nix | 4 +- .../libraries/arrow-cpp/default.nix | 59 ++++++++++--------- .../ocaml-modules/ounit/default.nix | 2 +- pkgs/os-specific/linux/autofs/default.nix | 2 +- pkgs/tools/networking/atinout/default.nix | 2 +- pkgs/top-level/perl-packages.nix | 2 +- 14 files changed, 53 insertions(+), 48 deletions(-) diff --git a/pkgs/applications/audio/audacious/default.nix b/pkgs/applications/audio/audacious/default.nix index 82a2303e26b3b..7ab86a0a29b73 100644 --- a/pkgs/applications/audio/audacious/default.nix +++ b/pkgs/applications/audio/audacious/default.nix @@ -40,6 +40,7 @@ mkDerivation rec { # derivations, since they really expect to be in the same prefix. # This is slighly tricky. builder = builtins.toFile "builder.sh" '' + source .attrs.sh # First build audacious. ( source $stdenv/setup @@ -47,7 +48,7 @@ mkDerivation rec { ) # Then build the plugins. ( - nativeBuildInputs="$out $nativeBuildInputs" # to find audacious + nativeBuildInputs+=("''${outputs[out]}") # to find audacious source $stdenv/setup rm -rfv audacious-* src=$pluginsSrc diff --git a/pkgs/applications/misc/barrier/default.nix b/pkgs/applications/misc/barrier/default.nix index b9dbcf529be12..7bcf6abc74dc7 100644 --- a/pkgs/applications/misc/barrier/default.nix +++ b/pkgs/applications/misc/barrier/default.nix @@ -23,7 +23,7 @@ mkDerivation rec { ''; qtWrapperArgs = [ - ''--prefix PATH : ${lib.makeBinPath [ openssl ]}'' + "--prefix" "PATH" ":" (lib.makeBinPath [ openssl ]) ]; meta = { diff --git a/pkgs/applications/networking/mailreaders/evolution/evolution/default.nix b/pkgs/applications/networking/mailreaders/evolution/evolution/default.nix index f6bea3c83574f..881dafebf58a7 100644 --- a/pkgs/applications/networking/mailreaders/evolution/evolution/default.nix +++ b/pkgs/applications/networking/mailreaders/evolution/evolution/default.nix @@ -123,7 +123,7 @@ stdenv.mkDerivation rec { }; }; - PKG_CONFIG_LIBEDATASERVERUI_1_2_UIMODULEDIR = "${placeholder "out"}/lib/evolution-data-server/ui-modules"; + env.PKG_CONFIG_LIBEDATASERVERUI_1_2_UIMODULEDIR = "${placeholder "out"}/lib/evolution-data-server/ui-modules"; meta = with lib; { homepage = "https://wiki.gnome.org/Apps/Evolution"; diff --git a/pkgs/data/documentation/anarchism/default.nix b/pkgs/data/documentation/anarchism/default.nix index d0cda3da544c8..0299e5390f71a 100644 --- a/pkgs/data/documentation/anarchism/default.nix +++ b/pkgs/data/documentation/anarchism/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { sha256 = "04ylk0y5b3jml2awmyz7m1hnymni8y1n83m0k6ychdh0px8frhm5"; }; - phases = [ "unpackPhase" "postPatch" "installPhase" ]; + dontBuild = true; postPatch = '' substituteInPlace debian/anarchism.desktop \ diff --git a/pkgs/development/compilers/aspectj/builder.sh b/pkgs/development/compilers/aspectj/builder.sh index 3b43937200423..4c19dade25e81 100755 --- a/pkgs/development/compilers/aspectj/builder.sh +++ b/pkgs/development/compilers/aspectj/builder.sh @@ -1,3 +1,5 @@ +source .attrs.sh + source $stdenv/setup export JAVA_HOME=$jre diff --git a/pkgs/development/compilers/graalvm/community-edition.nix b/pkgs/development/compilers/graalvm/community-edition.nix index 3a8fca2c1a05b..55d43c4c40817 100644 --- a/pkgs/development/compilers/graalvm/community-edition.nix +++ b/pkgs/development/compilers/graalvm/community-edition.nix @@ -121,7 +121,6 @@ let } mkdir -p $out - arr=($srcs) # The tarball on Linux has the following directory structure: # @@ -132,7 +131,7 @@ let # graalvm-ce-java11-20.3.0/Contents/Home/* # # We therefor use --strip-components=1 vs 3 depending on the platform. - tar xf ''${arr[0]} -C $out --strip-components=${if stdenv.isLinux then "1" else "3"} + tar xf ''${srcs[0]} -C $out --strip-components=${if stdenv.isLinux then "1" else "3"} # Sanity check if [ ! -d $out/bin ]; then @@ -143,10 +142,10 @@ let exit 1 fi - unpack_jar ''${arr[1]} - unpack_jar ''${arr[2]} - unpack_jar ''${arr[3]} - unpack_jar ''${arr[4]} + unpack_jar ''${srcs[1]} + unpack_jar ''${srcs[2]} + unpack_jar ''${srcs[3]} + unpack_jar ''${srcs[4]} ''; installPhase = { diff --git a/pkgs/development/compilers/rust/rustfmt.nix b/pkgs/development/compilers/rust/rustfmt.nix index b3191c242feab..4370e3f8bf405 100644 --- a/pkgs/development/compilers/rust/rustfmt.nix +++ b/pkgs/development/compilers/rust/rustfmt.nix @@ -14,12 +14,12 @@ rustPlatform.buildRustPackage rec { buildInputs = lib.optional stdenv.isDarwin Security; # As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler - RUSTC_BOOTSTRAP = 1; + env.RUSTC_BOOTSTRAP = 1; # As of rustc 1.45.0, these env vars are required to build rustfmt (due to # https://github.com/rust-lang/rust/pull/72001) - CFG_RELEASE = "${rustPlatform.rust.rustc.version}-nightly"; - CFG_RELEASE_CHANNEL = "nightly"; + env.CFG_RELEASE = "${rustPlatform.rust.rustc.version}-nightly"; + env.CFG_RELEASE_CHANNEL = "nightly"; meta = with lib; { description = "A tool for formatting Rust code according to style guidelines"; diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 7c58b0007a67b..24916dffaa253 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -153,7 +153,7 @@ let echo "$d" | grep -q "\(/_\|examples\|Godeps\|testdata\)" && return 0 [ -n "$excludedPackages" ] && echo "$d" | grep -q "$excludedPackages" && return 0 local OUT - if ! OUT="$(go $cmd $buildFlags "''${buildFlagsArray[@]}" -v -p $NIX_BUILD_CORES $d 2>&1)"; then + if ! OUT="$(go $cmd "''${buildFlags[@]}" "''${buildFlagsArray[@]}" -v -p $NIX_BUILD_CORES $d 2>&1)"; then if ! echo "$OUT" | grep -qE '(no( buildable| non-test)?|build constraints exclude all) Go (source )?files'; then echo "$OUT" >&2 return 1 diff --git a/pkgs/development/libraries/appindicator-sharp/default.nix b/pkgs/development/libraries/appindicator-sharp/default.nix index 9eff4e3895ba1..cf076b6769ca8 100644 --- a/pkgs/development/libraries/appindicator-sharp/default.nix +++ b/pkgs/development/libraries/appindicator-sharp/default.nix @@ -31,8 +31,8 @@ stdenv.mkDerivation rec { libappindicator ]; - ac_cv_path_MDOC = "no"; - installFlagsArray = ["GAPIXMLDIR=/tmp/gapixml"]; + env.ac_cv_path_MDOC = "no"; + installFlags = [ "GAPIXMLDIR=/tmp/gapixml" ]; meta = { description = "Bindings for appindicator using gobject-introspection"; diff --git a/pkgs/development/libraries/arrow-cpp/default.nix b/pkgs/development/libraries/arrow-cpp/default.nix index 8a9074ccb9047..86e5cc94c87ae 100644 --- a/pkgs/development/libraries/arrow-cpp/default.nix +++ b/pkgs/development/libraries/arrow-cpp/default.nix @@ -30,22 +30,38 @@ in stdenv.mkDerivation rec { }; sourceRoot = "apache-arrow-${version}/cpp"; - ARROW_JEMALLOC_URL = fetchurl { - # From - # ./cpp/cmake_modules/ThirdpartyToolchain.cmake - # ./cpp/thirdparty/versions.txt - url = - "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2"; - sha256 = "1xl7z0vwbn5iycg7amka9jd6hxd8nmfk7nahi4p9w2bnw9f0wcrl"; - }; + env = { + ARROW_JEMALLOC_URL = toString (fetchurl { + # From + # ./cpp/cmake_modules/ThirdpartyToolchain.cmake + # ./cpp/thirdparty/versions.txt + url = + "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2"; + sha256 = "1xl7z0vwbn5iycg7amka9jd6hxd8nmfk7nahi4p9w2bnw9f0wcrl"; + }); - ARROW_MIMALLOC_URL = fetchurl { - # From - # ./cpp/cmake_modules/ThirdpartyToolchain.cmake - # ./cpp/thirdparty/versions.txt - url = - "https://github.com/microsoft/mimalloc/archive/v1.6.4.tar.gz"; - sha256 = "1b8av0974q70alcmaw5cwzbn6n9blnpmj721ik1qwmbbwwd6nqgs"; + ARROW_MIMALLOC_URL = toString (fetchurl { + # From + # ./cpp/cmake_modules/ThirdpartyToolchain.cmake + # ./cpp/thirdparty/versions.txt + url = + "https://github.com/microsoft/mimalloc/archive/v1.6.4.tar.gz"; + sha256 = "1b8av0974q70alcmaw5cwzbn6n9blnpmj721ik1qwmbbwwd6nqgs"; + }); + + ARROW_TEST_DATA = + lib.optionalString doInstallCheck "${arrow-testing}/data"; + PARQUET_TEST_DATA = + lib.optionalString doInstallCheck "${parquet-testing}/data"; + GTEST_FILTER = let + # Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11398 + filteredTests = lib.optionals stdenv.hostPlatform.isAarch64 [ + "TestFilterKernelWithNumeric/3.CompareArrayAndFilterRandomNumeric" + "TestFilterKernelWithNumeric/7.CompareArrayAndFilterRandomNumeric" + "TestCompareKernel.PrimitiveRandomTests" + ]; + in + lib.optionalString doInstallCheck "-${builtins.concatStringsSep ":" filteredTests}"; }; patches = [ @@ -112,19 +128,6 @@ in stdenv.mkDerivation rec { ] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF"; doInstallCheck = true; - ARROW_TEST_DATA = - if doInstallCheck then "${arrow-testing}/data" else null; - PARQUET_TEST_DATA = - if doInstallCheck then "${parquet-testing}/data" else null; - GTEST_FILTER = - if doInstallCheck then let - # Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11398 - filteredTests = lib.optionals stdenv.hostPlatform.isAarch64 [ - "TestFilterKernelWithNumeric/3.CompareArrayAndFilterRandomNumeric" - "TestFilterKernelWithNumeric/7.CompareArrayAndFilterRandomNumeric" - "TestCompareKernel.PrimitiveRandomTests" - ]; - in "-${builtins.concatStringsSep ":" filteredTests}" else null; installCheckInputs = [ perl which ]; installCheckPhase = let diff --git a/pkgs/development/ocaml-modules/ounit/default.nix b/pkgs/development/ocaml-modules/ounit/default.nix index e705dc93ed1bc..34ec3a605e4ce 100644 --- a/pkgs/development/ocaml-modules/ounit/default.nix +++ b/pkgs/development/ocaml-modules/ounit/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation { buildInputs = [ findlib ]; propagatedBuildInputs = [ ounit2 ]; - phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; + dontBuild = true; createFindlibDestdir = true; diff --git a/pkgs/os-specific/linux/autofs/default.nix b/pkgs/os-specific/linux/autofs/default.nix index 0bde35080e8b0..a1daf3c6bcab3 100644 --- a/pkgs/os-specific/linux/autofs/default.nix +++ b/pkgs/os-specific/linux/autofs/default.nix @@ -13,7 +13,7 @@ in stdenv.mkDerivation { }; preConfigure = '' - configureFlags="--enable-force-shutdown --enable-ignore-busy --with-path=$PATH" + configureFlags+=("--enable-force-shutdown" "--enable-ignore-busy" "--with-path=$PATH") export sssldir="${sssd}/lib/sssd/modules" export HAVE_SSS_AUTOFS=1 diff --git a/pkgs/tools/networking/atinout/default.nix b/pkgs/tools/networking/atinout/default.nix index 1a3ef39bef79b..7746c3fcdd259 100644 --- a/pkgs/tools/networking/atinout/default.nix +++ b/pkgs/tools/networking/atinout/default.nix @@ -5,7 +5,7 @@ stdenv.mkDerivation rec { version = "0.9.2-alpha"; env.NIX_CFLAGS_COMPILE = "-Werror=implicit-fallthrough=0"; - LANG = "C.UTF-8"; + env.LANG = "C.UTF-8"; nativeBuildInputs = [ ronn mount ]; src = fetchgit { diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index addd3ede75ce1..43c94595dd968 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -23204,7 +23204,7 @@ let url = "mirror://cpan/authors/id/M/MS/MSTPLBG/X11-XCB-0.18.tar.gz"; sha256 = "1cjpghw7cnackw20lbd7yzm222kz5bnrwz52f8ay24d1f4pwrnxf"; }; - AUTOMATED_TESTING = false; + env.AUTOMATED_TESTING = false; buildInputs = [ pkgs.xorg.libxcb pkgs.xorg.xcbproto pkgs.xorg.xcbutil pkgs.xorg.xcbutilwm ExtUtilsDepends ExtUtilsPkgConfig TestDeep TestException XSObjectMagic ]; propagatedBuildInputs = [ DataDump MouseXNativeTraits XMLDescent XMLSimple ]; env.NIX_CFLAGS_LINK = "-lxcb -lxcb-util -lxcb-xinerama -lxcb-icccm"; From f40274db3451b6fe1f21700a6851cf54c2c0c175 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 21 Apr 2021 19:59:36 -0500 Subject: [PATCH 224/323] treewide: fix package builds with structured-attrs --- pkgs/applications/blockchains/dashpay.nix | 2 +- pkgs/applications/graphics/tesseract/tesseract3.nix | 2 +- pkgs/applications/misc/cura/default.nix | 2 +- pkgs/applications/networking/sync/casync/default.nix | 2 +- pkgs/applications/science/misc/boinc/default.nix | 2 +- pkgs/applications/virtualization/crosvm/default.nix | 2 +- pkgs/data/fonts/comic-neue/default.nix | 2 -- pkgs/desktops/gnustep/make/builder.sh | 6 ++++-- pkgs/desktops/gnustep/make/setup-hook.sh | 2 ++ pkgs/development/compilers/dmd/default.nix | 2 +- pkgs/development/compilers/rust/clippy.nix | 2 +- pkgs/development/compilers/xa/dxa.nix | 5 ++--- pkgs/development/go-modules/generic/default.nix | 4 ++-- pkgs/development/interpreters/clips/default.nix | 2 +- .../interpreters/python/mk-python-derivation.nix | 4 +++- pkgs/development/libraries/libhandy/default.nix | 4 ++-- pkgs/development/libraries/libnest2d/default.nix | 2 +- pkgs/development/libraries/rocksdb/default.nix | 9 +++++---- pkgs/development/misc/resholve/deps.nix | 6 +++--- pkgs/development/misc/resholve/resholve.nix | 2 +- pkgs/development/python-modules/graphviz/default.nix | 4 ++-- pkgs/development/python-modules/pynest2d/default.nix | 2 +- .../tools/build-managers/apache-maven/builder.sh | 2 ++ pkgs/development/tools/build-managers/boot/builder.sh | 2 ++ pkgs/development/tools/misc/chruby/default.nix | 4 +--- pkgs/development/tools/misc/cwebbin/default.nix | 6 +++--- pkgs/games/commandergenius/default.nix | 4 ++-- pkgs/games/crawl/default.nix | 2 +- pkgs/games/dwarf-fortress/soundsense.nix | 1 - pkgs/misc/emulators/cdemu/libmirage.nix | 4 ++-- pkgs/os-specific/linux/dbus-broker/default.nix | 6 +++--- pkgs/servers/dict/wiktionary/builder.sh | 2 ++ pkgs/tools/audio/beets/default.nix | 2 +- pkgs/tools/compression/upx/default.nix | 2 +- pkgs/tools/inputmethods/skk/skk-dicts/default.nix | 2 +- pkgs/tools/misc/cloud-sql-proxy/default.nix | 2 +- pkgs/tools/misc/dynamic-colors/default.nix | 2 +- pkgs/tools/nix/cached-nix-shell/default.nix | 2 +- pkgs/tools/security/bitwarden_rs/default.nix | 2 +- pkgs/tools/security/browserpass/default.nix | 2 +- pkgs/top-level/perl-packages.nix | 2 +- 41 files changed, 64 insertions(+), 57 deletions(-) diff --git a/pkgs/applications/blockchains/dashpay.nix b/pkgs/applications/blockchains/dashpay.nix index ca1dd13e42519..4f8a737a5f837 100644 --- a/pkgs/applications/blockchains/dashpay.nix +++ b/pkgs/applications/blockchains/dashpay.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { miniupnpc protobuf qrencode util-linux ]; - configureFlags = [ "--with-boost-libdir=${boost.out}/lib --with-gui=no" ] + configureFlags = [ "--with-boost-libdir=${boost.out}/lib" "--with-gui=no" ] ++ optional enable_Upnp "--enable-upnp-default" ++ optional disable_Wallet "--disable-wallet" ++ optional disable_Daemon "--disable-daemon" diff --git a/pkgs/applications/graphics/tesseract/tesseract3.nix b/pkgs/applications/graphics/tesseract/tesseract3.nix index 7b9669bc465e4..82546afa193c5 100644 --- a/pkgs/applications/graphics/tesseract/tesseract3.nix +++ b/pkgs/applications/graphics/tesseract/tesseract3.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config autoreconfHook ]; buildInputs = [ leptonica libpng libtiff icu pango opencl-headers ]; - LIBLEPT_HEADERSDIR = "${leptonica}/include"; + env.LIBLEPT_HEADERSDIR = "${leptonica}/include"; meta = { description = "OCR engine"; diff --git a/pkgs/applications/misc/cura/default.nix b/pkgs/applications/misc/cura/default.nix index 46143747f6d95..57c1a1da95149 100644 --- a/pkgs/applications/misc/cura/default.nix +++ b/pkgs/applications/misc/cura/default.nix @@ -33,7 +33,7 @@ mkDerivation rec { makeWrapperArgs = [ # hacky workaround for https://github.com/NixOS/nixpkgs/issues/59901 - "--set OMP_NUM_THREADS 1" + "--set" "OMP_NUM_THREADS" "1" ]; postPatch = '' diff --git a/pkgs/applications/networking/sync/casync/default.nix b/pkgs/applications/networking/sync/casync/default.nix index 5bc29832c5f3b..933d5e3098f90 100644 --- a/pkgs/applications/networking/sync/casync/default.nix +++ b/pkgs/applications/networking/sync/casync/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation { patchShebangs test/http-server.py ''; - PKG_CONFIG_UDEV_UDEVDIR = "lib/udev"; + env.PKG_CONFIG_UDEV_UDEVDIR = "lib/udev"; mesonFlags = lib.optionals (!fuseSupport) [ "-Dfuse=false" ] ++ lib.optionals (!udevSupport) [ "-Dudev=false" ] ++ lib.optionals (!selinuxSupport) [ "-Dselinux=false" ]; diff --git a/pkgs/applications/science/misc/boinc/default.nix b/pkgs/applications/science/misc/boinc/default.nix index a814df6d6241b..e51a975a30f14 100644 --- a/pkgs/applications/science/misc/boinc/default.nix +++ b/pkgs/applications/science/misc/boinc/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { preConfigure = '' ./_autosetup - configureFlags="$configureFlags --sysconfdir=$out/etc" + configureFlags+=("--sysconfdir=$out/etc") ''; enableParallelBuilding = true; diff --git a/pkgs/applications/virtualization/crosvm/default.nix b/pkgs/applications/virtualization/crosvm/default.nix index 848b93a5381c7..1ea4f911a8e01 100644 --- a/pkgs/applications/virtualization/crosvm/default.nix +++ b/pkgs/applications/virtualization/crosvm/default.nix @@ -73,7 +73,7 @@ in cp seccomp/${arch}/* $out/share/policy/ ''; - CROSVM_CARGO_TEST_KERNEL_BINARY = + env.CROSVM_CARGO_TEST_KERNEL_BINARY = lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform) "${linux}/${stdenv.hostPlatform.linux-kernel.target}"; diff --git a/pkgs/data/fonts/comic-neue/default.nix b/pkgs/data/fonts/comic-neue/default.nix index df618aea81108..7485d435cb23a 100644 --- a/pkgs/data/fonts/comic-neue/default.nix +++ b/pkgs/data/fonts/comic-neue/default.nix @@ -10,8 +10,6 @@ stdenv.mkDerivation rec { stripRoot = false; # because it comes with a __MACOSX directory }; - phases = [ "unpackPhase" "installPhase" ]; - installPhase = '' mkdir -pv $out/share/{doc/${pname}-${version},fonts/{opentype,truetype,WOFF,WOFF2}} cp -v ${pname}-${version}/{FONTLOG,OFL-FAQ,OFL}.txt $out/share/doc/ diff --git a/pkgs/desktops/gnustep/make/builder.sh b/pkgs/desktops/gnustep/make/builder.sh index 66afe1271cae5..2204a5ace0f92 100644 --- a/pkgs/desktops/gnustep/make/builder.sh +++ b/pkgs/desktops/gnustep/make/builder.sh @@ -1,3 +1,5 @@ +source .attrs.sh + source $stdenv/setup preConfigure() { @@ -76,7 +78,7 @@ postInstall() { if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_DOC_INFO" in *"${tmp}"*) false;; *) true;; esac; then addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_INFO "$tmp" fi - + # write the config file echo GNUSTEP_MAKEFILES=$GNUSTEP_MAKEFILES >> $conf if [ -n "$NIX_GNUSTEP_SYSTEM_APPS" ]; then @@ -112,7 +114,7 @@ postInstall() { if [ -n "$NIX_GNUSTEP_SYSTEM_DOC_INFO" ]; then echo NIX_GNUSTEP_SYSTEM_DOC_INFO="$NIX_GNUSTEP_SYSTEM_DOC_INFO" >> $conf fi - + for i in $out/bin/*; do echo "wrapping $(basename $i)" wrapGSMake "$i" "$out/share/.GNUstep.conf" diff --git a/pkgs/desktops/gnustep/make/setup-hook.sh b/pkgs/desktops/gnustep/make/setup-hook.sh index b2b90f1e5222d..4af6519252f62 100644 --- a/pkgs/desktops/gnustep/make/setup-hook.sh +++ b/pkgs/desktops/gnustep/make/setup-hook.sh @@ -1,3 +1,5 @@ +out=${outputs[out]} + # this path is used by some packages to install additional makefiles export DESTDIR_GNUSTEP_MAKEFILES=$out/share/GNUstep/Makefiles diff --git a/pkgs/development/compilers/dmd/default.nix b/pkgs/development/compilers/dmd/default.nix index 4e8a762bcbf10..8a7116b51a486 100644 --- a/pkgs/development/compilers/dmd/default.nix +++ b/pkgs/development/compilers/dmd/default.nix @@ -86,7 +86,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper unzip which gdb git ] - ++ lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ + ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ Foundation ]); diff --git a/pkgs/development/compilers/rust/clippy.nix b/pkgs/development/compilers/rust/clippy.nix index a3597e9febf77..34bd936eb1183 100644 --- a/pkgs/development/compilers/rust/clippy.nix +++ b/pkgs/development/compilers/rust/clippy.nix @@ -13,7 +13,7 @@ rustPlatform.buildRustPackage { buildInputs = [ rustc rustc.llvm ] ++ lib.optionals stdenv.isDarwin [ Security ]; # fixes: error: the option `Z` is only accepted on the nightly compiler - RUSTC_BOOTSTRAP = 1; + env.RUSTC_BOOTSTRAP = 1; # Without disabling the test the build fails with: # error: failed to run custom build command for `rustc_llvm v0.0.0 diff --git a/pkgs/development/compilers/xa/dxa.nix b/pkgs/development/compilers/xa/dxa.nix index e0ff060de8d71..bd00e10aab875 100644 --- a/pkgs/development/compilers/xa/dxa.nix +++ b/pkgs/development/compilers/xa/dxa.nix @@ -18,9 +18,8 @@ stdenv.mkDerivation rec { dontConfigure = true; postPatch = '' - substituteInPlace \ - --replace "CC = gcc" "CC = cc' \ - Makefile + substituteInPlace Makefile \ + --replace "CC = gcc" "CC = cc" ''; installPhase = '' diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 24916dffaa253..9b0b86242fd06 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -55,7 +55,7 @@ let env = { inherit (go.env) GOOS GOARCH; GO111MODULE = "on"; - }; + } // args.env; patches = args.patches or []; preBuild = args.preBuild or ""; @@ -124,7 +124,7 @@ let inherit (go.env) GOOS GOARCH; GO111MODULE = "on"; GOFLAGS = "-mod=vendor" + lib.optionalString (!allowGoReference) " -trimpath"; - }; + } // args.env; configurePhase = args.configurePhase or '' runHook preConfigure diff --git a/pkgs/development/interpreters/clips/default.nix b/pkgs/development/interpreters/clips/default.nix index 64fd89008e335..cf7b9bda7f6bb 100644 --- a/pkgs/development/interpreters/clips/default.nix +++ b/pkgs/development/interpreters/clips/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { substituteInPlace core/makefile --replace 'gcc' '${stdenv.cc.targetPrefix}cc' ''; - makeFlags = [ "-C" "core" ]; + makeFlags = [ "-C core" ]; installPhase = '' runHook preInstall diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 737bcdea50308..814ec31091a11 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -149,7 +149,9 @@ let inherit strictDeps; - env.LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8"; + env = { + LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8"; + } // env; # Python packages don't have a checkPhase, only an installCheckPhase doCheck = false; diff --git a/pkgs/development/libraries/libhandy/default.nix b/pkgs/development/libraries/libhandy/default.nix index 4532edfd884b6..81d9a187b4229 100644 --- a/pkgs/development/libraries/libhandy/default.nix +++ b/pkgs/development/libraries/libhandy/default.nix @@ -65,8 +65,8 @@ stdenv.mkDerivation rec { ]; # Uses define_variable in pkg-config, but we still need it to use the glade output - PKG_CONFIG_GLADEUI_2_0_MODULEDIR = "${placeholder "glade"}/lib/glade/modules"; - PKG_CONFIG_GLADEUI_2_0_CATALOGDIR = "${placeholder "glade"}/share/glade/catalogs"; + env.PKG_CONFIG_GLADEUI_2_0_MODULEDIR = "${placeholder "glade"}/lib/glade/modules"; + env.PKG_CONFIG_GLADEUI_2_0_CATALOGDIR = "${placeholder "glade"}/share/glade/catalogs"; doCheck = true; diff --git a/pkgs/development/libraries/libnest2d/default.nix b/pkgs/development/libraries/libnest2d/default.nix index 1e666758f816b..b15f3fa441948 100644 --- a/pkgs/development/libraries/libnest2d/default.nix +++ b/pkgs/development/libraries/libnest2d/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ clipper nlopt boost ]; nativeBuildInputs = [ cmake ]; - CLIPPER_PATH = "${clipper.out}"; + env.CLIPPER_PATH = "${clipper.out}"; cmakeFlags = [ "-DLIBNEST2D_HEADER_ONLY=OFF" ]; meta = with lib; { diff --git a/pkgs/development/libraries/rocksdb/default.nix b/pkgs/development/libraries/rocksdb/default.nix index 60fc1f149fd65..e17edfe56a9dc 100644 --- a/pkgs/development/libraries/rocksdb/default.nix +++ b/pkgs/development/libraries/rocksdb/default.nix @@ -47,12 +47,13 @@ stdenv.mkDerivation rec { "-DWITH_GFLAGS=0" "-DUSE_RTTI=1" "-DROCKSDB_INSTALL_ON_WINDOWS=YES" # harmless elsewhere - (lib.optional + ] + ++ (lib.optional (stdenv.hostPlatform.isx86 && stdenv.hostPlatform.isLinux) "-DFORCE_SSE42=1") - (lib.optional enableLite "-DROCKSDB_LITE=1") - "-DFAIL_ON_WARNINGS=${if stdenv.hostPlatform.isMinGW then "NO" else "YES"}" - ] ++ lib.optional (!enableShared) "-DROCKSDB_BUILD_SHARED=0"; + ++ (lib.optional enableLite "-DROCKSDB_LITE=1") + ++ [ "-DFAIL_ON_WARNINGS=${if stdenv.hostPlatform.isMinGW then "NO" else "YES"}" ] + ++ lib.optional (!enableShared) "-DROCKSDB_BUILD_SHARED=0"; # otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]" hardeningDisable = lib.optional stdenv.hostPlatform.isWindows "format"; diff --git a/pkgs/development/misc/resholve/deps.nix b/pkgs/development/misc/resholve/deps.nix index 6a1d9c77b5a0c..2a11a0b2c26f2 100644 --- a/pkgs/development/misc/resholve/deps.nix +++ b/pkgs/development/misc/resholve/deps.nix @@ -80,7 +80,7 @@ rec { # TODO: not sure why I'm having to set this for nix-build... # can anyone tell if I'm doing something wrong? - SOURCE_DATE_EPOCH = 315532800; + env.SOURCE_DATE_EPOCH = 315532800; # These aren't, strictly speaking, nix/nixpkgs specific, but I've # had hell upstreaming them. Pulling from resholve source and @@ -103,10 +103,10 @@ rec { patchShebangs asdl build core doctools frontend native oil_lang ''; - _NIX_SHELL_LIBCMARK = "${cmark}/lib/libcmark${stdenv.hostPlatform.extensions.sharedLibrary}"; + env._NIX_SHELL_LIBCMARK = "${cmark}/lib/libcmark${stdenv.hostPlatform.extensions.sharedLibrary}"; # See earlier note on glibcLocales - LOCALE_ARCHIVE = lib.optionalString (stdenv.buildPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive"; + env.LOCALE_ARCHIVE = lib.optionalString (stdenv.buildPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive"; meta = { description = "A new unix shell"; diff --git a/pkgs/development/misc/resholve/resholve.nix b/pkgs/development/misc/resholve/resholve.nix index 4d039770ce0e5..48d48de2bb80e 100644 --- a/pkgs/development/misc/resholve/resholve.nix +++ b/pkgs/development/misc/resholve/resholve.nix @@ -58,7 +58,7 @@ python27Packages.buildPythonApplication { inherit doCheck; checkInputs = [ bats ]; - RESHOLVE_PATH = "${lib.makeBinPath [ file findutils gettext ]}"; + env.RESHOLVE_PATH = "${lib.makeBinPath [ file findutils gettext ]}"; checkPhase = '' # explicit interpreter for test suite diff --git a/pkgs/development/python-modules/graphviz/default.nix b/pkgs/development/python-modules/graphviz/default.nix index 1a0e6d903a474..eba31e0ab789c 100644 --- a/pkgs/development/python-modules/graphviz/default.nix +++ b/pkgs/development/python-modules/graphviz/default.nix @@ -31,9 +31,9 @@ buildPythonPackage rec { ]; # Fontconfig error: Cannot load default config file - FONTCONFIG_FILE = makeFontsConf { + env.FONTCONFIG_FILE = toString (makeFontsConf { fontDirectories = [ freefont_ttf ]; - }; + }); checkInputs = [ mock pytestCheckHook pytest-mock pytestcov ]; diff --git a/pkgs/development/python-modules/pynest2d/default.nix b/pkgs/development/python-modules/pynest2d/default.nix index 7ca72293382d3..2d72dad07a43f 100644 --- a/pkgs/development/python-modules/pynest2d/default.nix +++ b/pkgs/development/python-modules/pynest2d/default.nix @@ -16,7 +16,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ libnest2d sip clipper ]; nativeBuildInputs = [ cmake ]; - CLIPPER_PATH = "${clipper.out}"; + env.CLIPPER_PATH = "${clipper.out}"; postPatch = '' sed -i 's#''${Python3_SITEARCH}#${placeholder "out"}/${python3.sitePackages}#' cmake/SIPMacros.cmake diff --git a/pkgs/development/tools/build-managers/apache-maven/builder.sh b/pkgs/development/tools/build-managers/apache-maven/builder.sh index dcc38b9ec74a1..553d0ff4a4166 100644 --- a/pkgs/development/tools/build-managers/apache-maven/builder.sh +++ b/pkgs/development/tools/build-managers/apache-maven/builder.sh @@ -1,3 +1,5 @@ +source .attrs.sh + source $stdenv/setup unpackPhase diff --git a/pkgs/development/tools/build-managers/boot/builder.sh b/pkgs/development/tools/build-managers/boot/builder.sh index c1481dc6a1445..744a335bd178f 100644 --- a/pkgs/development/tools/build-managers/boot/builder.sh +++ b/pkgs/development/tools/build-managers/boot/builder.sh @@ -1,3 +1,5 @@ +source .attrs.sh + source $stdenv/setup boot_bin=$out/bin/boot diff --git a/pkgs/development/tools/misc/chruby/default.nix b/pkgs/development/tools/misc/chruby/default.nix index bcc0687f55b60..12d9ca76e8301 100644 --- a/pkgs/development/tools/misc/chruby/default.nix +++ b/pkgs/development/tools/misc/chruby/default.nix @@ -19,9 +19,7 @@ in stdenv.mkDerivation rec { sha256 = "1894g6fymr8kra9vwhbmnrcr58l022mcd7g9ans4zd3izla2j3gx"; }; - phases = [ "unpackPhase" "patchPhase" "installPhase" "fixupPhase" ]; - - patches = lib.optionalString (rubies != null) [ + patches = lib.optionals (rubies != null) [ ./env.patch ]; diff --git a/pkgs/development/tools/misc/cwebbin/default.nix b/pkgs/development/tools/misc/cwebbin/default.nix index 3ab8800f3c4e2..00a05f467e8c6 100644 --- a/pkgs/development/tools/misc/cwebbin/default.nix +++ b/pkgs/development/tools/misc/cwebbin/default.nix @@ -32,13 +32,13 @@ stdenv.mkDerivation rec { buildPhase = '' zcat ${cweb} | tar -xvpf - - make -f Makefile.unix boot $makeFlags - make -f Makefile.unix cautiously $makeFlags + make -f Makefile.unix boot "''${makeFlags[@]}" + make -f Makefile.unix cautiously "''${makeFlags[@]}" ''; installPhase = '' mkdir -p $out/share/man/man1 $out/share/texmf/tex/generic $out/share/emacs $out/lib - make -f Makefile.unix install $makeFlags + make -f Makefile.unix install "''${makeFlags[@]}" ''; meta = with lib; { diff --git a/pkgs/games/commandergenius/default.nix b/pkgs/games/commandergenius/default.nix index 725cc5231c7ef..d648324b66338 100644 --- a/pkgs/games/commandergenius/default.nix +++ b/pkgs/games/commandergenius/default.nix @@ -16,8 +16,8 @@ stdenv.mkDerivation rec { buildInputs = [ SDL2 SDL2_image SDL2_mixer libGL boost libvorbis zlib curl python3 ]; preConfigure = '' - export cmakeFlags="$cmakeFlags -DCMAKE_INSTALL_PREFIX=$out -DSHAREDIR=$out/share" - export makeFlags="$makeFlags DESTDIR=$(out)" + export cmakeFlags+=(-DCMAKE_INSTALL_PREFIX=$out -DSHAREDIR=$out/share) + export makeFlags+=(DESTDIR=$(out)) ''; nativeBuildInputs = [ cmake pkg-config ]; diff --git a/pkgs/games/crawl/default.nix b/pkgs/games/crawl/default.nix index 11ac23fcef3ac..3557f8e4260bd 100644 --- a/pkgs/games/crawl/default.nix +++ b/pkgs/games/crawl/default.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { rm -rf contrib ''; - fontsPath = lib.optionalString tileMode dejavu_fonts; + env.fontsPath = toString (lib.optionalString tileMode dejavu_fonts); makeFlags = [ "prefix=${placeholder "out"}" "FORCE_CC=${stdenv.cc.targetPrefix}cc" "FORCE_CXX=${stdenv.cc.targetPrefix}c++" "HOSTCXX=${buildPackages.stdenv.cc.targetPrefix}c++" "FORCE_PKGCONFIG=y" diff --git a/pkgs/games/dwarf-fortress/soundsense.nix b/pkgs/games/dwarf-fortress/soundsense.nix index a59c873069039..9a825d0f6c719 100644 --- a/pkgs/games/dwarf-fortress/soundsense.nix +++ b/pkgs/games/dwarf-fortress/soundsense.nix @@ -19,7 +19,6 @@ stdenv.mkDerivation rec { url = "http://df.zweistein.cz/soundsense/soundSense_${version}.zip"; sha256 = "1gkrs69l3xsh858yjp204ddp29m668j630akm7arssc9359wxqkk"; }; - phases = [ "unpackPhase" "buildPhase" "installPhase" ]; nativeBuildInputs = [ dos2unix ]; buildPhase = '' dos2unix soundSense.sh diff --git a/pkgs/misc/emulators/cdemu/libmirage.nix b/pkgs/misc/emulators/cdemu/libmirage.nix index 0b8090ce41d2c..20556b9a686c5 100644 --- a/pkgs/misc/emulators/cdemu/libmirage.nix +++ b/pkgs/misc/emulators/cdemu/libmirage.nix @@ -10,8 +10,8 @@ let pkg = import ./base.nix { in callPackage pkg { buildInputs = [ glib libsndfile zlib bzip2 lzma libsamplerate intltool ]; drvParams = { - PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "out"}/share/gir-1.0"; - PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "${placeholder "out"}/lib/girepository-1.0"; + env.PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "out"}/share/gir-1.0"; + env.PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "${placeholder "out"}/lib/girepository-1.0"; nativeBuildInputs = [ cmake gobject-introspection pkg-config ]; propagatedBuildInputs = [ pcre util-linux libselinux libsepol ]; }; diff --git a/pkgs/os-specific/linux/dbus-broker/default.nix b/pkgs/os-specific/linux/dbus-broker/default.nix index bffc90260c18a..35e0ad858fc57 100644 --- a/pkgs/os-specific/linux/dbus-broker/default.nix +++ b/pkgs/os-specific/linux/dbus-broker/default.nix @@ -17,9 +17,9 @@ stdenv.mkDerivation rec { buildInputs = [ dbus linuxHeaders systemd ]; - PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system"; - PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user"; - PKG_CONFIG_SYSTEMD_CATALOGDIR = "${placeholder "out"}/lib/systemd/catalog"; + env.PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system"; + env.PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user"; + env.PKG_CONFIG_SYSTEMD_CATALOGDIR = "${placeholder "out"}/lib/systemd/catalog"; postInstall = '' install -Dm644 $src/README.md $out/share/doc/dbus-broker/README diff --git a/pkgs/servers/dict/wiktionary/builder.sh b/pkgs/servers/dict/wiktionary/builder.sh index 65652ad4bdbfd..af1b84b7f52be 100644 --- a/pkgs/servers/dict/wiktionary/builder.sh +++ b/pkgs/servers/dict/wiktionary/builder.sh @@ -1,3 +1,5 @@ +source .attrs.sh + source $stdenv/setup mkdir -p $out/share/dictd/ diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index a3eedf3ea47ec..7fd54e38974b3 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -261,7 +261,7 @@ in pythonPackages.buildPythonApplication rec { runHook postInstallCheck ''; - makeWrapperArgs = [ "--set GI_TYPELIB_PATH \"$GI_TYPELIB_PATH\"" "--set GST_PLUGIN_SYSTEM_PATH_1_0 \"$GST_PLUGIN_SYSTEM_PATH_1_0\"" ]; + makeWrapperArgs = [ "--set" "GI_TYPELIB_PATH" "\"$GI_TYPELIB_PATH\"" "--set" "GST_PLUGIN_SYSTEM_PATH_1_0" "\"$GST_PLUGIN_SYSTEM_PATH_1_0\"" ]; passthru = { # FIXME: remove in favor of pkgs.beetsExternalPlugins diff --git a/pkgs/tools/compression/upx/default.nix b/pkgs/tools/compression/upx/default.nix index 3b92321c3459c..df5c04f3ff9cf 100644 --- a/pkgs/tools/compression/upx/default.nix +++ b/pkgs/tools/compression/upx/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { export UPX_UCLDIR=${ucl} ''; - makeFlags = [ "-C" "src" "CHECK_WHITESPACE=true" ]; + makeFlags = [ "-C src" "CHECK_WHITESPACE=true" ]; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/tools/inputmethods/skk/skk-dicts/default.nix b/pkgs/tools/inputmethods/skk/skk-dicts/default.nix index bc9aa73c2fc6b..a9fc8c7ed3167 100644 --- a/pkgs/tools/inputmethods/skk/skk-dicts/default.nix +++ b/pkgs/tools/inputmethods/skk/skk-dicts/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation { } mkdir -p $out/share - for src in $srcs; do + for src in "''${srcs[@]}"; do dst=$out/share/$(dictname $src) echo ";;; -*- coding: utf-8 -*-" > $dst # libskk requires this on the first line iconv -f EUC-JP -t UTF-8 $src |\ diff --git a/pkgs/tools/misc/cloud-sql-proxy/default.nix b/pkgs/tools/misc/cloud-sql-proxy/default.nix index 552ea140d6089..0d5d9a091f77c 100644 --- a/pkgs/tools/misc/cloud-sql-proxy/default.nix +++ b/pkgs/tools/misc/cloud-sql-proxy/default.nix @@ -16,7 +16,7 @@ buildGoPackage rec { goDeps = ./deps.nix; - buildFlagsArray = [ "-ldflags=" "-X main.versionString=${version}" ]; + buildFlagsArray = [ "-ldflags=-X main.versionString=${version}" ]; meta = with lib; { description = "An authenticating proxy for Second Generation Google Cloud SQL databases"; diff --git a/pkgs/tools/misc/dynamic-colors/default.nix b/pkgs/tools/misc/dynamic-colors/default.nix index c0ff0fec328a2..1422ded67ca21 100644 --- a/pkgs/tools/misc/dynamic-colors/default.nix +++ b/pkgs/tools/misc/dynamic-colors/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "0i63570z9aqbxa8ixh4ayb3akgjdnlqyl2sbf9d7x8f1pxhk5kd5"; }; - PREFIX = placeholder "out"; + env.PREFIX = placeholder "out"; postPatch = '' substituteInPlace bin/dynamic-colors \ diff --git a/pkgs/tools/nix/cached-nix-shell/default.nix b/pkgs/tools/nix/cached-nix-shell/default.nix index 853bf87346f24..fb2ec5485e57a 100644 --- a/pkgs/tools/nix/cached-nix-shell/default.nix +++ b/pkgs/tools/nix/cached-nix-shell/default.nix @@ -24,7 +24,7 @@ in rustPlatform.buildRustPackage rec { # The BLAKE3 C library is intended to be built by the project depending on it # rather than as a standalone library. # https://github.com/BLAKE3-team/BLAKE3/blob/0.3.1/c/README.md#building - BLAKE3_CSRC = "${blake3-src}/c"; + env.BLAKE3_CSRC = "${blake3-src}/c"; nativeBuildInputs = [ ronn ]; diff --git a/pkgs/tools/security/bitwarden_rs/default.nix b/pkgs/tools/security/bitwarden_rs/default.nix index 2cce00693a4fa..5cc9eb6ef320b 100644 --- a/pkgs/tools/security/bitwarden_rs/default.nix +++ b/pkgs/tools/security/bitwarden_rs/default.nix @@ -23,7 +23,7 @@ in rustPlatform.buildRustPackage rec { ++ optional (dbBackend == "mysql") libmysqlclient ++ optional (dbBackend == "postgresql") postgresql; - RUSTC_BOOTSTRAP = 1; + env.RUSTC_BOOTSTRAP = 1; cargoSha256 = "0ga7ahlszja8ilng8xsrwdy7zy6bbci4mf00lknladjhlw16wibf"; cargoBuildFlags = [ featuresFlag ]; diff --git a/pkgs/tools/security/browserpass/default.nix b/pkgs/tools/security/browserpass/default.nix index 9aec14e0a418b..016763ef1b319 100644 --- a/pkgs/tools/security/browserpass/default.nix +++ b/pkgs/tools/security/browserpass/default.nix @@ -25,7 +25,7 @@ buildGoModule rec { sed -i -e 's/INSTALL :=.*/INSTALL := install/' Makefile ''; - DESTDIR = placeholder "out"; + env.DESTDIR = placeholder "out"; postConfigure = '' make configure diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 43c94595dd968..3e73fbc046188 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -5731,7 +5731,7 @@ let sha256 = "1k6n261nrrcll9wxn5xwi4ibpavqv1il96687k62mbpznzl2gx37"; }; - SYBASE = pkgs.freetds; + env.SYBASE = toString pkgs.freetds; buildInputs = [ pkgs.freetds ]; propagatedBuildInputs = [ DBI ]; From 14dc2646c07d4d38215ecf3767719fcdf2058390 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 23 Apr 2021 14:14:37 -0500 Subject: [PATCH 225/323] wrapPythonPrograms: handle pythonPath correctly --- pkgs/development/interpreters/python/wrap.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/interpreters/python/wrap.sh b/pkgs/development/interpreters/python/wrap.sh index f10ba003432be..46270026e90f4 100644 --- a/pkgs/development/interpreters/python/wrap.sh +++ b/pkgs/development/interpreters/python/wrap.sh @@ -1,13 +1,14 @@ # Wrapper around wrapPythonProgramsIn, below. The $pythonPath # variable is passed in from the buildPythonPackage function. wrapPythonPrograms() { - wrapPythonProgramsIn "$out/bin" "$out $pythonPath" + local pythonPath=($out "${pythonPath[@]}") + wrapPythonProgramsIn "$out/bin" "${pythonPath[@]}" } # Builds environment variables like PYTHONPATH and PATH walking through closure # of dependencies. buildPythonPath() { - local pythonPath="$1" + local pythonPath=("$@") local path # Create an empty table of python paths (see doc on _addToPythonPath @@ -18,7 +19,7 @@ buildPythonPath() { program_PATH= pythonPathsSeen["@pythonHost@"]=1 addToSearchPath program_PATH @pythonHost@/bin - for path in $pythonPath; do + for path in "${pythonPath[@]}"; do _addToPythonPath $path done } @@ -41,10 +42,11 @@ patchPythonScript() { # suffix). wrapPythonProgramsIn() { local dir="$1" - local pythonPath="$2" + shift + local pythonPath=("$@") local f - buildPythonPath "$pythonPath" + buildPythonPath "${pythonPath[@]}" # Find all regular files in the output directory that are executable. if [ -d "$dir" ]; then From 2524d3ca89acdf577ae0ef954a22e635a40e7641 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 23 Apr 2021 18:31:57 -0500 Subject: [PATCH 226/323] treewide: fix structured-attrs eval failures --- pkgs/development/go-modules/generic/default.nix | 4 ++-- .../matrix-synapse/matrix-appservice-irc/node-composition.nix | 2 +- pkgs/servers/monitoring/zabbix/agent2.nix | 2 -- pkgs/tools/audio/botamusique/default.nix | 2 +- pkgs/top-level/all-packages.nix | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 9b0b86242fd06..367ee64b85a2c 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -55,7 +55,7 @@ let env = { inherit (go.env) GOOS GOARCH; GO111MODULE = "on"; - } // args.env; + } // (args.env or {}); patches = args.patches or []; preBuild = args.preBuild or ""; @@ -124,7 +124,7 @@ let inherit (go.env) GOOS GOARCH; GO111MODULE = "on"; GOFLAGS = "-mod=vendor" + lib.optionalString (!allowGoReference) " -trimpath"; - } // args.env; + } // (args.env or {}); configurePhase = args.configurePhase or '' runHook preConfigure diff --git a/pkgs/servers/matrix-synapse/matrix-appservice-irc/node-composition.nix b/pkgs/servers/matrix-synapse/matrix-appservice-irc/node-composition.nix index e0d21f7d44d36..e56cb9176e92b 100644 --- a/pkgs/servers/matrix-synapse/matrix-appservice-irc/node-composition.nix +++ b/pkgs/servers/matrix-synapse/matrix-appservice-irc/node-composition.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../../development/node-packages/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile; + inherit (pkgs) stdenv lib python2 runCommand writeTextFile jq; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/pkgs/servers/monitoring/zabbix/agent2.nix b/pkgs/servers/monitoring/zabbix/agent2.nix index 1deada4363740..ef8f8c7491ddb 100644 --- a/pkgs/servers/monitoring/zabbix/agent2.nix +++ b/pkgs/servers/monitoring/zabbix/agent2.nix @@ -17,8 +17,6 @@ import ./versions.nix ({ version, sha256 }: nativeBuildInputs = [ autoreconfHook pkg-config ]; buildInputs = [ libiconv openssl pcre zlib ]; - inherit (buildGoModule.go) GOOS GOARCH; - # need to provide GO* env variables & patch for reproducibility postPatch = '' substituteInPlace src/go/Makefile.am \ diff --git a/pkgs/tools/audio/botamusique/default.nix b/pkgs/tools/audio/botamusique/default.nix index 11f228ea6919c..3655a12d6f19f 100644 --- a/pkgs/tools/audio/botamusique/default.nix +++ b/pkgs/tools/audio/botamusique/default.nix @@ -15,7 +15,7 @@ let nodejs = pkgs.nodejs-12_x; nodeEnv = import ../../../development/node-packages/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile; + inherit (pkgs) stdenv lib python2 runCommand writeTextFile jq; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 76c8c91ecfd98..cc99874cd3edb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11232,7 +11232,7 @@ in ocsigen-i18n = callPackage ../development/tools/ocaml/ocsigen-i18n { }; opa = callPackage ../development/compilers/opa { - ocamlPackages = ocaml-ng.ocamlPackages_4_04; + ocamlPackages = ocaml-ng.ocamlPackages_4_05; }; opaline = callPackage ../development/tools/ocaml/opaline { }; From e62cfc97add1319fbeb7664f632b28baaf35b82f Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sat, 3 Apr 2021 11:06:49 +0200 Subject: [PATCH 227/323] pythonPackages.tappy: init at 3.0 --- .../python-modules/tappy/default.nix | 29 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/development/python-modules/tappy/default.nix diff --git a/pkgs/development/python-modules/tappy/default.nix b/pkgs/development/python-modules/tappy/default.nix new file mode 100644 index 0000000000000..9e0b83bc925d6 --- /dev/null +++ b/pkgs/development/python-modules/tappy/default.nix @@ -0,0 +1,29 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchPypi +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "tap.py"; + version = "3.0"; + + disabled = pythonOlder "3.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-9e7u6/1k5T0yZhdSu0wohYmjuru5bbPzkaTsKfE1nHA="; + }; + + checkInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "tap" ]; + + meta = with lib; { + homepage = "https://github.com/python-tap/tappy"; + description = "A set of tools for working with the Test Anything Protocol (TAP) in Python"; + license = licenses.bsd2; + maintainers = with maintainers; [ sfrijters ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fe2313d473ba7..5a1cc005a37e5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8380,6 +8380,8 @@ in { tailer = callPackage ../development/python-modules/tailer { }; + tappy = callPackage ../development/python-modules/tappy { }; + tarman = callPackage ../development/python-modules/tarman { }; tasklib = callPackage ../development/python-modules/tasklib { }; From c447fb48791b8b622166ca73e85d222e2c243624 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 21 Mar 2021 07:28:27 +0000 Subject: [PATCH 228/323] =?UTF-8?q?tracker:=203.0.3=20=E2=86=92=203.1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also reverts #118823 Co-Authored-By: Bastian Köcher Co-Authored-By: Stefan Frijters --- .../development/libraries/tracker/default.nix | 32 ++++++++++++------- .../libraries/tracker/fix-docs.patch | 28 ++++++++++++++++ 2 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 pkgs/development/libraries/tracker/fix-docs.patch diff --git a/pkgs/development/libraries/tracker/default.nix b/pkgs/development/libraries/tracker/default.nix index fae10f2b1b4a6..0af1476e7e26a 100644 --- a/pkgs/development/libraries/tracker/default.nix +++ b/pkgs/development/libraries/tracker/default.nix @@ -1,5 +1,6 @@ { lib, stdenv , fetchurl +, fetchpatch , gettext , meson , ninja @@ -27,15 +28,15 @@ , substituteAll }: -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { pname = "tracker"; - version = "3.0.3"; + version = "3.1.1"; outputs = [ "out" "dev" "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "sha256-b1yEqzvh7aUgUBsq7XIhYWoM8VKRDFN3V7U4vAXv/KM="; + sha256 = "sha256-Q3bi6YRUBm9E96JC5FuZs7/kwDtn+rGauw7Vhsp0iuc="; }; patches = [ @@ -43,6 +44,17 @@ stdenv.mkDerivation (rec { src = ./fix-paths.patch; inherit asciidoc; }) + + # Add missing build target dependencies to fix parallel building of docs. + # TODO: Upstream this. + ./fix-docs.patch + + # Fix 32bit datetime issue, use this upstream patch until 3.1.2 lands + # https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/401 + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/tracker/merge_requests/401.patch"; + sha256 = "QEf+ciGkkCzanmtGO0aig6nAxd+NxjvuNi4RbNOwZEA="; + }) ]; nativeBuildInputs = [ @@ -74,22 +86,23 @@ stdenv.mkDerivation (rec { libstemmer ]; - checkInputs = [ - python3.pkgs.pygobject3 + checkInputs = with python3.pkgs; [ + pygobject3 + tappy ]; mesonFlags = [ "-Ddocs=true" ]; - # https://gitlab.gnome.org/GNOME/tracker/-/issues/292#note_1075369 - doCheck = !stdenv.isi686; + doCheck = true; postPatch = '' patchShebangs utils/g-ir-merge/g-ir-merge patchShebangs utils/data-generators/cc/generate patchShebangs tests/functional-tests/test-runner.sh.in patchShebangs tests/functional-tests/*.py + patchShebangs examples/python/endpoint.py ''; preCheck = '' @@ -134,8 +147,3 @@ stdenv.mkDerivation (rec { platforms = platforms.linux; }; } - // lib.optionalAttrs stdenv.isi686 { - # TMP: fatal error: libtracker-sparql/tracker-sparql-enum-types.h: No such file or directory - enableParallelBuilding = false; - } -) diff --git a/pkgs/development/libraries/tracker/fix-docs.patch b/pkgs/development/libraries/tracker/fix-docs.patch new file mode 100644 index 0000000000000..a6ff84cda3e58 --- /dev/null +++ b/pkgs/development/libraries/tracker/fix-docs.patch @@ -0,0 +1,28 @@ +diff --git a/docs/reference/libtracker-sparql/examples/meson.build b/docs/reference/libtracker-sparql/examples/meson.build +index 1cb1d9f3f..313c72345 100644 +--- a/docs/reference/libtracker-sparql/examples/meson.build ++++ b/docs/reference/libtracker-sparql/examples/meson.build +@@ -1,20 +1,20 @@ + executable( + 'readonly-example', + 'readonly-example.c', +- dependencies: tracker_sparql_dep, ++ dependencies: [tracker_common_dep, tracker_sparql_dep], + build_by_default: true + ) + + executable( + 'writeonly-example', + 'writeonly-example.c', +- dependencies: tracker_sparql_dep, ++ dependencies: [tracker_common_dep, tracker_sparql_dep], + build_by_default: true + ) + + executable( + 'writeonly-with-blank-nodes-example', + 'writeonly-with-blank-nodes-example.c', +- dependencies: tracker_sparql_dep, ++ dependencies: [tracker_common_dep, tracker_sparql_dep], + build_by_default: true + ) From 41358258fbbb5af33d0aa72a448946f89f013cca Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 24 Apr 2021 17:10:30 -0500 Subject: [PATCH 229/323] treewide: structured-attrs eval fixes --- pkgs/applications/audio/aacgain/default.nix | 2 +- pkgs/applications/audio/oxefmsynth/default.nix | 2 +- pkgs/applications/misc/qlcplus/default.nix | 2 +- pkgs/applications/networking/calls/default.nix | 2 +- pkgs/applications/video/vlc/default.nix | 4 ++-- .../virtualization/looking-glass-client/default.nix | 2 +- pkgs/desktops/xfce/core/xfce4-panel/default.nix | 2 +- pkgs/development/compilers/llvm/12/compiler-rt/default.nix | 5 ++--- pkgs/development/compilers/llvm/12/llvm/default.nix | 2 +- pkgs/development/libraries/mbedtls/default.nix | 6 ++---- pkgs/development/libraries/openvino/default.nix | 2 +- .../tools/poetry2nix/poetry2nix/mk-poetry-dep.nix | 4 ++-- pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix | 4 ++-- pkgs/games/pinball/default.nix | 6 ++---- pkgs/tools/filesystems/curlftpfs/default.nix | 2 +- 15 files changed, 21 insertions(+), 26 deletions(-) diff --git a/pkgs/applications/audio/aacgain/default.nix b/pkgs/applications/audio/aacgain/default.nix index 0f9b511d4553f..0d30a24e4487f 100644 --- a/pkgs/applications/audio/aacgain/default.nix +++ b/pkgs/applications/audio/aacgain/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation { # -Wnarrowing is enabled by default in recent GCC versions, # causing compilation to fail. - NIX_CFLAGS_COMPILE = "-Wno-narrowing"; + env.NIX_CFLAGS_COMPILE = "-Wno-narrowing"; postPatch = '' ( diff --git a/pkgs/applications/audio/oxefmsynth/default.nix b/pkgs/applications/audio/oxefmsynth/default.nix index 427029f3c863f..8f231b33395f1 100644 --- a/pkgs/applications/audio/oxefmsynth/default.nix +++ b/pkgs/applications/audio/oxefmsynth/default.nix @@ -22,7 +22,7 @@ in stdenv.mkDerivation rec { sha256 = "1rk71ls33a38wx8i22plsi7d89cqqxrfxknq5i4f9igsw1ipm4gn"; }; - NIX_CFLAGS_COMPILE = [ "-Wno-error=narrowing" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=narrowing"; buildFlags = [ "VSTSDK_PATH=${vst-sdk}/VST2_SDK" ]; diff --git a/pkgs/applications/misc/qlcplus/default.nix b/pkgs/applications/misc/qlcplus/default.nix index 439af2b8c01e6..d26e19d1e5c2e 100644 --- a/pkgs/applications/misc/qlcplus/default.nix +++ b/pkgs/applications/misc/qlcplus/default.nix @@ -29,7 +29,7 @@ mkDerivation rec { qmakeFlags = [ "INSTALLROOT=$(out)" ]; - NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; postPatch = '' patchShebangs . diff --git a/pkgs/applications/networking/calls/default.nix b/pkgs/applications/networking/calls/default.nix index 8937404e91d33..12eba0f168fc2 100644 --- a/pkgs/applications/networking/calls/default.nix +++ b/pkgs/applications/networking/calls/default.nix @@ -72,7 +72,7 @@ stdenv.mkDerivation rec { xvfb_run ]; - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; mesonFlags = [ "-Dgtk_doc=true" diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix index adb7ba970e294..f896d33fe66d8 100644 --- a/pkgs/applications/video/vlc/default.nix +++ b/pkgs/applications/video/vlc/default.nix @@ -54,11 +54,11 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - LIVE555_PREFIX = if (!stdenv.hostPlatform.isAarch64) then live555 else null; + env.LIVE555_PREFIX = optionalString (!stdenv.hostPlatform.isAarch64) (toString live555); # vlc depends on a c11-gcc wrapper script which we don't have so we need to # set the path to the compiler - BUILDCC = "${stdenv.cc}/bin/gcc"; + env.BUILDCC = "${stdenv.cc}/bin/gcc"; postPatch = '' substituteInPlace modules/text_renderer/freetype/platform_fonts.h --replace \ diff --git a/pkgs/applications/virtualization/looking-glass-client/default.nix b/pkgs/applications/virtualization/looking-glass-client/default.nix index 50b418e30c1c3..bf85a21000920 100644 --- a/pkgs/applications/virtualization/looking-glass-client/default.nix +++ b/pkgs/applications/virtualization/looking-glass-client/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { # Including our own patch here since upstream commit patch doesnt apply cleanly on B3 ./0001-client-all-fix-more-maybe-uninitialized-when-O3-is-i.patch ]; - patchFlags = "-p2"; + patchFlags = [ "-p2" ]; sourceRoot = "source/client"; env.NIX_CFLAGS_COMPILE = "-mavx"; # Fix some sort of AVX compiler problem. diff --git a/pkgs/desktops/xfce/core/xfce4-panel/default.nix b/pkgs/desktops/xfce/core/xfce4-panel/default.nix index 0a08d38823864..d62df1aee139d 100644 --- a/pkgs/desktops/xfce/core/xfce4-panel/default.nix +++ b/pkgs/desktops/xfce/core/xfce4-panel/default.nix @@ -53,7 +53,7 @@ mkXfceDerivation { ''; # Workaround https://bugzilla.xfce.org/show_bug.cgi?id=15825 - NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; + env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0"; meta = { description = "Xfce's panel"; diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix index bf7f4bc4312a8..64eeae1bd911e 100644 --- a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix @@ -16,9 +16,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake python3 llvm ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; - NIX_CFLAGS_COMPILE = [ - "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" - ]; + env.NIX_CFLAGS_COMPILE = + "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"; cmakeFlags = [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" diff --git a/pkgs/development/compilers/llvm/12/llvm/default.nix b/pkgs/development/compilers/llvm/12/llvm/default.nix index 33bb7b931f1e1..10423db18931e 100644 --- a/pkgs/development/compilers/llvm/12/llvm/default.nix +++ b/pkgs/development/compilers/llvm/12/llvm/default.nix @@ -105,7 +105,7 @@ in stdenv.mkDerivation (rec { ''; # E.g. mesa.drivers use the build-id as a cache key (see #93946): - LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1"; + env.LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1"; cmakeFlags = with stdenv; [ "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" diff --git a/pkgs/development/libraries/mbedtls/default.nix b/pkgs/development/libraries/mbedtls/default.nix index 90e2c9bd9a735..805e664e8bcc0 100644 --- a/pkgs/development/libraries/mbedtls/default.nix +++ b/pkgs/development/libraries/mbedtls/default.nix @@ -34,10 +34,8 @@ stdenv.mkDerivation rec { ''; cmakeFlags = [ "-DUSE_SHARED_MBEDTLS_LIBRARY=on" ]; - NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ - "-Wno-error=format" - "-Wno-error=format-truncation" - ]; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU + "-Wno-error=format -Wno-error=format-truncation"; meta = with lib; { homepage = "https://tls.mbed.org/"; diff --git a/pkgs/development/libraries/openvino/default.nix b/pkgs/development/libraries/openvino/default.nix index a083c06a334fb..fc196872b198b 100644 --- a/pkgs/development/libraries/openvino/default.nix +++ b/pkgs/development/libraries/openvino/default.nix @@ -93,7 +93,7 @@ stdenv.mkDerivation rec { python tbb shellcheck - ] ++ lib.optional enablePython (with python.pkgs; [ + ] ++ lib.optionals enablePython (with python.pkgs; [ cython pybind11 ]); diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/mk-poetry-dep.nix b/pkgs/development/tools/poetry2nix/poetry2nix/mk-poetry-dep.nix index bb7b4e39b037a..92efde2ffc228 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/mk-poetry-dep.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/mk-poetry-dep.nix @@ -116,8 +116,8 @@ pythonPackages.callPackage buildInputs = ( baseBuildInputs ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) pythonPackages.setuptools - ++ lib.optional (!isSource) (getManyLinuxDeps fileInfo.name).pkg - ++ lib.optional isLocal buildSystemPkgs + ++ lib.optionals (!isSource) (getManyLinuxDeps fileInfo.name).pkg + ++ lib.optionals isLocal buildSystemPkgs ++ lib.optional (!__isBootstrap) pythonPackages.poetry ); diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix index aa58864fed78a..1fecfb222c739 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix @@ -137,11 +137,11 @@ self: super: cryptography = super.cryptography.overridePythonAttrs ( old: { nativeBuildInputs = (old.nativeBuildInputs or [ ]) - ++ lib.optional (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ] + ++ lib.optionals (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ] ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) self.python.pythonForBuild.pkgs.cffi; buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl ]; } // lib.optionalAttrs (lib.versionAtLeast old.version "3.4" && lib.versionOlder old.version "3.5") { - CRYPTOGRAPHY_DONT_BUILD_RUST = "1"; + env = (old.env or {}) // { CRYPTOGRAPHY_DONT_BUILD_RUST = "1"; }; } ); diff --git a/pkgs/games/pinball/default.nix b/pkgs/games/pinball/default.nix index b7abf1dac8cb2..6d356b9ff165b 100644 --- a/pkgs/games/pinball/default.nix +++ b/pkgs/games/pinball/default.nix @@ -23,10 +23,8 @@ stdenv.mkDerivation rec { "--with-sdl-prefix=${lib.getDev SDL}" ]; - NIX_CFLAGS_COMPILE = [ - "-I${lib.getDev SDL_image}/include/SDL" - "-I${lib.getDev SDL_mixer}/include/SDL" - ]; + env.NIX_CFLAGS_COMPILE = + "-I${lib.getDev SDL_image}/include/SDL -I${lib.getDev SDL_mixer}/include/SDL"; enableParallelBuilding = true; diff --git a/pkgs/tools/filesystems/curlftpfs/default.nix b/pkgs/tools/filesystems/curlftpfs/default.nix index 2c5d886c14df7..6749b97e1b509 100644 --- a/pkgs/tools/filesystems/curlftpfs/default.nix +++ b/pkgs/tools/filesystems/curlftpfs/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ autoreconfHook pkg-config ]; buildInputs = [ fuse curl glib zlib ]; - CFLAGS = lib.optionalString stdenv.isDarwin "-D__off_t=off_t"; + env.CFLAGS = lib.optionalString stdenv.isDarwin "-D__off_t=off_t"; postPatch = lib.optionalString stdenv.isDarwin '' # Fix the build on macOS with macFUSE installed. Needs autoreconfHook for From 8d602a06745cc38e9848664fe3f82ad62d0d902f Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:52:41 -0500 Subject: [PATCH 230/323] gogs: structured-attrs build fix --- pkgs/applications/version-management/gogs/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/version-management/gogs/default.nix b/pkgs/applications/version-management/gogs/default.nix index c0b0021f8cbec..0b845b17248cf 100644 --- a/pkgs/applications/version-management/gogs/default.nix +++ b/pkgs/applications/version-management/gogs/default.nix @@ -29,11 +29,11 @@ buildGoModule rec { buildInputs = optional pamSupport pam; - buildFlags = [ "-tags" ]; - - buildFlagsArray = - ( optional sqliteSupport "sqlite" - ++ optional pamSupport "pam"); + buildFlags = [ + "-tags" + ( optionalString sqliteSupport "sqlite" + + optionalString pamSupport " pam") + ]; postInstall = '' From 93978b37e92b011168cb00d892793e55e87887b8 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:53:03 -0500 Subject: [PATCH 231/323] gnome3.gdm: structured-attrs build fix --- pkgs/desktops/gnome-3/core/gdm/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/desktops/gnome-3/core/gdm/default.nix b/pkgs/desktops/gnome-3/core/gdm/default.nix index 324ab865b11e5..6b0eda55ad5b6 100644 --- a/pkgs/desktops/gnome-3/core/gdm/default.nix +++ b/pkgs/desktops/gnome-3/core/gdm/default.nix @@ -129,20 +129,20 @@ stdenv.mkDerivation rec { ''; preInstall = '' - install -D ${override} ${DESTDIR}/$out/share/glib-2.0/schemas/org.gnome.login-screen.gschema.override + install -D ${override} ${env.DESTDIR}/$out/share/glib-2.0/schemas/org.gnome.login-screen.gschema.override ''; postInstall = '' # Move stuff from DESTDIR to proper location. # We use rsync to merge the directories. - rsync --archive "${DESTDIR}/etc" "$out" - rm --recursive "${DESTDIR}/etc" - for o in $outputs; do - rsync --archive "${DESTDIR}/''${!o}" "$(dirname "''${!o}")" - rm --recursive "${DESTDIR}/''${!o}" + rsync --archive "${env.DESTDIR}/etc" "$out" + rm --recursive "${env.DESTDIR}/etc" + for o in "''${outputs[@]}"; do + rsync --archive "${env.DESTDIR}/''${o}" "$(dirname "''${o}")" + rm --recursive "${env.DESTDIR}/''${o}" done # Ensure the DESTDIR is removed. - rmdir "${DESTDIR}/nix/store" "${DESTDIR}/nix" "${DESTDIR}" + rmdir "${env.DESTDIR}/nix/store" "${env.DESTDIR}/nix" "${env.DESTDIR}" # We are setting DESTDIR so the post-install script does not compile the schemas. glib-compile-schemas "$out/share/glib-2.0/schemas" @@ -154,7 +154,7 @@ stdenv.mkDerivation rec { # at install time but Meson does not support this # so we need to convince it to install all files to a temporary # location using DESTDIR and then move it to proper one in postInstall. - DESTDIR = "${placeholder "out"}/dest"; + env.DESTDIR = "${placeholder "out"}/dest"; passthru = { updateScript = gnome3.updateScript { From d0cfdf3fbd388d3729b2420ef758c3f65ad12240 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:53:22 -0500 Subject: [PATCH 232/323] gnome3.mutter: structured-attrs build fix --- pkgs/desktops/gnome-3/core/mutter/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/gnome-3/core/mutter/default.nix b/pkgs/desktops/gnome-3/core/mutter/default.nix index 07e3b536a4101..55c18326ff048 100644 --- a/pkgs/desktops/gnome-3/core/mutter/default.nix +++ b/pkgs/desktops/gnome-3/core/mutter/default.nix @@ -125,7 +125,7 @@ let self = stdenv.mkDerivation rec { ''; # Install udev files into our own tree. - PKG_CONFIG_UDEV_UDEVDIR = "${placeholder "out"}/lib/udev"; + env.PKG_CONFIG_UDEV_UDEVDIR = "${placeholder "out"}/lib/udev"; passthru = { libdir = "${self}/lib/mutter-7"; From 465b4dd7e0e3a1f79bfc0a8a2599907c4ccc80aa Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:53:39 -0500 Subject: [PATCH 233/323] haskellPackage.mkDerivation: structured-attrs build fix --- .../haskell-modules/generic-builder.nix | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index faf80da0c7d96..e779e369f0291 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -309,7 +309,8 @@ stdenv.mkDerivation ({ buildInputs = otherBuildInputs ++ optionals (!isLibrary) propagatedBuildInputs; propagatedBuildInputs = optionals isLibrary propagatedBuildInputs; - LANG = "en_US.UTF-8"; # GHC needs the locale configured during the Haddock phase. + env.LANG = "en_US.UTF-8"; # GHC needs the locale configured during the Haddock phase. + env.LOCALE_ARCHIVE = optionalString (stdenv.buildPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive"; prePatch = optionalString (editedCabalFile != null) '' echo "Replace Cabal file with edited version from ${newCabalFileUrl}." @@ -334,7 +335,7 @@ stdenv.mkDerivation ({ mkdir -p $packageConfDir setupCompileFlags="${concatStringsSep " " setupCompileFlags}" - configureFlags="${concatStringsSep " " defaultConfigureFlags} $configureFlags" + configureFlags=(${concatStringsSep " " defaultConfigureFlags} "''${configureFlags[@]}") '' # We build the Setup.hs on the *build* machine, and as such should only add # dependencies for the build machine. @@ -351,16 +352,16 @@ stdenv.mkDerivation ({ for p in "''${pkgsHostHost[@]}" "''${pkgsHostTarget[@]}"; do ${buildPkgDb ghc.name "$packageConfDir"} if [ -d "$p/include" ]; then - configureFlags+=" --extra-include-dirs=$p/include" + configureFlags+=("--extra-include-dirs=$p/include") fi if [ -d "$p/lib" ]; then - configureFlags+=" --extra-lib-dirs=$p/lib" + configureFlags+=("--extra-lib-dirs=$p/lib") fi '' # It is not clear why --extra-framework-dirs does work fine on Linux + optionalString (!stdenv.buildPlatform.isDarwin || versionAtLeast nativeGhc.version "8.0") '' if [[ -d "$p/Library/Frameworks" ]]; then - configureFlags+=" --extra-framework-dirs=$p/Library/Frameworks" + configureFlags+=("--extra-framework-dirs=$p/Library/Frameworks") fi '' + '' done @@ -422,8 +423,8 @@ stdenv.mkDerivation ({ unset GHC_PACKAGE_PATH # Cabal complains if this variable is set during configure. - echo configureFlags: $configureFlags - ${setupCommand} configure $configureFlags 2>&1 | ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log" + echo configureFlags: "''${configureFlags[@]}" + ${setupCommand} configure "''${configureFlags[@]}" 2>&1 | ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log" ${lib.optionalString (!allowInconsistentDependencies) '' if ${gnugrep}/bin/egrep -q -z 'Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then echo >&2 "*** abort because of serious configure-time warning from Cabal" @@ -615,21 +616,24 @@ stdenv.mkDerivation ({ in stdenv.mkDerivation ({ inherit name shellHook; + dontUnpack = true; + depsBuildBuild = lib.optional isCross ghcEnvForBuild; nativeBuildInputs = [ ghcEnv ] ++ optional (allPkgconfigDepends != []) pkg-config ++ collectedToolDepends; buildInputs = otherBuildInputsSystem; - phases = ["installPhase"]; - installPhase = "echo $nativeBuildInputs $buildInputs > $out"; - LANG = "en_US.UTF-8"; - LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive"; - "NIX_${ghcCommandCaps}" = "${ghcEnv}/bin/${ghcCommand}"; - "NIX_${ghcCommandCaps}PKG" = "${ghcEnv}/bin/${ghcCommand}-pkg"; + installPhase = '' + echo "''${nativeBuildInputs[@]}" "''${buildInputs[@]}" > $out + ''; + env.LANG = "en_US.UTF-8"; + env.LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive"; + env."NIX_${ghcCommandCaps}" = "${ghcEnv}/bin/${ghcCommand}"; + env."NIX_${ghcCommandCaps}PKG" = "${ghcEnv}/bin/${ghcCommand}-pkg"; # TODO: is this still valid? - "NIX_${ghcCommandCaps}_DOCDIR" = "${ghcEnv}/share/doc/ghc/html"; - "NIX_${ghcCommandCaps}_LIBDIR" = if ghc.isHaLVM or false + env."NIX_${ghcCommandCaps}_DOCDIR" = "${ghcEnv}/share/doc/ghc/html"; + env."NIX_${ghcCommandCaps}_LIBDIR" = if ghc.isHaLVM or false then "${ghcEnv}/lib/HaLVM-${ghc.version}" else "${ghcEnv}/lib/${ghcCommand}-${ghc.version}"; }); @@ -670,6 +674,5 @@ stdenv.mkDerivation ({ // optionalAttrs (args ? postFixup) { inherit postFixup; } // optionalAttrs (args ? dontStrip) { inherit dontStrip; } // optionalAttrs (args ? hardeningDisable) { inherit hardeningDisable; } -// optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; } ) ) From 982390dad37aea4622d0bdc05a628043a12b7720 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:55:33 -0500 Subject: [PATCH 234/323] spice-gtk: structured-attrs build fix --- pkgs/development/libraries/spice-gtk/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/spice-gtk/default.nix b/pkgs/development/libraries/spice-gtk/default.nix index 3d76e67f67ad1..5c8f8946880c7 100644 --- a/pkgs/development/libraries/spice-gtk/default.nix +++ b/pkgs/development/libraries/spice-gtk/default.nix @@ -111,7 +111,7 @@ stdenv.mkDerivation rec { zlib ] ++ lib.optionals withPolkit [ polkit acl usbutils ] ; - PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions"; + env.PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions"; mesonFlags = [ "-Dcelt051=disabled" From 431cd92f10ed768207d3b710371a7827de77f116 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:55:46 -0500 Subject: [PATCH 235/323] python.pkgs.ansible-lint: structured-attrs build fix --- pkgs/development/python-modules/ansible-lint/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/ansible-lint/default.nix b/pkgs/development/python-modules/ansible-lint/default.nix index e404edddbcf3f..433580f8458a3 100644 --- a/pkgs/development/python-modules/ansible-lint/default.nix +++ b/pkgs/development/python-modules/ansible-lint/default.nix @@ -63,7 +63,7 @@ buildPythonPackage rec { "test_role_handler_positive" ]; - makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ansible ]}" ]; + makeWrapperArgs = [ "--prefix" "PATH" ":" (lib.makeBinPath [ ansible ]) ]; meta = with lib; { homepage = "https://github.com/ansible-community/ansible-lint"; From 473e5b67c65b3859f112ee45355fae89becbec6f Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:56:04 -0500 Subject: [PATCH 236/323] python.pkgs.jaraco_classes: structured-attrs build fix --- pkgs/development/python-modules/jaraco_classes/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/jaraco_classes/default.nix b/pkgs/development/python-modules/jaraco_classes/default.nix index 9054f1f109c52..f4a3fd3f11b6c 100644 --- a/pkgs/development/python-modules/jaraco_classes/default.nix +++ b/pkgs/development/python-modules/jaraco_classes/default.nix @@ -18,7 +18,7 @@ buildPythonPackage rec { pythonNamespaces = [ "jaraco" ]; - SETUPTOOLS_SCM_PRETEND_VERSION = version; + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; nativeBuildInputs = [ setuptools_scm toml ]; From fa98abb8597c4e3fe13ed64967390be76bd0c484 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:56:17 -0500 Subject: [PATCH 237/323] gomplate: structured-attrs build fix --- pkgs/development/tools/gomplate/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/gomplate/default.nix b/pkgs/development/tools/gomplate/default.nix index 45602a0535223..d85744317db6a 100644 --- a/pkgs/development/tools/gomplate/default.nix +++ b/pkgs/development/tools/gomplate/default.nix @@ -19,11 +19,11 @@ buildGoModule rec { rm net/net_test.go ''; - buildFlagsArray = [ - "-ldflags=" - "-s" - "-w" - "-X github.com/${owner}/${pname}/v3/version.Version=${rev}" + buildFlags = [ + ("-ldflags=" + + "-s" + + " -w" + + " -X github.com/${owner}/${pname}/v3/version.Version=${rev}") ]; meta = with lib; { From 4ef8740edd16e16dbc3956ebcd4168666f5ac332 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:56:41 -0500 Subject: [PATCH 238/323] agate: structured-attrs build fix --- pkgs/servers/gemini/agate/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/gemini/agate/default.nix b/pkgs/servers/gemini/agate/default.nix index b41153caeb81c..5c5577fc9b40d 100644 --- a/pkgs/servers/gemini/agate/default.nix +++ b/pkgs/servers/gemini/agate/default.nix @@ -18,8 +18,8 @@ rustPlatform.buildRustPackage rec { checkFlags = [ # Username and Password use the same ports and causes collision # https://github.com/mbrubeck/agate/issues/50 - "--skip username" - "--skip password" + "--skip" "username" + "--skip" "password" ]; doInstallCheck = true; From 72b3c05545f87dc65a9cdea432f54393ddb01c5c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:56:54 -0500 Subject: [PATCH 239/323] DisnixWebService: structured-attrs build fix --- .../disnix/DisnixWebService/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/package-management/disnix/DisnixWebService/default.nix b/pkgs/tools/package-management/disnix/DisnixWebService/default.nix index ba3c51822e908..62b8b40e41023 100644 --- a/pkgs/tools/package-management/disnix/DisnixWebService/default.nix +++ b/pkgs/tools/package-management/disnix/DisnixWebService/default.nix @@ -7,10 +7,10 @@ stdenv.mkDerivation { sha256 = "0m451msd127ay09yb8rbflg68szm8s4hh65j99f7s3mz375vc114"; }; buildInputs = [ apacheAnt jdk ]; - PREFIX = "\${env.out}"; - AXIS2_LIB = "${axis2}/lib"; - AXIS2_WEBAPP = "${axis2}/webapps/axis2"; - DBUS_JAVA_LIB = "${dbus_java}/share/java"; + env.PREFIX = "\${env.out}"; + env.AXIS2_LIB = "${axis2}/lib"; + env.AXIS2_WEBAPP = "${axis2}/webapps/axis2"; + env.DBUS_JAVA_LIB = "${dbus_java}/share/java"; prePatch = '' sed -i -e "s|#JAVA_HOME=|JAVA_HOME=${jdk}|" \ -e "s|#AXIS2_LIB=|AXIS2_LIB=${axis2}/lib|" \ From 4d4f48a2505b34d182c91a5084a7cf03a0b51752 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 26 Apr 2021 16:57:07 -0500 Subject: [PATCH 240/323] gnupg1compat: structured-attrs build fix --- pkgs/tools/security/gnupg/1compat.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/gnupg/1compat.nix b/pkgs/tools/security/gnupg/1compat.nix index 371a7ca67afde..a756f491ba412 100644 --- a/pkgs/tools/security/gnupg/1compat.nix +++ b/pkgs/tools/security/gnupg/1compat.nix @@ -3,8 +3,9 @@ stdenv.mkDerivation { name = "gnupg1compat-${gnupg.version}"; - builder = writeScript "gnupg1compat-builder" '' - PATH=${coreutils}/bin + dontUnpack = true; + + installPhase = '' # First symlink all top-level dirs mkdir -p $out ln -s "${gnupg}/"* $out @@ -20,6 +21,8 @@ stdenv.mkDerivation { [[ -e ''${f%2} ]] && continue # ignore commands that already have non-*2 versions ln -s -- "''${f##*/}" "''${f%2}" done + + rm $out/lib ''; meta = gnupg.meta // { From 4d277317b513313661a9d522d0ee4ae8e28ef7f5 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:45:26 -0500 Subject: [PATCH 241/323] dosage: structured-attrs build fix --- pkgs/applications/graphics/dosage/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/dosage/default.nix b/pkgs/applications/graphics/dosage/default.nix index db0012a184bef..289b8cbcdf4f8 100644 --- a/pkgs/applications/graphics/dosage/default.nix +++ b/pkgs/applications/graphics/dosage/default.nix @@ -3,7 +3,7 @@ python3Packages.buildPythonApplication rec { pname = "dosage"; version = "2018.04.08"; - PBR_VERSION = version; + env.PBR_VERSION = version; src = fetchFromGitHub { owner = "webcomics"; From f8c1d39b92bfaa384b6992437bfe8b24957e7995 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:45:48 -0500 Subject: [PATCH 242/323] birdtray: structured-attrs build fix --- pkgs/applications/misc/birdtray/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/birdtray/default.nix b/pkgs/applications/misc/birdtray/default.nix index f007fb71377be..95a0bce17f3a0 100644 --- a/pkgs/applications/misc/birdtray/default.nix +++ b/pkgs/applications/misc/birdtray/default.nix @@ -38,7 +38,7 @@ mkDerivation rec { # Wayland support is broken. # https://github.com/gyunaev/birdtray/issues/113#issuecomment-621742315 - qtWrapperArgs = [ "--set QT_QPA_PLATFORM xcb" ]; + qtWrapperArgs = [ "--set" "QT_QPA_PLATFORM" "xcb" ]; meta = with lib; { description = "Mail system tray notification icon for Thunderbird"; From 8a4cec796f8eee72a2a9d7111f18cbf97bfbca70 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:46:04 -0500 Subject: [PATCH 243/323] clipcat: structured-attrs build fix --- pkgs/applications/misc/clipcat/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/clipcat/default.nix b/pkgs/applications/misc/clipcat/default.nix index 497e5616e8050..ab1b823ef701c 100644 --- a/pkgs/applications/misc/clipcat/default.nix +++ b/pkgs/applications/misc/clipcat/default.nix @@ -14,11 +14,11 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "1ffgvhkdj8wkhlgi0cj0njdm9ycxq2qda4b5qn8bmaygzr2zkwpd"; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + env.LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; # needed for internal protobuf c wrapper library - PROTOC = "${protobuf}/bin/protoc"; - PROTOC_INCLUDE = "${protobuf}/include"; + env.PROTOC = "${protobuf}/bin/protoc"; + env.PROTOC_INCLUDE = "${protobuf}/include"; nativeBuildInputs = [ pkg-config From df7293e2a29b7d4785e52986eb1ba7259e351be6 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:46:17 -0500 Subject: [PATCH 244/323] digitalbitbox: structured-attrs build fix --- .../misc/digitalbitbox/default.nix | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/misc/digitalbitbox/default.nix b/pkgs/applications/misc/digitalbitbox/default.nix index 4771cebc3411d..9245dcfc27abc 100644 --- a/pkgs/applications/misc/digitalbitbox/default.nix +++ b/pkgs/applications/misc/digitalbitbox/default.nix @@ -79,22 +79,18 @@ in mkDerivation rec { qtmultimedia ]; - LUPDATE="${qttools.dev}/bin/lupdate"; - LRELEASE="${qttools.dev}/bin/lrelease"; - MOC="${qtbase.dev}/bin/moc"; - QTDIR=qtbase.dev; - RCC="${qtbase.dev}/bin/rcc"; - UIC="${qtbase.dev}/bin/uic"; - - configureFlags = [ - "--enable-libusb" - ]; + env.LUPDATE = "${qttools.dev}/bin/lupdate"; + env.LRELEASE = "${qttools.dev}/bin/lrelease"; + env.MOC = "${qtbase.dev}/bin/moc"; + env.QTDIR = toString qtbase.dev; + env.RCC = "${qtbase.dev}/bin/rcc"; + env.UIC = "${qtbase.dev}/bin/uic"; - hardeningDisable = [ - "format" - ]; + configureFlags = [ "--enable-libusb" ]; + + hardeningDisable = [ "format" ]; - qtWrapperArgs = [ "--prefix LD_LIBRARY_PATH : $out/lib" ]; + qtWrapperArgs = [ "--prefix" "LD_LIBRARY_PATH" ":" "$out/lib" ]; postInstall = '' mkdir -p "$out/lib" From 3fc0b969c43c26b3be9eae0346a21a4b51f31176 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:46:32 -0500 Subject: [PATCH 245/323] cloudfoundry-cli: structured-attrs build fix --- .../networking/cluster/cloudfoundry-cli/default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/networking/cluster/cloudfoundry-cli/default.nix b/pkgs/applications/networking/cluster/cloudfoundry-cli/default.nix index a251886ebdd76..aa5dc3b28969d 100644 --- a/pkgs/applications/networking/cluster/cloudfoundry-cli/default.nix +++ b/pkgs/applications/networking/cluster/cloudfoundry-cli/default.nix @@ -25,12 +25,11 @@ buildGoModule rec { nativeBuildInputs = [ installShellFiles ]; - buildFlagsArray = [ - "-ldflags=" - "-s" - "-w" - "-X code.cloudfoundry.org/cli/version.binaryBuildDate=1970-01-01" - "-X code.cloudfoundry.org/cli/version.binaryVersion=${version}" + buildFlags = [ + ("-ldflags=-s" + + " -w" + + " -X code.cloudfoundry.org/cli/version.binaryBuildDate=1970-01-01" + + " -X code.cloudfoundry.org/cli/version.binaryVersion=${version}") ]; postInstall = '' From 52710db034184a69b754cfd9718f77ef803956a3 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:46:51 -0500 Subject: [PATCH 246/323] commitizen: structured-attrs build fix --- .../commitizen/node-composition.nix | 6 +- .../commitizen/node-env.nix | 542 ------------------ 2 files changed, 3 insertions(+), 545 deletions(-) delete mode 100644 pkgs/applications/version-management/commitizen/node-env.nix diff --git a/pkgs/applications/version-management/commitizen/node-composition.nix b/pkgs/applications/version-management/commitizen/node-composition.nix index 0769168a78fa3..edb1aa46608d2 100644 --- a/pkgs/applications/version-management/commitizen/node-composition.nix +++ b/pkgs/applications/version-management/commitizen/node-composition.nix @@ -5,9 +5,9 @@ }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}: let - nodeEnv = import ./node-env.nix { - inherit (pkgs) lib stdenv python2 util-linux runCommand writeTextFile; - inherit nodejs; + nodeEnv = import ../../../development/node-packages/node-env.nix { + inherit (pkgs) lib stdenv python2 runCommand writeTextFile jq; + inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; in diff --git a/pkgs/applications/version-management/commitizen/node-env.nix b/pkgs/applications/version-management/commitizen/node-env.nix deleted file mode 100644 index 262df27e464fe..0000000000000 --- a/pkgs/applications/version-management/commitizen/node-env.nix +++ /dev/null @@ -1,542 +0,0 @@ -# This file originates from node2nix - -{lib, stdenv, nodejs, python2, util-linux, libtool, runCommand, writeTextFile}: - -let - python = if nodejs ? python then nodejs.python else python2; - - # Create a tar wrapper that filters all the 'Ignoring unknown extended header keyword' noise - tarWrapper = runCommand "tarWrapper" {} '' - mkdir -p $out/bin - - cat > $out/bin/tar <> $out/nix-support/hydra-build-products - ''; - }; - - includeDependencies = {dependencies}: - lib.optionalString (dependencies != []) - (lib.concatMapStrings (dependency: - '' - # Bundle the dependencies of the package - mkdir -p node_modules - cd node_modules - - # Only include dependencies if they don't exist. They may also be bundled in the package. - if [ ! -e "${dependency.name}" ] - then - ${composePackage dependency} - fi - - cd .. - '' - ) dependencies); - - # Recursively composes the dependencies of a package - composePackage = { name, packageName, src, dependencies ? [], ... }@args: - builtins.addErrorContext "while evaluating node package '${packageName}'" '' - DIR=$(pwd) - cd $TMPDIR - - unpackFile ${src} - - # Make the base dir in which the target dependency resides first - mkdir -p "$(dirname "$DIR/${packageName}")" - - if [ -f "${src}" ] - then - # Figure out what directory has been unpacked - packageDir="$(find . -maxdepth 1 -type d | tail -1)" - - # Restore write permissions to make building work - find "$packageDir" -type d -exec chmod u+x {} \; - chmod -R u+w "$packageDir" - - # Move the extracted tarball into the output folder - mv "$packageDir" "$DIR/${packageName}" - elif [ -d "${src}" ] - then - # Get a stripped name (without hash) of the source directory. - # On old nixpkgs it's already set internally. - if [ -z "$strippedName" ] - then - strippedName="$(stripHash ${src})" - fi - - # Restore write permissions to make building work - chmod -R u+w "$strippedName" - - # Move the extracted directory into the output folder - mv "$strippedName" "$DIR/${packageName}" - fi - - # Unset the stripped name to not confuse the next unpack step - unset strippedName - - # Include the dependencies of the package - cd "$DIR/${packageName}" - ${includeDependencies { inherit dependencies; }} - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - ''; - - pinpointDependencies = {dependencies, production}: - let - pinpointDependenciesFromPackageJSON = writeTextFile { - name = "pinpointDependencies.js"; - text = '' - var fs = require('fs'); - var path = require('path'); - - function resolveDependencyVersion(location, name) { - if(location == process.env['NIX_STORE']) { - return null; - } else { - var dependencyPackageJSON = path.join(location, "node_modules", name, "package.json"); - - if(fs.existsSync(dependencyPackageJSON)) { - var dependencyPackageObj = JSON.parse(fs.readFileSync(dependencyPackageJSON)); - - if(dependencyPackageObj.name == name) { - return dependencyPackageObj.version; - } - } else { - return resolveDependencyVersion(path.resolve(location, ".."), name); - } - } - } - - function replaceDependencies(dependencies) { - if(typeof dependencies == "object" && dependencies !== null) { - for(var dependency in dependencies) { - var resolvedVersion = resolveDependencyVersion(process.cwd(), dependency); - - if(resolvedVersion === null) { - process.stderr.write("WARNING: cannot pinpoint dependency: "+dependency+", context: "+process.cwd()+"\n"); - } else { - dependencies[dependency] = resolvedVersion; - } - } - } - } - - /* Read the package.json configuration */ - var packageObj = JSON.parse(fs.readFileSync('./package.json')); - - /* Pinpoint all dependencies */ - replaceDependencies(packageObj.dependencies); - if(process.argv[2] == "development") { - replaceDependencies(packageObj.devDependencies); - } - replaceDependencies(packageObj.optionalDependencies); - - /* Write the fixed package.json file */ - fs.writeFileSync("package.json", JSON.stringify(packageObj, null, 2)); - ''; - }; - in - '' - node ${pinpointDependenciesFromPackageJSON} ${if production then "production" else "development"} - - ${lib.optionalString (dependencies != []) - '' - if [ -d node_modules ] - then - cd node_modules - ${lib.concatMapStrings (dependency: pinpointDependenciesOfPackage dependency) dependencies} - cd .. - fi - ''} - ''; - - # Recursively traverses all dependencies of a package and pinpoints all - # dependencies in the package.json file to the versions that are actually - # being used. - - pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }@args: - '' - if [ -d "${packageName}" ] - then - cd "${packageName}" - ${pinpointDependencies { inherit dependencies production; }} - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - fi - ''; - - # Extract the Node.js source code which is used to compile packages with - # native bindings - nodeSources = runCommand "node-sources" {} '' - tar --no-same-owner --no-same-permissions -xf ${nodejs.src} - mv node-* $out - ''; - - # Script that adds _integrity fields to all package.json files to prevent NPM from consulting the cache (that is empty) - addIntegrityFieldsScript = writeTextFile { - name = "addintegrityfields.js"; - text = '' - var fs = require('fs'); - var path = require('path'); - - function augmentDependencies(baseDir, dependencies) { - for(var dependencyName in dependencies) { - var dependency = dependencies[dependencyName]; - - // Open package.json and augment metadata fields - var packageJSONDir = path.join(baseDir, "node_modules", dependencyName); - var packageJSONPath = path.join(packageJSONDir, "package.json"); - - if(fs.existsSync(packageJSONPath)) { // Only augment packages that exist. Sometimes we may have production installs in which development dependencies can be ignored - console.log("Adding metadata fields to: "+packageJSONPath); - var packageObj = JSON.parse(fs.readFileSync(packageJSONPath)); - - if(dependency.integrity) { - packageObj["_integrity"] = dependency.integrity; - } else { - packageObj["_integrity"] = "sha1-000000000000000000000000000="; // When no _integrity string has been provided (e.g. by Git dependencies), add a dummy one. It does not seem to harm and it bypasses downloads. - } - - if(dependency.resolved) { - packageObj["_resolved"] = dependency.resolved; // Adopt the resolved property if one has been provided - } else { - packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories. - } - - if(dependency.from !== undefined) { // Adopt from property if one has been provided - packageObj["_from"] = dependency.from; - } - - fs.writeFileSync(packageJSONPath, JSON.stringify(packageObj, null, 2)); - } - - // Augment transitive dependencies - if(dependency.dependencies !== undefined) { - augmentDependencies(packageJSONDir, dependency.dependencies); - } - } - } - - if(fs.existsSync("./package-lock.json")) { - var packageLock = JSON.parse(fs.readFileSync("./package-lock.json")); - - if(packageLock.lockfileVersion !== 1) { - process.stderr.write("Sorry, I only understand lock file version 1!\n"); - process.exit(1); - } - - if(packageLock.dependencies !== undefined) { - augmentDependencies(".", packageLock.dependencies); - } - } - ''; - }; - - # Reconstructs a package-lock file from the node_modules/ folder structure and package.json files with dummy sha1 hashes - reconstructPackageLock = writeTextFile { - name = "addintegrityfields.js"; - text = '' - var fs = require('fs'); - var path = require('path'); - - var packageObj = JSON.parse(fs.readFileSync("package.json")); - - var lockObj = { - name: packageObj.name, - version: packageObj.version, - lockfileVersion: 1, - requires: true, - dependencies: {} - }; - - function augmentPackageJSON(filePath, dependencies) { - var packageJSON = path.join(filePath, "package.json"); - if(fs.existsSync(packageJSON)) { - var packageObj = JSON.parse(fs.readFileSync(packageJSON)); - dependencies[packageObj.name] = { - version: packageObj.version, - integrity: "sha1-000000000000000000000000000=", - dependencies: {} - }; - processDependencies(path.join(filePath, "node_modules"), dependencies[packageObj.name].dependencies); - } - } - - function processDependencies(dir, dependencies) { - if(fs.existsSync(dir)) { - var files = fs.readdirSync(dir); - - files.forEach(function(entry) { - var filePath = path.join(dir, entry); - var stats = fs.statSync(filePath); - - if(stats.isDirectory()) { - if(entry.substr(0, 1) == "@") { - // When we encounter a namespace folder, augment all packages belonging to the scope - var pkgFiles = fs.readdirSync(filePath); - - pkgFiles.forEach(function(entry) { - if(stats.isDirectory()) { - var pkgFilePath = path.join(filePath, entry); - augmentPackageJSON(pkgFilePath, dependencies); - } - }); - } else { - augmentPackageJSON(filePath, dependencies); - } - } - }); - } - } - - processDependencies("node_modules", lockObj.dependencies); - - fs.writeFileSync("package-lock.json", JSON.stringify(lockObj, null, 2)); - ''; - }; - - prepareAndInvokeNPM = {packageName, bypassCache, reconstructLock, npmFlags, production}: - let - forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com"; - in - '' - # Pinpoint the versions of all dependencies to the ones that are actually being used - echo "pinpointing versions of dependencies..." - source $pinpointDependenciesScriptPath - - # Patch the shebangs of the bundled modules to prevent them from - # calling executables outside the Nix store as much as possible - patchShebangs . - - # Deploy the Node.js package by running npm install. Since the - # dependencies have been provided already by ourselves, it should not - # attempt to install them again, which is good, because we want to make - # it Nix's responsibility. If it needs to install any dependencies - # anyway (e.g. because the dependency parameters are - # incomplete/incorrect), it fails. - # - # The other responsibilities of NPM are kept -- version checks, build - # steps, postprocessing etc. - - export HOME=$TMPDIR - cd "${packageName}" - runHook preRebuild - - ${lib.optionalString bypassCache '' - ${lib.optionalString reconstructLock '' - if [ -f package-lock.json ] - then - echo "WARNING: Reconstruct lock option enabled, but a lock file already exists!" - echo "This will most likely result in version mismatches! We will remove the lock file and regenerate it!" - rm package-lock.json - else - echo "No package-lock.json file found, reconstructing..." - fi - - node ${reconstructPackageLock} - ''} - - node ${addIntegrityFieldsScript} - ''} - - npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} rebuild - - if [ "''${dontNpmInstall-}" != "1" ] - then - # NPM tries to download packages even when they already exist if npm-shrinkwrap is used. - rm -f npm-shrinkwrap.json - - npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} install - fi - ''; - - # Builds and composes an NPM package including all its dependencies - buildNodePackage = - { name - , packageName - , version - , dependencies ? [] - , buildInputs ? [] - , production ? true - , npmFlags ? "" - , dontNpmInstall ? false - , bypassCache ? false - , reconstructLock ? false - , preRebuild ? "" - , dontStrip ? true - , unpackPhase ? "true" - , buildPhase ? "true" - , ... }@args: - - let - extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" ]; - in - stdenv.mkDerivation ({ - name = "node_${name}-${version}"; - buildInputs = [ tarWrapper python nodejs ] - ++ lib.optional (stdenv.isLinux) util-linux - ++ lib.optional (stdenv.isDarwin) libtool - ++ buildInputs; - - inherit nodejs; - - inherit dontStrip; # Stripping may fail a build for some package deployments - inherit dontNpmInstall preRebuild unpackPhase buildPhase; - - compositionScript = composePackage args; - pinpointDependenciesScript = pinpointDependenciesOfPackage args; - - passAsFile = [ "compositionScript" "pinpointDependenciesScript" ]; - - installPhase = '' - # Create and enter a root node_modules/ folder - mkdir -p $out/lib/node_modules - cd $out/lib/node_modules - - # Compose the package and all its dependencies - source $compositionScriptPath - - ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} - - # Create symlink to the deployed executable folder, if applicable - if [ -d "$out/lib/node_modules/.bin" ] - then - ln -s $out/lib/node_modules/.bin $out/bin - fi - - # Create symlinks to the deployed manual page folders, if applicable - if [ -d "$out/lib/node_modules/${packageName}/man" ] - then - mkdir -p $out/share - for dir in "$out/lib/node_modules/${packageName}/man/"* - do - mkdir -p $out/share/man/$(basename "$dir") - for page in "$dir"/* - do - ln -s $page $out/share/man/$(basename "$dir") - done - done - fi - - # Run post install hook, if provided - runHook postInstall - ''; - } // extraArgs); - - # Builds a development shell - buildNodeShell = - { name - , packageName - , version - , src - , dependencies ? [] - , buildInputs ? [] - , production ? true - , npmFlags ? "" - , dontNpmInstall ? false - , bypassCache ? false - , reconstructLock ? false - , dontStrip ? true - , unpackPhase ? "true" - , buildPhase ? "true" - , ... }@args: - - let - extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ]; - - nodeDependencies = stdenv.mkDerivation ({ - name = "node-dependencies-${name}-${version}"; - - buildInputs = [ tarWrapper python nodejs ] - ++ lib.optional (stdenv.isLinux) util-linux - ++ lib.optional (stdenv.isDarwin) libtool - ++ buildInputs; - - inherit dontStrip; # Stripping may fail a build for some package deployments - inherit dontNpmInstall unpackPhase buildPhase; - - includeScript = includeDependencies { inherit dependencies; }; - pinpointDependenciesScript = pinpointDependenciesOfPackage args; - - passAsFile = [ "includeScript" "pinpointDependenciesScript" ]; - - installPhase = '' - mkdir -p $out/${packageName} - cd $out/${packageName} - - source $includeScriptPath - - # Create fake package.json to make the npm commands work properly - cp ${src}/package.json . - chmod 644 package.json - ${lib.optionalString bypassCache '' - if [ -f ${src}/package-lock.json ] - then - cp ${src}/package-lock.json . - fi - ''} - - # Go to the parent folder to make sure that all packages are pinpointed - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - - ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} - - # Expose the executables that were installed - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - - mv ${packageName} lib - ln -s $out/lib/node_modules/.bin $out/bin - ''; - } // extraArgs); - in - stdenv.mkDerivation { - name = "node-shell-${name}-${version}"; - - buildInputs = [ python nodejs ] ++ lib.optional (stdenv.isLinux) util-linux ++ buildInputs; - buildCommand = '' - mkdir -p $out/bin - cat > $out/bin/shell < Date: Tue, 27 Apr 2021 18:47:12 -0500 Subject: [PATCH 247/323] buildRustPackage: structured-attrs build fix --- pkgs/build-support/rust/hooks/cargo-build-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/hooks/cargo-build-hook.sh b/pkgs/build-support/rust/hooks/cargo-build-hook.sh index c10120c5aa19e..e34692d58e525 100644 --- a/pkgs/build-support/rust/hooks/cargo-build-hook.sh +++ b/pkgs/build-support/rust/hooks/cargo-build-hook.sh @@ -24,7 +24,7 @@ cargoBuildHook() { --target @rustTargetPlatformSpec@ \ --frozen \ ${cargoBuildProfileFlag} \ - ${cargoBuildFlags} + "${cargoBuildFlags[@]}" ) if [ ! -z "${buildAndTestSubdir-}" ]; then From 3c4933d5d757a62f14aa36d89174171c12baa8b0 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:47:33 -0500 Subject: [PATCH 248/323] wrapGappsHook: structured-attrs build fix --- .../setup-hooks/wrap-gapps-hook/wrap-gapps-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/setup-hooks/wrap-gapps-hook/wrap-gapps-hook.sh b/pkgs/build-support/setup-hooks/wrap-gapps-hook/wrap-gapps-hook.sh index 1a46e075dbe76..551509dbdbded 100644 --- a/pkgs/build-support/setup-hooks/wrap-gapps-hook/wrap-gapps-hook.sh +++ b/pkgs/build-support/setup-hooks/wrap-gapps-hook/wrap-gapps-hook.sh @@ -38,7 +38,7 @@ gappsWrapperArgsHook() { done } -preFixupPhases+=" gappsWrapperArgsHook" +preFixupPhases+=("gappsWrapperArgsHook") wrapGApp() { local program="$1" From aa9891af601225fcb9dddf9398743128df2589f3 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:47:51 -0500 Subject: [PATCH 249/323] arduino-cli: structured-attrs build fix --- pkgs/development/arduino/arduino-cli/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/arduino/arduino-cli/default.nix b/pkgs/development/arduino/arduino-cli/default.nix index 95586d064d96f..fa1fd89df8d77 100644 --- a/pkgs/development/arduino/arduino-cli/default.nix +++ b/pkgs/development/arduino/arduino-cli/default.nix @@ -19,9 +19,10 @@ let doCheck = false; - buildFlagsArray = [ - "-ldflags=-s -w -X github.com/arduino/arduino-cli/version.versionString=${version} -X github.com/arduino/arduino-cli/version.commit=unknown" - ] ++ lib.optionals stdenv.isLinux [ "-extldflags '-static'" ]; + buildFlags = [ + ("-ldflags=-s -w -X github.com/arduino/arduino-cli/version.versionString=${version} -X github.com/arduino/arduino-cli/version.commit=unknown" + + lib.optionalString stdenv.isLinux " -extldflags '-static'") + ]; meta = with lib; { inherit (src.meta) homepage; From 4fec6e0418299ef156f10d9e72c17c3b17ef4f1d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:48:05 -0500 Subject: [PATCH 250/323] arduino-core: structured-attrs build fix --- pkgs/development/arduino/arduino-core/default.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/development/arduino/arduino-core/default.nix b/pkgs/development/arduino/arduino-core/default.nix index 529be6e2a56e8..001141040d8d4 100644 --- a/pkgs/development/arduino/arduino-core/default.nix +++ b/pkgs/development/arduino/arduino-core/default.nix @@ -131,14 +131,12 @@ stdenv.mkDerivation rec { buildPhase = '' # Copy pre-downloaded files to proper locations - download_src=($downloadSrcList) - download_dst=($downloadDstList) - while [[ "''${#download_src[@]}" -ne 0 ]]; do - file_src=''${download_src[0]} - file_dst=''${download_dst[0]} + while [[ "''${#downloadSrcList[@]}" -ne 0 ]]; do + file_src=''${downloadSrcList[0]} + file_dst=''${downloadDstList[0]} mkdir -p $(dirname $file_dst) - download_src=(''${download_src[@]:1}) - download_dst=(''${download_dst[@]:1}) + downloadSrcList=(''${downloadSrcList[@]:1}) + downloadDstList=(''${downloadDstList[@]:1}) cp -v $file_src $file_dst done From 1aab2eb9976920e76da0484a85430f3a12ced9b2 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:48:19 -0500 Subject: [PATCH 251/323] buildGoModule: structured-attrs build fix --- pkgs/development/go-modules/generic/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 367ee64b85a2c..3653e1b23e210 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -168,8 +168,8 @@ let getGoDirs() { local type; type="$1" - if [ -n "$subPackages" ]; then - echo "$subPackages" | sed "s,\(^\| \),\1./,g" + if [ ''${#subPackages[@]} -gt 0 ]; then + echo "''${subPackages[@]}" | sed "s,\(^\| \),\1./,g" else find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort --unique fi From e2c79cdf15287075d85b324245112c3bb7e73036 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:48:36 -0500 Subject: [PATCH 252/323] buildGoPackage: structured-attrs build fix --- pkgs/development/go-packages/generic/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/go-packages/generic/default.nix b/pkgs/development/go-packages/generic/default.nix index 2ec3ffb607f8e..4cfb067be23c9 100644 --- a/pkgs/development/go-packages/generic/default.nix +++ b/pkgs/development/go-packages/generic/default.nix @@ -165,8 +165,8 @@ let getGoDirs() { local type; type="$1" - if [ -n "$subPackages" ]; then - echo "$subPackages" | sed "s,\(^\| \),\1$goPackagePath/,g" + if [ ''${#subPackages[@]} -gt 0 ]; then + echo "''${subPackages[@]}" | sed "s,\(^\| \),\1$goPackagePath/,g" else pushd "$NIX_BUILD_TOP/go/src" >/dev/null find "$goPackagePath" -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort | uniq From 54a11fa4b5007640fc0d3b381f0d2f60b3d31560 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:48:52 -0500 Subject: [PATCH 253/323] buildDhallPackage: structured-attrs build fix --- pkgs/development/interpreters/dhall/build-dhall-package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/dhall/build-dhall-package.nix b/pkgs/development/interpreters/dhall/build-dhall-package.nix index 9fc9a44121560..4461b3c775be3 100644 --- a/pkgs/development/interpreters/dhall/build-dhall-package.nix +++ b/pkgs/development/interpreters/dhall/build-dhall-package.nix @@ -62,7 +62,7 @@ in mkdir -p ${cacheDhall} - for dependency in $dependencies; do + for dependency in "''${dependencies[@]}"; do ${lndir}/bin/lndir -silent $dependency/${cacheDhall} ${cacheDhall} done From 42543e20ad2daac5c6e928334d3bf6fbb94dd546 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:49:05 -0500 Subject: [PATCH 254/323] clearsilver: structured-attrs build fix --- pkgs/development/libraries/clearsilver/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/clearsilver/default.nix b/pkgs/development/libraries/clearsilver/default.nix index 73ffd6c12b23a..2a2c901126915 100644 --- a/pkgs/development/libraries/clearsilver/default.nix +++ b/pkgs/development/libraries/clearsilver/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "1046m1dpq3nkgxbis2dr2x7hynmy51n64465q78d7pdgvqwa178y"; }; - PYTHON_SITE = "${placeholder "out"}/${python2.sitePackages}"; + env.PYTHON_SITE = "${placeholder "out"}/${python2.sitePackages}"; configureFlags = [ "--with-python=${python2.interpreter}" From 32757f61498fbfff0b426b6b704b373e07f5cb67 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:49:21 -0500 Subject: [PATCH 255/323] clwrapper: structured-attrs build fix --- pkgs/development/lisp-modules/clwrapper/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/development/lisp-modules/clwrapper/default.nix b/pkgs/development/lisp-modules/clwrapper/default.nix index 69872eb41af6a..7ae80932ef983 100644 --- a/pkgs/development/lisp-modules/clwrapper/default.nix +++ b/pkgs/development/lisp-modules/clwrapper/default.nix @@ -2,7 +2,8 @@ stdenv.mkDerivation { name = "cl-wrapper-script"; - buildPhase=""; + dontUnpack = true; + dontBuild = true; installPhase='' mkdir -p "$out"/bin @@ -42,9 +43,7 @@ stdenv.mkDerivation { setupHook = ./setup-hook.sh; - phases="installPhase fixupPhase"; - - ASDF_OUTPUT_TRANSLATIONS="${builtins.storeDir}/:${builtins.storeDir}"; + env.ASDF_OUTPUT_TRANSLATIONS="${builtins.storeDir}/:${builtins.storeDir}"; passthru = { inherit lisp; From be56e81a05693550dcc10a1d9329eb99055713db Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:49:34 -0500 Subject: [PATCH 256/323] certbot: structured-attrs build fix --- pkgs/development/python-modules/certbot/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/certbot/default.nix b/pkgs/development/python-modules/certbot/default.nix index 7b4f7064b16a1..169a3112d9629 100644 --- a/pkgs/development/python-modules/certbot/default.nix +++ b/pkgs/development/python-modules/certbot/default.nix @@ -53,7 +53,7 @@ buildPythonPackage rec { doCheck = true; - makeWrapperArgs = [ "--prefix PATH : ${dialog}/bin" ]; + makeWrapperArgs = [ "--prefix" "PATH" ":" "${dialog}/bin" ]; # certbot.withPlugins has a similar calling convention as python*.withPackages # it gets invoked with a lambda, and invokes that lambda with the python package set matching certbot's: From 8f3165cf8c04b43dba2492a492a6e6d3697227eb Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:49:48 -0500 Subject: [PATCH 257/323] python.pkgs.tqdm: structured-attrs build fix --- pkgs/development/python-modules/tqdm/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/tqdm/default.nix b/pkgs/development/python-modules/tqdm/default.nix index 70893dc541f00..a663ce2019ba1 100644 --- a/pkgs/development/python-modules/tqdm/default.nix +++ b/pkgs/development/python-modules/tqdm/default.nix @@ -39,9 +39,9 @@ buildPythonPackage rec { # Remove performance testing. # Too sensitive for on Hydra. - PYTEST_ADDOPTS = "-k \"not perf\""; + env.PYTEST_ADDOPTS = "-k \"not perf\""; - LC_ALL="en_US.UTF-8"; + env.LC_ALL = "en_US.UTF-8"; meta = { description = "A Fast, Extensible Progress Meter"; From 50f7f723750c24c5f5b97d50a7ae8c142a3a14d7 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:50:05 -0500 Subject: [PATCH 258/323] conftest: structured-attrs build fix --- pkgs/development/tools/conftest/default.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/conftest/default.nix b/pkgs/development/tools/conftest/default.nix index 4c6cbbbe6b04c..de4fd3a5ffee8 100644 --- a/pkgs/development/tools/conftest/default.nix +++ b/pkgs/development/tools/conftest/default.nix @@ -15,11 +15,10 @@ buildGoModule rec { doCheck = false; - buildFlagsArray = [ - "-ldflags=" - "-s" - "-w" - "-X github.com/open-policy-agent/conftest/internal/commands.version=${version}" + buildFlags = [ + ("-ldflags=-s" + + " -w" + + " -X github.com/open-policy-agent/conftest/internal/commands.version=${version}") ]; meta = with lib; { From 9aab708ade7beb67fde5cfc93390e2417b985830 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:50:20 -0500 Subject: [PATCH 259/323] devpi-client: structured-attrs build fix --- pkgs/development/tools/devpi-client/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/devpi-client/default.nix b/pkgs/development/tools/devpi-client/default.nix index 5bca873377146..d42118fc75b89 100644 --- a/pkgs/development/tools/devpi-client/default.nix +++ b/pkgs/development/tools/devpi-client/default.nix @@ -47,7 +47,7 @@ buildPythonApplication rec { HOME=$TMPDIR py.test --fast ''; - LC_ALL = "en_US.UTF-8"; + env.LC_ALL = "en_US.UTF-8"; meta = with lib; { homepage = "http://doc.devpi.net"; From be3edc7113fec128a17cb570a97348adc7a5aeaf Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:50:31 -0500 Subject: [PATCH 260/323] clojure-lsp: structured-attrs build fix --- pkgs/development/tools/misc/clojure-lsp/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/misc/clojure-lsp/default.nix b/pkgs/development/tools/misc/clojure-lsp/default.nix index c0d4567fe0b77..3a67f2b9b772b 100644 --- a/pkgs/development/tools/misc/clojure-lsp/default.nix +++ b/pkgs/development/tools/misc/clojure-lsp/default.nix @@ -26,7 +26,7 @@ in stdenv.mkDerivation rec { --replace ":main" ":local-repo \"${repository}\" :main" ''; - GRAALVM_HOME = graalvm11-ce; + env.GRAALVM_HOME = toString graalvm11-ce; buildInputs = [ graalvm11-ce leiningen11 repository ]; From d971efbb7194cc5567f85b54a8d2eb3955e4d894 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:50:45 -0500 Subject: [PATCH 261/323] cryptodev: structured-attrs build fix --- pkgs/os-specific/linux/cryptodev/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/cryptodev/default.nix b/pkgs/os-specific/linux/cryptodev/default.nix index bbd8d35403b51..857a7e0c5b25f 100644 --- a/pkgs/os-specific/linux/cryptodev/default.nix +++ b/pkgs/os-specific/linux/cryptodev/default.nix @@ -13,9 +13,9 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - KERNEL_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; - INSTALL_MOD_PATH = "\${out}"; - prefix = "\${out}"; + env.KERNEL_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; + env.INSTALL_MOD_PATH = "\${out}"; + env.prefix = "\${out}"; meta = { description = "Device that allows access to Linux kernel cryptographic drivers"; From e0a56e1d93088d25bf0a0960074dad542b243dc3 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:51:45 -0500 Subject: [PATCH 262/323] formats.{json,toml}: structured-attrs build fix --- pkgs/pkgs-lib/formats.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/pkgs-lib/formats.nix b/pkgs/pkgs-lib/formats.nix index 14589f8ecdc3a..0b4d4ed089e79 100644 --- a/pkgs/pkgs-lib/formats.nix +++ b/pkgs/pkgs-lib/formats.nix @@ -39,10 +39,9 @@ rec { generate = name: value: pkgs.runCommandNoCC name { nativeBuildInputs = [ pkgs.jq ]; - value = builtins.toJSON value; - passAsFile = [ "value" ]; + inherit value; } '' - jq . "$valuePath"> $out + jq .value .attrs.json > $out ''; }; @@ -98,11 +97,11 @@ rec { in valueType; generate = name: value: pkgs.runCommandNoCC name { - nativeBuildInputs = [ pkgs.remarshal ]; - value = builtins.toJSON value; - passAsFile = [ "value" ]; + nativeBuildInputs = [ pkgs.remarshal pkgs.jq ]; + inherit value; } '' - json2toml "$valuePath" "$out" + jq .value .attrs.json > value.json + json2toml value.json "$out" ''; }; From 0212e111baf0558d73553d6b73d715ba9b722010 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:52:15 -0500 Subject: [PATCH 263/323] dictDBs.wordnet: structured-attrs build fix --- pkgs/servers/dict/dictd-wordnet.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/dict/dictd-wordnet.nix b/pkgs/servers/dict/dictd-wordnet.nix index 8378102dac535..e9277ca55e19d 100644 --- a/pkgs/servers/dict/dictd-wordnet.nix +++ b/pkgs/servers/dict/dictd-wordnet.nix @@ -4,11 +4,11 @@ stdenv.mkDerivation rec { version = "542"; pname = "dict-db-wordnet"; + dontUnpack = true; + buildInputs = [python2 wordnet]; - convert = ./wordnet_structures.py; - builder = writeScript "builder.sh" '' - . ${stdenv}/setup + installPhase = '' mkdir -p $out/share/dictd/ cd $out/share/dictd @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { DATA="$DATA `echo $i | sed -e s,data,index,` $i"; done - python ${convert} $DATA + python ${./wordnet_structures.py} $DATA echo en_US.UTF-8 > locale ''; From 56a79eb9bd4ae0db17f3b9f2dbf44275fca56132 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:52:31 -0500 Subject: [PATCH 264/323] duplicity: structured-attrs build fix --- pkgs/tools/backup/duplicity/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/backup/duplicity/default.nix b/pkgs/tools/backup/duplicity/default.nix index 24e1a2954ed6f..b95e82dced015 100644 --- a/pkgs/tools/backup/duplicity/default.nix +++ b/pkgs/tools/backup/duplicity/default.nix @@ -36,7 +36,7 @@ pythonPackages.buildPythonApplication rec { ./linux-disable-timezone-test.patch ]; - SETUPTOOLS_SCM_PRETEND_VERSION = version; + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; nativeBuildInputs = [ makeWrapper From a482410e0baf244203c5051967e96c9aa66d8f85 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:52:47 -0500 Subject: [PATCH 265/323] ncompress: structured-attrs build fix --- pkgs/tools/compression/ncompress/builder.sh | 15 --------------- pkgs/tools/compression/ncompress/default.nix | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 18 deletions(-) delete mode 100644 pkgs/tools/compression/ncompress/builder.sh diff --git a/pkgs/tools/compression/ncompress/builder.sh b/pkgs/tools/compression/ncompress/builder.sh deleted file mode 100644 index 7a3f34aae4691..0000000000000 --- a/pkgs/tools/compression/ncompress/builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -source $stdenv/setup -installFlags="PREFIX=$out" - -preBuild() { - cp Makefile.def Makefile - sed -i GNUmakefile -e 's/compress %/%/g' -} - -postInstall() { - rm $out/bin/uncompress* $out/bin/zcat* - ln -s compress $out/bin/uncompress - ln -s compress $out/bin/zcat -} - -genericBuild diff --git a/pkgs/tools/compression/ncompress/default.nix b/pkgs/tools/compression/ncompress/default.nix index f580709495ed9..0f2f08797e1b1 100644 --- a/pkgs/tools/compression/ncompress/default.nix +++ b/pkgs/tools/compression/ncompress/default.nix @@ -1,16 +1,27 @@ -{lib, stdenv, fetchurl}: +{ lib, stdenv, fetchurl }: stdenv.mkDerivation rec { pname = "ncompress"; version = "5.0"; - builder = ./builder.sh; - src = fetchurl { url = "mirror://sourceforge/project/ncompress/${pname}-${version}.tar.gz"; sha256 = "004r086c11sw9vg2j3srgxpz98w8pycjl33bk3pgqnd0s92igrn4"; }; + installFlags = [ "PREFIX=${placeholder "out"}" ]; + + preBuild = '' + cp Makefile.def Makefile + sed -i GNUmakefile -e 's/compress %/%/g' + ''; + + postInstall = '' + rm $out/bin/uncompress* $out/bin/zcat* + ln -s compress $out/bin/uncompress + ln -s compress $out/bin/zcat + ''; + meta = { homepage = "http://ncompress.sourceforge.net/"; license = lib.licenses.publicDomain; From ca12cb1380be6127913bef32ea7d903e9cffad8e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:53:00 -0500 Subject: [PATCH 266/323] directx-shader-compiler: structured-attrs build fix --- pkgs/tools/graphics/directx-shader-compiler/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/graphics/directx-shader-compiler/default.nix b/pkgs/tools/graphics/directx-shader-compiler/default.nix index 6bab32ff27fa0..80a62ab9a8381 100644 --- a/pkgs/tools/graphics/directx-shader-compiler/default.nix +++ b/pkgs/tools/graphics/directx-shader-compiler/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { configurePhase = '' # Requires some additional flags to cmake from a file in the repo additionalCMakeFlags=$(< utils/cmake-predefined-config-params) - cmakeFlags="$additionalCMakeFlags''${cmakeFlags:+ $cmakeFlags}" + cmakeFlags+=($additionalCMakeFlags) cmakeConfigurePhase ''; From 8e99a30ad6e5f0c76132e830661d207d57d1a2d6 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:53:21 -0500 Subject: [PATCH 267/323] bukubrow: structured-attrs build fix --- pkgs/tools/networking/bukubrow/default.nix | 35 +++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/pkgs/tools/networking/bukubrow/default.nix b/pkgs/tools/networking/bukubrow/default.nix index 157720651f43b..17999cb269a44 100644 --- a/pkgs/tools/networking/bukubrow/default.nix +++ b/pkgs/tools/networking/bukubrow/default.nix @@ -1,12 +1,18 @@ -{ lib, rustPlatform, fetchFromGitHub, sqlite }: let - -manifest = { - description = "Bukubrow extension host application"; - name = "com.samhh.bukubrow"; - path = "@out@/bin/bukubrow"; - type = "stdio"; -}; - +{ lib, writeText, rustPlatform, fetchFromGitHub, sqlite }: + +let + manifest = { + description = "Bukubrow extension host application"; + name = "com.samhh.bukubrow"; + path = "${placeholder "out"}/bin/bukubrow"; + type = "stdio"; + }; + firefoxManifest = writeText "firefox.json" (builtins.toJSON (manifest // { + allowed_extensions = [ "bukubrow@samhh.com" ]; + })); + chromeManifest = writeText "chrome.json" (builtins.toJSON (manifest // { + allowed_origins = [ "chrome-extension://ghniladkapjacfajiooekgkfopkjblpn/" ]; + })); in rustPlatform.buildRustPackage rec { pname = "bukubrow-host"; version = "5.0.0"; @@ -22,16 +28,9 @@ in rustPlatform.buildRustPackage rec { buildInputs = [ sqlite ]; - passAsFile = [ "firefoxManifest" "chromeManifest" ]; - firefoxManifest = builtins.toJSON (manifest // { - allowed_extensions = [ "bukubrow@samhh.com" ]; - }); - chromeManifest = builtins.toJSON (manifest // { - allowed_origins = [ "chrome-extension://ghniladkapjacfajiooekgkfopkjblpn/" ]; - }); postBuild = '' - substituteAll $firefoxManifestPath firefox.json - substituteAll $chromeManifestPath chrome.json + install -v ${firefoxManifest} firefox.json + install -v ${chromeManifest} chrome.json ''; postInstall = '' install -Dm0644 firefox.json $out/lib/mozilla/native-messaging-hosts/com.samhh.bukubrow.json From 6f70eb003af98f91a8c336ec8df6bd8a21598c76 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:53:36 -0500 Subject: [PATCH 268/323] clash: structured-attrs build fix --- pkgs/tools/networking/clash/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/clash/default.nix b/pkgs/tools/networking/clash/default.nix index 9cad36c68a632..11a86debb60a0 100644 --- a/pkgs/tools/networking/clash/default.nix +++ b/pkgs/tools/networking/clash/default.nix @@ -15,9 +15,8 @@ buildGoModule rec { doCheck = false; - buildFlagsArray = [ - "-ldflags=" - "-X github.com/Dreamacro/clash/constant.Version=${version}" + buildFlags = [ + "-ldflags=-X github.com/Dreamacro/clash/constant.Version=${version}" ]; meta = with lib; { From ba31f056f5399586c4ea406490e14eb2d08cfadc Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:53:45 -0500 Subject: [PATCH 269/323] azureus: structured-attrs build fix --- pkgs/tools/networking/p2p/azureus/default.nix | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/p2p/azureus/default.nix b/pkgs/tools/networking/p2p/azureus/default.nix index ba775a91c2622..d463439cf48a9 100644 --- a/pkgs/tools/networking/p2p/azureus/default.nix +++ b/pkgs/tools/networking/p2p/azureus/default.nix @@ -8,7 +8,27 @@ stdenv.mkDerivation { sha256 = "1hwrh3n0b0jbpsdk15zrs7pw175418phhmg6pn4xi1bvilxq1wrd"; }; - inherit jdk swt; + dontUnpack = true; + + installPhase = '' + mkdir -p $out/jars + cp $src $out/jars/azureus.jar + + mkdir -p $out/bin + cat > $out/bin/azureus < Date: Tue, 27 Apr 2021 18:53:53 -0500 Subject: [PATCH 270/323] chipsec: structured-attrs build fix --- pkgs/tools/security/chipsec/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/security/chipsec/default.nix b/pkgs/tools/security/chipsec/default.nix index fbb9c421e3539..5a1bc30f3266b 100644 --- a/pkgs/tools/security/chipsec/default.nix +++ b/pkgs/tools/security/chipsec/default.nix @@ -22,7 +22,7 @@ python3.pkgs.buildPythonApplication rec { patches = lib.optionals withDriver [ ./ko-path.diff ./compile-ko.diff ]; - KSRC = lib.optionalString withDriver "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; + env.KSRC = lib.optionalString withDriver "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; nativeBuildInputs = [ libelf From 9cf1b3d4f0619dcc2dedaebf9405e6e2037bd2e1 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 18:54:02 -0500 Subject: [PATCH 271/323] doas: structured-attrs build fix --- pkgs/tools/security/doas/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/doas/default.nix b/pkgs/tools/security/doas/default.nix index 7da3b8e9f0683..d703eea51e5c3 100644 --- a/pkgs/tools/security/doas/default.nix +++ b/pkgs/tools/security/doas/default.nix @@ -23,10 +23,9 @@ stdenv.mkDerivation rec { dontDisableStatic = true; configureFlags = [ - (lib.optionalString withTimestamp "--with-timestamp") # to allow the "persist" setting - (lib.optionalString (!withPAM) "--without-pam") "--pamdir=${placeholder "out"}/etc/pam.d" - ]; + ] ++ lib.optional withTimestamp "--with-timestamp" # to allow the "persist" setting + ++ lib.optional (!withPAM) "--without-pam"; patches = [ # Allow doas to discover binaries in /run/current-system/sw/{s,}bin and From ac630e8d2664c78dd988b25032f2ada1f99cf763 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:04:35 -0500 Subject: [PATCH 272/323] driversi686Linux.vaapiIntel: structured-attrs build fix --- pkgs/development/libraries/vaapi-intel/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/vaapi-intel/default.nix b/pkgs/development/libraries/vaapi-intel/default.nix index f21a947a533f1..1470227c23b06 100644 --- a/pkgs/development/libraries/vaapi-intel/default.nix +++ b/pkgs/development/libraries/vaapi-intel/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { }; # Set the correct install path: - LIBVA_DRIVERS_PATH = "${placeholder "out"}/lib/dri"; + env.LIBVA_DRIVERS_PATH = "${placeholder "out"}/lib/dri"; postInstall = lib.optionalString enableHybridCodec '' ln -s ${vaapi-intel-hybrid}/lib/dri/* $out/lib/dri/ From e1ecc2fb4e473558d7b60d2b5f40fbe36ba6910f Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:05:02 -0500 Subject: [PATCH 273/323] dunst: structured-attrs build fix --- pkgs/applications/misc/dunst/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/dunst/default.nix b/pkgs/applications/misc/dunst/default.nix index 5dffbf56a36ae..4eba2f6a3a799 100644 --- a/pkgs/applications/misc/dunst/default.nix +++ b/pkgs/applications/misc/dunst/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out)" - "VERSION=$(version)" + "VERSION=${version}" "SYSCONFDIR=$(out)/etc" "SERVICEDIR_DBUS=$(out)/share/dbus-1/services" "SERVICEDIR_SYSTEMD=$(out)/lib/systemd/user" From d2d882a2bdabc7b4bfdb8f6f6b71a3c9dae1b060 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:05:14 -0500 Subject: [PATCH 274/323] dolphinEmuMaster: structured-attrs build fix --- pkgs/misc/emulators/dolphin-emu/master.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/misc/emulators/dolphin-emu/master.nix b/pkgs/misc/emulators/dolphin-emu/master.nix index 1162791456038..014759de89520 100644 --- a/pkgs/misc/emulators/dolphin-emu/master.nix +++ b/pkgs/misc/emulators/dolphin-emu/master.nix @@ -55,7 +55,7 @@ in stdenv.mkDerivation rec { ]; qtWrapperArgs = lib.optionals stdenv.isLinux [ - "--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib" + "--prefix" "LD_LIBRARY_PATH" ":" "${vulkan-loader}/lib" ]; # - Allow Dolphin to use nix-provided libraries instead of building them From 28ec447cb8f1b3f59ce1387c3712c7479056dc8e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:07:04 -0500 Subject: [PATCH 275/323] edbrowse: structured-attrs build fix --- pkgs/applications/editors/edbrowse/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/editors/edbrowse/default.nix b/pkgs/applications/editors/edbrowse/default.nix index 86cc81a58c268..28a125a410678 100644 --- a/pkgs/applications/editors/edbrowse/default.nix +++ b/pkgs/applications/editors/edbrowse/default.nix @@ -4,6 +4,13 @@ stdenv.mkDerivation rec { pname = "edbrowse"; version = "3.7.7"; + src = fetchFromGitHub { + owner = "CMB"; + repo = "edbrowse"; + rev = "v${version}"; + sha256 = "0cw9d60mdhwna57r1vxn53s8gl81rr3cxnvm769ifq3xyh49vfcf"; + }; + buildInputs = [ curl pcre readline openssl duktape perl html-tidy ]; postPatch = '' @@ -14,16 +21,10 @@ stdenv.mkDerivation rec { ''; makeFlags = [ - "-C" "src" + "-C src" "prefix=${placeholder "out"}" ]; - src = fetchFromGitHub { - owner = "CMB"; - repo = "edbrowse"; - rev = "v${version}"; - sha256 = "0cw9d60mdhwna57r1vxn53s8gl81rr3cxnvm769ifq3xyh49vfcf"; - }; meta = with lib; { description = "Command Line Editor Browser"; longDescription = '' From f2564d809c3dae3cc73a909b453268a0de83259c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:16:43 -0500 Subject: [PATCH 276/323] elan: structured-attrs build fix --- pkgs/applications/science/logic/elan/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/logic/elan/default.nix b/pkgs/applications/science/logic/elan/default.nix index fab930e2c7b8f..0a41c70a3777e 100644 --- a/pkgs/applications/science/logic/elan/default.nix +++ b/pkgs/applications/science/logic/elan/default.nix @@ -20,10 +20,10 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config makeWrapper ]; - OPENSSL_NO_VENDOR = 1; + env.OPENSSL_NO_VENDOR = 1; buildInputs = [ curl zlib openssl ]; - cargoBuildFlags = [ "--features no-self-update" ]; + cargoBuildFlags = [ "--features" "no-self-update" ]; patches = lib.optionals stdenv.isLinux [ # Run patchelf on the downloaded binaries. From c6dfbee09f3490c854fc08f0ba7e78a6a866932b Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:20:56 -0500 Subject: [PATCH 277/323] eksctl: structured-attrs build fix --- pkgs/tools/admin/eksctl/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/admin/eksctl/default.nix b/pkgs/tools/admin/eksctl/default.nix index e24f002248327..a5a8b057691d3 100644 --- a/pkgs/tools/admin/eksctl/default.nix +++ b/pkgs/tools/admin/eksctl/default.nix @@ -17,10 +17,9 @@ buildGoModule rec { subPackages = [ "cmd/eksctl" ]; - buildFlags = [ "-tags netgo" "-tags release" ]; - - buildFlagsArray = [ + buildFlags = [ "-ldflags=-s -w -X github.com/weaveworks/eksctl/pkg/version.gitCommit=${src.rev} -X github.com/weaveworks/eksctl/pkg/version.buildDate=19700101-00:00:00" + "-tags" "netgo" "-tags" "release" ]; nativeBuildInputs = [ installShellFiles ]; From f51e26853bb39bdae1c83dadf72d6419ad555ada Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:27:43 -0500 Subject: [PATCH 278/323] electrs: structured-attrs build fix --- pkgs/applications/blockchains/electrs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/blockchains/electrs.nix b/pkgs/applications/blockchains/electrs.nix index 30742f8d7199a..a90de7eeff14d 100644 --- a/pkgs/applications/blockchains/electrs.nix +++ b/pkgs/applications/blockchains/electrs.nix @@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec { # needed for librocksdb-sys nativeBuildInputs = [ llvmPackages.clang ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + env.LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; cargoSha256 = "1rqpadlr9r4z2z825li6vi5a21hivc3bsn5ibxshrdrwiycyyxz8"; From cf588259ee0e2c35f8bd169de3ae484af7463c44 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:37:59 -0500 Subject: [PATCH 279/323] fetchHex: structured-attrs build fix --- pkgs/development/beam-modules/fetch-hex.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/beam-modules/fetch-hex.nix b/pkgs/development/beam-modules/fetch-hex.nix index 7f84e23607040..4bb2d433f6f1c 100644 --- a/pkgs/development/beam-modules/fetch-hex.nix +++ b/pkgs/development/beam-modules/fetch-hex.nix @@ -14,14 +14,14 @@ stdenv.mkDerivation ({ inherit sha256; }; - phases = [ "unpackPhase" "installPhase" ]; - unpackCmd = '' tar -xf $curSrc contents.tar.gz mkdir contents tar -C contents -xzf contents.tar.gz ''; + dontBuild = true; + installPhase = '' runHook preInstall mkdir "$out" From c12d2fb78d5709e09cd8fc68a0b51104c18ff96a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:38:12 -0500 Subject: [PATCH 280/323] mixRelease: structured-attrs build fix --- pkgs/development/beam-modules/mix-release.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/beam-modules/mix-release.nix b/pkgs/development/beam-modules/mix-release.nix index 320fcaa9c9b7c..98a744ad393b5 100644 --- a/pkgs/development/beam-modules/mix-release.nix +++ b/pkgs/development/beam-modules/mix-release.nix @@ -18,13 +18,13 @@ in stdenv.mkDerivation (overridable // { nativeBuildInputs = nativeBuildInputs ++ [ erlang hex elixir makeWrapper git ]; - MIX_ENV = mixEnv; - MIX_DEBUG = if enableDebugInfo then 1 else 0; - HEX_OFFLINE = 1; - DEBUG = if enableDebugInfo then 1 else 0; # for Rebar3 compilation + env.MIX_ENV = mixEnv; + env.MIX_DEBUG = if enableDebugInfo then 1 else 0; + env.HEX_OFFLINE = 1; + env.DEBUG = if enableDebugInfo then 1 else 0; # for Rebar3 compilation # the api with `mix local.rebar rebar path` makes a copy of the binary - MIX_REBAR = "${rebar}/bin/rebar"; - MIX_REBAR3 = "${rebar3}/bin/rebar3"; + env.MIX_REBAR = "${rebar}/bin/rebar"; + env.MIX_REBAR3 = "${rebar3}/bin/rebar3"; postUnpack = '' export HEX_HOME="$TEMPDIR/hex" From 3cd9ef01225c2fac108bc52f75abae7c88d9a69c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:42:44 -0500 Subject: [PATCH 281/323] qwt: structured-attrs build fix --- pkgs/development/libraries/qwt/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qwt/default.nix b/pkgs/development/libraries/qwt/default.nix index e158fe3488566..f87e698052f78 100644 --- a/pkgs/development/libraries/qwt/default.nix +++ b/pkgs/development/libraries/qwt/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { ''; preConfigure = '' - qmakeFlags="$qmakeFlags INSTALLBASE=$out -after doc.path=$out/share/doc/${name}" + qmakeFlags+=("INSTALLBASE=$out" "-after" "doc.path=$out/share/doc/${name}") ''; meta = with lib; { From 4754e01052cd7a63a76650400721eca32cc618d8 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 19:53:02 -0500 Subject: [PATCH 282/323] shellcheck: structured-attrs build fix --- pkgs/development/tools/shellcheck/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/tools/shellcheck/default.nix b/pkgs/development/tools/shellcheck/default.nix index 568b9e1e1dddc..284ce6d817a91 100644 --- a/pkgs/development/tools/shellcheck/default.nix +++ b/pkgs/development/tools/shellcheck/default.nix @@ -27,8 +27,6 @@ let outputs = [ "bin" "man" "doc" "out" ]; - phases = [ "unpackPhase" "buildPhase" "installPhase" "fixupPhase" ]; - buildPhase = '' pandoc -s -f markdown-smart -t man shellcheck.1.md -o shellcheck.1 ''; From 9a8da1056fc77a16c25ef4eb8e212917518a853a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 20:19:14 -0500 Subject: [PATCH 283/323] qwt6_qt4: structured-attrs build fix --- pkgs/development/libraries/qwt/6_qt4.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qwt/6_qt4.nix b/pkgs/development/libraries/qwt/6_qt4.nix index 61903af93fac5..18fabef33e89d 100644 --- a/pkgs/development/libraries/qwt/6_qt4.nix +++ b/pkgs/development/libraries/qwt/6_qt4.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { install_name_tool -id "$out/lib/qwt.framework/Versions/6/qwt" "$out/lib/qwt.framework/Versions/6/qwt" ''; - qmakeFlags = [ "-after doc.path=$out/share/doc/${name}" ]; + qmakeFlags = [ "-after" "doc.path=$out/share/doc/${name}" ]; meta = with lib; { description = "Qt widgets for technical applications"; From 481c8d590a8e3b102fed43047da9a177191ae2e1 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 20:21:20 -0500 Subject: [PATCH 284/323] facedetect: structured-attrs build fix --- pkgs/tools/graphics/facedetect/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/tools/graphics/facedetect/default.nix b/pkgs/tools/graphics/facedetect/default.nix index 257de05a898ab..aa45fd1fa6874 100644 --- a/pkgs/tools/graphics/facedetect/default.nix +++ b/pkgs/tools/graphics/facedetect/default.nix @@ -14,8 +14,6 @@ stdenv.mkDerivation rec { buildInputs = [ python2Packages.python python2Packages.wrapPython ]; pythonPath = [ python2Packages.numpy python2Packages.opencv4 ]; - phases = [ "unpackPhase" "patchPhase" "installPhase" ]; - patchPhase = '' substituteInPlace facedetect \ --replace /usr/share/opencv "${python2Packages.opencv4}/share/opencv4" From 7e74a749683ecc83d726a40af758b971b91cfe6d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 20:23:46 -0500 Subject: [PATCH 285/323] enigma: structured-attrs build fix --- pkgs/games/enigma/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/games/enigma/default.nix b/pkgs/games/enigma/default.nix index 131bd00e1857c..bb343e99107bb 100644 --- a/pkgs/games/enigma/default.nix +++ b/pkgs/games/enigma/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { # For some reason (might be related to the alpha status), some includes # which are required by lib-src/enigma-core are not picked up by the # configure script. Hence we add them manually. - CPPFLAGS = "-I${SDL2.dev}/include/SDL2 -I${SDL2_ttf}/include/SDL2 -I${SDL2_image}/include/SDL2 -I${SDL2_mixer}/include/SDL2"; + env.CPPFLAGS = "-I${SDL2.dev}/include/SDL2 -I${SDL2_ttf}/include/SDL2 -I${SDL2_image}/include/SDL2 -I${SDL2_mixer}/include/SDL2"; postInstall = '' rm -r $out/include From 28b9bcd52ef26b10ac98895226a526f36db191e1 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 20:24:07 -0500 Subject: [PATCH 286/323] freesweep: structured-attrs build fix --- pkgs/games/freesweep/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/games/freesweep/default.nix b/pkgs/games/freesweep/default.nix index 7c17877e93416..eb6c11af1d689 100644 --- a/pkgs/games/freesweep/default.nix +++ b/pkgs/games/freesweep/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses ]; preConfigure = '' - configureFlags="$configureFlags --with-prefsdir=$out/share" + configureFlags+=("--with-prefsdir=$out/share") ''; installPhase = '' From aefb18b16e9f773a4838b5840bc06e7aec81c874 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 20:31:44 -0500 Subject: [PATCH 287/323] gamenetworkingsockets: structured-attrs build fix --- pkgs/development/libraries/gamenetworkingsockets/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/gamenetworkingsockets/default.nix b/pkgs/development/libraries/gamenetworkingsockets/default.nix index 0546bfb8e08ec..4f2bfac8769a9 100644 --- a/pkgs/development/libraries/gamenetworkingsockets/default.nix +++ b/pkgs/development/libraries/gamenetworkingsockets/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ninja go ]; - cmakeFlags = [ "-G Ninja" ]; + cmakeFlags = [ "-G" "Ninja" ]; # tmp home for go preBuild = "export HOME=\"$TMPDIR\""; From 3e015912f8ebf0157b3d04a98633dacfa96c40ed Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 20:50:18 -0500 Subject: [PATCH 288/323] gibo: structured-attrs build fix --- pkgs/tools/misc/gibo/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/tools/misc/gibo/default.nix b/pkgs/tools/misc/gibo/default.nix index 70d0eb19ca853..6ee4698d750c4 100644 --- a/pkgs/tools/misc/gibo/default.nix +++ b/pkgs/tools/misc/gibo/default.nix @@ -11,8 +11,6 @@ stdenv.mkDerivation rec { sha256 = "07j3sv9ar9l074krajw8nfmsfmdp836irsbd053dbqk2v880gfm6"; }; - phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; - installPhase = '' mkdir -p $out/bin $out/share/bash-completion/completions cp gibo $out/bin From b3771bafb9b283047bdea48344b006323f98d633 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 20:50:53 -0500 Subject: [PATCH 289/323] git-review: structured-attrs build fix --- pkgs/applications/version-management/git-review/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/git-review/default.nix b/pkgs/applications/version-management/git-review/default.nix index 042bdc2a19d71..8bc270819d636 100644 --- a/pkgs/applications/version-management/git-review/default.nix +++ b/pkgs/applications/version-management/git-review/default.nix @@ -6,7 +6,7 @@ buildPythonApplication rec { # Manually set version because prb wants to get it from the git # upstream repository (and we are installing from tarball instead) - PBR_VERSION = version; + env.PBR_VERSION = version; src = fetchurl { url = "https://opendev.org/opendev/${pname}/archive/${version}.tar.gz"; From 5d23c1cf5b1bacc2f81ddb9b9e4266d3774ca829 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 21:40:07 -0500 Subject: [PATCH 290/323] mono: structured-attrs build fix --- pkgs/development/compilers/mono/generic.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/mono/generic.nix b/pkgs/development/compilers/mono/generic.nix index 901848c693a49..2d8cb1669ea15 100644 --- a/pkgs/development/compilers/mono/generic.nix +++ b/pkgs/development/compilers/mono/generic.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { configurePhase = '' patchShebangs ./ - ./autogen.sh --prefix $out $configureFlags + ./autogen.sh --prefix $out "''${configureFlags[@]}" ''; # We want pkg-config to take priority over the dlls in the Mono framework and the GAC From 3f1e6e84965c42574b44f48c1025971793767cda Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 21:40:51 -0500 Subject: [PATCH 291/323] buildRubyGem: structured-attrs build fix --- .../ruby-modules/gem-config/default.nix | 2 +- pkgs/development/ruby-modules/gem/default.nix | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix index 37a3bec7806cc..a1d27fb94dfe8 100644 --- a/pkgs/development/ruby-modules/gem-config/default.nix +++ b/pkgs/development/ruby-modules/gem-config/default.nix @@ -169,7 +169,7 @@ in }; mimemagic = attrs: { - FREEDESKTOP_MIME_TYPES_PATH = "${shared-mime-info}/share/mime/packages/freedesktop.org.xml"; + env.FREEDESKTOP_MIME_TYPES_PATH = "${shared-mime-info}/share/mime/packages/freedesktop.org.xml"; }; mini_magick = attrs: { diff --git a/pkgs/development/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix index 4838888223bf8..006f29de13fb6 100644 --- a/pkgs/development/ruby-modules/gem/default.nix +++ b/pkgs/development/ruby-modules/gem/default.nix @@ -98,8 +98,6 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // { inherit src; - env.RUBY = toString ruby; - unpackPhase = attrs.unpackPhase or '' runHook preUnpack @@ -131,8 +129,12 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // { # As of ruby 3.0, ruby headers require -fdeclspec when building with clang # Introduced in https://github.com/ruby/ruby/commit/0958e19ffb047781fe1506760c7cbd8d7fe74e57 - env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && lib.versionAtLeast ruby.version.major "3") - "-fdeclspec"; + env = { + RUBY = toString ruby; + NIX_CFLAGS_COMPILE = (lib.optionalString (stdenv.cc.isClang && lib.versionAtLeast ruby.version.major "3") + "-fdeclspec") + + (lib.optionalString ((attrs.env or {}) ? NIX_CFLAGS_COMPILE) " ${attrs.env.NIX_CFLAGS_COMPILE}"); + } // (attrs.env or {}); buildPhase = attrs.buildPhase or '' runHook preBuild @@ -173,21 +175,21 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // { export GEM_HOME=$out/${ruby.gemPath} mkdir -p $GEM_HOME - echo "buildFlags: $buildFlags" + echo "buildFlags: ''${buildFlags[@]}" ${lib.optionalString (type == "url") '' ruby ${./nix-bundle-install.rb} \ "path" \ '${gemName}' \ '${version}' \ - '${lib.escapeShellArgs buildFlags}' + "''${buildFlags[@]}" ''} ${lib.optionalString (type == "git") '' ruby ${./nix-bundle-install.rb} \ "git" \ '${gemName}' \ '${version}' \ - '${lib.escapeShellArgs buildFlags}' \ + "''${buildFlags[@]}" '${attrs.source.url}' \ '.' \ '${attrs.source.rev}' @@ -212,7 +214,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // { --backtrace \ --no-env-shebang \ ${documentFlag} \ - $gempkg $gemFlags -- $buildFlags + $gempkg "''${gemFlags[@]}" -- "''${buildFlags[@]}" # looks like useless files which break build repeatability and consume space pushd $out/${ruby.gemPath} From 79475166ffe8e2eddb6293cb074d6937ce071c5c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Tue, 27 Apr 2021 21:41:09 -0500 Subject: [PATCH 292/323] mkYarnPackage: structured-attrs build fix --- .../tools/yarn2nix-moretea/yarn2nix/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix index ad7e2738bf593..3d4372f749a8a 100644 --- a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix +++ b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix @@ -105,7 +105,7 @@ in rec { in stdenv.mkDerivation { inherit preBuild postBuild name; - phases = ["configurePhase" "buildPhase"]; + dontUnpack = true; buildInputs = [ yarn nodejs git ] ++ extraBuildInputs; configurePhase = '' @@ -113,8 +113,8 @@ in rec { export HOME=$PWD/yarn_home ''; - buildPhase = '' - runHook preBuild + installPhase = '' + runHook preInstall mkdir -p "deps/${pname}" cp ${packageJSON} "deps/${pname}/package.json" @@ -138,7 +138,7 @@ in rec { mv deps $out/ patchShebangs $out - runHook postBuild + runHook postInstall ''; }; From 909c377fb993094be4208c1ed180ee8421763f67 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:26:18 -0500 Subject: [PATCH 293/323] grandorgue: structured-attrs build fix --- pkgs/applications/audio/grandorgue/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/audio/grandorgue/default.nix b/pkgs/applications/audio/grandorgue/default.nix index 2d660bc736c17..191d77a624bec 100644 --- a/pkgs/applications/audio/grandorgue/default.nix +++ b/pkgs/applications/audio/grandorgue/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { buildInputs = [ pkg-config fftwFloat alsaLib zlib wavpack wxGTK31 udev ] ++ lib.optional jackaudioSupport libjack2; - cmakeFlags = lib.optional (!jackaudioSupport) [ + cmakeFlags = lib.optionals (!jackaudioSupport) [ "-DRTAUDIO_USE_JACK=OFF" "-DRTMIDI_USE_JACK=OFF" ] ++ lib.optional (!includeDemo) "-DINSTALL_DEMO=OFF"; From bdf5192578cf8fe42f7044b39cbb80351e5bfd89 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:26:43 -0500 Subject: [PATCH 294/323] jupyter: structured-attrs build fix --- pkgs/applications/editors/jupyter/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/jupyter/default.nix b/pkgs/applications/editors/jupyter/default.nix index 2bca120c1debc..21db74d97ee4d 100644 --- a/pkgs/applications/editors/jupyter/default.nix +++ b/pkgs/applications/editors/jupyter/default.nix @@ -13,6 +13,6 @@ in with python3.pkgs; toPythonModule ( notebook.overridePythonAttrs(oldAttrs: { - makeWrapperArgs = ["--set JUPYTER_PATH ${jupyterPath}"]; + makeWrapperArgs = [ "--set" "JUPYTER_PATH" jupyterPath ]; }) ) From 42d2c9f581e92ca755a039d5f28614371809695f Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:27:07 -0500 Subject: [PATCH 295/323] uhd3_5: structured-attrs build fix --- pkgs/applications/radio/uhd/3.5.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/radio/uhd/3.5.nix b/pkgs/applications/radio/uhd/3.5.nix index d913927a7b995..5e1e18cf97bf0 100644 --- a/pkgs/applications/radio/uhd/3.5.nix +++ b/pkgs/applications/radio/uhd/3.5.nix @@ -82,7 +82,7 @@ stdenv.mkDerivation rec { # TODO: Check if this still needed # ABI differences GCC 7.1 # /nix/store/wd6r25miqbk9ia53pp669gn4wrg9n9cj-gcc-7.3.0/include/c++/7.3.0/bits/vector.tcc:394:7: note: parameter passing for argument of type 'std::vector::iterator {aka __gnu_cxx::__normal_iterator >}' changed in GCC 7.1 - ++ [ (lib.optionalString stdenv.isAarch32 "-DCMAKE_CXX_FLAGS=-Wno-psabi") ] + ++ lib.optional stdenv.isAarch32 "-DCMAKE_CXX_FLAGS=-Wno-psabi" ; # Python + Mako are always required for the build itself but not necessary for runtime. From 9833ad7fc3914f3077dde349e360efe0255cddda Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:27:22 -0500 Subject: [PATCH 296/323] gitlab: structured-attrs build fix --- pkgs/applications/version-management/gitlab/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/gitlab/default.nix b/pkgs/applications/version-management/gitlab/default.nix index 5d2b923628b24..7e28a5c4eb0f5 100644 --- a/pkgs/applications/version-management/gitlab/default.nix +++ b/pkgs/applications/version-management/gitlab/default.nix @@ -58,8 +58,8 @@ let patches = [ ./remove-hardcoded-locations.patch ]; # One of the patches uses this variable - if it's unset, execution # of rake tasks fails. - GITLAB_LOG_PATH = "log"; - FOSS_ONLY = !gitlabEnterprise; + env.GITLAB_LOG_PATH = "log"; + env.FOSS_ONLY = !gitlabEnterprise; configurePhase = '' runHook preConfigure From 42da0065a073b28208bb244901197c533ddae5de Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:27:52 -0500 Subject: [PATCH 297/323] guile-ncurses: structured-attrs build fix --- pkgs/development/guile-modules/guile-ncurses/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/guile-modules/guile-ncurses/default.nix b/pkgs/development/guile-modules/guile-ncurses/default.nix index 1e6418b0c3c71..f4542f3dfe771 100644 --- a/pkgs/development/guile-modules/guile-ncurses/default.nix +++ b/pkgs/development/guile-modules/guile-ncurses/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { ]; preConfigure = '' - configureFlags="$configureFlags --with-guilesitedir=$out/share/guile/site" + configureFlags+=("--with-guilesitedir=$out/share/guile/site") ''; postFixup = '' From 9c1fff6655f6039d9c3af949df6448a8787ef435 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:28:12 -0500 Subject: [PATCH 298/323] hunspellDicts: structured-attrs build fix --- pkgs/development/libraries/hunspell/dictionaries.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkgs/development/libraries/hunspell/dictionaries.nix b/pkgs/development/libraries/hunspell/dictionaries.nix index 37b5678963599..3570cf7c596e5 100644 --- a/pkgs/development/libraries/hunspell/dictionaries.nix +++ b/pkgs/development/libraries/hunspell/dictionaries.nix @@ -44,7 +44,6 @@ let maintainers = with maintainers; [ renzo ]; platforms = platforms.all; }; - phases = "unpackPhase patchPhase buildPhase installPhase"; nativeBuildInputs = [ unzip ]; buildInputs = [ bash coreutils which zip ]; patchPhase = '' @@ -88,7 +87,6 @@ let platforms = platforms.all; }; nativeBuildInputs = [ unzip ]; - phases = "unpackPhase installPhase"; sourceRoot = "."; unpackCmd = '' unzip $src dictionaries/${dictFileName}.dic dictionaries/${dictFileName}.aff $readmeFile @@ -128,7 +126,6 @@ let platforms = platforms.all; }; nativeBuildInputs = [ unzip ]; - phases = "unpackPhase installPhase"; sourceRoot = "."; unpackCmd = '' unzip $src ${dictFileName}.dic ${dictFileName}.aff ${readmeFile} @@ -157,7 +154,6 @@ let platforms = platforms.all; }; nativeBuildInputs = [ unzip ]; - phases = "unpackPhase installPhase"; sourceRoot = "."; unpackCmd = '' unzip $src ${srcFileName}.dic ${srcFileName}.aff ${srcReadmeFile} @@ -184,7 +180,6 @@ let platforms = platforms.all; }; nativeBuildInputs = [ unzip ]; - phases = "unpackPhase patchPhase installPhase"; sourceRoot = "."; prePatch = '' # Fix dic file empty lines (FS#22275) @@ -203,7 +198,6 @@ let inherit srcs; - phases = ["unpackPhase" "installPhase"]; sourceRoot = "."; # Copy files stripping until first dash (path and hash) unpackCmd = "cp $curSrc \${curSrc##*-}"; @@ -241,7 +235,6 @@ let buildInputs = [ ispell perl hunspell ]; - phases = ["unpackPhase" "installPhase"]; installPhase = '' patchShebangs bin make hunspell/${dictFileName}.aff hunspell/${dictFileName}.dic From a548768d6f5d246b79cbae1f0664294a2b96167b Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:28:31 -0500 Subject: [PATCH 299/323] incrtcl: structured-attrs build fix --- pkgs/development/libraries/incrtcl/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/incrtcl/default.nix b/pkgs/development/libraries/incrtcl/default.nix index 67ae5623db120..5235c5efc3ddd 100644 --- a/pkgs/development/libraries/incrtcl/default.nix +++ b/pkgs/development/libraries/incrtcl/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { ''; preConfigure = '' - configureFlags="--exec_prefix=$prefix $configureFlags" + configureFlags+=("--exec_prefix=$prefix") ''; postInstall = '' From c0b788e97fa64a7df80b993d487b25a995d207b7 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:28:48 -0500 Subject: [PATCH 300/323] gwtdragdrop: structured-attrs build fix --- pkgs/development/libraries/java/gwt-dragdrop/builder.sh | 4 ---- pkgs/development/libraries/java/gwt-dragdrop/default.nix | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) delete mode 100644 pkgs/development/libraries/java/gwt-dragdrop/builder.sh diff --git a/pkgs/development/libraries/java/gwt-dragdrop/builder.sh b/pkgs/development/libraries/java/gwt-dragdrop/builder.sh deleted file mode 100644 index d37e110011e8b..0000000000000 --- a/pkgs/development/libraries/java/gwt-dragdrop/builder.sh +++ /dev/null @@ -1,4 +0,0 @@ -source $stdenv/setup - -mkdir -p $out/share/java -cp $src $out/share/java/$name.jar diff --git a/pkgs/development/libraries/java/gwt-dragdrop/default.nix b/pkgs/development/libraries/java/gwt-dragdrop/default.nix index 34a0e8c530a47..4db4b74993f5f 100644 --- a/pkgs/development/libraries/java/gwt-dragdrop/default.nix +++ b/pkgs/development/libraries/java/gwt-dragdrop/default.nix @@ -2,13 +2,19 @@ stdenv.mkDerivation { name = "gwt-dnd-2.6.5"; - builder = ./builder.sh; src = fetchurl { url = "http://gwt-dnd.googlecode.com/files/gwt-dnd-2.6.5.jar"; sha256 = "07zdlr8afs499asnw0dcjmw1cnjc646v91lflx5dv4qj374c97fw"; }; + dontUnpack = true; + + installPhase = '' + mkdir -p $out/share/java + cp $src $out/share/java/$name.jar + ''; + meta = with lib; { platforms = platforms.unix; license = licenses.asl20; From e0cddfabe9393f8db973a7dd51b4034bb5977d11 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:29:05 -0500 Subject: [PATCH 301/323] gwtwidgets: structured-attrs build fix --- pkgs/development/libraries/java/gwt-widgets/builder.sh | 6 ------ .../development/libraries/java/gwt-widgets/default.nix | 10 +++++++++- 2 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 pkgs/development/libraries/java/gwt-widgets/builder.sh diff --git a/pkgs/development/libraries/java/gwt-widgets/builder.sh b/pkgs/development/libraries/java/gwt-widgets/builder.sh deleted file mode 100644 index 8c2502385f2b5..0000000000000 --- a/pkgs/development/libraries/java/gwt-widgets/builder.sh +++ /dev/null @@ -1,6 +0,0 @@ -source $stdenv/setup - -tar xfvz $src -cd gwt-widgets-* -mkdir -p $out/share/java -cp gwt-widgets-*.jar $out/share/java diff --git a/pkgs/development/libraries/java/gwt-widgets/default.nix b/pkgs/development/libraries/java/gwt-widgets/default.nix index 692326a218953..4e69d2e4300fd 100644 --- a/pkgs/development/libraries/java/gwt-widgets/default.nix +++ b/pkgs/development/libraries/java/gwt-widgets/default.nix @@ -2,13 +2,21 @@ stdenv.mkDerivation { name = "gwt-widgets-0.2.0"; - builder = ./builder.sh; src = fetchurl { url = "mirror://sourceforge/gwt-widget/gwt-widgets-0.2.0-bin.tar.gz"; sha256 = "09isj4j6842rj13nv8264irkjjhvmgihmi170ciabc98911bakxb"; }; + dontUnpack = true; + + installPhase = '' + tar xfvz $src + cd gwt-widgets-* + mkdir -p $out/share/java + cp gwt-widgets-*.jar $out/share/java + ''; + meta = with lib; { platforms = platforms.unix; license = with licenses; [ afl21 lgpl2 ]; From 0c409d57ea97cfb24606fbc711f9afa393e749d2 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:29:19 -0500 Subject: [PATCH 302/323] jdom: structured-attrs build fix --- pkgs/development/libraries/java/jdom/builder.sh | 6 ------ pkgs/development/libraries/java/jdom/default.nix | 9 ++++++++- 2 files changed, 8 insertions(+), 7 deletions(-) delete mode 100755 pkgs/development/libraries/java/jdom/builder.sh diff --git a/pkgs/development/libraries/java/jdom/builder.sh b/pkgs/development/libraries/java/jdom/builder.sh deleted file mode 100755 index dbec4b6f3e0e5..0000000000000 --- a/pkgs/development/libraries/java/jdom/builder.sh +++ /dev/null @@ -1,6 +0,0 @@ -set -e -source $stdenv/setup - -tar zxvf $src -mkdir -p $out -mv * $out diff --git a/pkgs/development/libraries/java/jdom/default.nix b/pkgs/development/libraries/java/jdom/default.nix index 4bb90dd98874b..64cca6a001b09 100644 --- a/pkgs/development/libraries/java/jdom/default.nix +++ b/pkgs/development/libraries/java/jdom/default.nix @@ -2,13 +2,20 @@ stdenv.mkDerivation { name = "jdom-1.0"; - builder = ./builder.sh; src = fetchurl { url = "http://www.jdom.org/dist/binary/jdom-1.0.tar.gz"; sha256 = "1igmxzcy0s25zcy9vmcw0kd13lh60r0b4qg8lnp1jic33f427pxf"; }; + dontUnpack = true; + + installPhase = '' + tar zxvf $src + mkdir -p $out + mv * $out + ''; + meta = with lib; { description = "Java-based solution for accessing, manipulating, and outputting XML data from Java code"; homepage = "http://www.jdom.org"; From 84e2bc14d7ae78b07cef19b02be2ee258bc5b58d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:29:32 -0500 Subject: [PATCH 303/323] ifcopenshell: structured-attrs build fix --- pkgs/development/python-modules/ifcopenshell/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/ifcopenshell/default.nix b/pkgs/development/python-modules/ifcopenshell/default.nix index 2eedaaece690b..2788542661f51 100644 --- a/pkgs/development/python-modules/ifcopenshell/default.nix +++ b/pkgs/development/python-modules/ifcopenshell/default.nix @@ -39,7 +39,7 @@ buildPythonPackage rec { cd cmake ''; - PYTHONUSERBASE="."; + env.PYTHONUSERBASE="."; cmakeFlags = [ "-DUSERSPACE_PYTHON_PREFIX=ON" "-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade" From 57e27f873a900deb069ec4fbd961947595da2b60 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:29:45 -0500 Subject: [PATCH 304/323] python.pkgs.notebook: structured-attrs build fix --- pkgs/development/python-modules/notebook/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/notebook/default.nix b/pkgs/development/python-modules/notebook/default.nix index bfc5d8c60c1ab..ca47dfbb42797 100644 --- a/pkgs/development/python-modules/notebook/default.nix +++ b/pkgs/development/python-modules/notebook/default.nix @@ -35,7 +35,7 @@ buildPythonPackage rec { sha256 = "0464b28e18e7a06cec37e6177546c2322739be07962dd13bf712bcb88361f013"; }; - LC_ALL = "en_US.utf8"; + env.LC_ALL = "en_US.utf8"; checkInputs = [ nose pytestCheckHook glibcLocales ] ++ (if isPy3k then [ nose_warnings_filters ] else [ mock ]); From e4c37edae43fb69800ac497b709ec64d6df8346e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:30:02 -0500 Subject: [PATCH 305/323] gup: structured-attrs build fix --- pkgs/development/tools/build-managers/gup/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/build-managers/gup/default.nix b/pkgs/development/tools/build-managers/gup/default.nix index dfa65736f99f2..ccb6b985995ed 100644 --- a/pkgs/development/tools/build-managers/gup/default.nix +++ b/pkgs/development/tools/build-managers/gup/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ python3 which pychecker ]; buildInputs = [ python3 ]; strictDeps = true; - SKIP_PYCHECKER = pychecker == null; + env.SKIP_PYCHECKER = pychecker == null; buildPhase = "make python"; installPhase = '' mkdir $out From ce124432dbc6eaa9f55d6984d5f9100d58275977 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:30:27 -0500 Subject: [PATCH 306/323] hyperrogue: structured-attrs build fix --- pkgs/games/hyperrogue/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/games/hyperrogue/default.nix b/pkgs/games/hyperrogue/default.nix index 08427bd29205f..d8ee8cffb215b 100644 --- a/pkgs/games/hyperrogue/default.nix +++ b/pkgs/games/hyperrogue/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { sha256 = "0bijgbqpc867pq8lbwwvcnc713gm51mmz625xb5br0q2qw09nkyh"; }; - CPPFLAGS = "-I${SDL.dev}/include/SDL"; + env.CPPFLAGS = "-I${SDL.dev}/include/SDL"; buildInputs = [ autoreconfHook SDL SDL_ttf SDL_gfx SDL_mixer libpng glew ]; From ff1efab80ff07e73932d2eeb58ea78160c9292e1 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:30:38 -0500 Subject: [PATCH 307/323] jool-cli: structured-attrs build fix --- pkgs/os-specific/linux/jool/cli.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/jool/cli.nix b/pkgs/os-specific/linux/jool/cli.nix index b1bce496614a1..0e3cbc5971265 100644 --- a/pkgs/os-specific/linux/jool/cli.nix +++ b/pkgs/os-specific/linux/jool/cli.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ autoreconfHook pkg-config ]; buildInputs = [ libnl iptables ]; - makeFlags = [ "-C" "src/usr" ]; + makeFlags = [ "-C src/usr" ]; prePatch = '' sed -e 's%^XTABLES_SO_DIR = .*%XTABLES_SO_DIR = '"$out"'/lib/xtables%g' -i src/usr/iptables/Makefile From 0d5df5569216d34450b36bac8b976b9b9b76e927 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:31:10 -0500 Subject: [PATCH 308/323] jboss_mysql_jdbc: structured-attrs build fix --- pkgs/servers/http/jboss/jdbc/mysql/builder.sh | 5 ----- pkgs/servers/http/jboss/jdbc/mysql/default.nix | 9 +++++++-- 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 pkgs/servers/http/jboss/jdbc/mysql/builder.sh diff --git a/pkgs/servers/http/jboss/jdbc/mysql/builder.sh b/pkgs/servers/http/jboss/jdbc/mysql/builder.sh deleted file mode 100644 index 6af39a0cb6338..0000000000000 --- a/pkgs/servers/http/jboss/jdbc/mysql/builder.sh +++ /dev/null @@ -1,5 +0,0 @@ -buildInputs="$mysql_jdbc" -source $stdenv/setup - -mkdir -p $out/server/default/lib -ln -s $mysql_jdbc/share/java/mysql-connector-java.jar $out/server/default/lib/mysql-connector-java.jar diff --git a/pkgs/servers/http/jboss/jdbc/mysql/default.nix b/pkgs/servers/http/jboss/jdbc/mysql/default.nix index e05bf4bfce8cc..991a31e90f795 100644 --- a/pkgs/servers/http/jboss/jdbc/mysql/default.nix +++ b/pkgs/servers/http/jboss/jdbc/mysql/default.nix @@ -3,9 +3,14 @@ stdenv.mkDerivation { name = "jboss-mysql-jdbc"; - builder = ./builder.sh; + buildInputs = [ mysql_jdbc ]; - inherit mysql_jdbc; + dontUnpack = true; + + installPhase = '' + mkdir -p $out/server/default/lib + ln -s ${mysql_jdbc}/share/java/mysql-connector-java.jar $out/server/default/lib/mysql-connector-java.jar + ''; meta = { platforms = lib.platforms.unix; From add2fb5f9ed22a5c09c2c9e5ff54b436dabe7b43 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:31:55 -0500 Subject: [PATCH 309/323] mysql_jdbc: structured-attrs build fix --- pkgs/servers/sql/mysql/jdbc/builder.sh | 9 --------- pkgs/servers/sql/mysql/jdbc/default.nix | 11 ++++++++++- 2 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 pkgs/servers/sql/mysql/jdbc/builder.sh diff --git a/pkgs/servers/sql/mysql/jdbc/builder.sh b/pkgs/servers/sql/mysql/jdbc/builder.sh deleted file mode 100644 index 56336e041356f..0000000000000 --- a/pkgs/servers/sql/mysql/jdbc/builder.sh +++ /dev/null @@ -1,9 +0,0 @@ -source $stdenv/setup - -set -e - -unzip $src -cd mysql-connector-java-* - -mkdir -p $out/share/java -cp mysql-connector-java-*-bin.jar $out/share/java/mysql-connector-java.jar diff --git a/pkgs/servers/sql/mysql/jdbc/default.nix b/pkgs/servers/sql/mysql/jdbc/default.nix index 6b22185cd8003..67ceabd9788b1 100644 --- a/pkgs/servers/sql/mysql/jdbc/default.nix +++ b/pkgs/servers/sql/mysql/jdbc/default.nix @@ -2,7 +2,6 @@ stdenv.mkDerivation rec { name = "mysql-connector-java-5.1.46"; - builder = ./builder.sh; src = fetchurl { url = "http://dev.mysql.com/get/Downloads/Connector-J/${name}.zip"; @@ -12,6 +11,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; buildInputs = [ ant ]; + unpackPhase = '' + unzip $src + cd mysql-connector-java-* + ''; + + installPhase = '' + mkdir -p $out/share/java + cp mysql-connector-java-*-bin.jar $out/share/java/mysql-connector-java.jar + ''; + meta = { platforms = lib.platforms.unix; }; From 1b1546a235ba30b18c173573d94184f18ea5f766 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:32:05 -0500 Subject: [PATCH 310/323] usbmuxd: structured-attrs build fix --- pkgs/tools/misc/usbmuxd/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/usbmuxd/default.nix b/pkgs/tools/misc/usbmuxd/default.nix index d001db4d3cb02..446f66693e5e0 100644 --- a/pkgs/tools/misc/usbmuxd/default.nix +++ b/pkgs/tools/misc/usbmuxd/default.nix @@ -15,8 +15,8 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ libimobiledevice libusb1 ]; preConfigure = '' - configureFlags="$configureFlags --with-udevrulesdir=$out/lib/udev/rules.d" - configureFlags="$configureFlags --with-systemdsystemunitdir=$out/lib/systemd/system" + configureFlags+=("--with-udevrulesdir=$out/lib/udev/rules.d") + configureFlags+=("--with-systemdsystemunitdir=$out/lib/systemd/system") ''; meta = with lib; { From d63e12c3351d29b73a48e5d886644c1eb73a075c Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:32:21 -0500 Subject: [PATCH 311/323] bitwarden_rs: structured-attrs build fix --- pkgs/tools/security/bitwarden_rs/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/security/bitwarden_rs/default.nix b/pkgs/tools/security/bitwarden_rs/default.nix index 70f0159cc69d1..88ef7ce38265b 100644 --- a/pkgs/tools/security/bitwarden_rs/default.nix +++ b/pkgs/tools/security/bitwarden_rs/default.nix @@ -4,7 +4,7 @@ , dbBackend ? "sqlite", libmysqlclient, postgresql }: let - featuresFlag = "--features ${dbBackend}"; + featuresFlags = [ "--features" dbBackend ]; in rustPlatform.buildRustPackage rec { pname = "bitwarden_rs"; @@ -26,12 +26,12 @@ in rustPlatform.buildRustPackage rec { env.RUSTC_BOOTSTRAP = 1; cargoSha256 = "139by5y2ma3v52nabzr5man1qy395rchs2dlivkj9xi829kg4mcr"; - cargoBuildFlags = [ featuresFlag ]; + cargoBuildFlags = featuresFlags; checkPhase = '' runHook preCheck - echo "Running cargo cargo test ${featuresFlag} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}" - cargo test ${featuresFlag} -- ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"} + echo "Running cargo cargo test ${toString featuresFlags} -- "''${checkFlags[@]}" ''${checkFlagsArray+''${checkFlagsArray[@]}}" + cargo test ${toString featuresFlags} -- "''${checkFlags[@]}" ''${checkFlagsArray+"''${checkFlagsArray[@]}"} runHook postCheck ''; From 85e4faf38b7bad7ab0c7ed116a260e4f92f7db86 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:32:31 -0500 Subject: [PATCH 312/323] gorilla-bin: structured-attrs build fix --- pkgs/tools/security/gorilla-bin/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/tools/security/gorilla-bin/default.nix b/pkgs/tools/security/gorilla-bin/default.nix index 68aa7c4881984..228271742c640 100644 --- a/pkgs/tools/security/gorilla-bin/default.nix +++ b/pkgs/tools/security/gorilla-bin/default.nix @@ -11,7 +11,6 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ patchelf makeWrapper ]; - phases = [ "unpackPhase" "installPhase" ]; unpackCmd = '' mkdir gorilla; From 3215bb59307e377d6297011f0136f4df5839175e Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:32:42 -0500 Subject: [PATCH 313/323] plan9port: structured-attrs build fix --- pkgs/tools/system/plan9port/builder.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/system/plan9port/builder.sh b/pkgs/tools/system/plan9port/builder.sh index b5196e512f418..b77ad62d1fbf0 100644 --- a/pkgs/tools/system/plan9port/builder.sh +++ b/pkgs/tools/system/plan9port/builder.sh @@ -1,3 +1,4 @@ +source .attrs.sh source $stdenv/setup export PLAN9=$out/plan9 From b5a367df2f31a799b0110ad5dc03a2f09b4d683f Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:32:55 -0500 Subject: [PATCH 314/323] ripgrep: structured-attrs build fix --- pkgs/tools/text/ripgrep/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/text/ripgrep/default.nix b/pkgs/tools/text/ripgrep/default.nix index 8c9eef9cc3dd1..998f8ede54c1d 100644 --- a/pkgs/tools/text/ripgrep/default.nix +++ b/pkgs/tools/text/ripgrep/default.nix @@ -22,7 +22,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "03wf9r2csi6jpa7v5sw5lpxkrk4wfzwmzx7k3991q3bdjzcwnnwp"; - cargoBuildFlags = lib.optional withPCRE2 "--features pcre2"; + cargoBuildFlags = lib.optionals withPCRE2 [ "--features" "pcre2" ]; nativeBuildInputs = [ asciidoctor installShellFiles ] ++ lib.optional withPCRE2 pkg-config; From 15cab9e9c4d2975379fa8313691fa976f9bfe06b Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:33:26 -0500 Subject: [PATCH 315/323] perlPackages.TermReadLineGnu: structured-attrs build fix --- pkgs/top-level/perl-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index d75d0a9ae0db8..e930b2121d7b6 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -19763,7 +19763,7 @@ let # For some crazy reason Makefile.PL doesn't generate a Makefile if # AUTOMATED_TESTING is set. - AUTOMATED_TESTING = false; + env.AUTOMATED_TESTING = false; # Makefile.PL looks for ncurses in Glibc's prefix. preConfigure = From 0652bd26ab34949adde3978f9ad67337b6565e2f Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:48:35 -0500 Subject: [PATCH 316/323] ipe: structured-attrs build fix --- pkgs/applications/graphics/ipe/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/graphics/ipe/default.nix b/pkgs/applications/graphics/ipe/default.nix index 72c79d7dc5019..3b598cd22dd69 100644 --- a/pkgs/applications/graphics/ipe/default.nix +++ b/pkgs/applications/graphics/ipe/default.nix @@ -42,11 +42,11 @@ mkDerivation rec { zlib ]; - IPEPREFIX=placeholder "out"; - URWFONTDIR="${texlive}/texmf-dist/fonts/type1/urw/"; - LUA_PACKAGE = "lua"; + env.IPEPREFIX = placeholder "out"; + env.URWFONTDIR = "${texlive}/texmf-dist/fonts/type1/urw/"; + env.LUA_PACKAGE = "lua"; - qtWrapperArgs = [ "--prefix PATH : ${texlive}/bin" ]; + qtWrapperArgs = [ "--prefix" "PATH" ":" "${texlive}/bin" ]; enableParallelBuilding = true; From c3ce3da5be9f333ae949dca5c8aea6a1a4230af1 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:50:29 -0500 Subject: [PATCH 317/323] irods: structured-attrs build fix --- pkgs/tools/filesystems/irods/common.nix | 4 +--- pkgs/tools/filesystems/irods/default.nix | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/filesystems/irods/common.nix b/pkgs/tools/filesystems/irods/common.nix index 77c05a616662a..83aaa3d612ab5 100644 --- a/pkgs/tools/filesystems/irods/common.nix +++ b/pkgs/tools/filesystems/irods/common.nix @@ -28,9 +28,7 @@ substituteInPlace CMakeLists.txt --replace "DESTINATION usr/bin" "DESTINATION bin" substituteInPlace CMakeLists.txt --replace "INCLUDE_DIRS usr/include/" "INCLUDE_DIRS include/" substituteInPlace CMakeLists.txt --replace "DESTINATION usr/lib/" "DESTINATION lib/" - export cmakeFlags="$cmakeFlags - -DCMAKE_INSTALL_PREFIX=$out - " + cmakeFlags+=("-DCMAKE_INSTALL_PREFIX=$out") ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/irods/default.nix b/pkgs/tools/filesystems/irods/default.nix index adbfafd84289b..a5044a744eced 100644 --- a/pkgs/tools/filesystems/irods/default.nix +++ b/pkgs/tools/filesystems/irods/default.nix @@ -45,11 +45,11 @@ in rec { do substituteInPlace $file --replace "CATCH2}/include" "CATCH2}/include/catch2" done - export cmakeFlags="$cmakeFlags - -DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,$out/lib - -DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,$out/lib - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,$out/lib - " + cmakeFlags+=( + "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,$out/lib" + "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,$out/lib" + "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,$out/lib" + ) substituteInPlace cmake/server.cmake --replace SETUID "" ''; From 89883afaf5c89406001f20cdf7eb63637aa7e6bc Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:55:01 -0500 Subject: [PATCH 318/323] innernet: structured-attrs build fix --- pkgs/tools/networking/innernet/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/networking/innernet/default.nix b/pkgs/tools/networking/innernet/default.nix index a195841ab575a..26d4e536745f6 100644 --- a/pkgs/tools/networking/innernet/default.nix +++ b/pkgs/tools/networking/innernet/default.nix @@ -10,7 +10,7 @@ rustPlatform.buildRustPackage rec { rev = "v${version}"; sha256 = "sha256-OomCSA02ypFVzkYMcmkFREWB6x7oxgpt7x2zRANIDMw="; }; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + env.LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; nativeBuildInputs = with llvmPackages; [ llvm clang ]; buildInputs = [ sqlite ] ++ lib.optionals stdenv.isDarwin [ Security ]; From 7aa6979ca9df1d531ff11c2e5ad363168706b6ee Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:55:10 -0500 Subject: [PATCH 319/323] indicator-application-gtk3: structured-attrs build fix --- pkgs/development/libraries/indicator-application/gtk3.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/indicator-application/gtk3.nix b/pkgs/development/libraries/indicator-application/gtk3.nix index 8947e33e9001a..606a23368cf6b 100644 --- a/pkgs/development/libraries/indicator-application/gtk3.nix +++ b/pkgs/development/libraries/indicator-application/gtk3.nix @@ -38,8 +38,8 @@ stdenv.mkDerivation rec { "localstatedir=\${TMPDIR}" ]; - PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "$(out)/lib/systemd/user"; - PKG_CONFIG_INDICATOR3_0_4_INDICATORDIR = "$(out)/lib/indicators3/7/"; + env.PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "$(out)/lib/systemd/user"; + env.PKG_CONFIG_INDICATOR3_0_4_INDICATORDIR = "$(out)/lib/indicators3/7/"; # Upstart is not used in NixOS postFixup = '' From ab2b6bfd2ee94bf47a979469e356bb88fdbb0a8d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 28 Apr 2021 14:58:50 -0500 Subject: [PATCH 320/323] httplz: structured-attrs build fix --- pkgs/tools/networking/httplz/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/networking/httplz/default.nix b/pkgs/tools/networking/httplz/default.nix index eacb598674d20..5214c6afc7d6d 100644 --- a/pkgs/tools/networking/httplz/default.nix +++ b/pkgs/tools/networking/httplz/default.nix @@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec { libiconv darwin.apple_sdk.frameworks.Security ]; - cargoBuildFlags = [ "--bin httplz" ]; + cargoBuildFlags = [ "--bin" "httplz" ]; cargoPatches = [ ./cargo-lock.patch ]; cargoSha256 = "1rpwzrr9bvw375vn97y5fqhraqz35d3ani9kfflvn2758x3g8gwf"; From 78d757695868595b3c39e5f1346dcc50eda221eb Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 30 Apr 2021 14:02:43 -0500 Subject: [PATCH 321/323] darwin: fix build with structured-attrs --- .../darwin/apple-source-releases/architecture/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/architecture/default.nix b/pkgs/os-specific/darwin/apple-source-releases/architecture/default.nix index 74327bc4c4285..c51028cbd62a9 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/architecture/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/architecture/default.nix @@ -11,7 +11,7 @@ appleDerivation { installFlags = [ "EXPORT_DSTDIR=/include/architecture" ]; - DSTROOT = "$(out)"; + env.DSTROOT = "$(out)"; appleHeaders = '' architecture/alignment.h From 813e2d3a2ec1ade9350380b0d1e73effd3d7fef4 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Fri, 30 Apr 2021 14:15:01 -0500 Subject: [PATCH 322/323] imag: fix build with structured-attrs --- pkgs/applications/misc/imag/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/imag/default.nix b/pkgs/applications/misc/imag/default.nix index 09f734df9a11d..f488c48503334 100644 --- a/pkgs/applications/misc/imag/default.nix +++ b/pkgs/applications/misc/imag/default.nix @@ -26,7 +26,7 @@ rustPlatform.buildRustPackage rec { ++ lib.optional stdenv.isDarwin Security; checkInputs = [ gitMinimal util-linuxMinimal ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + env.LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; cargoSha256 = "0n8cw70qh8g4hfwfaxwwxbrrx5hm2z037z8kdhvdpqkxljl9189x"; From 7c3a400378b494746332237f2aa25b5d64dbb2da Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 1 May 2021 09:57:56 -0500 Subject: [PATCH 323/323] jq: fix build with structured-attrs on darwin --- pkgs/development/tools/jq/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/jq/default.nix b/pkgs/development/tools/jq/default.nix index b73c4b01e28ec..3d8e9a2b5416f 100644 --- a/pkgs/development/tools/jq/default.nix +++ b/pkgs/development/tools/jq/default.nix @@ -25,10 +25,11 @@ stdenv.mkDerivation rec { # jq is linked to libjq: ++ lib.optional (!stdenv.isDarwin) "LDFLAGS=-Wl,-rpath,\\\${libdir}"; - preFixup = lib.optionalString minimal '' + preFixup = lib.optionalString minimal ('' rm -r .libs $out/{include,share} + '' + lib.optionalString stdenv.isLinux '' patchelf --shrink-rpath $out/bin/jq - ''; + ''); doInstallCheck = !minimal; installCheckTarget = "check";