1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-22 14:47:06 +00:00
nixpkgs/pkgs/development/libraries/capstone/default.nix

44 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, pkg-config }:
stdenv.mkDerivation rec {
pname = "capstone";
2020-05-17 00:19:57 +01:00
version = "4.0.2";
src = fetchurl {
2015-07-22 08:56:46 +01:00
url = "https://github.com/aquynh/capstone/archive/${version}.tar.gz";
2020-05-17 00:19:57 +01:00
sha256 = "0sjjbqps48az4map0kmai7j7dak3gy0xcq0sgx8fg09g0acdg0bw";
};
# 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;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ thoughtpolice ris ];
};
}