1{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, glib, hexdump, scowl }:
2
3stdenv.mkDerivation rec {
4 pname = "halfempty";
5 version = "0.40";
6
7 src = fetchFromGitHub {
8 owner = "googleprojectzero";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-YGq6fneAMo2jCpLPrjzRJ0eeOsStKaK5L+lwQfqcfpY=";
12 };
13
14 nativeBuildInputs = [ pkg-config hexdump ];
15 buildInputs = [ glib ];
16
17 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
18
19 enableParallelBuilding = true;
20
21 patches = [
22 (fetchpatch {
23 name = "fix-bash-specific-syntax.patch";
24 url = "https://github.com/googleprojectzero/halfempty/commit/ad15964d0fcaba12e5aca65c8935ebe3f37d7ea3.patch";
25 sha256 = "sha256:0hgdci0wwi5wyw8i57w0545cxjmsmswm1y6g4vhykap0y40zizav";
26 })
27 ];
28
29 postPatch = ''
30 substituteInPlace test/Makefile \
31 --replace '/usr/share/dict/words' '${scowl}/share/dict/words.txt'
32 '';
33
34 installPhase = ''
35 install -vDt $out/bin halfempty
36 '';
37
38 doCheck = true;
39 checkTarget = "test";
40
41 meta = {
42 description = "Fast, parallel test case minimization tool";
43 homepage = "https://github.com/googleprojectzero/halfempty/";
44 maintainers = with lib.maintainers; [ fpletz ];
45 license = with lib.licenses; [ asl20 ];
46 platforms = lib.platforms.unix;
47 };
48}