root/root-PyROOT-Don-t-install-the-python-modules-twice.patch
Mattias Ellert 64acc88ed1 Don't install the python modules twice
Fix Requires and Provides in the python3-root rpm
2025-12-18 13:08:34 +01:00

70 lines
3 KiB
Diff

From f09b4ce027b31dcd19ea8a398c35c5dfbcc0507f Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Thu, 18 Dec 2025 11:49:12 +0100
Subject: [PATCH] [PyROOT] Don't install the python modules twice
The binary python modules were moved one directory level down into the
ROOT and cppyy directories, so that they reside alongside the python
files in the same directories. The install rule for the python files
must therefore be extended to exclude the binary modules (PATTERN *.so
EXCLUDE) so that these are not installed a second time overwriting the
files installed by the install rule for the binary modules with another
copy with the wrong file permissions.
Also use the no-version option for the cppyy binary module as is
already done for the pythonization binary module, since it is now
installed in the python directory. Before it was installed in the
library directory with an unversioned symlink in the python directory.
---
bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt | 2 +-
bindings/pyroot/cppyy/cppyy/CMakeLists.txt | 5 +++--
bindings/pyroot/pythonizations/CMakeLists.txt | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt b/bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt
index bb48c032974..065a89348ff 100644
--- a/bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt
+++ b/bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt
@@ -73,7 +73,7 @@ endif()
add_library(cppyy SHARED src/CPyCppyyPyModule.cxx)
# Set the suffix to '.so' and the prefix to 'lib'
-set_target_properties(cppyy PROPERTIES ${ROOT_LIBRARY_PROPERTIES}
+set_target_properties(cppyy PROPERTIES ${ROOT_LIBRARY_PROPERTIES_NO_VERSION}
LIBRARY_OUTPUT_DIRECTORY ${localruntimedir}/cppyy)
if(MSVC)
target_link_libraries(cppyy PRIVATE CPyCppyy)
diff --git a/bindings/pyroot/cppyy/cppyy/CMakeLists.txt b/bindings/pyroot/cppyy/cppyy/CMakeLists.txt
index 3a29b4525f7..842ad12df97 100644
--- a/bindings/pyroot/cppyy/cppyy/CMakeLists.txt
+++ b/bindings/pyroot/cppyy/cppyy/CMakeLists.txt
@@ -31,8 +31,9 @@ endforeach()
# Install Python sources and bytecode
install(DIRECTORY ${localruntimedir}/cppyy
DESTINATION ${CMAKE_INSTALL_PYTHONDIR}
- COMPONENT libraries)
+ COMPONENT libraries
+ PATTERN *.so EXCLUDE)
if(NOT MSVC)
ROOT_ADD_TEST_SUBDIRECTORY(test)
-endif()
\ No newline at end of file
+endif()
diff --git a/bindings/pyroot/pythonizations/CMakeLists.txt b/bindings/pyroot/pythonizations/CMakeLists.txt
index 1230f18ca47..b415ba13697 100644
--- a/bindings/pyroot/pythonizations/CMakeLists.txt
+++ b/bindings/pyroot/pythonizations/CMakeLists.txt
@@ -239,7 +239,8 @@ install(TARGETS ${libname} EXPORT ${CMAKE_PROJECT_NAME}Exports
# Install Python sources and bytecode
install(DIRECTORY ${localruntimedir}/ROOT
DESTINATION ${CMAKE_INSTALL_PYTHONDIR}
- COMPONENT libraries)
+ COMPONENT libraries
+ PATTERN *.so EXCLUDE)
# Install headers required by pythonizations
install(FILES ${PYROOT_EXTRA_HEADERS}
--
2.52.0