kicad/0001-Use-library-target-install-for-python-module-to-fix-.patch
Stefan Brüns 0ee6c26f63 Accepting request 942464 from home:StefanBruens:branches:electronics:staging
- Update to version 6.0.0
  See https://www.kicad.org/blog/2021/12/KiCad-6.0.0-Release/ for details.
- Drop no longer necessary kicad-suse-help-path.patch
- Add 0001-Use-library-target-install-for-python-module-to-fix-.patch
- Adjust disk constraints (now 11G)

OBS-URL: https://build.opensuse.org/request/show/942464
OBS-URL: https://build.opensuse.org/package/show/electronics/kicad?expand=0&rev=84
2021-12-26 00:48:09 +00:00

43 lines
1.7 KiB
Diff

From 6baf90fcbce310036feb88ab021c740c5c079c96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sat, 11 Dec 2021 21:56:31 +0100
Subject: [PATCH] Use library target install for python module to fix RUNPATH
When the native python module is copied into the install tree, no special
handling for libraries/modules is triggered. This omits the RUNPATH
adjustments normally done by CMake during installation of binaries, which
is problematic for a number of reasons:
- library lookup can fail when dependencies require non-default RUNPATHs
- reproducible builds can fail when the buildroot contains semi-random
path components
Install the library target a second time, which is explicitly allowed
by CMake. As RENAME is not supported for `install(TARGETS)`, adjust the
name manually.
---
pcbnew/CMakeLists.txt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt
index 0ae24f0bd5..85b3cd471e 100644
--- a/pcbnew/CMakeLists.txt
+++ b/pcbnew/CMakeLists.txt
@@ -817,7 +817,13 @@ elseif( APPLE )
add_dependencies( ScriptingModulesPcbnewSoCopy ScriptingPythonDirectoryCreation )
set( PYMOD_EXT "so" )
else() # only linux remains among supported platforms
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.kiface DESTINATION ${PYTHON_DEST} COMPONENT binary RENAME "_pcbnew.so" )
+ install( TARGETS pcbnew_kiface DESTINATION ${PYTHON_DEST} COMPONENT binary )
+ cmake_policy(SET CMP0087 NEW)
+ install( CODE
+ "file( RENAME
+ \$ENV{DESTDIR}${PYTHON_DEST}/\$<TARGET_FILE_NAME:pcbnew_kiface>
+ \$ENV{DESTDIR}${PYTHON_DEST}/_pcbnew.so
+ )" )
set( PYMOD_EXT "so" )
endif()
--
2.34.1