nixpkgs/pkgs/by-name/le/lemon/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
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.
2024-11-09 20:04:51 +08:00

47 lines
1.3 KiB
Nix

{ lib, stdenv, fetchurl }:
let
srcs = {
lemon = fetchurl {
sha256 = "1c5pk2hz7j9hix5mpc38rwnm8dnlr2jqswf4lan6v78ccbyqzkjx";
url = "http://www.sqlite.org/src/raw/tool/lemon.c?name=680980c7935bfa1edec20c804c9e5ba4b1dd96f5";
name = "lemon.c";
};
lempar = fetchurl {
sha256 = "1ba13a6yh9j2cs1aw2fh4dxqvgf399gxq1gpp4sh8q0f2w6qiw3i";
url = "http://www.sqlite.org/src/raw/tool/lempar.c?name=01ca97f87610d1dac6d8cd96ab109ab1130e76dc";
name = "lempar.c";
};
};
in stdenv.mkDerivation {
pname = "lemon";
version = "1.69";
dontUnpack = true;
buildPhase = ''
sh -xc "$CC ${srcs.lemon} -o lemon"
'';
installPhase = ''
install -Dvm755 lemon $out/bin/lemon
install -Dvm644 ${srcs.lempar} $out/bin/lempar.c
'';
meta = with lib; {
description = "LALR(1) parser generator";
mainProgram = "lemon";
longDescription = ''
The Lemon program is an LALR(1) parser generator that takes a
context-free grammar and converts it into a subroutine that will parse a
file using that grammar. Lemon is similar to the much more famous
programs "yacc" and "bison", but is not compatible with either.
'';
homepage = "http://www.hwaci.com/sw/lemon/";
license = licenses.publicDomain;
platforms = platforms.unix;
};
}