From fae8d2627db00bd07d0a80669be26648161c86c0 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 4 Nov 2019 19:57:14 -0500 Subject: [PATCH 01/17] cc-wrapper, bintools-wrapper: Remove now unneeded `set {+,-}u` --- pkgs/build-support/bintools-wrapper/default.nix | 6 +----- pkgs/build-support/bintools-wrapper/setup-hook.sh | 3 --- pkgs/build-support/cc-wrapper/default.nix | 4 ---- pkgs/build-support/cc-wrapper/setup-hook.sh | 3 --- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 9f5395b635e0..4a56f00db49e 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -199,11 +199,7 @@ stdenv.mkDerivation { ]; postFixup = - '' - set -u - '' - - + optionalString (libc != null) ('' + optionalString (libc != null) ('' ## ## General libc support ## diff --git a/pkgs/build-support/bintools-wrapper/setup-hook.sh b/pkgs/build-support/bintools-wrapper/setup-hook.sh index 2e15fa95c794..a714bd151c90 100644 --- a/pkgs/build-support/bintools-wrapper/setup-hook.sh +++ b/pkgs/build-support/bintools-wrapper/setup-hook.sh @@ -2,8 +2,6 @@ # # See comments in cc-wrapper's setup hook. This works exactly the same way. -set -u - # Skip setup hook if we're neither a build-time dep, nor, temporarily, doing a # native compile. # @@ -73,4 +71,3 @@ export NIX_HARDENING_ENABLE # No local scope in sourced file unset -v role_pre role_post cmd upper_case -set +u diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index cf2d38cd9978..d6037552ef6e 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -134,8 +134,6 @@ stdenv.mkDerivation { installPhase = '' - set -u - mkdir -p $out/bin $out/nix-support wrap() { @@ -224,8 +222,6 @@ stdenv.mkDerivation { postFixup = '' - set -u - # Backwards compatability for packages expecting this file, e.g. with # `$NIX_CC/nix-support/dynamic-linker`. # diff --git a/pkgs/build-support/cc-wrapper/setup-hook.sh b/pkgs/build-support/cc-wrapper/setup-hook.sh index 211b50632914..5b13f2683097 100644 --- a/pkgs/build-support/cc-wrapper/setup-hook.sh +++ b/pkgs/build-support/cc-wrapper/setup-hook.sh @@ -54,8 +54,6 @@ # For more details, read the individual files where the mechanisms used to # accomplish this will be individually documented. -set -u - # Skip setup hook if we're neither a build-time dep, nor, temporarily, doing a # native compile. # @@ -120,4 +118,3 @@ export NIX_HARDENING_ENABLE # No local scope in sourced file unset -v role_pre role_post -set +u From cdbbaa91edc3179abee15b4597b8710aa8d0ca87 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Nov 2019 09:55:39 -0500 Subject: [PATCH 02/17] cmake: CMAKE_*_PATH can be undefined --- .../tools/build-managers/cmake/setup-hook.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index 8bd54d3bc13d..d5e88d773f67 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -128,22 +128,22 @@ makeCmakeFindLibs(){ for flag in $NIX_CFLAGS_COMPILE $NIX_LDFLAGS; do if test -n "$isystem_seen" && test -d "$flag"; then isystem_seen= - export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH${CMAKE_INCLUDE_PATH:+:}${flag}" + export CMAKE_INCLUDE_PATH="${CMAKE_INCLUDE_PATH-}${CMAKE_INCLUDE_PATH:+:}${flag}" elif test -n "$iframework_seen" && test -d "$flag"; then iframework_seen= - export CMAKE_FRAMEWORK_PATH="$CMAKE_FRAMEWORK_PATH${CMAKE_FRAMEWORK_PATH:+:}${flag}" + export CMAKE_FRAMEWORK_PATH="${CMAKE_FRAMEWORK_PATH-}${CMAKE_FRAMEWORK_PATH:+:}${flag}" else isystem_seen= iframework_seen= case $flag in -I*) - export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH${CMAKE_INCLUDE_PATH:+:}${flag:2}" + export CMAKE_INCLUDE_PATH="${CMAKE_INCLUDE_PATH-}${CMAKE_INCLUDE_PATH:+:}${flag:2}" ;; -L*) - export CMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH${CMAKE_LIBRARY_PATH:+:}${flag:2}" + export CMAKE_LIBRARY_PATH="${CMAKE_LIBRARY_PATH-}${CMAKE_LIBRARY_PATH:+:}${flag:2}" ;; -F*) - export CMAKE_FRAMEWORK_PATH="$CMAKE_FRAMEWORK_PATH${CMAKE_FRAMEWORK_PATH:+:}${flag:2}" + export CMAKE_FRAMEWORK_PATH="${CMAKE_FRAMEWORK_PATH-}${CMAKE_FRAMEWORK_PATH:+:}${flag:2}" ;; -isystem) isystem_seen=1 From 2c1d9d8bc1222abe8e597277eb1c3f1af2ac4423 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Nov 2019 14:21:42 -0500 Subject: [PATCH 03/17] i-score: CMAKE_PREFIX_PATH can be undefined --- pkgs/applications/audio/i-score/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/audio/i-score/default.nix b/pkgs/applications/audio/i-score/default.nix index 2cc39e649434..f3928499413c 100644 --- a/pkgs/applications/audio/i-score/default.nix +++ b/pkgs/applications/audio/i-score/default.nix @@ -70,7 +70,7 @@ stdenv.mkDerivation rec { ]; preConfigure = '' - export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:$(echo "${jamomacore}/jamoma/share/cmake/Jamoma")" + export CMAKE_PREFIX_PATH="''${CMAKE_PREFIX_PATH-}:$(echo "${jamomacore}/jamoma/share/cmake/Jamoma")" ''; postInstall = ''rm $out/bin/i-score.sh''; From 770a4c7946a1c55bf6295a34a42e1c4b657d1088 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Nov 2019 19:11:37 -0500 Subject: [PATCH 04/17] glib: Fix setup hook It was not robust against multiple matching directories, as the called function takes exactly 3 arguments. --- pkgs/development/libraries/glib/setup-hook.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/glib/setup-hook.sh b/pkgs/development/libraries/glib/setup-hook.sh index a1cb1f40c58a..20714ea7ab87 100644 --- a/pkgs/development/libraries/glib/setup-hook.sh +++ b/pkgs/development/libraries/glib/setup-hook.sh @@ -1,9 +1,11 @@ make_glib_find_gsettings_schemas() { # For packages that need gschemas of other packages (e.g. empathy) - if [ -d "$1"/share/gsettings-schemas/*/glib-2.0/schemas ]; then - addToSearchPath GSETTINGS_SCHEMAS_PATH "$1/share/gsettings-schemas/"* - fi + for maybe_dir in "$1"/share/gsettings-schemas/*/glib-2.0; do + if [[ -d "$maybe_dir/schemas" ]]; then + addToSearchPath GSETTINGS_SCHEMAS_PATH "$maybe_dir" + fi + done } addEnvHooks "$hostOffset" make_glib_find_gsettings_schemas From 42ffaf5290ec7c896c73d160151526041165115b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Nov 2019 19:16:36 -0500 Subject: [PATCH 05/17] cmake: NIX_CFLAGS_COMPILE NIX_LDFLAG could be undefined --- pkgs/development/tools/build-managers/cmake/setup-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index d5e88d773f67..52b9c3ab5f55 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -125,7 +125,7 @@ addEnvHooks "$targetOffset" addCMakeParams makeCmakeFindLibs(){ isystem_seen= iframework_seen= - for flag in $NIX_CFLAGS_COMPILE $NIX_LDFLAGS; do + for flag in ${NIX_CFLAGS_COMPILE-} ${NIX_LDFLAGS-}; do if test -n "$isystem_seen" && test -d "$flag"; then isystem_seen= export CMAKE_INCLUDE_PATH="${CMAKE_INCLUDE_PATH-}${CMAKE_INCLUDE_PATH:+:}${flag}" From 9167482d1275f2b17416ffcb18873237739f68c2 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Nov 2019 19:19:14 -0500 Subject: [PATCH 06/17] opensp: `sgmlHookDone` can be undefined --- pkgs/tools/text/sgml/opensp/setup-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/text/sgml/opensp/setup-hook.sh b/pkgs/tools/text/sgml/opensp/setup-hook.sh index 753a3ea64287..5bace3c66889 100644 --- a/pkgs/tools/text/sgml/opensp/setup-hook.sh +++ b/pkgs/tools/text/sgml/opensp/setup-hook.sh @@ -6,7 +6,7 @@ addSGMLCatalogs () { fi } -if test -z "$sgmlHookDone"; then +if test -z "${sgmlHookDone-}"; then sgmlHookDone=1 # Set http_proxy and ftp_proxy to a invalid host to prevent From 67cc85ec679eb16dc38908dfe78218544e637ee8 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Nov 2019 19:43:24 -0500 Subject: [PATCH 07/17] OCaml findlib: OCAMLPATH could be undefined --- pkgs/development/tools/ocaml/findlib/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix index fb1eb4276d62..7d95963209a3 100644 --- a/pkgs/development/tools/ocaml/findlib/default.nix +++ b/pkgs/development/tools/ocaml/findlib/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { setupHook = writeText "setupHook.sh" '' addOCamlPath () { if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib"; then - export OCAMLPATH="''${OCAMLPATH}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/" + export OCAMLPATH="''${OCAMLPATH-}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/" fi if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs"; then export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs" From 0b90a7f67f4df722a5c29773fcf8376d631f1fc8 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Nov 2019 19:45:48 -0500 Subject: [PATCH 08/17] lispPackages.clwrapper: NIX_LISP_LD_LIBRARY_PATH might be undefined --- pkgs/development/lisp-modules/clwrapper/setup-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/lisp-modules/clwrapper/setup-hook.sh b/pkgs/development/lisp-modules/clwrapper/setup-hook.sh index 8975ada53206..da2303a18bfb 100644 --- a/pkgs/development/lisp-modules/clwrapper/setup-hook.sh +++ b/pkgs/development/lisp-modules/clwrapper/setup-hook.sh @@ -27,7 +27,7 @@ setLisp () { collectNixLispLDLP () { if echo "$1/lib"/lib*.so* | grep . > /dev/null; then - export NIX_LISP_LD_LIBRARY_PATH="$NIX_LISP_LD_LIBRARY_PATH${NIX_LISP_LD_LIBRARY_PATH:+:}$1/lib" + export NIX_LISP_LD_LIBRARY_PATH="${NIX_LISP_LD_LIBRARY_PATH-}${NIX_LISP_LD_LIBRARY_PATH:+:}$1/lib" fi } From aaf0fd2c445d9d3bd686702d4b644d24ed3b10f3 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Nov 2019 19:50:42 -0500 Subject: [PATCH 09/17] lua-5 setup hook: LUA_PATH and LUA_CPATH can be undefined --- pkgs/development/interpreters/lua-5/setup-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/lua-5/setup-hook.sh b/pkgs/development/interpreters/lua-5/setup-hook.sh index f7e56b62ac90..1c445b82afde 100644 --- a/pkgs/development/interpreters/lua-5/setup-hook.sh +++ b/pkgs/development/interpreters/lua-5/setup-hook.sh @@ -20,7 +20,7 @@ addToLuaSearchPathWithCustomDelimiter() { if [[ ! -d "$topDir" ]]; then return; fi # export only if we haven't already got this dir in the search path - if [[ ${!varName} == *"$absPattern"* ]]; then return; fi + if [[ ${!varName-} == *"$absPattern"* ]]; then return; fi export "${varName}=${!varName:+${!varName};}${absPattern}" } From b78e84097fab550f365d39ca715632c7b9abd379 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Nov 2019 15:05:23 -0500 Subject: [PATCH 10/17] gdk-pixbuf setup hook: GDK_PIXBUF_MODULE_FILE might not be defined Also switch to [[ ... ]] because it is more robust w.r.t. empty arguments. --- pkgs/development/libraries/gdk-pixbuf/setup-hook.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh index 5a7dcd792996..8b6c80867a03 100644 --- a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh +++ b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh @@ -2,9 +2,9 @@ findGdkPixbufLoaders() { # choose the longest loaders.cache local loadersCache="$1/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" - if [ -f "$loadersCache" ]; then - if [ -f "$GDK_PIXBUF_MODULE_FILE" ]; then - if [ $(cat "$loadersCache"|wc -l) -gt $(cat "$GDK_PIXBUF_MODULE_FILE"|wc -l) ]; then + if [[ -f "$loadersCache" ]]; then + if [[ -f "${GDK_PIXBUF_MODULE_FILE-}" ]]; then + if [[ "$(cat "$loadersCache" | wc -l)" > "$(cat "$GDK_PIXBUF_MODULE_FILE" | wc -l)" ]]; then export GDK_PIXBUF_MODULE_FILE="$loadersCache" fi else From beda0365a64f025c26212cb69ffbb09f3ef329fd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Nov 2019 15:12:29 -0500 Subject: [PATCH 11/17] darwin private frameworks setup hook: NIX_CFLAGS_COMPILE may be undefined --- .../darwin/apple-sdk/private-frameworks-setup-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/darwin/apple-sdk/private-frameworks-setup-hook.sh b/pkgs/os-specific/darwin/apple-sdk/private-frameworks-setup-hook.sh index fbd977f8552d..a351c39de130 100644 --- a/pkgs/os-specific/darwin/apple-sdk/private-frameworks-setup-hook.sh +++ b/pkgs/os-specific/darwin/apple-sdk/private-frameworks-setup-hook.sh @@ -1,6 +1,6 @@ addPrivateFrameworks() { flag="-F/System/Library/PrivateFrameworks" - if [[ "$NIX_CFLAGS_COMPILE" != *$flag* ]]; then + if [[ "${NIX_CFLAGS_COMPILE-}" != *$flag* ]]; then NIX_CFLAGS_COMPILE+=" $flag" fi } From 12a85a7046503e6ff602663a1d054407a4e3f184 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Nov 2019 15:20:02 -0500 Subject: [PATCH 12/17] SDL, SDL2: SDL{,2}_PATH may be undefined --- pkgs/development/libraries/SDL/setup-hook.sh | 2 +- pkgs/development/libraries/SDL2/setup-hook.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/SDL/setup-hook.sh b/pkgs/development/libraries/SDL/setup-hook.sh index 20382f18f529..32a7d0d95548 100644 --- a/pkgs/development/libraries/SDL/setup-hook.sh +++ b/pkgs/development/libraries/SDL/setup-hook.sh @@ -1,6 +1,6 @@ addSDLPath () { if [ -e "$1/include/SDL" ]; then - export SDL_PATH="$SDL_PATH $1/include/SDL" + export SDL_PATH="${SDL_PATH-}${SDL_PATH:+ }$1/include/SDL" fi } diff --git a/pkgs/development/libraries/SDL2/setup-hook.sh b/pkgs/development/libraries/SDL2/setup-hook.sh index 3acce9d473c5..0119926491af 100644 --- a/pkgs/development/libraries/SDL2/setup-hook.sh +++ b/pkgs/development/libraries/SDL2/setup-hook.sh @@ -1,6 +1,6 @@ addSDL2Path () { if [ -e "$1/include/SDL2" ]; then - export SDL2_PATH="$SDL2_PATH $1/include/SDL2" + export SDL2_PATH="${SDL2_PATH-}${SDL2_PATH:+ }$1/include/SDL2" fi } From 908b143e510a0d6275d1960334e488173241251c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Nov 2019 16:31:55 -0500 Subject: [PATCH 13/17] gstreamer: GST_PLUGIN_SYSTEM_PATH.* may be undefined --- pkgs/development/libraries/gstreamer/core/setup-hook.sh | 2 +- .../libraries/gstreamer/legacy/gstreamer/setup-hook.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/core/setup-hook.sh b/pkgs/development/libraries/gstreamer/core/setup-hook.sh index b8c741af578f..026a4e5f55a0 100644 --- a/pkgs/development/libraries/gstreamer/core/setup-hook.sh +++ b/pkgs/development/libraries/gstreamer/core/setup-hook.sh @@ -1,7 +1,7 @@ addGstreamer1LibPath () { if test -d "$1/lib/gstreamer-1.0" then - export GST_PLUGIN_SYSTEM_PATH_1_0="${GST_PLUGIN_SYSTEM_PATH_1_0}${GST_PLUGIN_SYSTEM_PATH_1_0:+:}$1/lib/gstreamer-1.0" + export GST_PLUGIN_SYSTEM_PATH_1_0="${GST_PLUGIN_SYSTEM_PATH_1_0-}${GST_PLUGIN_SYSTEM_PATH_1_0:+:}$1/lib/gstreamer-1.0" fi } diff --git a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh index 65ce26112519..636e20b732b4 100644 --- a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh +++ b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh @@ -1,7 +1,7 @@ addGstreamerLibPath () { if test -d "$1/lib/gstreamer-0.10" then - export GST_PLUGIN_SYSTEM_PATH="${GST_PLUGIN_SYSTEM_PATH}${GST_PLUGIN_SYSTEM_PATH:+:}$1/lib/gstreamer-0.10" + export GST_PLUGIN_SYSTEM_PATH="${GST_PLUGIN_SYSTEM_PATH-}${GST_PLUGIN_SYSTEM_PATH:+:}$1/lib/gstreamer-0.10" fi } From 6fb526b32c86bb3e5fdf5694e23f2f53d7d892ce Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Nov 2019 17:12:25 -0500 Subject: [PATCH 14/17] findlib setup hook: `createFindlibDestdir` may not be defined --- pkgs/development/tools/ocaml/findlib/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix index 7d95963209a3..4398d8e41881 100644 --- a/pkgs/development/tools/ocaml/findlib/default.nix +++ b/pkgs/development/tools/ocaml/findlib/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs" fi export OCAMLFIND_DESTDIR="''$out/lib/ocaml/${ocaml.version}/site-lib/" - if test -n "$createFindlibDestdir"; then + if test -n "''${createFindlibDestdir-}"; then mkdir -p $OCAMLFIND_DESTDIR fi } From f1481f2c9084d61cb5ebc55d4fa7edbc756128d3 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Nov 2019 17:17:41 -0500 Subject: [PATCH 15/17] apple-sdk setup hooks: NIX_CFLAGS_COMPILE may be undefined --- pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh | 2 +- pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh b/pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh index 66e24fe58770..86c241cd0f56 100644 --- a/pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh +++ b/pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh @@ -1,5 +1,5 @@ linkSystemCoreFoundationFramework() { - NIX_CFLAGS_COMPILE="-F@out@/Library/Frameworks $NIX_CFLAGS_COMPILE" + NIX_CFLAGS_COMPILE="-F@out@/Library/Frameworks${NIX_CFLAGS_COMPILE:+ }${NIX_CFLAGS_COMPILE-}" # gross! many symbols (such as _OBJC_CLASS_$_NSArray) are defined in system CF, but not # in the opensource release # if the package needs private headers, we assume they also want to link with system CF diff --git a/pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh b/pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh index ed9bdbd912db..35cea773f98b 100644 --- a/pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh +++ b/pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh @@ -2,7 +2,7 @@ noDeprecatedDeclarations() { # Security.framework has about 2000 deprecated constants, all of which the user will be # warned about at compilation time flag="-Wno-deprecated-declarations" - if [[ "$NIX_CFLAGS_COMPILE" != *$flag* ]]; then + if [[ "${NIX_CFLAGS_COMPILE-}" != *$flag* ]]; then NIX_CFLAGS_COMPILE+=" $flag" fi } From ca782498a9532c48d8e12ce402813486ab90e7f0 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Nov 2019 18:24:49 -0500 Subject: [PATCH 16/17] emacs package setup hook: Fix 1. Make the test more robust 2. EMACSLOADPATH may be initially undefined. 3. did `targetOffset` twice when meant `hostOffset` too --- pkgs/build-support/emacs/setup-hook.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/emacs/setup-hook.sh b/pkgs/build-support/emacs/setup-hook.sh index e1db3e828fd7..b55c18738023 100644 --- a/pkgs/build-support/emacs/setup-hook.sh +++ b/pkgs/build-support/emacs/setup-hook.sh @@ -1,11 +1,11 @@ addEmacsVars () { - if test -d $1/share/emacs/site-lisp; then - export EMACSLOADPATH="$1/share/emacs/site-lisp:$EMACSLOADPATH" + if [[ -d "$1/share/emacs/site-lisp" ]]; then + export EMACSLOADPATH="$1/share/emacs/site-lisp${EMACSLOADPATH:+:}${EMACSLOADPATH-}" fi } # If this is for a wrapper derivation, emacs and the dependencies are all # run-time dependencies. If this is for precompiling packages into bytecode, # emacs is a compile-time dependency of the package. -addEnvHooks "$targetOffset" addEmacsVars +addEnvHooks "$hostOffset" addEmacsVars addEnvHooks "$targetOffset" addEmacsVars From 784c3dc0f96ca85561e3a6805b0261d4bfb9f7e0 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Nov 2019 19:39:03 -0500 Subject: [PATCH 17/17] qt5 qmake setup hook: `qmakeFlags` may be undefined --- 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 b785a779c8bc..7f6ddb76ad57 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-} ) qmakePrePhase() { qmakeFlags=( \