-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
CI_BRANCH="$1" | ||
CI_JSDEC="$PWD" | ||
CI_RZ_VERSION=$(curl -s GET https://api.github.com/repos/rizinorg/rizin/tags\?per_page\=1 | jq -r '.[].name') | ||
|
||
echo "CI_BRANCH: $CI_BRANCH" | ||
echo "CI_RZ_VERSION: $CI_RZ_VERSION" | ||
echo "CI_JSDEC: $CI_JSDEC" | ||
|
||
# avoid placing rizin in the same folder. | ||
cd .. | ||
|
||
# create a rizin folder and get inside it. | ||
mkdir rizin | ||
cd rizin | ||
CI_RIZIN="$PWD" | ||
echo "CI_RIZIN: $CI_RIZIN" | ||
|
||
DEBUGME=1 pwd ; ls -lah | ||
|
||
# download the latest tagged rizin version and extract it | ||
wget -O "rizin.tar.xz" "https://github.com/rizinorg/rizin/releases/download/$CI_RZ_VERSION/rizin-$CI_RZ_VERSION-static-x86_64.tar.xz" | ||
DEBUGME=1 pwd ; ls -lah | ||
tar xvf "rizin.tar.xz" | ||
|
||
DEBUGME=1 pwd ; ls -lah | ||
|
||
# add the extracted content to the pkg-config/path | ||
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$CI_RIZIN/lib/pkgconfig" | ||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CI_RIZIN/lib" | ||
export CFLAGS="$CFLAGS -I$CI_RIZIN/include/librz -I$CI_RIZIN/include/librz/sdb" | ||
export PATH="$PATH:$CI_RIZIN/bin" | ||
echo "PATH: $PATH" | ||
echo "CFLAGS: $CFLAGS" | ||
echo "PKG_CONFIG_PATH: $PKG_CONFIG_PATH" | ||
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH" | ||
|
||
# go back to the source folder of jsdec | ||
cd "$CI_JSDEC" | ||
|
||
# build jsdec and install in the rizin dir. | ||
meson -Dstandalone=false --prefix="$CI_RIZIN" build | ||
ninja -v -C build install | ||
|
||
# check if it was installed correctly and try to run it. | ||
HAS_JSDEC=$(rizin -Qc "Lc" | grep jsdec) | ||
if [ -z "$HAS_JSDEC" ]; then | ||
echo "rizin failed to load jsdec." | ||
rizin -e log.level=2 -Qc "Lc" | grep jsdec || sleep 0 | ||
exit 1 | ||
fi | ||
|
||
OUTPUT=$(rizin -Qc 'af ; pdd' /bin/ls) | ||
CHECK=$(echo -e "$OUTPUT" | grep "jsdec pseudo code output") | ||
echo -e "$OUTPUT" | ||
if [ -z "$CHECK" ]; then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: build-plugin | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
pull_request: | ||
|
||
|
||
# Automatically cancel any previous workflow on new push. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: alpine:edge | ||
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --security-opt apparmor=unconfined | ||
steps: | ||
- name: Install dependencies | ||
run: apk add --no-cache git gcc g++ linux-headers cmake curl wget unzip py3-wheel py3-setuptools py3-pip meson ninja xz | ||
- name: Checkout jsdec | ||
run: | | ||
git clone https://github.com/${{ github.repository }} | ||
cd jsdec | ||
git fetch origin ${{ github.ref }} | ||
git checkout -b local_branch FETCH_HEAD | ||
- name: build & run the plugin | ||
run: | | ||
chmod +x .ci-scripts/ci-build-linux.sh | ||
.ci-scripts/ci-build-linux.sh "${{ github.ref_name }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
push: | ||
branches: | ||
- master | ||
- dev | ||
pull_request: | ||
|
||
jobs: | ||
|