Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / tools / halfempty / default.nix
blob113647da9ff88583712c6615ba84aa58f9f2792b
1 { lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, glib, hexdump, scowl }:
3 stdenv.mkDerivation rec {
4   pname = "halfempty";
5   version = "0.40";
7   src = fetchFromGitHub {
8     owner = "googleprojectzero";
9     repo = pname;
10     rev = "v${version}";
11     sha256 = "sha256-YGq6fneAMo2jCpLPrjzRJ0eeOsStKaK5L+lwQfqcfpY=";
12   };
14   nativeBuildInputs = [ pkg-config hexdump ];
15   buildInputs = [ glib ];
17   makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
19   enableParallelBuilding = true;
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   ];
29   postPatch = ''
30     substituteInPlace test/Makefile \
31       --replace '/usr/share/dict/words' '${scowl}/share/dict/words.txt'
32   '';
34   installPhase = ''
35     install -vDt $out/bin halfempty
36   '';
38   doCheck = true;
39   checkTarget = "test";
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   };