From 411ffd93700e7be3c3da67e796e72991e9dca834 Mon Sep 17 00:00:00 2001 From: patryk4815 Date: Thu, 17 Apr 2025 02:54:26 +0200 Subject: [PATCH] nix: bump unicorn@dev only for LoongArch64 and enable GitHub Release for it (#2886) * add unicorn@dev only for loongarch64 release * install.sh add loongarch64 target * ci: releases add loongarch64 target --- .github/workflows/releases.yml | 2 ++ docs/install.sh | 2 +- nix/pyenv.nix | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 949690200..4003141b1 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -15,6 +15,7 @@ jobs: pwndbg-gdb-cross-ppc64-tarball, pwndbg-gdb-cross-ppc64le-tarball, pwndbg-gdb-cross-x86_32-tarball, + pwndbg-gdb-cross-loong64-tarball, # lldb pwndbg-lldb-cross-arm32-tarball, @@ -23,6 +24,7 @@ jobs: # pwndbg-lldb-cross-ppc64-tarball, # broken lldb compilation pwndbg-lldb-cross-ppc64le-tarball, pwndbg-lldb-cross-x86_32-tarball, + pwndbg-lldb-cross-loong64-tarball, ] runs-on: ubuntu-latest # x86_64-linux timeout-minutes: 360 diff --git a/docs/install.sh b/docs/install.sh index 53e6b1083..d06b51ef4 100755 --- a/docs/install.sh +++ b/docs/install.sh @@ -153,7 +153,7 @@ case "$OS" in powerpc64) FILE="${BINARY_NAME}_${VERSION}_powerpc64-portable.tar.xz" ;; powerpc64le) FILE="${BINARY_NAME}_${VERSION}_powerpc64le-portable.tar.xz" ;; s390x) FILE="${BINARY_NAME}_${VERSION}_s390x-portable.tar.xz" ;; - # loongarch64) FILE="${BINARY_NAME}_${VERSION}_loongarch64-portable.tar.xz" ;; + loongarch64) FILE="${BINARY_NAME}_${VERSION}_loongarch64-portable.tar.xz" ;; *) echoerr "Unsupported architecture: $ARCH" exit 1 diff --git a/nix/pyenv.nix b/nix/pyenv.nix index 4fd08ea18..222bae1e9 100644 --- a/nix/pyenv.nix +++ b/nix/pyenv.nix @@ -156,8 +156,6 @@ let capstone = pkgs.callPackage ( { cmake, - fixDarwinDylibNames, - fetchFromGitHub, stdenv, }: prev.capstone.overrideAttrs ( @@ -176,6 +174,7 @@ let pkg-config, cctools, stdenv, + fetchFromGitHub, }: prev.unicorn.overrideAttrs ( old: @@ -204,6 +203,19 @@ let --replace-fail "have_sprr_mrs='no'" "have_sprr_mrs='yes'" ''; } + // lib.optionalAttrs stdenv.hostPlatform.isLoongArch64 { + # Remove this block after upgrading to unicorn 2.2.0 + src = fetchFromGitHub { + owner = "unicorn-engine"; + repo = "unicorn"; + rev = "e867b08c66544ddf8cd62c1e36e8ff35d32c3e77"; + hash = "sha256-vov6io2+RY8CZAoF0S00J2trlEEQHeMxw4HV8gm2Q2Y="; + }; + sourceRoot = "source/bindings/python"; + preBuild = '' + chmod -R +w ../../../ + ''; + } ) ) { };