From d68dfbb545e862c8445bb52c641b3bc51a8726b6 Mon Sep 17 00:00:00 2001 From: Kovacsics Robert Date: Tue, 25 Feb 2020 17:45:53 +0000 Subject: [PATCH] noweb: fix installation, use placeholders The problem was that nix passes lists as space-separated strings not as arrays of strings, so `"${foo[@]}"` doesn't work as intended because it's not an array. Instead we pass it in a bash array. Also, using builtins.placeholder instead of passing "$(out)" to bash, as that's not what we want to do (the `$(...)` is the process expansion in bash) --- .../tools/literate-programming/noweb/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/literate-programming/noweb/default.nix b/pkgs/development/tools/literate-programming/noweb/default.nix index 8806b5a81cd..11ff5001678 100644 --- a/pkgs/development/tools/literate-programming/noweb/default.nix +++ b/pkgs/development/tools/literate-programming/noweb/default.nix @@ -27,16 +27,19 @@ let noweb = stdenv.mkDerivation rec { "CC=clang" ]; + installFlags = [ - "BIN=$(out)/bin" - "ELISP=$(out)/share/emacs/site-lisp" - "LIB=$(out)/lib/noweb" - "MAN=$(out)/share/man" - "TEXINPUTS=$(tex)/tex/latex/noweb" ]; preInstall = '' mkdir -p "$tex/tex/latex/noweb" + installFlagsArray+=( \ + "BIN=${placeholder "out"}/bin" \ + "ELISP=${placeholder "out"}/share/emacs/site-lisp" \ + "LIB=${placeholder "out"}/lib/noweb" \ + "MAN=${placeholder "out"}/share/man" \ + "TEXINPUTS=${placeholder "tex"}/tex/latex/noweb" \ + ) ''; installTargets = [ "install-code" "install-tex" "install-elisp" ]; @@ -57,7 +60,7 @@ let noweb = stdenv.mkDerivation rec { # HACK: This is ugly, but functional. PATH=$out/bin:$PATH make -BC xdoc - make "''${installFlags[@]} install-man" + make "''${installFlagsArray[@]}" install-man ln -s "$tex" "$out/share/texmf" '';