Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cutter qt6 deps. #3

Closed
wants to merge 69 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
1d81597
Cutter qt6 deps.
karliss May 29, 2024
55ae686
GHA yaml syntax.
karliss May 29, 2024
02c1a6d
More GHA yaml.
karliss May 29, 2024
e0d6611
Python prefix and linux jobs.
karliss May 29, 2024
2b1c816
Python handling adjustments.
karliss Jun 2, 2024
f7b1933
GHA adjustments.
karliss Jun 2, 2024
d332547
Linux cutter config fix.
karliss Jun 2, 2024
edbc4b4
More GHA tweaks, macOS target version.
karliss Jun 2, 2024
6c67c5f
Clang format.
karliss Jun 2, 2024
5079067
Misc fixes.
karliss Jun 2, 2024
f4d6954
Linux deps, macos python handling.
karliss Jun 2, 2024
1cd9def
Macos python_root , yara cutter_qt6
karliss Jun 2, 2024
84e4386
Yara regex fix.
karliss Jun 2, 2024
df6e90e
Windows yara.
karliss Jun 2, 2024
61e52c4
Update cutter deps.
karliss Jun 3, 2024
b996201
Appimage tweaks.
karliss Jun 3, 2024
3448cce
Linux deps.
karliss Jun 4, 2024
cabcaf5
Temporary disable test logging.
karliss Jun 4, 2024
8c7a3ce
Try hdiutil workaround
karliss Jun 4, 2024
cf6b70b
Macos HDIUTIL workaround 2.
karliss Jun 4, 2024
1337d3f
Try to get more output for windows build fail.
karliss Jun 9, 2024
7b24b57
More windows build debug.
karliss Jun 9, 2024
e268057
Windows test 3.
karliss Jun 9, 2024
4a4934c
Cmake error.
karliss Jun 9, 2024
5ffda16
Fix subcommand.
karliss Jun 9, 2024
7dc07e0
Test if windows build without ghidra succeeds.
karliss Jun 9, 2024
c3517a0
Disable windows ghidra properly.
karliss Jun 9, 2024
73d2f87
Maybe it's python packaging related.
karliss Jun 9, 2024
88b32af
Fix pyside file install.
karliss Jun 9, 2024
5405ed5
Start cleanup.
karliss Jun 9, 2024
6668e02
More cleanup.
karliss Jun 9, 2024
ca5779e
Build adjustments.
karliss Jun 16, 2024
993385c
Wayland bundling attempt2.
karliss Jun 18, 2024
1401988
Ci packaging adjustments.
karliss Jun 19, 2024
0ce814b
Ubuntu package install.
karliss Jun 22, 2024
21ab7e9
Try excluding wayland system libs from appimage.
karliss Jun 22, 2024
12040d5
Exclude attempt 2.
karliss Jun 22, 2024
23ed937
Try to fix qt5 build python bundling.
karliss Jun 26, 2024
b7dc53c
Linux python bundle fix.
karliss Jun 26, 2024
0300947
Appimage python bundling fix 2.
karliss Jun 26, 2024
2bec463
Appimage Python version check, different version.
karliss Jun 27, 2024
44df05a
Appimage python bundle version code fix.
karliss Jun 27, 2024
e3750e8
Adjust python plugin binding code.
karliss Jul 6, 2024
0bb57bb
Start making setup for running only build in docker.
karliss Jul 7, 2024
9a514a3
GHA syntax fix.
karliss Jul 7, 2024
801b879
Inconsistent GHA docker image syntax.
karliss Jul 7, 2024
0d5faf3
Use bash.
karliss Jul 7, 2024
e35e297
Start adding build script content.
karliss Jul 7, 2024
813cfb0
GHA doesn't like empty matrix.
karliss Jul 7, 2024
e44e299
Missing args.
karliss Jul 7, 2024
ecfea8c
Can't use input for image?
karliss Jul 7, 2024
a2f8000
Docker image name.
karliss Jul 7, 2024
0bfa594
Test arguments.
karliss Jul 7, 2024
d52b64b
Args?
karliss Jul 7, 2024
6443a7a
I don't know bash.
karliss Jul 7, 2024
8381e52
Move more code.
karliss Jul 7, 2024
5216238
Optional LD_LIBRARY_PATH
karliss Jul 7, 2024
ec4b465
Temporary workaround for cutter_deps
karliss Jul 7, 2024
31e8649
Do not update git.
karliss Jul 7, 2024
cd10bd9
Git install.
karliss Jul 7, 2024
e2c5cc7
Git.
karliss Jul 7, 2024
52aa1d6
Test permissions.
karliss Jul 7, 2024
02a0c31
Try to deal with git user complains.
karliss Jul 7, 2024
6528443
Pyside version and build outputs.
karliss Jul 7, 2024
f01adfe
Docker privileged for fuse.
karliss Jul 7, 2024
a0a6bae
Runn appiamge using extract due to fuse not working in docker.
karliss Jul 7, 2024
48477f0
Qt 6.7.2
karliss Jul 13, 2024
2890bfc
Restore disabled configs.
karliss Jul 13, 2024
a4e69ba
Dependency install fix.
karliss Jul 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/actions/build-linux-old/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Build linux'
description: 'Build cutter in a docker image'
inputs:
system-deps:
description: 'Use system libraries instead of cutter-deps'
required: true
image:
description: 'Docker image'
required: true
qt-major:
description: 'Qt major version'
required: true
package:
description: 'Package appimage'
required: true
runs:
using: 'docker'
image: 'ubuntu:18.04'
entrypoint: './.github/actions/build-linux-old/entrypoint.sh'
args:
- ${{ inputs.system-deps }}
env:
package: ${{ inputs.package }}
qt_major: ${{ inputs.qt-major }}
image: ${{ inputs.image }}
system_deps: ${{ inputs.system-deps }}
206 changes: 206 additions & 0 deletions .github/actions/build-linux-old/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
#!/bin/bash

set -euo pipefail

pwd
ls

#export TZ=UTC
#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

apt-get -y update

# latest git and cmake
export GIT_VERSION="git-2.36.1"
export CMAKE_VERSION="3.25.3"

apt-get -y install wget libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential

wget "https://www.kernel.org/pub/software/scm/git/$GIT_VERSION.tar.gz"
tar -zxf "$GIT_VERSION.tar.gz"
# build.
#make -C "$GIT_VERSION" prefix=/usr install -j > "$GIT_VERSION/build.log"
# ensure git is installed.
#git version
wget "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh"
bash ./cmake-$CMAKE_VERSION-linux-x86_64.sh --skip-license --prefix=/usr
# ensure cmake is installed.
cmake --version
# cleanup dev environment.
rm -rf "$GIT_VERSION.tar.gz" "$GIT_VERSION" cmake-$CMAKE_VERSION-linux-x86_64.sh
unset CMAKE_VERSION
unset GIT_VERSION

apt-get -y install libgraphviz-dev \
mesa-common-dev \
libxkbcommon-x11-dev \
ninja-build \
python3-pip \
curl \
libpcre2-dev \
libfuse2 \
pkg-config \
git


if [ "$image" = "ubuntu:18.04" ]; then
# install additional packages needed for appimage
apt-get -y install gcc-7 \
libglu1-mesa-dev \
freeglut3-dev \
mesa-common-dev \
libclang-8-dev \
llvm-8
ln -s /usr/bin/llvm-config-8 /usr/bin/llvm-config
fi
if [ "$image" = "ubuntu:18.04" ] || [ "$image" = "ubuntu:20.04" ]; then
# install additional packages needed for appimage
apt-get -y install libxcb1-dev \
libxkbcommon-dev \
libxcb-*-dev \
libegl1
fi
if [ "$image" = "ubuntu:20.04" ] && [ "$system_deps" = "false" ]; then
# install additional packages needed for appimage
apt-get -y install libclang-12-dev \
llvm-12 \
libsm6 \
libwayland-dev \
libgl1-mesa-dev
fi
if [ "$image" = "ubuntu:18.04" ] && [ "$system_deps" = "true" ]; then
apt-get -y install qt5-default \
libqt5svg5-dev \
qttools5-dev \
qttools5-dev-tools
fi
if [ "$image" = "ubuntu:22.04" ]; then
apt-get -y install libclang-12-dev \
llvm-12 \
qt6-base-dev \
qt6-tools-dev \
qt6-tools-dev-tools \
libqt6svg6-dev \
libqt6core5compat6-dev \
libqt6svgwidgets6 \
qt6-l10n-tools \
gcc-12 \
g++-12
fi

# https://github.com/rizinorg/cutter/runs/7170222817?check_suite_focus=true
python3 -m pip install meson==0.61.5


if [ "$system_deps" = "false" ]
then
CUTTER_QT="$qt_major" scripts/fetch_deps.sh
set +u # TODO: remove temp code after updating cutter_deps
. cutter-deps/env.sh
set -u
#export LD_LIBRARY_PATH="`llvm-config --libdir`:$LD_LIBRARY_PATH"
fi
#if [ "${{ matrix.cc-override }}" != "default" ]
#then
# export CC="${{matrix.cc-override}}"
# export CXX="${{matrix.cxx-override}}"
#fi

# otherwise git complains about dubious ownership, due to code being checked out outside the container with a different user
git config --global --add safe.directory /github/workspace/rizin

if [ $qt_major = 6]
then
CMAKE_QT_ARG='ON'
else
CMAKE_QT_ARG='OFF'
fi

mkdir build
cd build
if [ "$system_deps" = "false" ]
then
locale
locale -a
export LANG="C.UTF-8"
export LC_ALL="C.UTF-8"
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCUTTER_ENABLE_PYTHON=ON \
-DPython3_ROOT_DIR="$CUTTER_DEPS_PYTHON_PREFIX" \
-DCUTTER_ENABLE_PYTHON_BINDINGS=ON \
-DCUTTER_ENABLE_GRAPHVIZ=ON \
-DCUTTER_USE_BUNDLED_RIZIN=ON \
-DCUTTER_APPIMAGE_BUILD=ON \
-DCUTTER_ENABLE_PACKAGING=ON \
-DCUTTER_ENABLE_KSYNTAXHIGHLIGHTING=OFF \
-DCUTTER_ENABLE_SIGDB=ON \
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON \
-DCUTTER_PACKAGE_RZ_GHIDRA=ON \
-DCUTTER_PACKAGE_JSDEC=ON \
-DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \
-DCUTTER_PACKAGE_RZ_LIBYARA=ON \
-DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \
-DCMAKE_INSTALL_PREFIX=appdir/usr \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
-DCUTTER_QT6=$CMAKE_QT_ARG \
..
else
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCUTTER_USE_BUNDLED_RIZIN=ON \
-DCUTTER_QT6=$CMAKE_QT_ARG \
..
fi
ninja
if [ "$package" = "true" ]
then
export CUTTER_VERSION=$(python ../scripts/get_version.py)
export VERSION=$CUTTER_VERSION
ninja install
if [ $qt_major == "6" ]
then
pyside_ver=6
else
pyside_ver=2
fi
"../scripts/appimage_embed_python.sh" appdir $pyside_ver
APP_PREFIX=`pwd`/appdir/usr
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}:$APP_PREFIX/lib/rizin/plugins"
export PATH=$PATH:${APP_PREFIX}/bin
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt*.AppImage
rm -fv "../cutter-deps/qt/plugins/imageformats/libqjp2.so"
if [ "$qt_major" == "5" ]; then
export APPIMAGE_FILE="Cutter-${PACKAGE_ID}-Linux-Qt5-x86_64.AppImage"
./linuxdeployqt*.AppImage --appimage-extract-and-run \
./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.12/**/* \
-verbose=2
else
export APPIMAGE_FILE="Cutter-${PACKAGE_ID}-Linux-x86_64.AppImage"
./linuxdeployqt*.AppImage --appimage-extract-and-run \
./appdir/usr/share/applications/*.desktop \
-executable=./appdir/usr/bin/python3 \
-appimage \
-no-strip -exclude-libs=libnss3.so,libnssutil3.so,libqjp2.so \
-exclude-libs="libwayland-client.so,libwayland-egl.so,libwayland-cursor.so" \
-ignore-glob=usr/lib/python3.12/**/* \
-extra-plugins="platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration,wayland-graphics-integration-server" \
-verbose=2
fi
find ./appdir -executable -type f -exec ldd {} \; | cut -d " " -f 2-3 | sort | uniq
# find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq

mv Cutter-*-x86_64.AppImage "$APPIMAGE_FILE"
echo PACKAGE_NAME=$APPIMAGE_FILE >> $GITHUB_ENV
echo PACKAGE_NAME=$APPIMAGE_FILE >> $GITHUB_OUTPUT
echo PACKAGE_PATH=build/$APPIMAGE_FILE >> $GITHUB_ENV
echo PACKAGE_PATH=build/$APPIMAGE_FILE >> $GITHUB_OUTPUT
echo UPLOAD_ASSET_TYPE=application/x-executable >> $GITHUB_ENV
fi
Loading
Loading