void-packages/srcpkgs/xapian-core/patches/cross-config.cmake.patch
Đoàn Trần Công Danh 3353bf4722 srcpkgs/x*: 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

18 lines
857 B
Diff

--- a/cmake/xapian-config.cmake.in 2019-03-02 02:45:31.000000000 +0100
+++ b/cmake/xapian-config.cmake.in 2019-03-02 02:45:31.000000000 +0100
@@ -1,4 +1,14 @@
-SET(prefix "@prefix@")
+get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
+# Use original install prefix when loaded through a "/usr move"
+# cross-prefix symbolic link such as /lib -> /usr/lib.
+get_filename_component(_realCurr "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
+get_filename_component(_realOrig "@prefix@/lib/cmake/xapian" REALPATH)
+if(_realCurr STREQUAL _realOrig)
+ set(prefix "@prefix@")
+endif()
+unset(_realOrig)
+unset(_realCurr)
+
SET(exec_prefix "@exec_prefix@")
SET(XAPIAN_LIBRARIES "@libdir@/libxapian@LIBRARY_VERSION_SUFFIX@@SHLIBEXT@" CACHE FILEPATH "Libraries for Xapian")
SET(XAPIAN_INCLUDE_DIR "@incdir@" CACHE PATH "Include path for Xapian")