Build jsdec with -Djsc_folder option to embed the javascript code (#2801)

This commit is contained in:
Giovanni 2021-10-10 14:51:19 +02:00 committed by GitHub
parent 552cd6dff6
commit c205acd773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 14 deletions

View File

@ -2,9 +2,9 @@ $dist = $args[0]
$python = Split-Path((Get-Command python.exe).Path) $python = Split-Path((Get-Command python.exe).Path)
if (-not (Test-Path -Path 'jsdec' -PathType Container)) { 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 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 ninja -C build install
Remove-Item -Recurse -Force $dist\lib\plugins\core_pdd.lib Remove-Item -Recurse -Force $dist\lib\plugins\core_pdd.lib

View File

@ -7,13 +7,13 @@ SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "$SCRIPTPATH/.." cd "$SCRIPTPATH/.."
if [[ ! -d jsdec ]]; then 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 fi
cd jsdec cd jsdec
rm -rf build rm -rf build
mkdir build && cd 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
ninja install ninja install

View File

@ -184,21 +184,11 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
sleighHome.cd( sleighHome.cd(
"share/rizin/plugins/rz_ghidra_sleigh"); // Contents/Resources/rz/share/rizin/plugins/rz_ghidra_sleigh "share/rizin/plugins/rz_ghidra_sleigh"); // Contents/Resources/rz/share/rizin/plugins/rz_ghidra_sleigh
Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath()); 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 #endif
#if defined(Q_OS_WIN) && defined(CUTTER_ENABLE_PACKAGING) #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()); auto sleighHome = QDir(QCoreApplication::applicationDirPath());
sleighHome.cd("lib/plugins/rz_ghidra_sleigh"); sleighHome.cd("lib/plugins/rz_ghidra_sleigh");
Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath()); Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath());