Merge pull request #199650 from erdnaxe/unicorn-update

unicorn: 2.0.0-rc7 -> 2.0.1
This commit is contained in:
Robert Scott 2022-11-08 00:54:47 +00:00 committed by GitHub
commit 2b42887994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 4 deletions

View File

@ -4,28 +4,44 @@
, pkg-config
, cmake
, IOKit
, cctools
}:
stdenv.mkDerivation rec {
pname = "unicorn";
version = "2.0.0-rc7";
version = "2.0.1";
src = fetchFromGitHub {
owner = "unicorn-engine";
repo = pname;
rev = version;
hash = "sha256-qlxtFCJBmouPuUEu8RduZM+rbOr52sGjdb8ZRHWmJ/w=";
hash = "sha256-D8kwrHo58zksVjB13VtzoVqmz++FRfJ4zI2CT+YeBVE=";
};
patches = [
# Fix compilation on aarch64-darwin
# See https://github.com/unicorn-engine/unicorn/issues/1730
./tests_unit_endian_aarch64.patch
];
nativeBuildInputs = [
cmake
pkg-config
] ++ lib.optionals stdenv.isDarwin [
cctools
];
buildInputs = lib.optionals stdenv.isDarwin [
IOKit
];
cmakeFlags = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
# Some x86 tests are interrupted by signal 10
"-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;test_x86"
];
doCheck = true;
meta = with lib; {
description = "Lightweight multi-platform CPU emulator library";
homepage = "https://www.unicorn-engine.org";

View File

@ -0,0 +1,20 @@
diff --git a/tests/unit/endian.h b/tests/unit/endian.h
index 5bc86308..b455899e 100644
--- a/tests/unit/endian.h
+++ b/tests/unit/endian.h
@@ -54,6 +54,7 @@
|| defined(_POWER) || defined(__powerpc__) \
|| defined(__ppc__) || defined(__hpux) || defined(__hppa) \
|| defined(_MIPSEB) || defined(_POWER) \
+ || defined(__ARMEB__) || defined(__AARCH64EB__) \
|| defined(__s390__)
# define BOOST_BIG_ENDIAN
# define BOOST_BYTE_ORDER 4321
@@ -63,6 +64,7 @@
|| defined(_M_ALPHA) || defined(__amd64) \
|| defined(__amd64__) || defined(_M_AMD64) \
|| defined(__x86_64) || defined(__x86_64__) \
+ || defined(__ARMEL__) || defined(__AARCH64EL__) \
|| defined(_M_X64) || defined(__bfin__)
# define BOOST_LITTLE_ENDIAN

View File

@ -15,8 +15,7 @@ buildPythonPackage rec {
sourceRoot = "source/bindings/python";
prePatch = ''
ln -s ${unicorn-emu}/lib/libunicorn${stdenv.targetPlatform.extensions.sharedLibrary} prebuilt/
ln -s ${unicorn-emu}/lib/libunicorn.a prebuilt/
ln -s ${unicorn-emu}/lib/libunicorn.* prebuilt/
'';
# needed on non-x86 linux

View File

@ -12730,6 +12730,7 @@ with pkgs;
unicorn = callPackage ../development/libraries/unicorn {
inherit (darwin.apple_sdk.frameworks) IOKit;
inherit (darwin) cctools;
};
units = callPackage ../tools/misc/units {