From c205acd77316bb1284245d2823e36fd5f5dd3877 Mon Sep 17 00:00:00 2001 From: Giovanni <561184+wargio@users.noreply.github.com> Date: Sun, 10 Oct 2021 14:51:19 +0200 Subject: [PATCH] Build jsdec with -Djsc_folder option to embed the javascript code (#2801) --- dist/bundle_jsdec.ps1 | 4 ++-- scripts/jsdec.sh | 4 ++-- src/CutterApplication.cpp | 10 ---------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/dist/bundle_jsdec.ps1 b/dist/bundle_jsdec.ps1 index 03cbbc75..a8e1cd61 100644 --- a/dist/bundle_jsdec.ps1 +++ b/dist/bundle_jsdec.ps1 @@ -2,9 +2,9 @@ $dist = $args[0] $python = Split-Path((Get-Command python.exe).Path) if (-not (Test-Path -Path 'jsdec' -PathType Container)) { - git clone https://github.com/rizinorg/jsdec.git --depth 1 --branch v0.3.0 + git clone https://github.com/rizinorg/jsdec.git --depth 1 --branch v0.3.1 } cd jsdec -& meson.exe --buildtype=release -Dc_args=-DDUK_USE_DATE_NOW_WINDOWS --prefix=$dist --libdir=lib\plugins --datadir=lib\plugins p build +& meson.exe --buildtype=release -Dc_args=-DDUK_USE_DATE_NOW_WINDOWS -Djsc_folder="." -Drizin_plugdir=lib\plugins -prefix=$dist --libdir=lib\plugins --datadir=lib\plugins p build ninja -C build install Remove-Item -Recurse -Force $dist\lib\plugins\core_pdd.lib diff --git a/scripts/jsdec.sh b/scripts/jsdec.sh index f2954ca1..571ecb80 100755 --- a/scripts/jsdec.sh +++ b/scripts/jsdec.sh @@ -7,13 +7,13 @@ SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")") cd "$SCRIPTPATH/.." if [[ ! -d jsdec ]]; then - git clone https://github.com/rizinorg/jsdec.git --depth 1 --branch v0.3.0 + git clone https://github.com/rizinorg/jsdec.git --depth 1 --branch v0.3.1 fi cd jsdec rm -rf build mkdir build && cd build -meson --buildtype=release --libdir=share/rizin/plugins --datadir=share/rizin/plugins "$@" ../p +meson --buildtype=release -Drizin_plugdir=share/rizin/plugins -Djsc_folder="../" --libdir=share/rizin/plugins --datadir=share/rizin/plugins "$@" ../p ninja ninja install diff --git a/src/CutterApplication.cpp b/src/CutterApplication.cpp index ba06c112..f12539d1 100644 --- a/src/CutterApplication.cpp +++ b/src/CutterApplication.cpp @@ -184,21 +184,11 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc sleighHome.cd( "share/rizin/plugins/rz_ghidra_sleigh"); // Contents/Resources/rz/share/rizin/plugins/rz_ghidra_sleigh Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath()); - -# ifdef CUTTER_BUNDLE_JSDEC - auto jsdecHome = rzprefix; - jsdecHome.cd( - "share/rizin/plugins/jsdec"); // Contents/Resources/rz/share/rizin/plugins/jsdec - qputenv("JSDEC_HOME", jsdecHome.absolutePath().toLocal8Bit()); -# endif } #endif #if defined(Q_OS_WIN) && defined(CUTTER_ENABLE_PACKAGING) { -# ifdef CUTTER_BUNDLE_JSDEC - qputenv("JSDEC_HOME", "lib\\plugins\\jsdec"); -# endif auto sleighHome = QDir(QCoreApplication::applicationDirPath()); sleighHome.cd("lib/plugins/rz_ghidra_sleigh"); Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath());