aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-02-21 18:15:10 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-02-22 10:11:51 +0000
commit6c6991732355184698abeb12994149fe8b16727e (patch)
treec17d6415e004ef2afed61f89e189da4f5ee64f80 /sources
parent011b6ad1987f0dee3035e9803ece9fb2c1a0a1b2 (diff)
Don't copy duplicate libraries on package installation
This change makes sure to resolve symlinks and copy only one file for every dynamic shared library used (vs 3 before -> 2 symlinks + 1 actual library). This avoids duplicate files, as well as saves space when creating wheel (e.g. no 3 copies of standalone WebEngine library). This filtering happens copying from CMake install dir into pyside_package_dir (the symlinks are still present in the CMake dir, but that shouldn't harm anybody, and might be useful for users of shiboken only for example). Task-number: PYSIDE-495 Change-Id: I0fe454e16c6b254a8682aa7b1c702ec01a3064f0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside2/CMakeLists.txt6
-rw-r--r--sources/pyside2/PySide2/CMakeLists.txt6
-rw-r--r--sources/pyside2/PySide2/_built_modules.py.in3
-rw-r--r--sources/pyside2/PySide2/_config.py.in6
-rw-r--r--sources/pyside2/libpyside/CMakeLists.txt2
-rw-r--r--sources/shiboken2/CMakeLists.txt1
-rw-r--r--sources/shiboken2/data/Shiboken2Config-spec.cmake.in1
-rw-r--r--sources/shiboken2/libshiboken/CMakeLists.txt2
8 files changed, 19 insertions, 8 deletions
diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt
index d7d17f27d..08ed52473 100644
--- a/sources/pyside2/CMakeLists.txt
+++ b/sources/pyside2/CMakeLists.txt
@@ -166,6 +166,7 @@ set(BINDING_API_MICRO_VERSION "0")
set(BINDING_API_RELEASE_LEVEL "alpha") # alpha, beta, rc, or final
set(BINDING_API_SERIAL 0) # leave as 0 when release level is final
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}" CACHE STRING "PySide version" FORCE)
+set(PYSIDE_SO_VERSION ${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION})
if (BINDING_API_RELEASE_LEVEL STREQUAL "final")
set(BINDING_API_VERSION_FULL "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}"
CACHE STRING "PySide version [full]" FORCE)
@@ -220,6 +221,11 @@ if(GIT_FOUND)
endif()
endif()
+# Used by setup.py to know which symlink to resolve and copy in to the final package, in order to
+# avoid resolving all symlinks and thus copying unnecessary duplicate files.
+set(config_py_shiboken_library_version "")
+set(config_py_pyside_library_version "")
+
include(PySideModules)
macro(COLLECT_MODULE_IF_FOUND shortname)
diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt
index 2a8cf15ee..98cb00b0a 100644
--- a/sources/pyside2/PySide2/CMakeLists.txt
+++ b/sources/pyside2/PySide2/CMakeLists.txt
@@ -7,8 +7,8 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/global.h.in"
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in"
"${CMAKE_CURRENT_BINARY_DIR}/__init__.py" @ONLY)
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/_built_modules.py.in"
- "${CMAKE_CURRENT_BINARY_DIR}/_built_modules.py" @ONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/_config.py.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/_config.py" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/_utils.py.in"
"${CMAKE_CURRENT_BINARY_DIR}/_utils.py" @ONLY)
@@ -49,7 +49,7 @@ endforeach()
# install
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py"
DESTINATION "${PYTHON_SITE_PACKAGES}/${BINDING_NAME}${pyside2_SUFFIX}")
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/_built_modules.py"
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/_config.py"
DESTINATION "${PYTHON_SITE_PACKAGES}/${BINDING_NAME}${pyside2_SUFFIX}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_utils.py
DESTINATION "${PYTHON_SITE_PACKAGES}/${BINDING_NAME}${pyside2_SUFFIX}")
diff --git a/sources/pyside2/PySide2/_built_modules.py.in b/sources/pyside2/PySide2/_built_modules.py.in
deleted file mode 100644
index 4e491d081..000000000
--- a/sources/pyside2/PySide2/_built_modules.py.in
+++ /dev/null
@@ -1,3 +0,0 @@
-built_modules = list(name for name in
- "@all_module_shortnames@"
- .split(";"))
diff --git a/sources/pyside2/PySide2/_config.py.in b/sources/pyside2/PySide2/_config.py.in
new file mode 100644
index 000000000..db8a17210
--- /dev/null
+++ b/sources/pyside2/PySide2/_config.py.in
@@ -0,0 +1,6 @@
+built_modules = list(name for name in
+ "@all_module_shortnames@"
+ .split(";"))
+
+shiboken_library_soversion = str(@SHIBOKEN_SO_VERSION@)
+pyside_library_soversion = str(@PYSIDE_SO_VERSION@)
diff --git a/sources/pyside2/libpyside/CMakeLists.txt b/sources/pyside2/libpyside/CMakeLists.txt
index de29269a4..15879a201 100644
--- a/sources/pyside2/libpyside/CMakeLists.txt
+++ b/sources/pyside2/libpyside/CMakeLists.txt
@@ -99,7 +99,7 @@ target_link_libraries(pyside2
set_target_properties(pyside2 PROPERTIES
VERSION ${BINDING_API_VERSION}
- SOVERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}"
+ SOVERSION "${PYSIDE_SO_VERSION}"
OUTPUT_NAME "pyside2${pyside2_SUFFIX}${SHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX}"
DEFINE_SYMBOL PYSIDE_EXPORTS)
diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt
index be3187591..238ee2d34 100644
--- a/sources/shiboken2/CMakeLists.txt
+++ b/sources/shiboken2/CMakeLists.txt
@@ -15,6 +15,7 @@ set(shiboken_MAJOR_VERSION "2")
set(shiboken_MINOR_VERSION "0")
set(shiboken_MICRO_VERSION "0")
set(shiboken2_VERSION "${shiboken_MAJOR_VERSION}.${shiboken_MINOR_VERSION}.${shiboken_MICRO_VERSION}")
+set(shiboken2_library_so_version "${shiboken_MAJOR_VERSION}.${shiboken_MINOR_VERSION}")
option(BUILD_TESTS "Build tests." TRUE)
option(USE_PYTHON_VERSION "Use specific python version to build shiboken2." "")
diff --git a/sources/shiboken2/data/Shiboken2Config-spec.cmake.in b/sources/shiboken2/data/Shiboken2Config-spec.cmake.in
index 9a30d7b4d..576bed0e2 100644
--- a/sources/shiboken2/data/Shiboken2Config-spec.cmake.in
+++ b/sources/shiboken2/data/Shiboken2Config-spec.cmake.in
@@ -25,6 +25,7 @@ SET(SHIBOKEN_PYTHON_LIBRARIES "@SBK_PYTHON_LIBRARIES@")
SET(SHIBOKEN_PYTHON_EXTENSION_SUFFIX "@PYTHON_EXTENSION_SUFFIX@")
SET(SHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX "@PYTHON_SHARED_LIBRARY_SUFFIX@")
SET(SHIBOKEN_PYTHON_CONFIG_SUFFIX "@PYTHON_CONFIG_SUFFIX@")
+SET(SHIBOKEN_SO_VERSION "@shiboken2_library_so_version@")
message(STATUS "libshiboken built for @SHIBOKEN_BUILD_TYPE@")
@SBK_ADD_PY_DEBUG_DEFINITION@
diff --git a/sources/shiboken2/libshiboken/CMakeLists.txt b/sources/shiboken2/libshiboken/CMakeLists.txt
index 6f7e4b463..6e725e6af 100644
--- a/sources/shiboken2/libshiboken/CMakeLists.txt
+++ b/sources/shiboken2/libshiboken/CMakeLists.txt
@@ -22,7 +22,7 @@ set(libshiboken_MAJOR_VERSION ${shiboken_MAJOR_VERSION})
set(libshiboken_MINOR_VERSION ${shiboken_MINOR_VERSION})
set(libshiboken_MICRO_VERSION ${shiboken_MICRO_VERSION})
set(libshiboken_VERSION "${libshiboken_MAJOR_VERSION}.${libshiboken_MINOR_VERSION}.${libshiboken_MICRO_VERSION}")
-set(libshiboken_SOVERSION "${libshiboken_MAJOR_VERSION}.${libshiboken_MINOR_VERSION}")
+set(libshiboken_SOVERSION "${shiboken2_library_so_version}")
set(libshiboken_SRC
basewrapper.cpp