3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/capstone/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.1 KiB
Nix
Raw Normal View History

2021-12-27 00:04:38 +00:00
{ lib, stdenv, fetchFromGitHub, pkg-config }:
stdenv.mkDerivation rec {
pname = "capstone";
2020-05-17 00:19:57 +01:00
version = "4.0.2";
2021-12-27 00:04:38 +00:00
src = fetchFromGitHub {
owner = "aquynh";
repo = "capstone";
rev = version;
sha256 = "sha256-XMwQ7UaPC8YYu4yxsE4bbR3leYPfBHu5iixSLz05r3g=";
};
# replace faulty macos detection
postPatch = lib.optionalString stdenv.isDarwin ''
sed -i 's/^IS_APPLE := .*$/IS_APPLE := 1/' Makefile
'';
configurePhase = "patchShebangs make.sh ";
buildPhase = "PREFIX=$out ./make.sh";
doCheck = true;
checkPhase = ''
# first remove fuzzing steps from check target
substituteInPlace Makefile --replace "fuzztest fuzzallcorp" ""
make check
'';
installPhase = (lib.optionalString stdenv.isDarwin "HOMEBREW_CAPSTONE=1 ")
+ "PREFIX=$out ./make.sh install";
nativeBuildInputs = [
pkg-config
];
enableParallelBuilding = 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;
};
}