void-packages/srcpkgs/python3-pyside2/patches/crossbuild-no-pyi-generation.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```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

31 lines
1.4 KiB
Diff

pyside2 cmake code does not handle crossbuild while generating pyi files.
(stub files for type checker).
From now, disable their generation.
--- a/sources/pyside2/cmake/Macros/PySideModules.cmake
+++ b/sources/pyside2/cmake/Macros/PySideModules.cmake
@@ -201,18 +201,24 @@
endif()
# Add target to generate pyi file, which depends on the module target.
+ if(NOT CMAKE_CROSSCOMPILING)
add_custom_target("${module_NAME}_pyi" ALL
COMMAND ${CMAKE_COMMAND} -E env ${ld_prefix}
"${SHIBOKEN_PYTHON_INTERPRETER}"
"${CMAKE_CURRENT_SOURCE_DIR}/../support/generate_pyi.py" ${generate_pyi_options})
add_dependencies("${module_NAME}_pyi" ${module_NAME})
+ else()
+ message(STATUS "crossbuild: disable generation of ${module_NAME}_pyi")
+ endif()
# install
install(TARGETS ${module_NAME} LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}/PySide2")
+ if(NOT CMAKE_CROSSCOMPILING)
file(GLOB hinting_stub_files RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/PySide2" "${CMAKE_CURRENT_BINARY_DIR}/PySide2/*.pyi")
install(FILES ${hinting_stub_files}
DESTINATION "${PYTHON_SITE_PACKAGES}/PySide2")
+ endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide2/${module_NAME}/pyside2_${lower_module_name}_python.h
DESTINATION include/PySide2${pyside2_SUFFIX}/${module_NAME}/)