10 stdenv.mkDerivation rec {
14 src = fetchFromGitHub {
18 hash = "sha256-T7PWM5IGly6jpGt04dh5meQjrZPUTs8VEFTQEPO5RSw=";
24 cd build/${if stdenv.cc.isGNU then "gcc"
25 else if stdenv.cc.isClang then "clang"
26 else throw "Unsupported C compiler"}
31 nativeCheckInputs = [ bats uncrustify ];
34 patchShebangs ../../tests
36 # Disable a failing test.
37 rm -rf ../../tests/style.d
38 '' + lib.optionalString stdenv.cc.isClang ''
39 export NIX_CFLAGS_COMPILE+=' -Wno-error=strict-prototypes -Wno-error=int-conversion'
45 install -Dm755 release/bin/packcc $out/bin/packcc
50 passthru.tests.version = testers.testVersion {
55 description = "A parser generator for C";
57 PackCC is a parser generator for C. Its main features are as follows:
58 - Generates your parser in C from a grammar described in a PEG,
59 - Gives your parser great efficiency by packrat parsing,
60 - Supports direct and indirect left-recursive grammar rules.
62 homepage = "https://github.com/arithy/packcc";
63 changelog = "https://github.com/arithy/packcc/releases/tag/${src.rev}";
64 license = licenses.mit;
65 maintainers = with maintainers; [ azahi ];
66 platforms = platforms.unix;