void-packages/srcpkgs/kdesignerplugin/patches/kdesignerplugin-on-crossbuild.patch
Đoàn Trần Công Danh dd9d4a1979 srcpkgs/k*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

20 lines
769 B
Diff

On cross-build, use the host's binary.
Apply to both cross-build kdesignerplugin's package and use its package from others.
--- a/KF5DesignerPluginMacros.cmake
+++ b/KF5DesignerPluginMacros.cmake
@@ -51,9 +51,14 @@
get_filename_component(basename ${input} NAME_WE)
set(source ${CMAKE_CURRENT_BINARY_DIR}/${basename}widgets.cpp)
+ set(KGENDESIGNERPLUGIN_LOCATION KF5::kgendesignerplugin)
+ if(CMAKE_CROSSCOMPILING)
+ set(KGENDESIGNERPLUGIN_LOCATION /usr/bin/kgendesignerplugin)
+ endif()
+
# create source file from the .widgets file
add_custom_command(OUTPUT ${source}
- COMMAND KF5::kgendesignerplugin
+ COMMAND ${KGENDESIGNERPLUGIN_LOCATION}
ARGS -o ${source} ${input}
MAIN_DEPENDENCY ${input})