Unverified Commit 214883f7 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

treewide: fix patsh cross patching (#403184)

parents 7d4b7b7f 69c74ba1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  stdenv,
  fetchFromGitHub,
  coreutils,
  patsh,
}:

@@ -25,6 +26,9 @@ stdenv.mkDerivation rec {
    patsh
  ];

  # needed for cross
  buildInputs = [ coreutils ];

  makeFlags = [
    "BINDIR=$(out)/bin"
  ];
@@ -35,7 +39,7 @@ stdenv.mkDerivation rec {

  postInstall = ''
    substituteAllInPlace $out/bin/csvheader
    patsh $out/bin/csvheader -fs ${builtins.storeDir}
    patsh $out/bin/csvheader -fs ${builtins.storeDir} --path "$HOST_PATH"
  '';

  meta = with lib; {
+5 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
  fetchFromGitHub,
  patsh,
  hostname,
  coreutils,
}:

stdenv.mkDerivation rec {
@@ -19,6 +20,9 @@ stdenv.mkDerivation rec {

  nativeBuildInputs = [ patsh ];

  # needed for cross
  buildInputs = [ coreutils ];

  buildPhase = ''
    runHook preBuild

@@ -26,7 +30,7 @@ stdenv.mkDerivation rec {
      --replace-fail \
        'echo "hostname"' \
        'echo "${hostname}/bin/hostname"'
    patsh -f rmate -s ${builtins.storeDir}
    patsh -f rmate -s ${builtins.storeDir} --path "$HOST_PATH"

    runHook postBuild
  '';
+5 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
  fetchFromGitHub,
  installShellFiles,
  patsh,
  coreutils,
}:

stdenvNoCC.mkDerivation rec {
@@ -22,10 +23,13 @@ stdenvNoCC.mkDerivation rec {
    patsh
  ];

  # needed for cross
  buildInputs = [ coreutils ];

  installPhase = ''
    runHook preInstall

    patsh -f sd
    patsh -f sd -s ${builtins.storeDir} --path "$HOST_PATH"
    install -Dt "$out/bin" sd
    installShellCompletion --zsh _sd

+3 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
  fetchFromGitHub,
  makeDesktopItem,
  patsh,
  coreutils,
  xorg,
  nixosTests,
}:
@@ -24,12 +25,13 @@ stdenvNoCC.mkDerivation (finalAttrs: {
  nativeBuildInputs = [ patsh ];

  buildInputs = [
    coreutils # needed for cross
    xorg.xauth
    xorg.xorgserver
  ];

  postInstall = ''
    patsh -f $out/bin/sx -s ${builtins.storeDir}
    patsh -f $out/bin/sx -s ${builtins.storeDir} --path "$HOST_PATH"

    install -Dm755 -t $out/share/xsessions ${
      makeDesktopItem {
+11 −1
Original line number Diff line number Diff line
@@ -12,6 +12,10 @@
  stdenvNoCC,
  xdg-utils,
  zbar,
  coreutils,
  gnused,
  gnugrep,
  file,
}:
stdenvNoCC.mkDerivation (finalAttr: {
  pname = "wifi-qr";
@@ -37,6 +41,12 @@ stdenvNoCC.mkDerivation (finalAttr: {
    qrencode
    xdg-utils
    zbar
    # needed for cross
    # TODO: somehow splice the packages in stdenvNoCC.initialPath and use that
    coreutils
    gnugrep
    gnused
    file
  ];

  nativeBuildInputs = [
@@ -74,7 +84,7 @@ stdenvNoCC.mkDerivation (finalAttr: {
    runHook preFixup

    patchShebangs $out/bin/wifi-qr
    patsh -f $out/bin/wifi-qr -s ${builtins.storeDir}
    patsh -f $out/bin/wifi-qr -s ${builtins.storeDir} --path "$HOST_PATH"

    runHook postFixup
  '';