1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-23 07:26:54 +00:00
nixpkgs/pkgs/development/tools/parsing/lemon/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

46 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";
phases = [ "buildPhase" "installPhase" ];
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 = "An LALR(1) parser generator";
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;
};
}