From ff0b1d6cc7396de70c0bb0cd409bf525dbd95121 Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 30 Sep 2026 12:13:48 +0200 Subject: [PATCH] Add linux-arm ci builds and improve for r2pm-b --- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++-- .gitignore | 1 + Makefile.acr | 13 ++++++++- 3 files changed, 70 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15435d62..11fc6361 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,14 @@ jobs: run: ./preconfigure && ./configure --prefix=/usr && make -j4 ; make user-install - name: Testing r2ghidra oneliner on home setup run: R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt && grep entry0 a.txt + - name: Packaging r2pm binary + run: make bindist + - name: Uploading r2pm binary + uses: actions/upload-artifact@v7 + with: + name: bindist-linux-x86-64 + path: r2ghidra-*.zip + if-no-files-found: error - name: System-wide installation run: make user-uninstall && sudo make install - name: Testing r2ghidra oneliner on system wide install @@ -77,6 +85,29 @@ jobs: name: linux-acr-ok path: r2ghidra_sleigh-*.zip + linux-arm: + runs-on: ubuntu-22.04-arm + steps: + - name: Checkout + uses: actions/checkout@v7 + - name: Installing radare2 from deb + run: | + wget https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2_${{env.R2V}}_arm64.deb + wget https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-dev_${{env.R2V}}_arm64.deb + sudo dpkg -i *.deb + - name: Building r2ghidra with acr + run: ./preconfigure && ./configure --prefix=/usr && make -j4 ; make user-install + - name: Testing r2ghidra oneliner on home setup + run: R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt && grep entry0 a.txt + - name: Packaging r2pm binary + run: make bindist + - name: Uploading r2pm binary + uses: actions/upload-artifact@v7 + with: + name: bindist-linux-arm-64 + path: r2ghidra-*.zip + if-no-files-found: error + tarball: runs-on: ubuntu-22.04 steps: @@ -149,11 +180,15 @@ jobs: macos-pkg: # The type of runner that the job will run on - runs-on: macos-latest - # Build for both architectures + runs-on: ${{ matrix.os }} + # Build each architecture natively strategy: matrix: - arch: [x86_64, arm64] + include: + - os: macos-15-intel + arch: x86_64 + - os: macos-latest + arch: arm64 env: ARCH: ${{ matrix.arch }} @@ -185,6 +220,14 @@ jobs: run: | r2 -qc 'af;pdg' test/bins/rec | tee a.txt grep csu_init a.txt + - name: Packaging r2pm binary + run: make bindist + - name: Uploading r2pm binary + uses: actions/upload-artifact@v7 + with: + name: bindist-macos-${{ env.ARCH }} + path: r2ghidra-*.zip + if-no-files-found: error - name: Uploading artifacts uses: actions/upload-artifact@v7 with: @@ -235,6 +278,7 @@ jobs: tag_name: ${{ steps.release.outputs.tag }} needs: - linux-deb + - linux-arm - macos-pkg - tarball - w64 @@ -267,6 +311,14 @@ jobs: uses: actions/download-artifact@v8 with: path: dist/artifacts + - name: Packaging r2pm Windows binary + run: | + V=${{ steps.r2gv.outputs.branch }} + mkdir -p w64/plugins + unzip -q dist/artifacts/w64/r2ghidra-$V-w64.zip -d w64/plugins + unzip -q dist/artifacts/linux-acr-ok/r2ghidra_sleigh-$V.zip -d w64/plugins + mv w64/plugins/r2ghidra_sleigh-$V w64/plugins/r2ghidra_sleigh + cd w64 && zip -qr ../dist/artifacts/r2ghidra-$V-windows-x86-64.zip plugins - name: Create GitHub release and upload assets uses: softprops/action-gh-release@v3 env: @@ -285,3 +337,5 @@ jobs: dist/artifacts/tarball/r2ghidra-${{ steps.r2gv.outputs.branch }}.zip dist/artifacts/tarball/r2ghidra-${{ steps.r2gv.outputs.branch }}.tar.xz dist/artifacts/linux-acr-ok/r2ghidra_sleigh-${{ steps.r2gv.outputs.branch }}.zip + dist/artifacts/bindist-*/r2ghidra-${{ steps.r2gv.outputs.branch }}-*.zip + dist/artifacts/r2ghidra-${{ steps.r2gv.outputs.branch }}-windows-x86-64.zip diff --git a/.gitignore b/.gitignore index 6aab5a52..a766b9a8 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ src/core_ghidra.dylib src/fidb/r2fidb src/fidb/r2fidb.dSYM config.mk +/r2ghidra-*.zip diff --git a/Makefile.acr b/Makefile.acr index 5e1cdb27..6f118b95 100644 --- a/Makefile.acr +++ b/Makefile.acr @@ -54,4 +54,15 @@ r2ghidra_sleigh.zip dist: ghidra-processors.txt rm -rf tmp -.PHONY: mrproper clean install uninstall all dist +# Binary package for r2pm -bi: plugins/ (with r2ghidra_sleigh/) and bin/ for this r2 version and platform +BINDIST_ZIP=r2ghidra-$(shell r2 -qv)-$(shell r2pm -H R2PM_OS)-$(shell r2pm -H R2PM_ARCH)-$(shell r2pm -H R2PM_BITS).zip +BINDIST_DIR=$(CURDIR)/tmp/bindist + +bindist: ghidra-processors.txt + rm -rf $(BINDIST_DIR) $(BINDIST_ZIP) + $(MAKE) -C src install DESTDIR= PLUGDIR=$(BINDIST_DIR)/plugins BINDIR=$(BINDIST_DIR)/bin + $(MAKE) -C ghidra user-install DH=$(BINDIST_DIR)/plugins/r2ghidra_sleigh + cd $(BINDIST_DIR) && zip -r $(CURDIR)/$(BINDIST_ZIP) plugins bin + rm -rf $(BINDIST_DIR) + +.PHONY: mrproper clean install uninstall all dist bindist