Skip to content

Commit

Permalink
grap: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Bot-wxt1221 committed Oct 22, 2024
1 parent a69c616 commit b316f8d
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions pkgs/by-name/gr/grap/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
python3,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "grap";
version = "1.3.1";

src = fetchFromGitHub {
owner = "QuoSecGmbH";
repo = "grap";
rev = "v${version}";
sha256 = "1fkdi7adfffxg1k4h6r9i69i3wi93s44c1j4cvr69blxsfh0mcnc";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-zLIKoNOdrmTyZkQGRogeKfIRk4kpG0hmeN0519SJbbo=";
};

nativeBuildInputs = [
bison
cmake
flex
python3
(python3.withPackages (ps: with ps; [ setuptools ]))
swig
];

Expand All @@ -43,20 +43,26 @@ stdenv.mkDerivation rec {
];

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; {
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.
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 = "";
};
}
})

0 comments on commit b316f8d

Please sign in to comment.