Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "pe-parse";
10 version = "2.1.1";
11
12 src = fetchFromGitHub {
13 owner = "trailofbits";
14 repo = "pe-parse";
15 rev = "v${version}";
16 hash = "sha256-XegSZWRoQg6NEWuTSFI1RMvN3GbpLDrZrloPU2XdK2M=";
17 };
18
19 nativeBuildInputs = [ cmake ];
20
21 env.NIX_CFLAGS_COMPILE = toString (
22 lib.optionals stdenv.cc.isClang [
23 "-Wno-error=deprecated-declarations"
24 ]
25 );
26
27 doInstallCheck = true;
28 installCheckPhase = ''
29 $out/bin/dump-pe ../tests/assets/example.exe
30 '';
31
32 meta = {
33 description = "Principled, lightweight parser for Windows portable executable files";
34 homepage = "https://github.com/trailofbits/pe-parse";
35 changelog = "https://github.com/trailofbits/pe-parse/releases/tag/v${version}";
36 license = lib.licenses.mit;
37 maintainers = with lib.maintainers; [ arturcygan ];
38 mainProgram = "dump-pe";
39 platforms = lib.platforms.unix;
40 };
41}