various: switch from --replace to --replace-fail (#448078)

This commit is contained in:
Jörg Thalheim
2025-10-04 20:38:39 +00:00
committed by GitHub
9 changed files with 29 additions and 29 deletions
+2 -2
View File
@@ -108,8 +108,8 @@ stdenv.mkDerivation rec {
sed 's|/usr/include/libintl.h|${glibc.dev}/include/libintl.h|' -i wscript
patchShebangs ./tools/
substituteInPlace libs/ardour/video_tools_paths.cc \
--replace 'ffmpeg_exe = X_("");' 'ffmpeg_exe = X_("${ffmpeg}/bin/ffmpeg");' \
--replace 'ffprobe_exe = X_("");' 'ffprobe_exe = X_("${ffmpeg}/bin/ffprobe");'
--replace-fail 'ffmpeg_exe = X_("")' "ffmpeg_exe = X_(\"${lib.getExe ffmpeg}\");" \
--replace-fail 'ffprobe_exe = X_("");' "ffprobe_exe = X_(\"${lib.getExe' ffmpeg "ffprobe"}\");"
'';
nativeBuildInputs = [
@@ -74,7 +74,7 @@ stdenv.mkDerivation rec {
cp -r usr/share $out/share
substitute usr/share/applications/com.bitwig.BitwigStudio.desktop \
$out/share/applications/com.bitwig.BitwigStudio.desktop \
--replace /usr/bin/bitwig-studio $out/bin/bitwig-studio
--replace-fail "Exec=bitwig-studio" "Exec=$out/bin/bitwig-studio"
runHook postInstall
'';
@@ -94,7 +94,7 @@ stdenv.mkDerivation rec {
substitute usr/share/applications/com.bitwig.BitwigStudio.desktop \
$out/share/applications/com.bitwig.BitwigStudio.desktop \
--replace /usr/bin/bitwig-studio $out/bin/bitwig-studio
--replace-fail "Exec=bitwig-studio" "Exec=$out/bin/bitwig-studio"
runHook postInstall
'';
+2 -2
View File
@@ -75,13 +75,13 @@ stdenv.mkDerivation (finalAttrs: {
# --with-appname="$0" is evaluated with $0=.carla-wrapped instead of carla. Fix that.
for file in $(grep -rl -- '--with-appname="$0"'); do
filename="$(basename -- "$file")"
substituteInPlace "$file" --replace '--with-appname="$0"' "--with-appname=\"$filename\""
substituteInPlace "$file" --replace-fail '--with-appname="$0"' "--with-appname=\"$filename\""
done
''
+ lib.optionalString withGtk2 ''
# Will try to dlopen() libgtk-x11-2.0 at runtime when using the bridge.
substituteInPlace source/bridges-ui/Makefile \
--replace '$(CXX) $(OBJS_GTK2)' '$(CXX) $(OBJS_GTK2) -lgtk-x11-2.0'
--replace-fail '$(CXX) $(OBJS_GTK2)' '$(CXX) $(OBJS_GTK2) -lgtk-x11-2.0'
'';
dontWrapQtApps = true;
@@ -32,8 +32,8 @@ stdenv.mkDerivation rec {
postFixup = ''
substituteInPlace "$out"/lib/pkgconfig/codecserver.pc \
--replace '=''${prefix}//' '=/' \
--replace '=''${exec_prefix}//' '=/'
--replace-fail '=''${prefix}//' '=/' \
--replace-fail '=''${exec_prefix}//' '=/'
'';
meta = with lib; {
@@ -32,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: {
postPatch = ''
echo '#define GIT_REVISION "${finalAttrs.version}-NixOS"' > git-rev.h
substituteInPlace miniAudicle.pro \
--replace "/usr/local" $out
--replace-fail "/usr/local" $out
'';
nativeBuildInputs = [
+6 -6
View File
@@ -35,15 +35,15 @@ stdenv.mkDerivation rec {
# Fix ExecStart path and replace deprecated directory creation method,
# use dynamic user.
substituteInPlace "$out/lib/systemd/system/blackfire-agent.service" \
--replace '/usr/' "$out/" \
--replace 'ExecStartPre=/bin/mkdir -p /var/run/blackfire' 'RuntimeDirectory=blackfire' \
--replace 'ExecStartPre=/bin/chown blackfire: /var/run/blackfire' "" \
--replace 'User=blackfire' 'DynamicUser=yes' \
--replace 'PermissionsStartOnly=true' ""
--replace-fail '/usr/' "$out/" \
--replace-fail 'ExecStartPre=/bin/mkdir -p /var/run/blackfire' 'RuntimeDirectory=blackfire' \
--replace-fail 'ExecStartPre=/bin/chown blackfire: /var/run/blackfire' "" \
--replace-fail 'User=blackfire' 'DynamicUser=yes' \
--replace-fail 'PermissionsStartOnly=true' ""
# Modernize socket path.
substituteInPlace "$out/etc/blackfire/agent" \
--replace '/var/run' '/run'
--replace-fail '/var/run' '/run'
else
mkdir $out
+10 -10
View File
@@ -46,14 +46,14 @@ stdenv.mkDerivation rec {
scripts/common/impl/report_duplicates.awk; do
substituteInPlace $awks \
--replace /usr/bin/awk ${gawk}/bin/awk
--replace-fail "/usr/bin/awk" "${gawk}/bin/awk"
done
for mk in src/build-system/Makefile.meta.in \
src/build-system/helpers/run_with_lock.c ; do
substituteInPlace $mk \
--replace /bin/rm ${coreutils}/bin/rm
--replace-fail "/bin/rm" "${coreutils}/bin/rm"
done
for mk in src/build-system/Makefile.meta.gmake=no \
@@ -63,27 +63,27 @@ stdenv.mkDerivation rec {
src/build-system/Makefile.rules_with_autodep.in; do
substituteInPlace $mk \
--replace /bin/echo ${coreutils}/bin/echo
--replace-fail "/bin/echo" "${coreutils}/bin/echo"
done
for mk in src/build-system/Makefile.meta_p \
src/build-system/Makefile.rules_with_autodep.in \
src/build-system/Makefile.protobuf.in ; do
substituteInPlace $mk \
--replace /bin/mv ${coreutils}/bin/mv
--replace-fail "/bin/mv" "${coreutils}/bin/mv"
done
substituteInPlace src/build-system/configure \
--replace /bin/pwd ${coreutils}/bin/pwd \
--replace /bin/ln ${coreutils}/bin/ln
--replace-fail "/bin/pwd" "${coreutils}/bin/pwd" \
--replace-fail "/bin/ln" "${coreutils}/bin/ln"
substituteInPlace src/build-system/configure.ac \
--replace /bin/pwd ${coreutils}/bin/pwd \
--replace /bin/ln ${coreutils}/bin/ln
--replace-fail "/bin/pwd" "${coreutils}/bin/pwd" \
--replace-fail "/bin/ln" "${coreutils}/bin/ln"
substituteInPlace src/build-system/Makefile.meta_l \
--replace /bin/date ${coreutils}/bin/date
--replace-fail "/bin/date" "${coreutils}/bin/date"
'';
depsBuildBuild = [ buildPackages.stdenv.cc ];
@@ -108,7 +108,7 @@ stdenv.mkDerivation rec {
postInstall = ''
substituteInPlace $out/bin/get_species_taxids.sh \
--replace /bin/rm ${lib.getExe' coreutils "rm"}
--replace-fail "/bin/rm" "${coreutils}/bin/rm"
'';
patches = [ ./no_slash_bin.patch ];
+4 -4
View File
@@ -32,14 +32,14 @@ stdenv.mkDerivation rec {
patchShebangs data/themes/hungarian/scripts/sed-linux.sh
substituteInPlace Makefile.am \
--replace "\$(MKDIR_P) -m 2755 " "\$(MKDIR_P) -m 755 " \
--replace "chown root:games \$(DESTDIR)\$(pkglocalstatedir)/words" " "
--replace-fail "\$(MKDIR_P) -m 2755 " "\$(MKDIR_P) -m 755 " \
--replace-fail "chown root:games \$(DESTDIR)\$(pkglocalstatedir)/words" " "
# required until the following has been merged:
# https://salsa.debian.org/tux4kids-pkg-team/tuxtype/merge_requests/1
substituteInPlace configure.ac \
--replace 'CFLAGS="$CFLAGS $SDL_IMAGE"' 'CFLAGS="$CFLAGS $SDL_IMAGE_CFLAGS"' \
--replace 'PKG_CHECK_MODULES([SDL_ttf],' 'PKG_CHECK_MODULES([SDL_TTF],'
--replace-fail 'CFLAGS="$CFLAGS $SDL_IMAGE"' 'CFLAGS="$CFLAGS $SDL_IMAGE_CFLAGS"' \
--replace-fail 'PKG_CHECK_MODULES([SDL_ttf],' 'PKG_CHECK_MODULES([SDL_TTF],'
'';
nativeBuildInputs = [