cutter/scripts/jsdec.sh

25 lines
634 B
Bash
Raw Normal View History

2020-01-24 11:18:18 +00:00
#!/bin/bash
set -e
2024-02-24 15:55:19 +00:00
INSTALL_PREFIX="$1"
EXTRA_CMAKE_OPTS="$2"
2020-01-24 11:18:18 +00:00
SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "$SCRIPTPATH/.."
if [ ! -d jsdec ]; then
2024-02-24 15:55:19 +00:00
git clone https://github.com/rizinorg/jsdec.git --depth 1 --branch "dev"
2020-01-24 11:18:18 +00:00
fi
cd jsdec
2024-02-24 15:55:19 +00:00
if [ -d build_lib ]; then
rm -rf build_lib
fi
2024-02-24 15:55:19 +00:00
meson setup --buildtype=release --pkg-config-path="$INSTALL_PREFIX/lib/pkgconfig" -Dbuild_type=cutter build_lib
ninja -C build_lib
2020-01-24 11:18:18 +00:00
2024-02-24 15:55:19 +00:00
mkdir build_plugin && cd build_plugin
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DJSDEC_BUILD_DIR="../build_lib" -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $EXTRA_CMAKE_OPTS ../cutter-plugin
ninja install