capstone: enable for darwin, enable tests & fix pkg-config output
turns out capstone.pc is generated during the buildPhase, so needs PREFIX set here too for it to be correct
This commit is contained in:
parent
ba30ee3389
commit
a8c0c21f78
@ -9,9 +9,23 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "1isxw2qwy1fi3m3w7igsr5klzczxc5cxndz0a78dfss6ps6ymfvr";
|
sha256 = "1isxw2qwy1fi3m3w7igsr5klzczxc5cxndz0a78dfss6ps6ymfvr";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# replace faulty macos detection
|
||||||
|
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||||
|
sed -i 's/^IS_APPLE := .*$/IS_APPLE := 1/' Makefile
|
||||||
|
'';
|
||||||
|
|
||||||
configurePhase = '' patchShebangs make.sh '';
|
configurePhase = '' patchShebangs make.sh '';
|
||||||
buildPhase = '' ./make.sh '';
|
buildPhase = "PREFIX=$out ./make.sh";
|
||||||
installPhase = '' env PREFIX=$out ./make.sh install '';
|
|
||||||
|
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";
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkgconfig
|
pkgconfig
|
||||||
@ -23,7 +37,7 @@ stdenv.mkDerivation rec {
|
|||||||
description = "Advanced disassembly library";
|
description = "Advanced disassembly library";
|
||||||
homepage = "http://www.capstone-engine.org";
|
homepage = "http://www.capstone-engine.org";
|
||||||
license = stdenv.lib.licenses.bsd3;
|
license = stdenv.lib.licenses.bsd3;
|
||||||
platforms = stdenv.lib.platforms.linux;
|
platforms = stdenv.lib.platforms.unix;
|
||||||
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
maintainers = with stdenv.lib.maintainers; [ thoughtpolice ris ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user