From 97916acf085c7e65eb7cae39ccc92258b054a8b0 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Sun, 9 Sep 2018 05:37:29 -0400 Subject: [PATCH 1/7] texlive: Adds patch for missing synctex header. (#46376) This seems like a known issue as other distributions (ArchLinux here) have patches fixing the issue. This hopefully fixes more than one dependant builds for ZHF 18.09. (cherry picked from commit 1ac912bf1b964f0703b1bd8b10fb445006cdc383) --- pkgs/tools/typesetting/tex/texlive/bin.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index 53fac978ebb0..e3528ce699d1 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -32,6 +32,11 @@ let url = https://git.archlinux.org/svntogit/packages.git/plain/trunk/texlive-poppler-0.64.patch?h=packages/texlive-bin; sha256 = "0443d074zl3c5raba8jyhavish706arjcd80ibb84zwnwck4ai0w"; }) + (fetchurl { + name = "synctex-missing-header.patch"; + url = https://git.archlinux.org/svntogit/packages.git/plain/trunk/synctex-missing-header.patch?h=packages/texlive-bin&id=da56abf0f8a1e85daca0ec0f031b8fa268519e6b; + sha256 = "1c4aq8lk8g3mlfq3mdjnxvmhss3qs7nni5rmw0k054dmj6q1xj5n"; + }) ]; configureFlags = [ From 4ce4c247dbde5da05e8cbd096576cc366d630326 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sat, 8 Sep 2018 23:04:51 +0000 Subject: [PATCH 2/7] git: use default texinfo (cherry picked from commit 7705c76c49cf2958e56dc3293ea1fc5dd9aabfbf) --- pkgs/applications/version-management/git-and-tools/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix index 2093c86b050c..10c3d3391d60 100644 --- a/pkgs/applications/version-management/git-and-tools/default.nix +++ b/pkgs/applications/version-management/git-and-tools/default.nix @@ -4,7 +4,6 @@ args @ {config, lib, pkgs}: with args; with pkgs; let gitBase = callPackage ./git { - texinfo = texinfo5; svnSupport = false; # for git-svn support guiSupport = false; # requires tcl/tk sendEmailSupport = false; # requires plenty of perl libraries From 69b6db0ec5d871af72645fd6ee15e9f791c92615 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sat, 8 Sep 2018 23:04:55 +0000 Subject: [PATCH 3/7] gpgme: use default texinfo (cherry picked from commit 53c9efe9e51fa7355a4a41c559f08d4b2cff496e) --- pkgs/development/libraries/gpgme/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix index 71fe23ea6b0d..416ecb5631ed 100644 --- a/pkgs/development/libraries/gpgme/default.nix +++ b/pkgs/development/libraries/gpgme/default.nix @@ -2,7 +2,7 @@ , file, which , autoreconfHook , git -, texinfo5 +, texinfo , qtbase ? null , withPython ? false, swig2 ? null, python ? null }: @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { [ libgpgerror glib libassuan pth ] ++ lib.optional (qtbase != null) qtbase; - nativeBuildInputs = [ file pkgconfig gnupg autoreconfHook git texinfo5 ] + nativeBuildInputs = [ file pkgconfig gnupg autoreconfHook git texinfo ] ++ lib.optionals withPython [ python swig2 which ]; postPatch ='' From c64d76d0e682aa6094c3171e79475ad5be746b15 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 5 Sep 2018 13:57:25 -0400 Subject: [PATCH 4/7] dhcpcd: No need to hack around broken patchShebangs anymore --- pkgs/tools/networking/dhcpcd/default.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/networking/dhcpcd/default.nix b/pkgs/tools/networking/dhcpcd/default.nix index 1fe29b8b96ff..bb568bd2c1e7 100644 --- a/pkgs/tools/networking/dhcpcd/default.nix +++ b/pkgs/tools/networking/dhcpcd/default.nix @@ -11,7 +11,10 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ udev ]; + buildInputs = [ + udev + runtimeShellPackage # So patchShebangs finds a bash suitable for the installed scripts + ]; preConfigure = "patchShebangs ./configure"; @@ -29,11 +32,6 @@ stdenv.mkDerivation rec { # Check that the udev plugin got built. postInstall = stdenv.lib.optional (udev != null) "[ -e $out/lib/dhcpcd/dev/udev.so ]"; - # TODO shlevy remove once patchShebangs is fixed - postFixup = '' - find $out -type f -print0 | xargs --null sed -i 's|${stdenv.shellPackage}|${runtimeShellPackage}|' - ''; - meta = { description = "A client for the Dynamic Host Configuration Protocol (DHCP)"; homepage = https://roy.marples.name/projects/dhcpcd; From c72c8655600c297528c5a1d8e1a19dbbc5d6ecbd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 5 Sep 2018 13:15:35 -0400 Subject: [PATCH 5/7] stdenv: Define HOST_PATH more loosely when strictDeps isn't set This ensures this change is safe last minute for 18.09. Master won't have this. --- 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 141e94c5ed46..83a34c58a956 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -500,11 +500,11 @@ activatePackage() { # the transition, we do include everything in thatcase. # # TODO(@Ericson2314): Don't special-case native compilation - if [[ ( -z "${strictDeps-}" || "$hostOffset" -le -1 ) && -d "$pkg/bin" ]]; then + if [[ ( -z "${strictDeps-}" || "$hostOffset" -le -1 ) && -d "$pkg/bin" ]]; then addToSearchPath _PATH "$pkg/bin" fi - if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then + if [[ ( -z "${strictDeps-}" || "$hostOffset" -eq 0 ) && -d "$pkg/bin" ]]; then addToSearchPath HOST_PATH "$pkg/bin" fi From e9b63007e535a267657f5b61a75e91fce1cdb91b Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 19 Jul 2018 17:20:57 -0400 Subject: [PATCH 6/7] patch-shebangs: respect cross compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This hopefully makes patchShebangs respect cross compilation. It introduces the concept of the HOST_PATH. Nothing is ever executed on it but instead used as a way to get the proper path using ‘command -v’. Needs more testing. /cc @ericson2314 @dtzwill Fixes #33956 Fixes #21138 (Modified backport of f06942327ab60c0a546c7236cb718fd909430066. See previous commit to understand the differences between this and the original.) --- .../setup-hooks/patch-shebangs.sh | 53 +++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/setup-hooks/patch-shebangs.sh b/pkgs/build-support/setup-hooks/patch-shebangs.sh index 1433d1e1f144..04d7b6d8efa5 100644 --- a/pkgs/build-support/setup-hooks/patch-shebangs.sh +++ b/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -5,10 +5,32 @@ # rewritten to /nix/store//bin/python. Interpreters that are # already in the store are left untouched. -fixupOutputHooks+=('if [ -z "$dontPatchShebangs" -a -e "$prefix" ]; then patchShebangs "$prefix"; fi') +fixupOutputHooks+=(patchShebangsAuto) + +# Run patch shebangs on a directory. +# patchShebangs [--build | --host] directory + +# Flags: +# --build : Lookup commands available at build-time +# --host : Lookup commands available at runtime + +# Example use cases, +# $ patchShebangs --host /nix/store/...-hello-1.0/bin +# $ patchShebangs --build configure patchShebangs() { + local pathName + + if [ "$1" = "--host" ]; then + pathName=HOST_PATH + shift + elif [ "$1" = "--build" ]; then + pathName=PATH + shift + fi + local dir="$1" + header "patching script interpreter paths in $dir" local f local oldPath @@ -27,6 +49,14 @@ patchShebangs() { oldInterpreterLine=$(head -1 "$f" | tail -c+3) read -r oldPath arg0 args <<< "$oldInterpreterLine" + if [ -z "$pathName" ]; then + if [[ "$f" = "$NIX_STORE"* ]]; then + pathName=HOST_PATH + else + pathName=PATH + fi + fi + if $(echo "$oldPath" | grep -q "/bin/env$"); then # Check for unsupported 'env' functionality: # - options: something starting with a '-' @@ -35,14 +65,17 @@ patchShebangs() { echo "unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" exit 1 fi - newPath="$(command -v "$arg0" || true)" + + newPath="$(PATH="${!pathName}" command -v "$arg0" || true)" else if [ "$oldPath" = "" ]; then # If no interpreter is specified linux will use /bin/sh. Set # oldpath="/bin/sh" so that we get /nix/store/.../sh. oldPath="/bin/sh" fi - newPath="$(command -v "$(basename "$oldPath")" || true)" + + newPath="$(PATH="${!pathName}" command -v "$(basename "$oldPath")" || true)" + args="$arg0 $args" fi @@ -65,3 +98,17 @@ patchShebangs() { stopNest } + +patchShebangsAuto () { + if [ -z "$dontPatchShebangs" -a -e "$prefix" ]; then + + # Dev output will end up being run on the build platform. An + # example case of this is sdl2-config. Otherwise, we can just + # use the runtime path (--host). + if [ "$output" != out ] && [ "$output" = "${!outputDev}" ]; then + patchShebangs --build "$prefix" + else + patchShebangs --host "$prefix" + fi + fi +} From a86020b885b7a67284e533eeef44fd0d4a161d4a Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 16 Sep 2018 15:29:50 -0500 Subject: [PATCH 7/7] Revert "Merge pull request #46108 from obsidiansystems/cross-patch-shebangs" This reverts commit 6877b4c13e302fee846b711d38d6ddef1dccdf97, reversing changes made to 69b6db0ec5d871af72645fd6ee15e9f791c92615. --- .../setup-hooks/patch-shebangs.sh | 53 ++----------------- pkgs/stdenv/generic/setup.sh | 4 +- pkgs/tools/networking/dhcpcd/default.nix | 10 ++-- 3 files changed, 11 insertions(+), 56 deletions(-) diff --git a/pkgs/build-support/setup-hooks/patch-shebangs.sh b/pkgs/build-support/setup-hooks/patch-shebangs.sh index 04d7b6d8efa5..1433d1e1f144 100644 --- a/pkgs/build-support/setup-hooks/patch-shebangs.sh +++ b/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -5,32 +5,10 @@ # rewritten to /nix/store//bin/python. Interpreters that are # already in the store are left untouched. -fixupOutputHooks+=(patchShebangsAuto) - -# Run patch shebangs on a directory. -# patchShebangs [--build | --host] directory - -# Flags: -# --build : Lookup commands available at build-time -# --host : Lookup commands available at runtime - -# Example use cases, -# $ patchShebangs --host /nix/store/...-hello-1.0/bin -# $ patchShebangs --build configure +fixupOutputHooks+=('if [ -z "$dontPatchShebangs" -a -e "$prefix" ]; then patchShebangs "$prefix"; fi') patchShebangs() { - local pathName - - if [ "$1" = "--host" ]; then - pathName=HOST_PATH - shift - elif [ "$1" = "--build" ]; then - pathName=PATH - shift - fi - local dir="$1" - header "patching script interpreter paths in $dir" local f local oldPath @@ -49,14 +27,6 @@ patchShebangs() { oldInterpreterLine=$(head -1 "$f" | tail -c+3) read -r oldPath arg0 args <<< "$oldInterpreterLine" - if [ -z "$pathName" ]; then - if [[ "$f" = "$NIX_STORE"* ]]; then - pathName=HOST_PATH - else - pathName=PATH - fi - fi - if $(echo "$oldPath" | grep -q "/bin/env$"); then # Check for unsupported 'env' functionality: # - options: something starting with a '-' @@ -65,17 +35,14 @@ patchShebangs() { echo "unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" exit 1 fi - - newPath="$(PATH="${!pathName}" command -v "$arg0" || true)" + newPath="$(command -v "$arg0" || true)" else if [ "$oldPath" = "" ]; then # If no interpreter is specified linux will use /bin/sh. Set # oldpath="/bin/sh" so that we get /nix/store/.../sh. oldPath="/bin/sh" fi - - newPath="$(PATH="${!pathName}" command -v "$(basename "$oldPath")" || true)" - + newPath="$(command -v "$(basename "$oldPath")" || true)" args="$arg0 $args" fi @@ -98,17 +65,3 @@ patchShebangs() { stopNest } - -patchShebangsAuto () { - if [ -z "$dontPatchShebangs" -a -e "$prefix" ]; then - - # Dev output will end up being run on the build platform. An - # example case of this is sdl2-config. Otherwise, we can just - # use the runtime path (--host). - if [ "$output" != out ] && [ "$output" = "${!outputDev}" ]; then - patchShebangs --build "$prefix" - else - patchShebangs --host "$prefix" - fi - fi -} diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 83a34c58a956..141e94c5ed46 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -500,11 +500,11 @@ activatePackage() { # the transition, we do include everything in thatcase. # # TODO(@Ericson2314): Don't special-case native compilation - if [[ ( -z "${strictDeps-}" || "$hostOffset" -le -1 ) && -d "$pkg/bin" ]]; then + if [[ ( -z "${strictDeps-}" || "$hostOffset" -le -1 ) && -d "$pkg/bin" ]]; then addToSearchPath _PATH "$pkg/bin" fi - if [[ ( -z "${strictDeps-}" || "$hostOffset" -eq 0 ) && -d "$pkg/bin" ]]; then + if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then addToSearchPath HOST_PATH "$pkg/bin" fi diff --git a/pkgs/tools/networking/dhcpcd/default.nix b/pkgs/tools/networking/dhcpcd/default.nix index bb568bd2c1e7..1fe29b8b96ff 100644 --- a/pkgs/tools/networking/dhcpcd/default.nix +++ b/pkgs/tools/networking/dhcpcd/default.nix @@ -11,10 +11,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ - udev - runtimeShellPackage # So patchShebangs finds a bash suitable for the installed scripts - ]; + buildInputs = [ udev ]; preConfigure = "patchShebangs ./configure"; @@ -32,6 +29,11 @@ stdenv.mkDerivation rec { # Check that the udev plugin got built. postInstall = stdenv.lib.optional (udev != null) "[ -e $out/lib/dhcpcd/dev/udev.so ]"; + # TODO shlevy remove once patchShebangs is fixed + postFixup = '' + find $out -type f -print0 | xargs --null sed -i 's|${stdenv.shellPackage}|${runtimeShellPackage}|' + ''; + meta = { description = "A client for the Dynamic Host Configuration Protocol (DHCP)"; homepage = https://roy.marples.name/projects/dhcpcd;