Run cutter appimage packaging in GHA.

* Update cutter-deps.
* Switch to older visual studio due to pyside having problems parsing MSVC
headers.
This commit is contained in:
Kārlis Seņko 2020-11-29 17:44:20 +02:00 committed by karlis
parent df02332695
commit fe2399ccc3
4 changed files with 66 additions and 16 deletions

View File

@ -13,17 +13,22 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04] #, ubuntu-16.04, macos-latest, windows-latest]
os: [ubuntu-18.04, ubuntu-16.04, macos-latest, windows-2016]
python-version: [3.7.x]
system-deps: [false]
cc-override: [default]
cxx-override: [default]
include:
- os: ubuntu-16.04
- os: windows-latest
package: true
- os: ubuntu-16.04 # ensure that Cutter can be built at least in basic config on Ubuntu 16.04 using sytem libraries
python-version: 3.5.10
system-deps: true
cc-override: '/usr/bin/gcc-5'
cxx-override: '/usr/bin/g++-5'
- os: ubuntu-16.04 # release package build
system-deps: false
package: true
# Prevent one job from pausing the rest
fail-fast: false
steps:
@ -34,7 +39,7 @@ jobs:
- name: apt dependencies
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get install libgraphviz-dev mesa-common-dev
sudo apt-get install libgraphviz-dev mesa-common-dev libxkbcommon-x11-dev
if [[ "${{ matrix.os }}" = "ubuntu-16.04" ]]
then
sudo apt-get install ninja-build/xenial-backports
@ -85,6 +90,7 @@ jobs:
export PKG_CONFIG_PATH="$CUTTER_DEPS_PYTHON_PREFIX/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
export LD_LIBRARY_PATH="`llvm-config --libdir`:$LD_LIBRARY_PATH"
fi
set -euo pipefail #TODO: move to top once cutter-deps doesn't fail
if [[ "${{ matrix.cc-override }}" != "default" ]]
then
export CC="${{matrix.cc-override}}"
@ -100,14 +106,20 @@ jobs:
then
cmake \
-G Ninja \
-DCUTTER_ENABLE_PYTHON=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCUTTER_ENABLE_PYTHON=ON \
-DPYTHON_LIBRARY="$CUTTER_DEPS_PYTHON_PREFIX/lib/libpython3.6m.so.1.0" \
-DPYTHON_INCLUDE_DIR="$CUTTER_DEPS_PYTHON_PREFIX/include/python3.6m" \
-DPYTHON_EXECUTABLE="$CUTTER_DEPS_PYTHON_PREFIX/bin/python3" \
-DCUTTER_ENABLE_PYTHON_BINDINGS=OFF \
-DCUTTER_ENABLE_PYTHON_BINDINGS=ON \
-DCUTTER_ENABLE_GRAPHVIZ=OFF \
-DCUTTER_ENABLE_CRASH_REPORTS=ON \
-DCUTTER_USE_BUNDLED_RIZIN=ON \
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON \
-DCUTTER_PACKAGE_RZ_GHIDRA=ON \
-DCUTTER_APPIMAGE_BUILD=ON \
-DCMAKE_INSTALL_PREFIX=appdir/usr \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
..
else
cmake \
@ -117,6 +129,34 @@ jobs:
..
fi
ninja
if [[ "${{ matrix.package || false }}" = "true" ]]
then
export CUTTER_VERSION=$(python ../scripts/get_version.py)
export VERSION=$CUTTER_VERSION # TODO cleanup this
ninja install
"../scripts/appimage_embed_python.sh" appdir
# "../scripts/rz-ghidra.sh" -DCMAKE_INSTALL_PREFIX="`pwd`/appdir/usr" -DBUILD_CUTTER_PLUGIN=ON -DCUTTER_SOURCE_DIR="`pwd`/.."
APP_PREFIX=`pwd`/appdir/usr
# export LD_LIBRARY_PATH=${APP_PREFIX}/lib:$Shiboken2_ROOT/lib
export PATH=$PATH:${APP_PREFIX}/bin
"../scripts/r2dec.sh" --prefix=`pwd`/appdir/usr
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage"
chmod a+x linuxdeployqt*.AppImage
rm -fv "../cutter-deps/qt/plugins/imageformats/libqjp2.so"
# ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -executable=./appdir/usr/bin/python3 -bundle-non-qt-libs -no-strip -exclude-libs=libnss3.so,libnssutil3.so,libqjp2.so -ignore-glob=usr/lib/python3.9/**/* -verbose=2
# exclude librzghidra cutter plugin because cutter and rz plugin is loaded manuallly as they are plugins linuxdeployqt doesn't know this
./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop \
-executable=./appdir/usr/bin/python3 \
-appimage \
-no-strip -exclude-libs=libnss3.so,libnssutil3.so,libqjp2.so \
-ignore-glob=usr/lib/python3.9/**/* \
-ignore-glob=usr/share/RadareOrg/Cutter/plugins/native/librzghidra* \
-verbose=2
find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
export APPIMAGE_FILE="Cutter-v$CUTTER_VERSION-x64.Linux.AppImage"
mv Cutter-*-x86_64.AppImage "$APPIMAGE_FILE"
echo PACKAGE_NAME=$APPIMAGE_FILE >> $GITHUB_ENV
fi
- name: cmake macos
shell: bash
if: contains(matrix.os, 'macos')
@ -148,13 +188,13 @@ jobs:
scripts/fetch_deps.sh
choco install winflexbison3
- name: windows cmake
if: contains(matrix.os, 'windows-latest')
if: contains(matrix.os, 'windows')
shell: cmd
run: |
set ARCH=x64
set CUTTER_DEPS=%CD%\cutter-deps
set PATH=%CD%\cutter-deps\qt\bin;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
call scripts\prepare_breakpad.bat
cd
mkdir build

View File

@ -71,5 +71,5 @@ elseif (WIN32)
COMPONENT Devel
PATTERN "*.pdb" EXCLUDE)
else ()
install(DIRECTORY "${RIZIN_INSTALL_DIR}/" DESTINATION ".")
install(DIRECTORY "${RIZIN_INSTALL_DIR}/" DESTINATION "." USE_SOURCE_PERMISSIONS)
endif()

14
dist/CMakeLists.txt vendored
View File

@ -91,6 +91,17 @@ if(CUTTER_PACKAGE_RZ_GHIDRA)
INSTALL_COMMAND ""
)
endif()
if (WIN32)
set (GHIDRA_OPTIONS "
\"-DRIZIN_INSTALL_PLUGDIR=\${CMAKE_INSTALL_PREFIX}/${RIZIN_INSTALL_PLUGDIR}\"
-DCUTTER_INSTALL_PLUGDIR=plugins/native")
elseif (APPLE)
set (GHIDRA_OPTIONS "
\"-DRIZIN_INSTALL_PLUGDIR=\${CMAKE_INSTALL_PREFIX}/${RIZIN_INSTALL_PLUGDIR}\"
-DCUTTER_INSTALL_PLUGDIR=plugins/native")
else()
set (GHIDRA_OPTIONS "")
endif()
install(CODE "
execute_process(
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rz-ghidra-prefix/src/rz-ghidra-build
@ -100,8 +111,7 @@ if(CUTTER_PACKAGE_RZ_GHIDRA)
-DCMAKE_BUILD_TYPE=Release
\"-DCMAKE_PREFIX_PATH=\${CMAKE_INSTALL_PREFIX};\${CMAKE_INSTALL_PREFIX}/include/librz;\${CMAKE_INSTALL_PREFIX}/include/librz/sdb;${RZ_GHIDRA_PREFIX_PATH}\"
-DCMAKE_INSTALL_PREFIX=\${CMAKE_INSTALL_PREFIX}
\"-DRIZIN_INSTALL_PLUGDIR=\${CMAKE_INSTALL_PREFIX}/${RIZIN_INSTALL_PLUGDIR}\"
-DCUTTER_INSTALL_PLUGDIR=plugins/native
${GHIDRA_OPTIONS}
-DBUILD_CUTTER_PLUGIN=ON
-DBUILD_SLEIGH_PLUGIN=OFF
-G Ninja

12
scripts/fetch_deps.sh Executable file → Normal file
View File

@ -4,16 +4,16 @@ cd $(dirname "${BASH_SOURCE[0]}")/..
mkdir -p cutter-deps && cd cutter-deps
LINUX_FILE="cutter-deps-linux.tar.gz"
LINUX_MD5=31fd19443a3405d6b6097cbbd4c11fba
LINUX_URL=https://github.com/rizinorg/cutter-deps/releases/download/v12/cutter-deps-linux.tar.gz
LINUX_MD5=63fb136f9c2b1da0b881e460030bff7f
LINUX_URL=https://github.com/rizinorg/cutter-deps/releases/download/test-v13/cutter-deps-linux.tar.gz
MACOS_FILE="cutter-deps-macos.tar.gz"
MACOS_MD5=e75041c04fc806437723a399028402af
MACOS_URL=https://github.com/rizinorg/cutter-deps/releases/download/v12/cutter-deps-macos.tar.gz
MACOS_MD5=44e490ea45985cfedb5f7882acd36fa2
MACOS_URL=https://github.com/rizinorg/cutter-deps/releases/download/test-v13/cutter-deps-macos.tar.gz
WIN_FILE="cutter-deps-win.tar.gz"
WIN_MD5=7c755404140f2e9945bfc13d2e645bb1
WIN_URL=https://github.com/rizinorg/cutter-deps/releases/download/v12/cutter-deps-win.tar.gz
WIN_MD5=f7bfcf69da0c9bbe96f7c34dc149d3b9
WIN_URL=https://github.com/rizinorg/cutter-deps/releases/download/test-v13/cutter-deps-win.tar.gz
if [ "$OS" == "Windows_NT" ]; then
FILE="${WIN_FILE}"