Bundle r2dec into AppImage (#2023)

This commit is contained in:
Florian Märkl 2020-01-24 12:18:18 +01:00 committed by GitHub
parent d88bb43d22
commit 14f830dd81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 2 deletions

View File

@ -18,6 +18,9 @@ matrix:
apt:
packages:
- ninja-build
before_install:
- pyenv global 3.7
- pip install meson
- name: Linux CMake
os: linux
@ -224,6 +227,7 @@ after_success:
cp ../src/translations/*.qm appdir/usr/bin/translations/ &&
"$TRAVIS_BUILD_DIR/scripts/appimage_embed_python.sh" appdir &&
"$TRAVIS_BUILD_DIR/scripts/r2ghidra.sh" -DCMAKE_INSTALL_PREFIX="`pwd`/appdir/usr" -DBUILD_CUTTER_PLUGIN=ON -DCUTTER_SOURCE_DIR="$TRAVIS_BUILD_DIR" &&
"$TRAVIS_BUILD_DIR/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 "$TRAVIS_BUILD_DIR/cutter-deps/qt/plugins/imageformats/libqjp2.so" &&

19
scripts/r2dec.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "$SCRIPTPATH/.."
if [[ ! -d r2dec-js ]]; then
git clone --depth 1 https://github.com/wargio/r2dec-js.git
fi
cd r2dec-js
rm -rf build
mkdir build && cd build
meson --buildtype=release --libdir=share/radare2/plugins --datadir=share/radare2/plugins "$@" ../p
ninja
ninja install

View File

@ -208,10 +208,16 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
#ifdef APPIMAGE
{
auto sleighHome = QDir(QCoreApplication::applicationDirPath()); // appdir/bin
sleighHome.cdUp(); // appdir
auto appdir = QDir(QCoreApplication::applicationDirPath()); // appdir/bin
appdir.cdUp(); // appdir
auto sleighHome = appdir;
sleighHome.cd("share/radare2/plugins/r2ghidra_sleigh"); // appdir/share/radare2/plugins/r2ghidra_sleigh
Core()->setConfig("r2ghidra.sleighhome", sleighHome.absolutePath());
auto r2decHome = appdir;
appdir.cd("share/radare2/plugins/r2dec-js"); // appdir/share/radare2/plugins/r2dec-js
qputenv("R2DEC_HOME", appdir.absolutePath().toLocal8Bit());
}
#endif