Commit 5f43b695 authored by Ivan Yossi's avatar Ivan Yossi 👌 Committed by Ashwin Dhakaita

macos build: update ext_sip, ext_python, ext_pyqt to build

a correct instalation of Python in OSX

update packaging script to include Python in deployed DMG
parent 818b81e7
......@@ -10,7 +10,7 @@ if (UNIX)
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/pyport_osx.diff
COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/osx_fixappinstall.diff
CONFIGURE_COMMAND <SOURCE_DIR>/configure MACOSX_DEPLOYMENT_TARGET=10.11 -prefix=${PREFIX_ext_python} ${GLOBAL_AUTOMAKE_PROFILE}
CONFIGURE_COMMAND <SOURCE_DIR>/configure MACOSX_DEPLOYMENT_TARGET=10.11 -prefix=${PREFIX_ext_python} ${GLOBAL_AUTOMAKE_PROFILE} --enable-shared
--with-cxx-main=/usr/bin/g++ --without-ensurepip --disable-tests --without-test --without-tests --enable-framework=${PREFIX_ext_python}/lib
BUILD_COMMAND make
INSTALL_COMMAND make install
......
......@@ -21,27 +21,34 @@ if (UNIX)
UPDATE_COMMAND ""
)
else(APPLE)
find_package(PythonInterp 3.5)
if(NOT PYTHONINTERP_FOUND)
SET(PYTHON_EXECUTABLE ${PREFIX_ext_sip}/bin/python3)
if(NOT EXISTS "${PYTHON_EXECUTABLE}")
message("WARNING: using system python3!")
SET(PYTHON_EXECUTABLE python3)
endif()
# Get PYTHONVERSION
execute_process(COMMAND ${PYTHON_EXECUTABLE} -V COMMAND awk "{print $2}" OUTPUT_VARIABLE PYTHON_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHON_VERSION})
list(GET PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
list(GET PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
endif()
set(PY_VER "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
ExternalProject_Add( ext_sip
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://www.riverbankcomputing.com/static/Downloads/sip/sip-4.19.14.tar.gz
URL_MD5 bba62b2ea7e16193c7dfcfadb8dd0d05
URL https://www.riverbankcomputing.com/static/Downloads/sip/sip-4.19.15.zip
URL_MD5 4a1a4760cfabef15d68f45a6920974c2
CMAKE_ARGS -DPYTHON_INCLUDE_DIR=${PREFIX_ext_sip}/lib/Python.framework/Headers
CONFIGURE_COMMAND ${PYTHON_EXECUTABLE} <SOURCE_DIR>/configure.py --deployment-target=10.11
-b ${PREFIX_ext_sip}/bin -d ${PREFIX_ext_sip}/lib/Python.framework/Versions/Current/site-packages/
-e ${PREFIX_ext_sip}/include --sipdir ${PREFIX_ext_sip}/share/sip --target-py-version 3.5 --sip-module PyQt5.sip
BUILD_COMMAND make
INSTALL_COMMAND make install
COMMAND ${CMAKE_COMMAND} -E copy ${PREFIX_ext_sip}/sip/PyQt5/sip.so ${PREFIX_ext_sip}/lib/python${PY_VER}/site-packages/PyQt5/sip.so
COMMAND ${CMAKE_COMMAND} -E copy ${PREFIX_ext_sip}/sip/PyQt5/sip.pyi ${PREFIX_ext_sip}/lib/python${PY_VER}/site-packages/PyQt5/sip.pyi
# COMMAND ${CMAKE_COMMAND} -E create_symlink ./PyQt5/sip.so ${PREFIX_ext_sip}/lib/Python.framework/Versions/Current/site-packages/sip.so
# COMMAND ${CMAKE_COMMAND} -E create_symlink ./PyQt5/sip.pyi ${PREFIX_ext_sip}/lib/Python.framework/Versions/Current/site-packages/sip.pyi
BUILD_IN_SOURCE 1
......
......@@ -392,6 +392,8 @@ krita_deploy () {
mkdir -p ${KRITA_DMG}/krita.app/Contents/PlugIns
mkdir -p ${KRITA_DMG}/krita.app/Contents/Frameworks
mkdir -p ${KRITA_DMG}/krita.app/Contents/Frameworks
echo "Copying share..."
# Deletes old copies of translation and qml to be recreated
cd ${KIS_INSTALL_DIR}/share/
......@@ -443,6 +445,12 @@ krita_deploy () {
# rsync -prul {KIS_INSTALL_DIR}/lib/libkrita* Frameworks/
echo "Copying python..."
# folders with period in name are treated as Frameworks for codesign
# there cant be empty files
rsync -prul ${KIS_INSTALL_DIR}/lib/python3.5/ ${KRITA_DMG}/krita.app/Contents/Frameworks/python
ln -s python ${KRITA_DMG}/krita.app/Contents/Frameworks/python3.5
rsync -prul ${KIS_INSTALL_DIR}/lib/krita-python-libs ${KRITA_DMG}/krita.app/Contents/Frameworks/
# To avoid errors macdeployqt must be run from bin location
# ext_qt will not build macdeployqt by default so it must be build manually
# cd ${BUILDROOT}/depbuild/ext_qt/ext_qt-prefix/src/ext_qt/qttools/src
......@@ -489,6 +497,11 @@ krita_deploy () {
krita_findmissinglibs $(find ${KRITA_DMG}/krita.app/Contents -type f -perm 755 -or -name "*.dylib" -or -name "*.so")
echo "Done!"
# fix python
# precompile all pyc so the dont alter signature
cd ${KRITA_DMG}/krita.app
${KIS_INSTALL_DIR}/bin/python -m compileall .
}
# helper to define function only once
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment