mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 17:14:00 +00:00
grap: fix build
This commit is contained in:
parent
c42f79303e
commit
017ff7e496
@ -8,26 +8,33 @@
|
||||
swig,
|
||||
bison,
|
||||
cmake,
|
||||
python3,
|
||||
python3Packages,
|
||||
makeShellWrapper,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "grap";
|
||||
version = "1.3.1";
|
||||
pyproject = false;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "QuoSecGmbH";
|
||||
repo = "grap";
|
||||
rev = "v${version}";
|
||||
sha256 = "1fkdi7adfffxg1k4h6r9i69i3wi93s44c1j4cvr69blxsfh0mcnc";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-zLIKoNOdrmTyZkQGRogeKfIRk4kpG0hmeN0519SJbbo=";
|
||||
};
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
setuptools
|
||||
capstone
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
bison
|
||||
cmake
|
||||
flex
|
||||
python3
|
||||
swig
|
||||
makeShellWrapper
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@ -38,16 +45,29 @@ stdenv.mkDerivation rec {
|
||||
strictDeps = true;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DPYTHON_SITE_DIR=$out/${python3.sitePackages}"
|
||||
"-DPYTHON_SITE_DIR=${placeholder "out"}/${python3Packages.python.sitePackages}"
|
||||
"../src"
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/tools/grap-match/CMakeLists.txt --replace "/usr/local/bin" "$out/bin"
|
||||
substituteInPlace src/tools/grap/CMakeLists.txt --replace "/usr/local/bin" "$out/bin"
|
||||
substituteInPlace src/tools/grap-match/CMakeLists.txt --replace-fail "/usr/local/bin" "$out/bin"
|
||||
|
||||
substituteInPlace src/tools/grap/CMakeLists.txt --replace-fail "/usr/local/bin" "$out/bin"
|
||||
|
||||
substituteInPlace src/bindings/python/CMakeLists.txt --replace-fail "distutils" "setuptools._distutils"
|
||||
|
||||
substituteInPlace src/tools/setup.py --replace-fail "distutils.core" "setuptools"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
postInstall = ''
|
||||
cd $out/${python3Packages.python.sitePackages}
|
||||
mv pygrap.so _pygrap.so
|
||||
substituteInPlace pygrap.py \
|
||||
--replace-fail "import imp" "import importlib" \
|
||||
--replace-fail "imp." "importlib."
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Define and match graph patterns within binaries";
|
||||
longDescription = ''
|
||||
grap takes patterns and binary files, uses a Casptone-based disassembler to obtain the control flow graphs from the binaries, then matches the patterns against them.
|
||||
@ -55,8 +75,9 @@ stdenv.mkDerivation rec {
|
||||
Patterns are user-defined graphs with instruction conditions ("opcode is xor and arg1 is eax") and repetition conditions (3 identical instructions, basic blocks...).
|
||||
'';
|
||||
homepage = "https://github.com/QuoSecGmbH/grap/";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.s1341 ];
|
||||
platforms = platforms.linux;
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ s1341 ];
|
||||
platforms = lib.platforms.linux;
|
||||
mainProgram = "grap";
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user