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 (part 3) #373659

Merged
merged 1 commit into from
Jan 19, 2025
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/by-name/ac/accountsservice/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchurl,
substituteAll,
replaceVars,
pkg-config,
glib,
shadow,
Expand Down Expand Up @@ -36,8 +36,7 @@ stdenv.mkDerivation rec {

patches = [
# Hardcode dependency paths.
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit shadow coreutils;
})

Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/al/alvr/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
rustPlatform,
fetchFromGitHub,
substituteAll,
replaceVars,
nix-update-script,
pkg-config,
autoAddDriverRunpath,
Expand Down Expand Up @@ -59,8 +59,7 @@ rustPlatform.buildRustPackage rec {
};

patches = [
(substituteAll {
src = ./fix-finding-libs.patch;
(replaceVars ./fix-finding-libs.patch {
ffmpeg = lib.getDev ffmpeg;
x264 = lib.getDev x264;
})
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/ap/appstream-glib/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
docbook_xml_dtd_42,
docbook_xsl,
fontconfig,
Expand Down Expand Up @@ -74,8 +74,7 @@ stdenv.mkDerivation rec {
];

patches = [
(substituteAll {
src = ./paths.patch;
(replaceVars ./paths.patch {
pngquant = "${pngquant}/bin/pngquant";
})
];
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/cc/ccache/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
binutils,
asciidoctor,
cmake,
Expand Down Expand Up @@ -54,8 +54,7 @@ stdenv.mkDerivation (finalAttrs: {
# Darwin.
# Additionally, when cross compiling, the correct target prefix
# needs to be set.
(substituteAll {
src = ./fix-objdump-path.patch;
(replaceVars ./fix-objdump-path.patch {
objdump = "${binutils.bintools}/bin/${binutils.targetPrefix}objdump";
})
];
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/cm/cmake/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib
, stdenv
, fetchurl
, substituteAll
, replaceVars
, buildPackages
, bzip2
, curlMinimal
Expand Down Expand Up @@ -75,8 +75,7 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional stdenv.hostPlatform.isDarwin ./006-darwin-always-set-runtime-c-flag.diff
# On platforms where ps is not part of stdenv, patch the invocation of ps to use an absolute path.
++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) (
substituteAll {
src = ./007-darwin-bsd-ps-abspath.diff;
replaceVars ./007-darwin-bsd-ps-abspath.diff {
ps = lib.getExe ps;
})
++ [
Expand Down
11 changes: 4 additions & 7 deletions pkgs/by-name/fl/flatpak/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
python3,
shared-mime-info,
socat,
substituteAll,
replaceVars,
systemd,
testers,
valgrind,
Expand Down Expand Up @@ -84,8 +84,7 @@ stdenv.mkDerivation (finalAttrs: {
patches = [
# Hardcode paths used by tests and change test runtime generation to use files from Nix store.
# https://github.com/flatpak/flatpak/issues/1460
(substituteAll {
src = ./fix-test-paths.patch;
(replaceVars ./fix-test-paths.patch {
inherit
coreutils
gettext
Expand All @@ -98,8 +97,7 @@ stdenv.mkDerivation (finalAttrs: {
})

# Hardcode paths used by Flatpak itself.
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
p11kit = "${p11-kit.bin}/bin/p11-kit";
})

Expand Down Expand Up @@ -235,8 +233,7 @@ stdenv.mkDerivation (finalAttrs: {
'';

passthru = {
icon-validator-patch = substituteAll {
src = ./fix-icon-validation.patch;
icon-validator-patch = replaceVars ./fix-icon-validation.patch {
inherit (builtins) storeDir;
};

Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/fo/formatter/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
pkg-config,
pantheon,
python3,
substituteAll,
replaceVars,
glib,
gtk3,
dosfstools,
Expand All @@ -33,8 +33,7 @@ stdenv.mkDerivation rec {
};

patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
ext4 = "${e2fsprogs}/bin/mkfs.ext4";
exfat = "${exfat}/bin/mkfs.exfat";
fat = "${dosfstools}/bin/mkfs.fat";
Expand Down
8 changes: 3 additions & 5 deletions pkgs/by-name/gd/gdm/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
stdenv,
fetchurl,
fetchpatch,
substituteAll,
replaceVars,
meson,
ninja,
pkg-config,
Expand Down Expand Up @@ -35,8 +35,7 @@

let

override = substituteAll {
src = ./org.gnome.login-screen.gschema.override;
override = replaceVars ./org.gnome.login-screen.gschema.override {
icon = "${nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake-white.svg";
};

Expand Down Expand Up @@ -105,8 +104,7 @@ stdenv.mkDerivation (finalAttrs: {
})

# Change hardcoded paths to nix store paths.
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit
coreutils
plymouth
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/gl/glib-networking/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
stdenv,
lib,
fetchurl,
substituteAll,
replaceVars,
meson,
ninja,
nixosTests,
Expand Down Expand Up @@ -33,8 +33,7 @@ stdenv.mkDerivation rec {
};

patches = [
(substituteAll {
src = ./hardcode-gsettings.patch;
(replaceVars ./hardcode-gsettings.patch {
gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas;
})

Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/gn/gnome-control-center/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
fetchurl,
lib,
stdenv,
substituteAll,
replaceVars,
accountsservice,
adwaita-icon-theme,
colord,
Expand Down Expand Up @@ -82,8 +82,7 @@ stdenv.mkDerivation (finalAttrs: {
};

patches = [
(substituteAll {
src = ./paths.patch;
(replaceVars ./paths.patch {
gcm = gnome-color-manager;
inherit glibc tzdata shadow;
inherit cups networkmanagerapplet;
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/gn/gnome-desktop/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchurl,
substituteAll,
replaceVars,
pkg-config,
libxslt,
ninja,
Expand Down Expand Up @@ -44,8 +44,7 @@ stdenv.mkDerivation rec {
};

patches = lib.optionals stdenv.hostPlatform.isLinux [
(substituteAll {
src = ./bubblewrap-paths.patch;
(replaceVars ./bubblewrap-paths.patch {
bubblewrap_bin = "${bubblewrap}/bin/bwrap";
inherit (builtins) storeDir;
})
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/gn/gnome-initial-setup/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
stdenv,
lib,
fetchurl,
substituteAll,
replaceVars,
dconf,
gettext,
meson,
Expand Down Expand Up @@ -45,8 +45,7 @@ stdenv.mkDerivation (finalAttrs: {
};

patches = [
(substituteAll {
src = ./0001-fix-paths.patch;
(replaceVars ./0001-fix-paths.patch {
inherit tzdata;
tecla = gnome-tecla;
})
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/gn/gnome-pomodoro/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
substituteAll,
replaceVars,
meson,
ninja,
pkg-config,
Expand Down Expand Up @@ -36,8 +36,7 @@ stdenv.mkDerivation rec {
patches = [
# Our glib setup hooks moves GSettings schemas to a subdirectory to prevent conflicts.
# We need to patch the build script so that the extension can find them.
(substituteAll {
src = ./fix-schema-path.patch;
(replaceVars ./fix-schema-path.patch {
inherit pname version;
})
];
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/gn/gnome-session/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
fetchurl,
lib,
stdenv,
substituteAll,
replaceVars,
meson,
ninja,
pkg-config,
Expand Down Expand Up @@ -47,8 +47,7 @@ stdenv.mkDerivation (finalAttrs: {
};

patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
gsettings = "${glib.bin}/bin/gsettings";
dbusLaunch = "${dbus.lib}/bin/dbus-launch";
bash = "${bash}/bin/bash";
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/gn/gnome-settings-daemon/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
stdenv,
lib,
substituteAll,
replaceVars,
buildPackages,
fetchurl,
meson,
Expand Down Expand Up @@ -54,8 +54,7 @@ stdenv.mkDerivation (finalAttrs: {
# https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/202
./add-gnome-session-ctl-option.patch

(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit tzdata;
})
];
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/gn/gnome-settings-daemon46/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
stdenv,
lib,
substituteAll,
replaceVars,
fetchurl,
meson,
ninja,
Expand Down Expand Up @@ -51,8 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
# https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/202
./add-gnome-session-ctl-option.patch

(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit tzdata;
})
];
Expand Down
8 changes: 3 additions & 5 deletions pkgs/by-name/gn/gnome-shell-extensions/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
glib,
gnome,
gnome-menus,
substituteAll,
replaceVars,
}:

stdenv.mkDerivation (finalAttrs: {
Expand All @@ -23,12 +23,10 @@ stdenv.mkDerivation (finalAttrs: {
};

patches = [
(substituteAll {
src = ./fix_gmenu.patch;
(replaceVars ./fix_gmenu.patch {
gmenu_path = "${gnome-menus}/lib/girepository-1.0";
})
(substituteAll {
src = ./fix_gtop.patch;
(replaceVars ./fix_gtop.patch {
gtop_path = "${libgtop}/lib/girepository-1.0";
})
];
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/gn/gnome-shell/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
fetchurl,
fetchpatch,
substituteAll,
replaceVars,
lib,
stdenv,
docutils,
Expand Down Expand Up @@ -84,8 +84,7 @@ stdenv.mkDerivation (finalAttrs: {

patches = [
# Hardcode paths to various dependencies so that they can be found at runtime.
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
glib_compile_schemas = "${glib.dev}/bin/glib-compile-schemas";
gsettings = "${glib.bin}/bin/gsettings";
tecla = "${lib.getBin gnome-tecla}/bin/tecla";
Expand Down
5 changes: 2 additions & 3 deletions pkgs/by-name/gn/gnome-software/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchurl,
substituteAll,
replaceVars,
pkg-config,
meson,
ninja,
Expand Down Expand Up @@ -56,8 +56,7 @@ stdenv.mkDerivation (finalAttrs: {
};

patches = [
(substituteAll {
src = ./fix-paths.patch;
(replaceVars ./fix-paths.patch {
inherit isocodes;
})
];
Expand Down
Loading
Loading