capstone_4: init at 4.0.2
This commit is contained in:
parent
08304db444
commit
b861ecbcd5
|
@ -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;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, capstone_4
|
||||
, stdenv
|
||||
, setuptools
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
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 ];
|
||||
};
|
||||
}
|
|
@ -4616,6 +4616,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 { };
|
||||
|
||||
|
|
|
@ -1837,6 +1837,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