Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: replace substituteAll with replaceVars (#1) #365440

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pkgs/applications/audio/easyabc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
fetchFromGitHub,
fetchPypi,
substituteAll,
replaceVars,
python39,
fluidsynth,
soundfont-fluid,
Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
python3,
melpaBuild,
fetchFromGitHub,
substituteAll,
replaceVars,
acm,
markdown-mode,
basedpyright,
Expand Down Expand Up @@ -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;
})
];
Expand Down
5 changes: 2 additions & 3 deletions pkgs/applications/gis/qgis/unwrapped-ltr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
fetchFromGitHub,
makeWrapper,
mkDerivation,
substituteAll,
replaceVars,
wrapGAppsHook3,
wrapQtAppsHook,

Expand Down Expand Up @@ -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}";
})
Expand Down
5 changes: 2 additions & 3 deletions pkgs/applications/gis/qgis/unwrapped.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, fetchFromGitHub
, makeWrapper
, mkDerivation
, substituteAll
, replaceVars
, wrapGAppsHook3
, wrapQtAppsHook

Expand Down Expand Up @@ -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}";
})
Expand Down
5 changes: 2 additions & 3 deletions pkgs/applications/graphics/leocad/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
povray,
qmake,
qttools,
substituteAll,
replaceVars,
zlib,
}:

Expand Down Expand Up @@ -43,8 +43,7 @@ mkDerivation rec {
propagatedBuildInputs = [ povray ];

patches = [
(substituteAll {
src = ./povray.patch;
(replaceVars ./povray.patch {
inherit povray;
})
wolfgangwalther marked this conversation as resolved.
Show resolved Hide resolved
];
Expand Down
5 changes: 2 additions & 3 deletions pkgs/applications/graphics/qvge/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
wrapQtAppsHook,
qmake,
qtsvg,
Expand All @@ -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;
}
wolfgangwalther marked this conversation as resolved.
Show resolved Hide resolved
);
Expand Down
5 changes: 2 additions & 3 deletions pkgs/applications/kde/kdenlive/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
mkDerivation,
substituteAll,
replaceVars,
lib,
extra-cmake-modules,
breeze-icons,
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions pkgs/applications/misc/dmensamenu/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
buildPythonApplication,
fetchFromGitHub,
substituteAll,
replaceVars,
requests,
dmenu,
}:
Expand All @@ -19,8 +19,7 @@ buildPythonApplication rec {
};

patches = [
(substituteAll {
src = ./dmenu-path.patch;
(replaceVars ./dmenu-path.patch {
inherit dmenu;
})
];
Expand Down
5 changes: 2 additions & 3 deletions pkgs/applications/misc/inochi2d/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
callPackage,
}:

Expand Down Expand Up @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions pkgs/applications/misc/mysql-workbench/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchurl,
substituteAll,
replaceVars,
cmake,
ninja,
pkg-config,
Expand Down Expand Up @@ -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";
Expand All @@ -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}";
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
stdenv,
lib,
fetchurl,
substituteAll,
replaceVars,
PodParser,
}:

Expand All @@ -22,8 +22,7 @@ stdenv.mkDerivation {

patches = [
# The script requires a special Perl environment.
(substituteAll {
src = ./libpath.patch;
(replaceVars ./libpath.patch {
env = PodParser;
})
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchpatch,
substituteAll,
replaceVars,
buildEnv,
fetchFromGitHub,
python3Packages,
Expand All @@ -20,8 +20,7 @@ stdenv.mkDerivation rec {
};

patches = [
(substituteAll {
src = ./libpath.patch;
(replaceVars ./libpath.patch {
env = "${
buildEnv {
name = "wee-slack-env";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
lib,
stdenv,
substituteAll,
replaceVars,
buildEnv,
fetchgit,
fetchFromGitHub,
Expand Down Expand Up @@ -58,8 +58,7 @@ stdenv.mkDerivation rec {
};

patches = [
(substituteAll {
src = ./libpath.patch;
(replaceVars ./libpath.patch {
env = "${
buildEnv {
name = "weechat-otr-env";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
json-glib,
libmspack,
webkitgtk_4_1,
substituteAll,
replaceVars,
_experimental-update-script-combinators,
glib,
makeHardcodeGsettingsPatch,
Expand All @@ -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;
})
];
Expand Down
8 changes: 3 additions & 5 deletions pkgs/applications/office/activitywatch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
qtbase,
qtsvg,
xdg-utils,
substituteAll,
replaceVars,
buildNpmPackage,
}:

Expand Down Expand Up @@ -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;
})
];
Expand Down Expand Up @@ -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;
})
];
Expand Down
11 changes: 6 additions & 5 deletions pkgs/applications/science/math/caffe/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
pythonSupport ? false,
python ? null,
numpy ? null,
substituteAll,
replaceVars,
}:

let
Expand Down Expand Up @@ -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 \
Expand Down
5 changes: 2 additions & 3 deletions pkgs/applications/science/misc/cytoscape/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
fetchurl,
jre,
makeWrapper,
substituteAll,
replaceVars,
coreutils,
}:

Expand All @@ -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;
})
];
Expand Down
5 changes: 2 additions & 3 deletions pkgs/applications/virtualization/singularity/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ in
lib,
buildGoModule,
runCommandLocal,
substituteAll,
replaceVars,
# Native build inputs
addDriverRunpath,
makeWrapper,
Expand Down Expand Up @@ -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;
})
];
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/an/ansible-cmdb/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
lib,
fetchFromGitHub,
substituteAll,
replaceVars,
python3Packages,
testers,
ansible-cmdb,
Expand Down Expand Up @@ -31,8 +31,7 @@ buildPythonApplication {
};

patches = [
(substituteAll {
src = ./setup.patch;
(replaceVars ./setup.patch {
inherit version;
})
];
Expand Down
Loading
Loading