cross: replace --replace with --replace-fail where applicable

This commit is contained in:
Colin 2024-05-19 23:24:07 +00:00
parent 9c2cc9641b
commit d58bdf82d9

View File

@ -407,7 +407,7 @@ in with final; {
# - <https://github.com/NixOS/nixpkgs/pull/273297>
postPatch = (upstream.postPatch or "") + ''
substituteInPlace data/meson.build \
--replace 'meson.is_cross_build()' 'false'
--replace-fail 'meson.is_cross_build()' 'false'
'';
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
# prev.appstream
@ -493,8 +493,8 @@ in with final; {
];
postPatch = ''
substituteInPlace delfin/meson.build \
--replace "cargo, 'build'," "'${lib.getExe crossCargo}', 'build'," \
--replace "'delfin' / rust_target" "'delfin' / '${rust.envVars.rustHostPlatformSpec}' / rust_target"
--replace-fail "cargo, 'build'," "'${lib.getExe crossCargo}', 'build'," \
--replace-fail "'delfin' / rust_target" "'delfin' / '${rust.envVars.rustHostPlatformSpec}' / rust_target"
'';
});
@ -502,7 +502,7 @@ in with final; {
dialect = prev.dialect.overrideAttrs (upstream: {
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
postPatch = (upstream.postPatch or "") + ''
substituteInPlace data/resources/meson.build --replace \
substituteInPlace data/resources/meson.build --replace-fail \
"find_program('blueprint-compiler')" \
"'env', 'GI_TYPELIB_PATH=${typelibPath [
buildPackages.gdk-pixbuf
@ -582,8 +582,8 @@ in with final; {
emulator = stdenv.hostPlatform.emulator buildPackages;
in lib.optionalString (!prev.stdenv.buildPlatform.canExecute prev.stdenv.hostPlatform) ''
substituteInPlace Makefile \
--replace ' src/fseccomp/fseccomp' ' ${emulator} src/fseccomp/fseccomp' \
--replace ' src/fsec-optimize/fsec-optimize' ' ${emulator} src/fsec-optimize/fsec-optimize'
--replace-fail ' src/fseccomp/fseccomp' ' ${emulator} src/fseccomp/fseccomp' \
--replace-fail ' src/fsec-optimize/fsec-optimize' ' ${emulator} src/fsec-optimize/fsec-optimize'
'');
});
@ -594,7 +594,7 @@ in with final; {
flare-signal = prev.flare-signal.overrideAttrs (upstream: {
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
postPatch = (upstream.postPatch or "") + ''
substituteInPlace data/resources/meson.build --replace \
substituteInPlace data/resources/meson.build --replace-fail \
"find_program('blueprint-compiler')" \
"'env', 'GI_TYPELIB_PATH=${buildPackages.gdk-pixbuf.out}/lib/girepository-1.0:${buildPackages.harfbuzz.out}/lib/girepository-1.0:${buildPackages.gtk4.out}/lib/girepository-1.0:${buildPackages.graphene}/lib/girepository-1.0:${buildPackages.libadwaita}/lib/girepository-1.0:${buildPackages.pango.out}/lib/girepository-1.0', find_program('blueprint-compiler')"
'';
@ -621,7 +621,7 @@ in with final; {
flare-signal-nixified = prev.flare-signal-nixified.overrideAttrs (upstream: {
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
postPatch = (upstream.postPatch or "") + ''
substituteInPlace data/resources/meson.build --replace \
substituteInPlace data/resources/meson.build --replace-fail \
"find_program('blueprint-compiler')" \
"'env', 'GI_TYPELIB_PATH=${buildPackages.gdk-pixbuf.out}/lib/girepository-1.0:${buildPackages.harfbuzz.out}/lib/girepository-1.0:${buildPackages.gtk4.out}/lib/girepository-1.0:${buildPackages.graphene}/lib/girepository-1.0:${buildPackages.libadwaita}/lib/girepository-1.0:${buildPackages.pango.out}/lib/girepository-1.0', find_program('blueprint-compiler')"
'';
@ -716,8 +716,8 @@ in with final; {
];
postPatch = ''
substituteInPlace loaders/meson.build \
--replace "cargo_bin, 'build'," "'${lib.getExe crossCargo}', 'build'," \
--replace "'loaders' / rust_target" "'loaders' / '${rust.envVars.rustHostPlatformSpec}' / rust_target"
--replace-fail "cargo_bin, 'build'," "'${lib.getExe crossCargo}', 'build'," \
--replace-fail "'loaders' / rust_target" "'loaders' / '${rust.envVars.rustHostPlatformSpec}' / rust_target"
'';
});
@ -742,7 +742,7 @@ in with final; {
gnome-frog = prev.gnome-frog.overrideAttrs (upstream: {
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
postPatch = (upstream.postPatch or "") + ''
substituteInPlace data/meson.build --replace \
substituteInPlace data/meson.build --replace-fail \
"find_program('blueprint-compiler')" \
"'env', 'GI_TYPELIB_PATH=${typelibPath [
buildPackages.gdk-pixbuf
@ -773,10 +773,10 @@ in with final; {
"-DGLIB_COMPILE_SCHEMAS=${lib.getDev buildPackages.glib}/bin/glib-compile-schemas"
];
postPatch = (upstream.postPatch or "") + ''
substituteInPlace src/addressbook/libebook-contacts/CMakeLists.txt --replace \
substituteInPlace src/addressbook/libebook-contacts/CMakeLists.txt --replace-fail \
'COMMAND ''${CMAKE_CURRENT_BINARY_DIR}/gen-western-table' \
'COMMAND ${stdenv.hostPlatform.emulator buildPackages} ''${CMAKE_CURRENT_BINARY_DIR}/gen-western-table'
substituteInPlace src/camel/CMakeLists.txt --replace \
substituteInPlace src/camel/CMakeLists.txt --replace-fail \
'COMMAND ''${CMAKE_CURRENT_BINARY_DIR}/camel-gen-tables' \
'COMMAND ${stdenv.hostPlatform.emulator buildPackages} ''${CMAKE_CURRENT_BINARY_DIR}/camel-gen-tables'
'';
@ -827,10 +827,10 @@ in with final; {
postPatch = (upstream.postPatch or "") + ''
# fixes: "ERROR: Program 'gjs' not found or not executable"
substituteInPlace meson.build \
--replace "find_program('gjs')" "find_program('${gjs}/bin/gjs')"
--replace-fail "find_program('gjs')" "find_program('${gjs}/bin/gjs')"
# fixes missing `gapplication` binary when not on PATH (needed for non-cross build too)
substituteInPlace data/org.gnome.Maps.desktop.in.in \
--replace "gapplication" "${glib.bin}/bin/gapplication"
--replace-fail "gapplication" "${glib.bin}/bin/gapplication"
'';
});
# gnome-shell = super.gnome-shell.overrideAttrs (orig: {
@ -978,7 +978,7 @@ in with final; {
postPatch = ''
# @PYTHON@ becomes the build python, but this file isn't executable anyway so shouldn't have a shebang
substituteInPlace iotas/const.py.in \
--replace '#!@PYTHON@' ""
--replace-fail '#!@PYTHON@' ""
'';
});
@ -1035,7 +1035,7 @@ in with final; {
komikku = prev.komikku.overrideAttrs (upstream: {
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
postPatch = (upstream.postPatch or "") + ''
substituteInPlace data/meson.build --replace \
substituteInPlace data/meson.build --replace-fail \
"find_program('blueprint-compiler')" \
"'env', 'GI_TYPELIB_PATH=${typelibPath [
buildPackages.gdk-pixbuf
@ -1167,8 +1167,8 @@ in with final; {
loupe = prev.loupe.overrideAttrs (upstream: {
postPatch = (upstream.postPatch or "") + ''
substituteInPlace src/meson.build \
--replace "cargo, 'build'," "'${lib.getExe crossCargo}', 'build'," \
--replace "'src' / rust_target" "'src' / '${rust.envVars.rustHostPlatformSpec}' / rust_target"
--replace-fail "cargo, 'build'," "'${lib.getExe crossCargo}', 'build'," \
--replace-fail "'src' / rust_target" "'src' / '${rust.envVars.rustHostPlatformSpec}' / rust_target"
'';
});
@ -1190,12 +1190,11 @@ in with final; {
];
postPatch = (upstream.postPatch or "") + ''
substituteInPlace src/sdlshim.zig \
--replace 'cInclude("SDL2/SDL2_gfxPrimitives.h")' 'cInclude("SDL2_gfxPrimitives.h")' \
--replace 'cInclude("SDL2/SDL_image.h")' 'cInclude("SDL_image.h")' \
--replace 'cInclude("SDL2/SDL_ttf.h")' 'cInclude("SDL_ttf.h")'
--replace-fail 'cInclude("SDL2/SDL2_gfxPrimitives.h")' 'cInclude("SDL2_gfxPrimitives.h")' \
--replace-fail 'cInclude("SDL2/SDL_image.h")' 'cInclude("SDL_image.h")' \
--replace-fail 'cInclude("SDL2/SDL_ttf.h")' 'cInclude("SDL_ttf.h")'
substituteInPlace build.zig \
--replace 'step.linkSystemLibrary("curl")' 'step.linkSystemLibrary("libcurl")' \
--replace 'exe.install();' 'exe.install(); if (true) { return; } // skip tests when cross compiling'
--replace-fail 'step.linkSystemLibrary("curl")' 'step.linkSystemLibrary("libcurl")'
'';
# skip the mepo -docman self-documenting invocation
postInstall = ''
@ -1532,7 +1531,7 @@ in with final; {
rustTargetPlatform = rust.toRustTarget stdenv.hostPlatform;
in {
postPatch = (upstream.postPatch or "") + ''
substituteInPlace src/meson.build --replace \
substituteInPlace src/meson.build --replace-fail \
"'src' / rust_target" \
"'src' / '${rustTargetPlatform}' / rust_target"
'';
@ -1793,8 +1792,8 @@ in with final; {
# fixes "error: linker `cc` not found"
postPatch = (upstream.postPatch or "") + ''
substituteInPlace src/meson.build \
--replace "cargo, 'build'," "'${lib.getExe crossCargo}', 'build'," \
--replace "'src' / rust_target" "'src' / '${rust.envVars.rustHostPlatformSpec}' / rust_target"
--replace-fail "cargo, 'build'," "'${lib.getExe crossCargo}', 'build'," \
--replace-fail "'src' / rust_target" "'src' / '${rust.envVars.rustHostPlatformSpec}' / rust_target"
'';
});
@ -1881,8 +1880,8 @@ in with final; {
# additionally, gsjpack has a shebang for the host gjs. patchShebangs --build doesn't fix that: just manually specify the build gjs
postPatch = (upstream.postPatch or "") + ''
substituteInPlace src/meson.build \
--replace "find_program('gjs').full_path()" "'${gjs}/bin/gjs'" \
--replace "gjspack," "'env', 'GI_TYPELIB_PATH=${typelibPath [
--replace-fail "find_program('gjs').full_path()" "'${gjs}/bin/gjs'" \
--replace-fail "gjspack," "'env', 'GI_TYPELIB_PATH=${typelibPath [
buildPackages.gdk-pixbuf
buildPackages.glib
buildPackages.graphene
@ -1915,8 +1914,8 @@ in with final; {
unl0kr = prev.unl0kr.overrideAttrs (upstream: {
postPatch = (upstream.postPatch or "") + ''
substituteInPlace meson.build \
--replace "scdoc = dependency('scdoc')" "" \
--replace "scdoc.get_pkgconfig_variable('scdoc')" "'scdoc'"
--replace-fail "scdoc = dependency('scdoc')" "" \
--replace-fail "scdoc.get_pkgconfig_variable('scdoc')" "'scdoc'"
'';
});