Skip to content

Commit

Permalink
Fix paths in shiboken CMake scripts and package required dlls. (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
karliss authored Aug 30, 2020
1 parent c90b7ab commit 2ecadaf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
12 changes: 4 additions & 8 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ environment:
build_script:
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
- C:\msys64\usr\bin\bash -lc "
mkdir ninja &&
cd ninja &&
wget https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip &&
7z x ninja-win.zip &&
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe &&
7z x -oLLVM LLVM-10.0.0-win64.exe &&
export LLVM_INSTALL_DIR=\"$PWD/LLVM\" &&
cd \"%APPVEYOR_BUILD_FOLDER%\" &&
export PATH=\"$PWD/ninja:$PWD/qt/bin:$PATH\" &&
export LLVM_INSTALL_DIR=\"C:\Program Files\LLVM\" &&
export PATH=\"$PWD/qt/bin:$LLVM_INSTALL_DIR/bin:$PATH\" &&
make PYTHON_WINDOWS=\"C:\Python36-x64\""
# make PYTHON_WINDOWS=\"C:\Python36-x64\" QT_PREFIX=\"C:\Qt\5.12\msvc2017_64\""
# export PATH=\"$PWD/ninja:/c/Qt/5.12/msvc2017_64/bin:$PATH\" &&

artifacts:
- path: "%ARTIFACT_PATH%"
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PYTHON_INCLUDE_DIR=${PYTHON_PREFIX}/include/python3.6m
PYTHON_EXECUTABLE=${PYTHON_PREFIX}/bin/python3
else
PYTHON_PREFIX=${PYTHON_WINDOWS}
PYTHON_LIBRARY=${PYTHON_WINDOWS}/libs/python36.lib
PYTHON_LIBRARY=${PYTHON_WINDOWS}/libs/python3.lib
PYTHON_INCLUDE_DIR=${PYTHON_WINDOWS}/include
PYTHON_EXECUTABLE=${PYTHON_WINDOWS}/python.exe
PYTHON_DEPS=
Expand Down Expand Up @@ -267,6 +267,11 @@ ${PYSIDE_SRC_DIR}:
patch "${PYSIDE_SRC_DIR}/sources/pyside2/CMakeLists.txt" patch/pyside-5.14.1/CMakeLists.txt.patch
echo "" > "${PYSIDE_SRC_DIR}/sources/pyside2/cmake/Macros/FindQt5Extra.cmake"


ifeq (${PLATFORM},win)
patch "${PYSIDE_SRC_DIR}/sources/shiboken2/ApiExtractor/CMakeLists.txt" patch/lib_install_path.patch
endif

ifneq (${QT_OPENGL_ENABLED},1)
# Patches to remove OpenGL-related source files.
patch "${PYSIDE_SRC_DIR}/sources/pyside2/PySide2/QtGui/CMakeLists.txt" patch/pyside-5.12.1/QtGui-CMakeLists.txt.patch
Expand Down Expand Up @@ -331,6 +336,7 @@ endif
ifeq (${PLATFORM},win)
cd "${PYSIDE_SRC_DIR}/build/pyside2" && ninja -j ${BUILD_THREADS}
cd "${PYSIDE_SRC_DIR}/build/pyside2" && ninja install
cp "${LLVM_INSTALL_DIR}/bin/libclang.dll" "${PYSIDE_PREFIX}/bin/"
else
make -C "${PYSIDE_SRC_DIR}/build/pyside2" -j${BUILD_THREADS}
make -C "${PYSIDE_SRC_DIR}/build/pyside2" install
Expand Down
11 changes: 11 additions & 0 deletions patch/lib_install_path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- sources/shiboken2/ApiExtractor/CMakeLists.txt 2020-08-26 17:37:19.411334400 +0300
+++ sources/shiboken2/ApiExtractor/CMakeLists.txt 2020-08-26 17:36:55.459967400 +0300
@@ -84,7 +84,7 @@

target_compile_definitions(apiextractor PRIVATE CMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}")

-set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)
+set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)

if (BUILD_TESTS)
find_package(Qt5Test 5.12 REQUIRED)

0 comments on commit 2ecadaf

Please sign in to comment.