Unverified Commit 906789a8 authored by Wolfgang Walther's avatar Wolfgang Walther Committed by GitHub
Browse files

various: fix some substituteAll / replace with replaceVars (#376792)

parents 9a7c64d0 6cbf845d
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
  fetchFromGitHub,
  fish,
  runtimeShell,
  substituteAll,
  replaceVars,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -38,14 +38,16 @@ stdenv.mkDerivation (finalAttrs: {
    cp -vr * $out/share/oh-my-fish

    cp -v ${
      substituteAll {
        name = "omf-install";
        src = ./omf-install;
        omf = placeholder "out";
      replaceVars ./omf-install {
        inherit fish runtimeShell;
        # replaced below
        omf = null;
      }
    } $out/bin/omf-install

    substituteInPlace $out/bin/omf-install \
      --replace-fail '@omf@' "$out"

    chmod +x $out/bin/omf-install
    cat $out/bin/omf-install

+10 −11
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
  pytestCheckHook,
  pythonOlder,
  fetchFromGitLab,
  substituteAll,
  replaceVars,
  bubblewrap,
  exiftool,
  ffmpeg,
@@ -40,22 +40,21 @@ buildPythonPackage rec {
  patches =
    [
      # hardcode paths to some binaries
      (substituteAll (
        {
          src = ./paths.patch;
      (replaceVars ./paths.patch {
        exiftool = "${exiftool}/bin/exiftool";
        ffmpeg = "${ffmpeg}/bin/ffmpeg";
        }
        // lib.optionalAttrs dolphinIntegration { kdialog = "${plasma5Packages.kdialog}/bin/kdialog"; }
      ))
        kdialog = if dolphinIntegration then "${plasma5Packages.kdialog}/bin/kdialog" else null;
        # replaced in postPatch
        mat2 = null;
        mat2svg = null;
      })
      # the executable shouldn't be called .mat2-wrapped
      ./executable-name.patch
      # hardcode path to mat2 executable
      ./tests.patch
    ]
    ++ lib.optionals (stdenv.hostPlatform.isLinux) [
      (substituteAll {
        src = ./bubblewrap-path.patch;
      (replaceVars ./bubblewrap-path.patch {
        bwrap = "${bubblewrap}/bin/bwrap";
      })
    ];
+9 −17
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
  python,
  pytestCheckHook,
  stdenv,
  substituteAll,
  replaceVars,
  setuptools,
  torchWithRocm,
  zlib,
@@ -43,28 +43,20 @@ buildPythonPackage {
  patches =
    [
      ./0001-setup.py-introduce-TRITON_OFFLINE_BUILD.patch
      (substituteAll {
        src = ./0001-_build-allow-extra-cc-flags.patch;
      (replaceVars ./0001-_build-allow-extra-cc-flags.patch {
        ccCmdExtraFlags = "-Wl,-rpath,${addDriverRunpath.driverLink}/lib";
      })
      (substituteAll (
        {
          src = ./0002-nvidia-amd-driver-short-circuit-before-ldconfig.patch;
        }
        // lib.optionalAttrs rocmSupport { libhipDir = "${lib.getLib rocmPackages.clr}/lib"; }
        // lib.optionalAttrs cudaSupport {
          libcudaStubsDir = "${lib.getOutput "stubs" cudaPackages.cuda_cudart}/lib/stubs";
          ccCmdExtraFlags = "-Wl,-rpath,${addDriverRunpath.driverLink}/lib";
        }
      ))
      (replaceVars ./0002-nvidia-amd-driver-short-circuit-before-ldconfig.patch {
        libhipDir = if rocmSupport then "${lib.getLib rocmPackages.clr}/lib" else null;
        libcudaStubsDir =
          if cudaSupport then "${lib.getOutput "stubs" cudaPackages.cuda_cudart}/lib/stubs" else null;
      })
    ]
    ++ lib.optionals cudaSupport [
      (substituteAll {
        src = ./0003-nvidia-cudart-a-systempath.patch;
      (replaceVars ./0003-nvidia-cudart-a-systempath.patch {
        cudaToolkitIncludeDirs = "${lib.getInclude cudaPackages.cuda_cudart}/include";
      })
      (substituteAll {
        src = ./0004-nvidia-allow-static-ptxas-path.patch;
      (replaceVars ./0004-nvidia-allow-static-ptxas-path.patch {
        nixpkgsExtraBinaryPaths = lib.escapeShellArgs [ (lib.getExe' cudaPackages.cuda_nvcc "ptxas") ];
      })
    ];
+3 −4
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ rec {
      lib,
      callPackage,
      mitm-cache,
      substituteAll,
      replaceVars,
      symlinkJoin,
      concatTextFile,
      makeSetupHook,
@@ -266,11 +266,10 @@ rec {
            name = "setup-hook.sh";
            files = [
              (mitm-cache.setupHook)
              (substituteAll {
                src = ./setup-hook.sh;
              (replaceVars ./setup-hook.sh {
                # jdk used for keytool
                inherit (gradle) jdk;
                init_script = ./init-build.gradle;
                init_script = "${./init-build.gradle}";
              })
            ];
          }))
+3 −5
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
  lib,
  stdenv,
  fetchurl,
  substituteAll,
  replaceVars,
  nixosTests,

  docbook_xml_dtd_45,
@@ -65,8 +65,7 @@ stdenv.mkDerivation (finalAttrs: {
    ./respect-xml-catalog-files-var.patch

    # Hardcode paths
    (substituteAll {
      src = ./fix-paths.patch;
    (replaceVars ./fix-paths.patch {
      brz = "${breezy}/bin/brz";
      cp = "${coreutils}/bin/cp";
      patch = "${patch}/bin/patch";
@@ -81,8 +80,7 @@ stdenv.mkDerivation (finalAttrs: {
      euelfcompress = "${elfutils}/bin/eu-elfcompress";
    })

    (substituteAll {
      src = ./fix-test-paths.patch;
    (replaceVars ./fix-test-paths.patch {
      inherit glibcLocales;
    })
    ./fix-test-prefix.patch
Loading