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 checkInputs = [ bats uncrustify ];
34 patchShebangs ../../tests
36 # Disable a failing test.
37 rm -rf ../../tests/style.d
43 install -Dm755 release/bin/packcc $out/bin/packcc
48 passthru.tests.version = testers.testVersion {
53 description = "A parser generator for C";
55 PackCC is a parser generator for C. Its main features are as follows:
56 - Generates your parser in C from a grammar described in a PEG,
57 - Gives your parser great efficiency by packrat parsing,
58 - Supports direct and indirect left-recursive grammar rules.
60 homepage = "https://github.com/arithy/packcc";
61 changelog = "https://github.com/arithy/packcc/releases/tag/${src.rev}";
62 license = licenses.mit;
63 maintainers = with maintainers; [ azahi ];
64 platforms = platforms.unix;