Merge pull request #245527 from arcz/capstone-5.0
capstone: 4.0.2 -> 5.0.1
This commit is contained in:
commit
72a365b617
35
pkgs/development/libraries/capstone/4.nix
Normal file
35
pkgs/development/libraries/capstone/4.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, cmake
|
||||
, fetchFromGitHub
|
||||
, fixDarwinDylibNames
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "capstone";
|
||||
version = "4.0.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "capstone-engine";
|
||||
repo = "capstone";
|
||||
rev = version;
|
||||
sha256 = "sha256-XMwQ7UaPC8YYu4yxsE4bbR3leYPfBHu5iixSLz05r3g=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
fixDarwinDylibNames
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = {
|
||||
description = "Advanced disassembly library";
|
||||
homepage = "http://www.capstone-engine.org";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ thoughtpolice ris ];
|
||||
mainProgram = "cstool";
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
@ -7,15 +7,17 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "capstone";
|
||||
version = "4.0.2";
|
||||
version = "5.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "aquynh";
|
||||
owner = "capstone-engine";
|
||||
repo = "capstone";
|
||||
rev = version;
|
||||
sha256 = "sha256-XMwQ7UaPC8YYu4yxsE4bbR3leYPfBHu5iixSLz05r3g=";
|
||||
sha256 = "sha256-kKmL5sae9ruWGu1gas1mel9qM52qQOD+zLj8cRE3isg=";
|
||||
};
|
||||
|
||||
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
|
40
pkgs/development/python-modules/capstone/4.nix
Normal file
40
pkgs/development/python-modules/capstone/4.nix
Normal file
@ -0,0 +1,40 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, capstone_4
|
||||
, stdenv
|
||||
, setuptools
|
||||
, pythonAtLeast
|
||||
}:
|
||||
|
||||
buildPythonPackage {
|
||||
pname = "capstone";
|
||||
inherit (capstone_4) version src;
|
||||
|
||||
sourceRoot = "source/bindings/python";
|
||||
|
||||
postPatch = ''
|
||||
ln -s ${capstone_4}/lib/libcapstone${stdenv.targetPlatform.extensions.sharedLibrary} prebuilt/
|
||||
ln -s ${capstone_4}/lib/libcapstone${stdenv.targetPlatform.extensions.staticLibrary} prebuilt/
|
||||
substituteInPlace setup.py --replace manylinux1 manylinux2014
|
||||
'';
|
||||
|
||||
# aarch64 only available from MacOS SDK 11 onwards, so fix the version tag.
|
||||
# otherwise, bdist_wheel may detect "macosx_10_6_arm64" which doesn't make sense.
|
||||
setupPyBuildFlags = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ "--plat-name" "macosx_11_0" ];
|
||||
|
||||
propagatedBuildInputs = [ setuptools ];
|
||||
|
||||
checkPhase = ''
|
||||
mv capstone capstone.hidden
|
||||
patchShebangs test_*
|
||||
make check
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://www.capstone-engine.org/";
|
||||
license = licenses.bsdOriginal;
|
||||
description = "Python bindings for Capstone disassembly engine";
|
||||
maintainers = with maintainers; [ bennofs ris ];
|
||||
broken = pythonAtLeast "3.12"; # uses distutils
|
||||
};
|
||||
}
|
@ -17,9 +17,11 @@ buildPythonPackage rec {
|
||||
src = capstone.src;
|
||||
sourceRoot = "${src.name}/bindings/python";
|
||||
|
||||
# libcapstone.a is not built with BUILD_SHARED_LIBS. For some reason setup.py
|
||||
# checks if it exists but it is not really needed. Most likely a bug in setup.py.
|
||||
postPatch = ''
|
||||
ln -s ${capstone}/lib/libcapstone${stdenv.targetPlatform.extensions.sharedLibrary} prebuilt/
|
||||
ln -s ${capstone}/lib/libcapstone.a prebuilt/
|
||||
touch prebuilt/libcapstone${stdenv.targetPlatform.extensions.staticLibrary}
|
||||
substituteInPlace setup.py --replace manylinux1 manylinux2014
|
||||
'';
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, fetchpatch
|
||||
, capstone
|
||||
, capstone_4
|
||||
, cmsis-pack-manager
|
||||
, colorama
|
||||
, importlib-metadata
|
||||
@ -54,7 +54,7 @@ buildPythonPackage rec {
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
capstone
|
||||
capstone_4
|
||||
cmsis-pack-manager
|
||||
colorama
|
||||
importlib-metadata
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ lib, mkDerivation, fetchFromGitHub, cmake, pkg-config, boost, capstone
|
||||
{ lib, mkDerivation, fetchFromGitHub, cmake, pkg-config, boost, capstone_4
|
||||
, double-conversion, graphviz, qtxmlpatterns }:
|
||||
|
||||
mkDerivation rec {
|
||||
@ -15,7 +15,7 @@ mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
|
||||
buildInputs = [ boost.dev capstone double-conversion graphviz qtxmlpatterns ];
|
||||
buildInputs = [ boost.dev capstone_4 double-conversion graphviz qtxmlpatterns ];
|
||||
|
||||
postPatch = ''
|
||||
# Remove CMAKE_INSTALL_PREFIX from DEFAULT_PLUGIN_PATH otherwise the nix store path will appear twice.
|
||||
|
@ -4553,6 +4553,7 @@ with pkgs;
|
||||
candle = libsForQt5.callPackage ../applications/misc/candle { };
|
||||
|
||||
capstone = callPackage ../development/libraries/capstone { };
|
||||
capstone_4 = callPackage ../development/libraries/capstone/4.nix { };
|
||||
|
||||
keystone = callPackage ../development/libraries/keystone { };
|
||||
|
||||
|
@ -1887,6 +1887,9 @@ self: super: with self; {
|
||||
capstone = callPackage ../development/python-modules/capstone {
|
||||
inherit (pkgs) capstone;
|
||||
};
|
||||
capstone_4 = callPackage ../development/python-modules/capstone/4.nix {
|
||||
inherit (pkgs) capstone_4;
|
||||
};
|
||||
|
||||
captcha = callPackage ../development/python-modules/captcha { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user