refactor: replace --replace substitutions with --replace-fail where applicable

This commit is contained in:
Colin 2024-05-19 23:31:54 +00:00
parent d58bdf82d9
commit 9873353d00
11 changed files with 18 additions and 18 deletions

View File

@ -22,7 +22,7 @@ let
# # "Change commandline flag to allow disabling video, since it is enabled by default"
# postPatch = (upstream.postPatch or "") + ''
# substituteInPlace src/validate.rs \
# --replace 'if transcode_options.needs_reencode() {' 'if false {'
# --replace-fail 'if transcode_options.needs_reencode() {' 'if false {'
# '';
# });
in {

View File

@ -45,7 +45,7 @@ chatty.overrideAttrs (upstream: rec {
postPatch = (upstream.postPatch or "") + ''
substituteInPlace build-aux/meson/postinstall.py \
--replace 'gtk-update-icon-cache' 'gtk4-update-icon-cache'
--replace-fail 'gtk-update-icon-cache' 'gtk4-update-icon-cache'
'';
nativeBuildInputs = [

View File

@ -17,7 +17,7 @@ self = stdenv.mkDerivation rec {
postPatch = ''
# link dynamically
substituteInPlace Makefile --replace \
substituteInPlace Makefile --replace-fail \
'LIBTLS_LDFLAGS_STATIC = -ltls -lssl -lcrypto -static' \
'LIBTLS_LDFLAGS_STATIC = -ltls -lssl -lcrypto'
'';

View File

@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
postPatch = ''
substituteInPlace 'udev/80-modem-eg25.rules' \
--replace '/bin/grep' '${gnugrep}/bin/grep'
--replace-fail '/bin/grep' '${gnugrep}/bin/grep'
'';
depsBuildBuild = [

View File

@ -56,7 +56,7 @@ rustPlatform.buildRustPackage rec {
mkdir -p $out/share/applications
substitute lightdm-mobile-greeter.desktop \
$out/share/applications/lightdm-mobile-greeter.desktop \
--replace lightdm-mobile-greeter $out/bin/lightdm-mobile-greeter
--replace-fail lightdm-mobile-greeter $out/bin/lightdm-mobile-greeter
'';
passthru.xgreeters = linkFarm "lightdm-mobile-greeter-xgreeters" [{

View File

@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
postPatch = ''
substituteInPlace src/meson.build \
--replace "python.find_installation('python3').full_path()" "'${pythonEnv}/bin/python3'"
--replace-fail "python.find_installation('python3').full_path()" "'${pythonEnv}/bin/python3'"
'';
nativeBuildInputs = [

View File

@ -31,11 +31,11 @@ buildGoModule rec {
# GOFLAGS or CGO_LDFLAGS could both sort of do this, but they struggle with the spaces/quoting of the above,
# so instead i manually patch in the values
substituteInPlace cmd/peerswap-plugin/main.go \
--replace 'var GitCommit string' 'var GitCommit string = "${src.rev}"'
--replace-fail 'var GitCommit string' 'var GitCommit string = "${src.rev}"'
substituteInPlace cmd/peerswaplnd/peerswapd/main.go \
--replace 'var GitCommit string' 'var GitCommit string = "${src.rev}"'
--replace-fail 'var GitCommit string' 'var GitCommit string = "${src.rev}"'
substituteInPlace cmd/peerswaplnd/pscli/main.go \
--replace 'var GitCommit string' 'var GitCommit string = "${src.rev}"'
--replace-fail 'var GitCommit string' 'var GitCommit string = "${src.rev}"'
'';
postInstall = ''

View File

@ -56,11 +56,11 @@ stdenv.mkDerivation rec {
patchShebangs build-aux/post_install.py
sed -i /phog_plugins_dir/d build-aux/post_install.py
substituteInPlace src/greetd.c \
--replace '/usr/share/wayland-sessions' '/run/current-system/sw/share/wayland-sessions/' \
--replace '/usr/share/xsessions' '/run/current-system/sw/share/xsessions'
--replace-fail '/usr/share/wayland-sessions' '/run/current-system/sw/share/wayland-sessions/' \
--replace-fail '/usr/share/xsessions' '/run/current-system/sw/share/xsessions'
'' + lib.optionalString (squeekboard == null) ''
substituteInPlace data/phog.in \
--replace " & squeekboard" ""
--replace-fail " & squeekboard" ""
'';
preFixup = ''
gappsWrapperArgs+=(

View File

@ -255,7 +255,7 @@ stdenv.mkDerivation rec {
# notably: ELECTRON_RUN_AS_NODE, cookie encryption, NODE_OPTIONS env var, --inspect-* CLI args, app.asar validation
# skipping the fuse process seems relatively inconsequential
substituteInPlace ts/scripts/after-pack.ts \
--replace 'await fuseElectron' '//await fuseElectron'
--replace-fail 'await fuseElectron' '//await fuseElectron'
'';
configurePhase = ''

View File

@ -161,8 +161,8 @@ python.pkgs.buildPythonApplication rec {
sed -i "/--cov/d" setup.cfg
sed -i "/--no-cov-on-fail/d" setup.cfg
substituteInPlace pyproject.toml \
--replace 'deepdiff = "^5.8.1"' 'deepdiff = ">=5.8.1"' \
--replace 'python-Levenshtein = "^0.12.0"' 'levenshtein = ">=0.12.0"'
--replace-fail 'deepdiff = "^5.8.1"' 'deepdiff = ">=5.8.1"' \
--replace-fail 'python-Levenshtein = "^0.12.0"' 'levenshtein = ">=0.12.0"'
'';
# hook for gobject-introspection doesn't like strictDeps

View File

@ -40,9 +40,9 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'w3lib = "^1.22.0"' 'w3lib = "*"' \
--replace 'aiodns = "^2.0.0"' 'aiodns = "*"' \
--replace 'uvloop = "^0.15.2"' 'uvloop = "*"'
--replace-fail 'w3lib = "^1.22.0"' 'w3lib = "*"' \
--replace-fail 'aiodns = "^2.0.0"' 'aiodns = "*"' \
--replace-fail 'uvloop = "^0.15.2"' 'uvloop = "*"'
'';
propagatedBuildInputs = [