2018-07-21 03:44:44 +03:00
|
|
|
{ stdenv, fetchurl, pkgconfig }:
|
2014-04-08 16:04:11 +04:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "capstone";
|
2019-01-18 04:48:07 +03:00
|
|
|
version = "4.0.1";
|
2014-04-08 16:04:11 +04:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-07-22 10:56:46 +03:00
|
|
|
url = "https://github.com/aquynh/capstone/archive/${version}.tar.gz";
|
2019-01-18 04:48:07 +03:00
|
|
|
sha256 = "1isxw2qwy1fi3m3w7igsr5klzczxc5cxndz0a78dfss6ps6ymfvr";
|
2014-04-08 16:04:11 +04:00
|
|
|
};
|
|
|
|
|
2020-01-04 02:31:31 +03:00
|
|
|
# replace faulty macos detection
|
|
|
|
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
sed -i 's/^IS_APPLE := .*$/IS_APPLE := 1/' Makefile
|
|
|
|
'';
|
|
|
|
|
2016-10-03 13:51:16 +03:00
|
|
|
configurePhase = '' patchShebangs make.sh '';
|
2020-01-04 02:31:31 +03:00
|
|
|
buildPhase = "PREFIX=$out ./make.sh";
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
# first remove fuzzing steps from check target
|
|
|
|
substituteInPlace Makefile --replace "fuzztest fuzzallcorp" ""
|
|
|
|
make check
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = (stdenv.lib.optionalString stdenv.isDarwin "HOMEBREW_CAPSTONE=1 ")
|
|
|
|
+ "PREFIX=$out ./make.sh install";
|
2017-01-15 02:45:52 +03:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig
|
|
|
|
];
|
2016-10-03 13:51:16 +03:00
|
|
|
|
2016-09-01 11:46:11 +03:00
|
|
|
enableParallelBuilding = true;
|
2014-04-08 16:04:11 +04:00
|
|
|
|
|
|
|
meta = {
|
2016-06-20 13:53:46 +03:00
|
|
|
description = "Advanced disassembly library";
|
2014-04-08 16:04:11 +04:00
|
|
|
homepage = "http://www.capstone-engine.org";
|
|
|
|
license = stdenv.lib.licenses.bsd3;
|
2020-01-04 02:31:31 +03:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ thoughtpolice ris ];
|
2014-04-08 16:04:11 +04:00
|
|
|
};
|
|
|
|
}
|