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