Skip to content

Commit

Permalink
Build cutter-deps on GHA , update qt and Python (#10)
Browse files Browse the repository at this point in the history
* Move cutter deps from Travis to GHA due to more open source friendly plan
* Ensure that resulting Linux libs can be used for building Cutter release package on GHA and don't depend on Travis specific library versions
* Use latest cutter-deps-qt with qt 5.15.2 see rizinorg/cutter-deps-qt#3
* lib_isntall_path.patch applied upstream https://bugreports.qt.io/browse/PYSIDE-1299
* Update Python to 3.9.1
* https://bugreports.qt.io/browse/PYSIDE-1299 fixed paths for libs but introduced absolute path for shibokken executable
  • Loading branch information
karliss authored Dec 17, 2020
1 parent 2ecadaf commit 62c2ec3
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 159 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/package-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: package build

on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-16.04, macos-10.15]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: build linux
if: contains(matrix.os, 'ubuntu')
run: |
set -euo pipefail
sudo apt remove llvm-9
sudo apt install libclang-8-dev llvm-8 mesa-common-dev libgl1-mesa-dev
make
echo UPLOAD_FILE=cutter-deps-linux.tar.gz >> $GITHUB_ENV
echo UPLOAD_ASSET_TYPE=application/gzip >> $GITHUB_ENV
- name: build macos
if: contains(matrix.os, 'macos')
run: |
set -euo pipefail
brew install llvm ccache
export PATH=/usr/local/opt/llvm/bin:$PATH;
xcode-select -print-path
ls /Applications
sudo xcode-select -s /Applications/Xcode_11.2.1.app/Contents/Developer
# sudo xcode-select -s /Applications/Xcode_11.5.app/Contents/Developer
xcode-select -print-path
which llvm-config
llvm-config --version
make
echo UPLOAD_FILE=cutter-deps-macos.tar.gz >> $GITHUB_ENV
echo UPLOAD_ASSET_TYPE=application/gzip >> $GITHUB_ENV
- name: build windows
if: contains(matrix.os, 'windows')
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
C:\msys64\usr\bin\bash -lc "
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/qt/bin:$LLVM_INSTALL_DIR/bin:$PATH\" &&
make PYTHON_WINDOWS=\"C:\Python36-x64\""
- uses: actions/upload-artifact@v2
with:
name: ${{ env.UPLOAD_FILE }}
path: ${{ env.UPLOAD_FILE }}
- name: Get release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
id: get_release
uses: karliss/get-release@bee343636450eb2e9b85d9f1592d8d73c408dc74
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release assets
if: false && steps.get_release.outputs.upload_url != null
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ env.UPLOAD_FILE }}
asset_name: ${{ env.UPLOAD_FILE }}
asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }}
File renamed without changes.
40 changes: 23 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ endif
PKG_FILES=pyside

ifeq (${PYTHON_WINDOWS},)
PYTHON_SRC_FILE=Python-3.6.4.tar.xz
PYTHON_SRC_MD5=1325134dd525b4a2c3272a1a0214dd54
PYTHON_SRC_URL=https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
PYTHON_SRC_DIR=Python-3.6.4
PYTHON_VERSION=3.9.1
PYTHON_VERSION_MAJOR_MINOR=3.9
PYTHON_SRC_FILE=Python-${PYTHON_VERSION}.tar.xz
# 3.6.12
#PYTHON_SRC_MD5=9ca8ca6f206e9ac0f0726ecb4ebb6e2c
# 3.9.1
PYTHON_SRC_MD5=61981498e75ac8f00adcb908281fadb6

PYTHON_SRC_URL=https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz
PYTHON_SRC_DIR=Python-${PYTHON_VERSION}
PYTHON_DEPS=python
PKG_FILES+=python
ifeq (${PLATFORM},macos)
Expand All @@ -34,7 +40,7 @@ else
endif
${PYTHON_SRC_DIR}_target=PYTHON_SRC
PYTHON_LIBRARY=${PYTHON_PREFIX}/lib/libpython3.so
PYTHON_INCLUDE_DIR=${PYTHON_PREFIX}/include/python3.6m
PYTHON_INCLUDE_DIR=${PYTHON_PREFIX}/include/python${PYTHON_VERSION_MAJOR_MINOR}
PYTHON_EXECUTABLE=${PYTHON_PREFIX}/bin/python3
else
PYTHON_PREFIX=${PYTHON_WINDOWS}
Expand All @@ -59,10 +65,10 @@ ${PATCHELF_SRC_DIR}_target=PATCHELF_SRC
ifeq (${QT_PREFIX},)
QT_BIN_FILE=cutter-deps-qt-${PLATFORM}.tar.gz
PACKAGE_FILE=cutter-deps-${PLATFORM}.tar.gz
QT_BIN_URL=https://github.com/radareorg/cutter-deps-qt/releases/download/v9/${QT_BIN_FILE}
QT_BIN_MD5_linux=06ec8a1a89cbae078ca9a84579e8c9ce
QT_BIN_MD5_macos=2975208b05ce617e71844d1b3ba41221
QT_BIN_MD5_win=e1ba0fdfcdebe48bd255e01ddd794339
QT_BIN_URL=https://github.com/rizinorg/cutter-deps-qt/releases/download/v10/${QT_BIN_FILE}
QT_BIN_MD5_linux=e64ca2b9fb89b10349bbfd832554090e
QT_BIN_MD5_macos=887c0e4ac0924f751badff0646f12bb6
QT_BIN_MD5_win=226a052638521057a60385b9d547f242
QT_BIN_MD5=${QT_BIN_MD5_${PLATFORM}}
QT_BIN_DIR=qt
QT_PREFIX:=${ROOT_DIR}/${QT_BIN_DIR}
Expand All @@ -75,9 +81,9 @@ QT_OPENGL_ENABLED:=1
QT_DEPS=
endif

QT_VERSION=5.14.2
QT_VERSION=5.15.2
PYSIDE_SRC_FILE=pyside-setup-opensource-src-${QT_VERSION}.tar.xz
PYSIDE_SRC_MD5=e81aefb22c8584d6420ccdf3cb86673c
PYSIDE_SRC_MD5=e9bb6b57d39eb6cf1720cd3589a8b76a
PYSIDE_SRC_URL=https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${QT_VERSION}-src/pyside-setup-opensource-src-${QT_VERSION}.tar.xz
PYSIDE_SRC_DIR=pyside-setup-opensource-src-${QT_VERSION}
#PYSIDE_SRC_DIR=pyside-src
Expand Down Expand Up @@ -126,6 +132,7 @@ ifeq (${PLATFORM},macos)
@echo "Checking MD5 for $1"
@if [ "`md5 -r \"$1\"`" != "$2 $1" ]; then \
echo "MD5 mismatch for file $1"; \
md5 -r "$1";\
exit 1; \
else \
echo "$1 OK"; \
Expand Down Expand Up @@ -190,7 +197,7 @@ else
endif

ifeq (${PLATFORM},linux)
for lib in "${PYTHON_PREFIX}/lib/python3.6/lib-dynload"/*.so ; do \
for lib in "${PYTHON_PREFIX}/lib/python${PYTHON_VERSION_MAJOR_MINOR}/lib-dynload"/*.so ; do \
echo " patching $$lib" && \
"${PATCHELF_EXECUTABLE}" --set-rpath '$$ORIGIN/../..' "$$lib" || exit 1 ; \
done
Expand Down Expand Up @@ -264,13 +271,12 @@ ${PYSIDE_SRC_DIR}:

# Patch needed, so the PySide2 CMakeLists.txt doesn't search for Qt5UiTools and other stuff,
# which would mess up finding the actual modules later.
patch "${PYSIDE_SRC_DIR}/sources/pyside2/CMakeLists.txt" patch/pyside-5.14.1/CMakeLists.txt.patch
patch "${PYSIDE_SRC_DIR}/sources/pyside2/CMakeLists.txt" patch/pyside-5.15.2/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
# ifeq (${PLATFORM},win)
patch "${PYSIDE_SRC_DIR}/sources/shiboken2/generator/CMakeLists.txt" patch/pyside-5.15.2/shiboken_executable_install.patch
#endif

ifneq (${QT_OPENGL_ENABLED},1)
# Patches to remove OpenGL-related source files.
Expand Down
11 changes: 0 additions & 11 deletions patch/lib_install_path.patch

This file was deleted.

12 changes: 0 additions & 12 deletions patch/pyside-5.14.1/CMakeLists.txt.patch

This file was deleted.

12 changes: 12 additions & 0 deletions patch/pyside-5.15.2/CMakeLists.txt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- sources/pyside2/CMakeLists.txt 2020-11-11 14:51:30.000000000 +0200
+++ sources/pyside2/CMakeListsAfter.txt 2020-12-07 22:48:36.144247404 +0200
@@ -252,7 +252,8 @@
#####################################################################

add_subdirectory(libpyside)
-find_package(Qt${QT_MAJOR_VERSION}Designer)
+#find_package(Qt${QT_MAJOR_VERSION}Designer)
+set(Qt${QT_MAJOR_VERSION}Designer_FOUND FALSE)
if(${QT_MAJOR_VERSION} LESS 6 AND Qt${QT_MAJOR_VERSION}UiTools_FOUND
AND Qt${QT_MAJOR_VERSION}Designer_FOUND)
add_subdirectory(plugins)
16 changes: 16 additions & 0 deletions patch/pyside-5.15.2/shiboken_executable_install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Using CMAKE_INSTALL_PREFIX is unnecesarry and causes generated target cmake file to contain absolute path.
When us just "bin" CMake generates correct relative paths making resulting package relocatable.

diff --git a/sources/shiboken2/generator/CMakeLists.txt b/sources/shiboken2/generator/CMakeLists.txt
index 1a3f4e5c4..a44489b03 100644
--- a/sources/shiboken2/generator/CMakeLists.txt
+++ b/sources/shiboken2/generator/CMakeLists.txt
@@ -30,7 +30,7 @@ configure_file(shibokenconfig.h.in "${CMAKE_CURRENT_BINARY_DIR}/shibokenconfig.h

install(TARGETS shiboken2
EXPORT Shiboken2Targets
- DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
+ DESTINATION "bin")

set(shiboken_generator_package_name "shiboken2_generator")

22 changes: 0 additions & 22 deletions patch/pyside-7a7952f/CMakeLists.txt.patch

This file was deleted.

20 changes: 0 additions & 20 deletions patch/pyside-7a7952f/PySideModules.cmake.patch

This file was deleted.

67 changes: 0 additions & 67 deletions patch/pyside-7a7952f/QtGui-CMakeLists.txt.patch

This file was deleted.

10 changes: 0 additions & 10 deletions patch/pyside-7a7952f/QtWidgets-CMakeLists.txt.patch

This file was deleted.

0 comments on commit 62c2ec3

Please sign in to comment.