treewide: replace substituteAll with replaceVars (#1)

Driving #237216 forward.
This commit is contained in:
Wolfgang Walther 2024-12-14 22:09:44 +01:00
parent 5319145368
commit ebd18cf115
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1
97 changed files with 209 additions and 303 deletions

View File

@ -2,7 +2,7 @@
lib,
fetchFromGitHub,
fetchPypi,
substituteAll,
replaceVars,
python39,
fluidsynth,
soundfont-fluid,
@ -58,8 +58,7 @@ python.pkgs.buildPythonApplication {
strictDeps = false;
patches = [
(substituteAll {
src = ./hardcoded-paths.patch;
(replaceVars ./hardcoded-paths.patch {
fluidsynth = "${fluidsynth}/lib/libfluidsynth.so";
soundfont = "${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2";
ghostscript = "${ghostscript}/bin/gs";

View File

@ -3,7 +3,7 @@
python3,
melpaBuild,
fetchFromGitHub,
substituteAll,
replaceVars,
acm,
markdown-mode,
basedpyright,
@ -42,8 +42,7 @@ melpaBuild {
patches = [
# Hardcode the python dependencies needed for lsp-bridge, so users
# don't have to modify their global environment
(substituteAll {
src = ./hardcode-dependencies.patch;
(replaceVars ./hardcode-dependencies.patch {
python = python.interpreter;
})
];

View File

@ -3,7 +3,7 @@
fetchFromGitHub,
makeWrapper,
mkDerivation,
substituteAll,
replaceVars,
wrapGAppsHook3,
wrapQtAppsHook,
@ -145,8 +145,7 @@ mkDerivation rec {
++ pythonBuildInputs;
patches = [
(substituteAll {
src = ./set-pyqt-package-dirs-ltr.patch;
(replaceVars ./set-pyqt-package-dirs-ltr.patch {
pyQt5PackageDir = "${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}";
qsciPackageDir = "${py.pkgs.qscintilla-qt5}/${py.pkgs.python.sitePackages}";
})

View File

@ -2,7 +2,7 @@
, fetchFromGitHub
, makeWrapper
, mkDerivation
, substituteAll
, replaceVars
, wrapGAppsHook3
, wrapQtAppsHook
@ -141,8 +141,7 @@ in mkDerivation rec {
++ pythonBuildInputs;
patches = [
(substituteAll {
src = ./set-pyqt-package-dirs.patch;
(replaceVars ./set-pyqt-package-dirs.patch {
pyQt5PackageDir = "${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}";
qsciPackageDir = "${py.pkgs.qscintilla-qt5}/${py.pkgs.python.sitePackages}";
})

View File

@ -6,7 +6,7 @@
povray,
qmake,
qttools,
substituteAll,
replaceVars,
zlib,
}:
@ -43,8 +43,7 @@ mkDerivation rec {
propagatedBuildInputs = [ povray ];
patches = [
(substituteAll {
src = ./povray.patch;
(replaceVars ./povray.patch {
inherit povray;
})
];

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
wrapQtAppsHook,
qmake,
qtsvg,
@ -24,8 +24,7 @@ stdenv.mkDerivation rec {
sourceRoot = "${src.name}/src";
patches = (
substituteAll {
src = ./set-graphviz-path.patch;
replaceVars ./set-graphviz-path.patch {
inherit graphviz;
}
);

View File

@ -1,6 +1,6 @@
{
mkDerivation,
substituteAll,
replaceVars,
lib,
extra-cmake-modules,
breeze-icons,
@ -89,8 +89,7 @@ mkDerivation {
# doesn't find them. See:
# https://github.com/NixOS/nixpkgs/issues/83885
patches = [
(substituteAll {
src = ./dependency-paths.patch;
(replaceVars ./dependency-paths.patch {
inherit mediainfo glaxnimate;
ffmpeg = ffmpeg-full;
mlt = mlt-full;

View File

@ -2,7 +2,7 @@
lib,
buildPythonApplication,
fetchFromGitHub,
substituteAll,
replaceVars,
requests,
dmenu,
}:
@ -19,8 +19,7 @@ buildPythonApplication rec {
};
patches = [
(substituteAll {
src = ./dmenu-path.patch;
(replaceVars ./dmenu-path.patch {
inherit dmenu;
})
];

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
callPackage,
}:
@ -35,8 +35,7 @@ in
patches = [
# Upstream asks that we change the bug tracker URL to not point to the upsteam bug tracker
(substituteAll {
src = ./support-url.patch;
(replaceVars ./support-url.patch {
assignees = "TomaSajt"; # should be a comma separated list of the github usernames of the maintainers
})
# Change how duplicate locales differentiate themselves (the store paths were too long)

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchurl,
substituteAll,
replaceVars,
cmake,
ninja,
pkg-config,
@ -57,8 +57,7 @@ stdenv.mkDerivation (finalAttrs: {
};
patches = [
(substituteAll {
src = ./hardcode-paths.patch;
(replaceVars ./hardcode-paths.patch {
catchsegv = "${glibc.bin}/bin/catchsegv";
bash = "${bash}/bin/bash";
cp = "${coreutils}/bin/cp";
@ -74,8 +73,7 @@ stdenv.mkDerivation (finalAttrs: {
# Fix swig not being able to find headers
# https://github.com/NixOS/nixpkgs/pull/82362#issuecomment-597948461
(substituteAll {
src = ./fix-swig-build.patch;
(replaceVars ./fix-swig-build.patch {
cairoDev = "${cairo.dev}";
})

View File

@ -2,7 +2,7 @@
stdenv,
lib,
fetchurl,
substituteAll,
replaceVars,
PodParser,
}:
@ -22,8 +22,7 @@ stdenv.mkDerivation {
patches = [
# The script requires a special Perl environment.
(substituteAll {
src = ./libpath.patch;
(replaceVars ./libpath.patch {
env = PodParser;
})
];

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchpatch,
substituteAll,
replaceVars,
buildEnv,
fetchFromGitHub,
python3Packages,
@ -20,8 +20,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./libpath.patch;
(replaceVars ./libpath.patch {
env = "${
buildEnv {
name = "wee-slack-env";

View File

@ -1,7 +1,7 @@
{
lib,
stdenv,
substituteAll,
replaceVars,
buildEnv,
fetchgit,
fetchFromGitHub,
@ -58,8 +58,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./libpath.patch;
(replaceVars ./libpath.patch {
env = "${
buildEnv {
name = "weechat-otr-env";

View File

@ -15,7 +15,7 @@
json-glib,
libmspack,
webkitgtk_4_1,
substituteAll,
replaceVars,
_experimental-update-script-combinators,
glib,
makeHardcodeGsettingsPatch,
@ -35,8 +35,7 @@ stdenv.mkDerivation rec {
# schemas from evolution. evolution-data-server is not wrapped with
# evolution's schemas because it would be a circular dependency with
# evolution.
(substituteAll {
src = ./hardcode-gsettings.patch;
(replaceVars ./hardcode-gsettings.patch {
evo = glib.makeSchemaPath evolution evolution.name;
})
];

View File

@ -15,7 +15,7 @@
qtbase,
qtsvg,
xdg-utils,
substituteAll,
replaceVars,
buildNpmPackage,
}:
@ -188,8 +188,7 @@ rec {
patches = [
# Override version string with hardcoded value as it may be outdated upstream.
(substituteAll {
src = ./override-version.patch;
(replaceVars ./override-version.patch {
version = sources.rev;
})
];
@ -234,8 +233,7 @@ rec {
patches = [
# Hardcode version to avoid the need to have the Git repo available at build time.
(substituteAll {
src = ./commit-hash.patch;
(replaceVars ./commit-hash.patch {
commit_hash = sources.rev;
})
];

View File

@ -25,7 +25,7 @@
pythonSupport ? false,
python ? null,
numpy ? null,
substituteAll,
replaceVars,
}:
let
@ -130,10 +130,11 @@ stdenv.mkDerivation rec {
hash = "sha256-ZegTvp0tTHlopQv+UzHDigs6XLkP2VfqLCWXl6aKJSI=";
})
]
++ lib.optional pythonSupport (substituteAll {
src = ./python.patch;
inherit (python.sourceVersion) major minor; # Should be changed in case of PyPy
});
++ lib.optional pythonSupport (
replaceVars ./python.patch {
inherit (python.sourceVersion) major minor; # Should be changed in case of PyPy
}
);
postPatch = ''
substituteInPlace src/caffe/util/io.cpp --replace \

View File

@ -4,7 +4,7 @@
fetchurl,
jre,
makeWrapper,
substituteAll,
replaceVars,
coreutils,
}:
@ -20,8 +20,7 @@ stdenv.mkDerivation rec {
patches = [
# By default, gen_vmoptions.sh tries to store custom options in $out/share
# at run time. This patch makes sure $HOME is used instead.
(substituteAll {
src = ./gen_vmoptions_to_homedir.patch;
(replaceVars ./gen_vmoptions_to_homedir.patch {
inherit coreutils;
})
];

View File

@ -25,7 +25,7 @@ in
lib,
buildGoModule,
runCommandLocal,
substituteAll,
replaceVars,
# Native build inputs
addDriverRunpath,
makeWrapper,
@ -109,8 +109,7 @@ in
inherit pname version src;
patches = lib.optionals (projectName == "apptainer") [
(substituteAll {
src = ./apptainer/0001-ldCache-patch-for-driverLink.patch;
(replaceVars ./apptainer/0001-ldCache-patch-for-driverLink.patch {
inherit (addDriverRunpath) driverLink;
})
];

View File

@ -1,7 +1,7 @@
{
lib,
fetchFromGitHub,
substituteAll,
replaceVars,
python3Packages,
testers,
ansible-cmdb,
@ -31,8 +31,7 @@ buildPythonApplication {
};
patches = [
(substituteAll {
src = ./setup.patch;
(replaceVars ./setup.patch {
inherit version;
})
];

View File

@ -19,7 +19,7 @@
lib,
openssl,
buildPackages,
substituteAll,
replaceVars,
writeScript,
}:
@ -41,8 +41,7 @@ stdenv.mkDerivation rec {
patches = lib.optional (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) (
# Build process generates files by compiling and then invoking an executable.
substituteAll {
src = ./jam-cross.patch;
replaceVars ./jam-cross.patch {
emulator = stdenv.hostPlatform.emulator buildPackages;
}
);

View File

@ -2,7 +2,7 @@
lib,
python3Packages,
fetchFromGitHub,
substituteAll,
replaceVars,
gobject-introspection,
wrapGAppsHook3,
gtk3,
@ -48,8 +48,7 @@ python3Packages.buildPythonPackage rec {
patches = [
# hardcodes version output
(substituteAll {
src = ./fix-version-output.patch;
(replaceVars ./fix-version-output.patch {
inherit version;
})

View File

@ -3,7 +3,7 @@
lib,
fetchFromGitHub,
makeWrapper,
substituteAll,
replaceVars,
perlPackages,
# Flags to enable processors
# Currently, Markdown.pl does not work
@ -35,8 +35,7 @@ stdenv.mkDerivation {
buildInputs = [ TextMarkdown ] ++ lib.optionals usePandoc [ pandoc ];
patches = [
(substituteAll {
src = ./0001-Setting-markdown_bin.patch;
(replaceVars ./0001-Setting-markdown_bin.patch {
markdown_path = if usePandoc then pandoc_path else markdownpl_path;
})
];

View File

@ -5,7 +5,7 @@
pkg-config,
util-linux,
bash,
substituteAll,
replaceVars,
}:
stdenv.mkDerivation rec {
@ -34,8 +34,7 @@ stdenv.mkDerivation rec {
'';
patches = [
(substituteAll {
src = ./bcache-udev-modern.patch;
(replaceVars ./bcache-udev-modern.patch {
shell = "${bash}/bin/sh";
})
./fix-static.patch

View File

@ -2,7 +2,7 @@
stdenv,
lib,
fetchzip,
substituteAll,
replaceVars,
bash,
jre,
}:
@ -20,8 +20,7 @@ stdenv.mkDerivation rec {
# The software has a non-standard install bash script which kind of works.
# However, to make it fully functional, the automatically detection of the
# program paths must be substituted with full paths.
(substituteAll {
src = ./install.patch;
(replaceVars ./install.patch {
inherit bash jre;
})
];

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
meson,
ninja,
pkg-config,
@ -46,8 +46,7 @@ stdenv.mkDerivation (finalAttrs: {
];
patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
gsettings = lib.getExe' glib "gsettings";
dbusLaunch = lib.getExe' dbus "dbus-launch";
bash = lib.getExe bash;

View File

@ -2,7 +2,7 @@
lib,
rustPlatform,
fetchFromGitHub,
substituteAll,
replaceVars,
stdenv,
}:
@ -21,8 +21,7 @@ rustPlatform.buildRustPackage rec {
patches = [
# patch the binary path so tests can find the binary when `--target` is present
(substituteAll {
src = ./fix-test-binary-path.patch;
(replaceVars ./fix-test-binary-path.patch {
shortTarget = stdenv.hostPlatform.rust.rustcTarget;
})
];

View File

@ -11,7 +11,7 @@
, zlib
, unstableGitUpdater
, libseccomp
, substituteAll
, replaceVars
}:
stdenv.mkDerivation {
@ -28,8 +28,7 @@ stdenv.mkDerivation {
patches = [
# Include chawan's man pages in mancha's search path
(substituteAll {
src = ./mancha-augment-path.diff;
(replaceVars ./mancha-augment-path.diff {
out = placeholder "out";
})
];

View File

@ -11,7 +11,7 @@
nixosTests,
libsodium,
pkg-config,
substituteAll,
replaceVars,
}:
rustPlatform.buildRustPackage rec {
@ -26,8 +26,7 @@ rustPlatform.buildRustPackage rec {
};
patches = [
(substituteAll {
src = ./system-libsodium.patch;
(replaceVars ./system-libsodium.patch {
libsodium_include_dir = "${libsodium.dev}/include";
})
];

View File

@ -5,7 +5,7 @@
bintools-unwrapped,
callPackage,
coreutils,
substituteAll,
replaceVars,
unzip,
}:
@ -22,8 +22,7 @@ stdenv.mkDerivation (finalAttrs: {
patches = [
# make sure tests set PATH correctly
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit coreutils;
})
];

View File

@ -1,7 +1,7 @@
{
lib,
fetchFromGitHub,
substituteAll,
replaceVars,
python3Packages,
mpv,
}:
@ -24,8 +24,7 @@ python3Packages.buildPythonApplication rec {
];
patches = [
(substituteAll {
src = ./mpv.patch;
(replaceVars ./mpv.patch {
inherit mpv;
})
];

View File

@ -3,7 +3,7 @@
, autoreconfHook
, neon
, procps
, substituteAll
, replaceVars
, zlib
, wrapperDir ? "/run/wrappers/bin"
}:
@ -28,12 +28,10 @@ stdenv.mkDerivation (finalAttrs: {
patches = [
./fix-sysconfdir.patch
./disable-suid.patch
(substituteAll {
src = ./0001-umount_davfs-substitute-ps-command.patch;
(replaceVars ./0001-umount_davfs-substitute-ps-command.patch {
ps = "${procps}/bin/ps";
})
(substituteAll {
src = ./0002-Make-sure-that-the-setuid-wrapped-umount-is-invoked.patch;
(replaceVars ./0002-Make-sure-that-the-setuid-wrapped-umount-is-invoked.patch {
inherit wrapperDir;
})
];

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
cmake,
openjpeg,
yaml-cpp,
@ -34,8 +34,7 @@ stdenv.mkDerivation (finalAttrs: {
};
patches = lib.optionals withCloudflareZlib [
(substituteAll {
src = ./dont-fetch-external-libs.patch;
(replaceVars ./dont-fetch-external-libs.patch {
inherit cloudflareZlib;
})
];

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitLab,
substituteAll,
replaceVars,
meson,
ninja,
pkg-config,
@ -36,8 +36,7 @@ stdenv.mkDerivation (finalAttrs: {
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit coreutils;
})
];

View File

@ -1,7 +1,7 @@
{
stdenv,
elvish,
substituteAll,
replaceVars,
}:
stdenv.mkDerivation {
@ -14,8 +14,7 @@ stdenv.mkDerivation {
buildCommand = ''
elvish ${
substituteAll {
src = ./expect-version.elv;
replaceVars ./expect-version.elv {
inherit (elvish) version;
}
}

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
makeWrapper,
makeDesktopItem,
copyDesktopItems,
@ -64,10 +64,11 @@ stdenv.mkDerivation (finalAttrs: {
patches =
[ ./disable_update_checking.patch ]
++ lib.optional withSystemEquicord (substituteAll {
inherit equicord;
src = ./use_system_equicord.patch;
});
++ lib.optional withSystemEquicord (
replaceVars ./use_system_equicord.patch {
inherit equicord;
}
);
env = {
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;

View File

@ -3,7 +3,7 @@
stdenv,
fetchFromGitHub,
fetchpatch2,
substituteAll,
replaceVars,
apple-sdk_11,
cmake,
darwinMinVersionHook,
@ -26,8 +26,7 @@ stdenv.mkDerivation (finalAttrs: {
patches = [
# Fix library searching and installation
(substituteAll {
src = ./fix-cmake.patch;
(replaceVars ./fix-cmake.patch {
so = stdenv.hostPlatform.extensions.sharedLibrary;
})

View File

@ -3,7 +3,7 @@
buildGoModule,
fetchFromGitHub,
nix-update-script,
substituteAll,
replaceVars,
}:
buildGoModule rec {
pname = "flottbot";
@ -18,8 +18,7 @@ buildGoModule rec {
patches = [
# patch out debug.ReadBuidlInfo since version information is not available with buildGoModule
(substituteAll {
src = ./version.patch;
(replaceVars ./version.patch {
version = version;
vcsHash = version; # Maybe there is a way to get the git ref from src? idk.
})

View File

@ -2,7 +2,7 @@
stdenv,
lib,
fetchzip,
substituteAll,
replaceVars,
dpkg,
autoPatchelfHook,
cups,
@ -41,8 +41,7 @@ stdenv.mkDerivation rec {
# replaces the code that looks for X11s locale.alias in /usr/share/X11/locale or
# /usr/lib/X11/locale with /nix/store/libX11/share/X11/locale
(substituteAll {
src = ./fxlocalechk.tcl.patch;
(replaceVars ./fxlocalechk.tcl.patch {
inherit (xorg) libX11;
})
];

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
pkg-config,
cmake,
bluez,
@ -34,8 +34,7 @@ stdenv.mkDerivation rec {
patches = [
./bashcomp-dir.patch
./systemd.patch
(substituteAll {
src = ./gammu-config-dialog.patch;
(replaceVars ./gammu-config-dialog.patch {
dialog = "${dialog}/bin/dialog";
})
];

View File

@ -2,7 +2,7 @@
stdenv,
lib,
fetchurl,
substituteAll,
replaceVars,
bubblewrap,
cairo,
cargo,
@ -70,8 +70,7 @@ stdenv.mkDerivation (finalAttrs: {
packageName = "glycin";
};
glycinPathsPatch = substituteAll {
src = ./fix-glycin-paths.patch;
glycinPathsPatch = replaceVars ./fix-glycin-paths.patch {
bwrap = "${bubblewrap}/bin/bwrap";
};
};

View File

@ -2,7 +2,7 @@
lib,
buildGoModule,
fetchFromGitHub,
substituteAll,
replaceVars,
}:
buildGoModule rec {
@ -18,8 +18,7 @@ buildGoModule rec {
patches = [
# patch in version information
(substituteAll {
src = ./version.patch;
(replaceVars ./version.patch {
inherit version;
})
];

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchurl,
substituteAll,
replaceVars,
meson,
ninja,
pkg-config,
@ -45,8 +45,7 @@ stdenv.mkDerivation rec {
# * fakesink (gstreamer)
# * playbin (gst-plugins-base)
# * chromaprint (gst-plugins-bad)
(substituteAll {
src = ./chromaprint-gst-plugins.patch;
(replaceVars ./chromaprint-gst-plugins.patch {
load_plugins =
lib.concatMapStrings
(plugin: ''gst_registry_scan_path(gst_registry_get(), "${lib.getLib plugin}/lib/gstreamer-1.0");'')

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchurl,
substituteAll,
replaceVars,
pkg-config,
autoreconfHook,
gobject-introspection,
@ -47,9 +47,8 @@ let
hash = "sha256-Hzxr3SVmGoouGBU2VdbwbwKMHZwwjWnI7P13Z6LQxao=";
};
hplipState = substituteAll {
hplipState = replaceVars ./hplip.state {
inherit version;
src = ./hplip.state;
};
hplipPlatforms = {

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
xapp,
circle-flags,
gettext,
@ -25,8 +25,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./libmpv-path.patch;
(replaceVars ./libmpv-path.patch {
libmpv = "${lib.getLib mpv}/lib/libmpv${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];

View File

@ -1,7 +1,7 @@
{
lib,
fetchFromGitHub,
substituteAll,
replaceVars,
python3Packages,
gst_all_1,
wrapGAppsHook3,
@ -54,8 +54,7 @@ python3Packages.buildPythonApplication rec {
patches = [
# Fix paths
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
libcanberra = libcanberra-gtk3;
inherit libpulseaudio;
})

View File

@ -3,7 +3,7 @@
stdenv,
fetchFromGitHub,
python3,
substituteAll,
replaceVars,
}:
stdenv.mkDerivation rec {
@ -18,8 +18,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./0001-Don-t-detect-package-version-with-Git.patch;
(replaceVars ./0001-Don-t-detect-package-version-with-Git.patch {
inherit version;
})
];

View File

@ -4,7 +4,7 @@
fetchgit,
cmake,
linux-pam,
substituteAll,
replaceVars,
enablePython ? false,
python ? null,
}:
@ -22,8 +22,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./python.patch;
(replaceVars ./python.patch {
siteDir = lib.optionalString enablePython python.sitePackages;
includeDir = lib.optionalString enablePython "include/${python.libPrefix}";
})

View File

@ -3,7 +3,7 @@
mupdf,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
cmake,
qt6,
desktopToDarwinBundle,
@ -25,8 +25,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./use_mupdf_in_nixpkgs.patch;
(replaceVars ./use_mupdf_in_nixpkgs.patch {
nixMupdfLibPath = "${mupdf-cxx.out}/lib";
nixMupdfIncludePath = "${mupdf-cxx.dev}/include";
})

View File

@ -4,7 +4,7 @@
fetchFromGitHub,
cmake,
pkg-config,
substituteAll,
replaceVars,
addDriverRunpath,
}:
@ -29,8 +29,7 @@ stdenv.mkDerivation (finalAttrs: {
];
patches = [
(substituteAll {
src = ./opengl-driver-lib.patch;
(replaceVars ./opengl-driver-lib.patch {
inherit (addDriverRunpath) driverLink;
})
];

View File

@ -2,7 +2,7 @@
, stdenv
, fetchurl
, perl
, substituteAll
, replaceVars
, coreutils
, gnugrep
}:
@ -22,8 +22,7 @@ stdenv.mkDerivation rec {
patches = [
./nosetuid.patch
(substituteAll {
src = ./cat-grep-sort-wc.patch;
(replaceVars ./cat-grep-sort-wc.patch {
coreutils = "${coreutils}/bin/";
gnugrep = "${gnugrep}/bin/";
})

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
antlr4_9,
libargs,
catch2,
@ -24,8 +24,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./fix-lib-paths.patch;
(replaceVars ./fix-lib-paths.patch {
antlr4RuntimeCpp = antlr4.runtime.cpp.dev;
yamlCpp = yaml-cpp;
inherit libargs catch2;

View File

@ -1,7 +1,7 @@
{ stdenv
, lib
, fetchurl
, substituteAll
, replaceVars
, openfortivpn
, autoreconfHook
, gettext
@ -30,8 +30,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit openfortivpn;
})
./support-ppp-2.5.0.patch

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitLab,
substituteAll,
replaceVars,
autoreconfHook,
iodine,
intltool,
@ -29,8 +29,7 @@ stdenv.mkDerivation {
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit iodine;
})
];

View File

@ -1,7 +1,7 @@
{
stdenv,
lib,
substituteAll,
replaceVars,
fetchFromGitHub,
autoreconfHook,
pkg-config,
@ -33,8 +33,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit strongswan xl2tpd;
})
];

View File

@ -2,7 +2,7 @@
stdenv,
lib,
fetchurl,
substituteAll,
replaceVars,
glib,
libxml2,
openconnect,
@ -32,8 +32,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit kmod openconnect;
})
];

View File

@ -2,7 +2,7 @@
stdenv,
lib,
fetchurl,
substituteAll,
replaceVars,
openvpn,
gettext,
libxml2,
@ -30,8 +30,7 @@ stdenv.mkDerivation (finalAttrs: {
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit kmod openvpn;
})
];

View File

@ -1,7 +1,7 @@
{ stdenv
, lib
, fetchurl
, substituteAll
, replaceVars
, vpnc
, pkg-config
, networkmanager
@ -27,8 +27,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit vpnc kmod;
})
];

View File

@ -3,7 +3,7 @@
buildNimPackage,
fetchFromGitHub,
nixosTests,
substituteAll,
replaceVars,
unstableGitUpdater,
}:
@ -22,8 +22,7 @@ buildNimPackage (
lockFile = ./lock.json;
patches = [
(substituteAll {
src = ./nitter-version.patch;
(replaceVars ./nitter-version.patch {
inherit (finalAttrs) version;
inherit (finalAttrs.src) rev;
url = builtins.replaceStrings [ "archive" ".tar.gz" ] [ "commit" "" ] finalAttrs.src.url;

View File

@ -2,7 +2,7 @@
lib,
python3,
stdenv,
substituteAll,
replaceVars,
fetchFromGitHub,
}:
@ -20,8 +20,7 @@ stdenv.mkDerivation rec {
patches =
with python3.pkgs;
[
(substituteAll {
src = ./websockify.patch;
(replaceVars ./websockify.patch {
inherit websockify;
})
]

View File

@ -1,7 +1,7 @@
{
python3Packages,
onionshare,
substituteAll,
replaceVars,
meek,
obfs4,
snowflake,
@ -23,8 +23,7 @@ python3Packages.buildPythonApplication rec {
patches = [
# hardcode store paths of dependencies
(substituteAll {
src = ./fix-paths-gui.patch;
(replaceVars ./fix-paths-gui.patch {
inherit
meek
obfs4

View File

@ -5,7 +5,7 @@
fetchFromGitHub,
# patches
substituteAll,
replaceVars,
meek,
obfs4,
snowflake,
@ -32,8 +32,7 @@ python3Packages.buildPythonApplication rec {
patches = [
# hardcode store paths of dependencies
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit
meek
obfs4

View File

@ -2,7 +2,7 @@
lib,
buildGoModule,
fetchFromGitHub,
substituteAll,
replaceVars,
installShellFiles,
testers,
org-stats,
@ -24,8 +24,7 @@ buildGoModule rec {
patches = [
# patch in version information
# since `debug.ReadBuildInfo` does not work with `go build
(substituteAll {
src = ./version.patch;
(replaceVars ./version.patch {
inherit version;
})
];

View File

@ -3,7 +3,7 @@
stdenv,
fetchFromGitHub,
makeBinaryWrapper,
substituteAll,
replaceVars,
age,
getopt,
coreutils,
@ -31,8 +31,7 @@ stdenv.mkDerivation (finalAttrs: {
};
patches = [
(substituteAll {
src = ./darwin-getopt-path.patch;
(replaceVars ./darwin-getopt-path.patch {
inherit getopt;
})
];

View File

@ -3,7 +3,7 @@
stdenv,
fetchFromGitLab,
rustPlatform,
substituteAll,
replaceVars,
cargo,
desktop-file-utils,
git,
@ -39,8 +39,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./borg-path.patch;
(replaceVars ./borg-path.patch {
borg = lib.getExe borgbackup;
})
];

View File

@ -2,7 +2,7 @@
lib,
fetchFromGitHub,
gitUpdater,
substituteAll,
replaceVars,
ffmpeg,
python3Packages,
sox,
@ -20,8 +20,7 @@ python3Packages.buildPythonApplication rec {
};
patches = [
(substituteAll {
src = ./ffmpeg-location.patch;
(replaceVars ./ffmpeg-location.patch {
inherit ffmpeg;
})
];

View File

@ -11,7 +11,7 @@
libadwaita,
gtk4,
pango,
substituteAll,
replaceVars,
}:
let
gtk4' = gtk4.override { x11Support = true; };
@ -33,8 +33,7 @@ crystal.buildCrystalPackage rec {
# 1) fixed gi-crystal binding generator command
# 2) fixed docset generator command
# 3) added commands to build gschemas and update icon-cache
(substituteAll {
src = ./make.patch;
(replaceVars ./make.patch {
inherit crystal;
})
# added chmod +w for copied docs to prevent error:

View File

@ -4,7 +4,7 @@
buildNpmPackage,
fetchNpmDeps,
nodejs,
substituteAll,
replaceVars,
}:
let
@ -66,8 +66,7 @@ buildNpmPackage {
preBuild = ''
chmod +w /build/source
patch -p3 <${
substituteAll {
src = ./decouple-from-source-tree.patch;
replaceVars ./decouple-from-source-tree.patch {
inherit client;
}
}

View File

@ -2,7 +2,7 @@
lib,
fetchFromGitHub,
stdenv,
substituteAll,
replaceVars,
SDL2,
frei0r,
ladspaPlugins,
@ -53,9 +53,8 @@ stdenv.mkDerivation (finalAttrs: {
cmakeFlags = [ "-DSHOTCUT_VERSION=${finalAttrs.version}" ];
patches = [
(substituteAll {
(replaceVars ./fix-mlt-ffmpeg-path.patch {
inherit mlt ffmpeg;
src = ./fix-mlt-ffmpeg-path.patch;
})
];

View File

@ -2,13 +2,12 @@
lib,
buildGoModule,
fetchFromGitHub,
substituteAll,
replaceVars,
v2ray-domain-list-community,
}:
let
patch = substituteAll {
src = ./main.go;
patch = replaceVars ./main.go {
geosite_data = "${v2ray-domain-list-community}/share/v2ray/geosite.dat";
};
in

View File

@ -3,7 +3,7 @@
stdenv,
fetchFromGitHub,
buildGo123Module,
substituteAll,
replaceVars,
pandoc,
nodejs,
pnpm_9,
@ -51,8 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
vendorHash = "sha256-uK++FoWCoeb05TyUhh0PK+wkTmzTko0K7oLodoGAWt8=";
patches = [
(substituteAll {
src = ./set-pandoc-path.patch;
(replaceVars ./set-pandoc-path.patch {
pandoc_path = lib.getExe pandoc;
})
];

View File

@ -6,7 +6,7 @@
stdenv,
testers,
static-server,
substituteAll,
replaceVars,
}:
buildGoModule rec {
@ -24,8 +24,7 @@ buildGoModule rec {
patches = [
# patch out debug.ReadBuidlInfo since version information is not available with buildGoModule
(substituteAll {
src = ./version.patch;
(replaceVars ./version.patch {
inherit version;
})
];

View File

@ -1,7 +1,7 @@
{
lib,
stdenv,
substituteAll,
replaceVars,
fetchFromGitHub,
gnused,
ncurses,
@ -28,8 +28,7 @@ stdenv.mkDerivation {
];
patches = [
(substituteAll {
src = ./paths.patch;
(replaceVars ./paths.patch {
sed = "${gnused}/bin/sed";
xprop = "${xorg.xprop}/bin/xprop";
rlwrap = "${rlwrap}/bin/rlwrap";

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
iproute2,
}:
stdenv.mkDerivation {
@ -17,8 +17,7 @@ stdenv.mkDerivation {
};
patches = [
(substituteAll {
src = ./nix.patch;
(replaceVars ./nix.patch {
inherit iproute2;
})
];

View File

@ -7,7 +7,7 @@
makeWrapper,
nodejs,
prefetch-yarn-deps,
substituteAll,
replaceVars,
yarn,
testers,
typescript,
@ -25,8 +25,7 @@ stdenv.mkDerivation (finalAttrs: {
};
patches = [
(substituteAll {
src = ./default-fallbackTsserverPath.diff;
(replaceVars ./default-fallbackTsserverPath.diff {
typescript = "${typescript}/lib/node_modules/typescript/lib/tsserver.js";
})
];

View File

@ -5,7 +5,7 @@
nodejs,
ffmpeg,
callPackage,
substituteAll,
replaceVars,
makeWrapper,
toml2json,
jq,
@ -32,8 +32,7 @@ buildNpmPackage rec {
];
patches = [
(substituteAll {
src = ./ffmpeg-filepicker.patch;
(replaceVars ./ffmpeg-filepicker.patch {
inherit ffmpeg;
filepicker = lib.getExe (callPackage ./filepicker.nix { });
})

View File

@ -8,7 +8,7 @@
fuse,
wxGTK32,
lvm2,
substituteAll,
replaceVars,
e2fsprogs,
exfat,
ntfs3g,
@ -27,8 +27,7 @@ stdenv.mkDerivation (finalAttrs: {
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
ext2 = "${e2fsprogs}/bin/mkfs.ext2";
ext3 = "${e2fsprogs}/bin/mkfs.ext3";
ext4 = "${e2fsprogs}/bin/mkfs.ext4";

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
makeBinaryWrapper,
makeWrapper,
makeDesktopItem,
@ -70,10 +70,11 @@ stdenv.mkDerivation (finalAttrs: {
patches =
[ ./disable_update_checking.patch ]
++ lib.optional withSystemVencord (substituteAll {
inherit vencord;
src = ./use_system_vencord.patch;
});
++ lib.optional withSystemVencord (
replaceVars ./use_system_vencord.patch {
inherit vencord;
}
);
env = {
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;

View File

@ -5,7 +5,7 @@
pkg-config,
qt5,
stdenv,
substituteAll,
replaceVars,
unzip,
zip,
}:
@ -35,8 +35,7 @@ stdenv.mkDerivation (finalAttrs: {
];
patches = [
(substituteAll {
src = ./patches/0000-fix-zip-paths.diff;
(replaceVars ./patches/0000-fix-zip-paths.diff {
zipPath = "${lib.getExe zip}";
unzipPath = "${lib.getExe unzip}";
})

View File

@ -2,7 +2,7 @@
# allow overriding electron
electron,
webcord,
substituteAll,
replaceVars,
lib,
vencord-web-extension,
}:
@ -12,8 +12,7 @@
pname = "webcord-vencord";
patches = (old.patches or [ ]) ++ [
(substituteAll {
src = ./add-extension.patch;
(replaceVars ./add-extension.patch {
vencord = vencord-web-extension;
})
];

View File

@ -3,7 +3,7 @@
stdenv,
fetchFromGitHub,
unstableGitUpdater,
substituteAll,
replaceVars,
meson,
ninja,
pkg-config,
@ -27,8 +27,7 @@ stdenv.mkDerivation rec {
patches = [
# Tells the indicator the path for libapplication.so
(substituteAll {
src = ./fix-libapplication-dir.patch;
(replaceVars ./fix-libapplication-dir.patch {
indicator_application = indicator-application-gtk3;
})
];

View File

@ -7,7 +7,7 @@
libnotify,
wrapGAppsHook3,
gobject-introspection,
substituteAll,
replaceVars,
}:
python3Packages.buildPythonPackage rec {
@ -40,8 +40,7 @@ python3Packages.buildPythonPackage rec {
postPatch =
let
setup = substituteAll {
src = ./setup.py;
setup = replaceVars ./setup.py {
desc = meta.description; # "description" is reserved
inherit pname version;
};

View File

@ -2,7 +2,7 @@
lib,
python3,
fetchPypi,
substituteAll,
replaceVars,
ffmpeg,
installShellFiles,
}:
@ -22,8 +22,7 @@ python3.pkgs.buildPythonApplication rec {
};
patches = [
(substituteAll {
src = ./ffmpeg-path.patch;
(replaceVars ./ffmpeg-path.patch {
ffmpeg = "${lib.getBin ffmpeg}/bin/ffmpeg";
ffprobe = "${lib.getBin ffmpeg}/bin/ffmpeg";
version = lib.getVersion ffmpeg;

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
gitstatus,
bash,
}:
@ -36,8 +36,7 @@ stdenv.mkDerivation rec {
buildInputs = [ bash ];
patches = [
(substituteAll {
src = ./gitstatusd.patch;
(replaceVars ./gitstatusd.patch {
gitstatusdPath = "${gitstatus'}/bin/gitstatusd";
})
];

View File

@ -1,7 +1,7 @@
{
stdenv,
lib,
substituteAll,
replaceVars,
fetchurl,
cmake,
libogg,
@ -27,8 +27,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./libpath.patch;
(replaceVars ./libpath.patch {
inherit
zlib
curl

View File

@ -58,7 +58,7 @@
{
mkDerivation,
substituteAll,
replaceVars,
pkgs,
}:
{
@ -80,8 +80,7 @@ mkDerivation {
"buildPhase"
"fixupPhase"
];
setupNew = substituteAll {
src = ../../stdenv/generic/setup.sh;
setupNew = replaceVars ../../stdenv/generic/setup.sh {
inherit gcc;
};

View File

@ -1,6 +1,6 @@
{
mkTmuxPlugin,
substituteAll,
replaceVars,
fetchFromGitHub,
crystal,
}:
@ -38,8 +38,7 @@ mkTmuxPlugin {
rtpFilePath = "tmux-fingers.tmux";
patches = [
(substituteAll {
src = ./fix.patch;
(replaceVars ./fix.patch {
tmuxFingersDir = "${fingers}/bin";
})
];

View File

@ -1,7 +1,7 @@
{
mkTmuxPlugin,
thumbs,
substituteAll,
replaceVars,
}:
mkTmuxPlugin {
@ -12,8 +12,7 @@ mkTmuxPlugin {
rtpFilePath = "tmux-thumbs.tmux";
patches = [
(substituteAll {
src = ./fix.patch;
(replaceVars ./fix.patch {
tmuxThumbsDir = "${thumbs}/bin";
})
];

View File

@ -11,7 +11,7 @@
postgresql,
rustPlatform,
stdenv,
substituteAll,
replaceVars,
}:
let
@ -42,8 +42,7 @@ in
patches = [
# Tell the `c` crate to use the flags from the rust bindgen hook
(substituteAll {
src = ./0001-read-clang-flags-from-environment.diff;
(replaceVars ./0001-read-clang-flags-from-environment.diff {
clang = lib.getExe clang;
})
];

View File

@ -2,7 +2,7 @@
lib,
multiStdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
pkgsi686Linux,
dbus,
meson,
@ -99,8 +99,7 @@ multiStdenv.mkDerivation (finalAttrs: {
patches = [
# Hard code bitbridge & runtime dependencies
(substituteAll {
src = ./hardcode-dependencies.patch;
(replaceVars ./hardcode-dependencies.patch {
libdbus = dbus.lib;
libxcb32 = pkgsi686Linux.xorg.libxcb;
inherit wine;

View File

@ -3,7 +3,7 @@
, fetchFromGitLab
, fetchFromGitHub
, fetchurl
, substituteAll
, replaceVars
, coreutils
, curl
, gnugrep
@ -127,8 +127,7 @@ stdenv.mkDerivation (finalAttrs: {
# Hard code dependencies. Can't use makeWrapper since the Vulkan
# layer can be used without the mangohud executable by setting MANGOHUD=1.
(substituteAll {
src = ./hardcode-dependencies.patch;
(replaceVars ./hardcode-dependencies.patch {
path = lib.makeBinPath [
coreutils

View File

@ -5,7 +5,7 @@
qmake,
qtbase,
qttools,
substituteAll,
replaceVars,
libGLU,
wrapQtAppsHook,
fetchpatch,
@ -25,8 +25,7 @@ stdenv.mkDerivation {
patches = [
./external-lib-paths.patch
(substituteAll {
src = ./qttools-bins.patch;
(replaceVars ./qttools-bins.patch {
qttools = "${qttools.dev}/bin";
})
(fetchpatch {

View File

@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
appstream-glib,
gettext,
pkg-config,
@ -27,8 +27,7 @@ stdenv.mkDerivation rec {
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
libhangul = "${libhangul}/lib/libhangul.so.1";
})
];

View File

@ -1,7 +1,7 @@
{
lib,
stdenv,
substituteAll,
replaceVars,
git,
fetchFromGitLab,
buildGoModule,
@ -74,8 +74,7 @@ buildGoModule rec {
patches = [
# This patch fixes the paths in the build script generated by qmake
# to use the correct paths for qmlcachegen and lrelease
(substituteAll {
src = ./fix_paths.patch;
(replaceVars ./fix_paths.patch {
inherit qtbase qtdeclarative qttools;
})

View File

@ -6,7 +6,7 @@
cmake,
catch2,
pkg-config,
substituteAll,
replaceVars,
yaml-cpp,
}:
@ -23,9 +23,8 @@ stdenv.mkDerivation {
};
patches = [
(substituteAll {
(replaceVars ./remove-fetchcontent-usage.patch {
# We will download them instead of cmake's fetchContent
src = ./remove-fetchcontent-usage.patch;
catch2Src = catch2.src;
})
];

View File

@ -9,7 +9,7 @@
curl,
openssl,
xz,
substituteAll,
replaceVars,
# for passthru.tests:
edgedb,
testers,
@ -50,8 +50,7 @@ rustPlatform.buildRustPackage rec {
checkFeatures = [ ];
patches = [
(substituteAll {
src = ./0001-dynamically-patchelf-binaries.patch;
(replaceVars ./0001-dynamically-patchelf-binaries.patch {
inherit patchelf;
dynamicLinker = stdenv.cc.bintools.dynamicLinker;
})

View File

@ -2,7 +2,7 @@
lib,
buildPythonApplication,
fetchFromGitHub,
substituteAll,
replaceVars,
writeShellScript,
steam-run,
fetchpatch2,
@ -30,8 +30,7 @@ buildPythonApplication rec {
patches = [
# Use steam-run to run Proton binaries
(substituteAll {
src = ./steam-run.patch;
(replaceVars ./steam-run.patch {
steamRun = lib.getExe steam-run;
bash = writeShellScript "steam-run-bash" ''
exec ${lib.getExe steam-run} bash "$@"

View File

@ -1,6 +1,6 @@
{
stdenv,
substituteAll,
replaceVars,
lib,
buildGoModule,
fetchFromGitHub,
@ -36,8 +36,7 @@ buildGoModule rec {
vendorHash = "sha256-KHahkGzkXr6xp0XY9MyEeeiHnmphaNYi9dPBQ476+us=";
patches = [
(substituteAll {
src = ./fix-paths-keybase.patch;
(replaceVars ./fix-paths-keybase.patch {
gpg = "${gnupg}/bin/gpg";
gpg2 = "${gnupg}/bin/gpg2";
})