mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-08 14:03:29 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
81 lines
1.8 KiB
Nix
81 lines
1.8 KiB
Nix
{
|
|
bats,
|
|
fetchFromGitHub,
|
|
lib,
|
|
python3,
|
|
stdenv,
|
|
testers,
|
|
uncrustify,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "packcc";
|
|
version = "2.0.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "arithy";
|
|
repo = "packcc";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-k1C/thvr/5fYrgu/j8YN3kwXp4k26sC9AhYhYAKQuX0=";
|
|
};
|
|
|
|
postPatch = ''
|
|
patchShebangs tests
|
|
'';
|
|
|
|
dontConfigure = true;
|
|
|
|
preBuild = ''
|
|
cd build/${
|
|
if stdenv.cc.isGNU then
|
|
"gcc"
|
|
else if stdenv.cc.isClang then
|
|
"clang"
|
|
else
|
|
throw "Unsupported C compiler"
|
|
}
|
|
'';
|
|
|
|
doCheck = true;
|
|
|
|
nativeCheckInputs = [
|
|
bats
|
|
uncrustify
|
|
python3
|
|
];
|
|
|
|
preCheck =
|
|
''
|
|
# Style tests will always fail because upstream uses an older version of
|
|
# uncrustify.
|
|
rm -rf ../../tests/style.d
|
|
''
|
|
+ lib.optionalString stdenv.cc.isClang ''
|
|
export NIX_CFLAGS_COMPILE+=' -Wno-error=strict-prototypes -Wno-error=int-conversion'
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
install -Dm755 release/bin/packcc $out/bin/packcc
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
|
|
|
|
meta = with lib; {
|
|
description = "Parser generator for C";
|
|
longDescription = ''
|
|
PackCC is a parser generator for C. Its main features are as follows:
|
|
- Generates your parser in C from a grammar described in a PEG,
|
|
- Gives your parser great efficiency by packrat parsing,
|
|
- Supports direct and indirect left-recursive grammar rules.
|
|
'';
|
|
homepage = "https://github.com/arithy/packcc";
|
|
changelog = "https://github.com/arithy/packcc/releases/tag/${finalAttrs.src.rev}";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ azahi ];
|
|
platforms = platforms.unix;
|
|
mainProgram = "packcc";
|
|
};
|
|
})
|