From 7cfa918aac7446e0840c38141b1ed104881d2df0 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Fri, 18 Sep 2015 03:46:06 +0200 Subject: [PATCH] lemon: init at 1.0 --- .../tools/parsing/lemon/default.nix | 48 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/tools/parsing/lemon/default.nix diff --git a/pkgs/development/tools/parsing/lemon/default.nix b/pkgs/development/tools/parsing/lemon/default.nix new file mode 100644 index 000000000000..23d4ea911dbe --- /dev/null +++ b/pkgs/development/tools/parsing/lemon/default.nix @@ -0,0 +1,48 @@ +{ stdenv, fetchurl }: + +let + + version = "1.0"; + + srcs = { + lemon = fetchurl { + sha256 = "1grm95m2cnc61zim332g7z8nchmcy91ljf50k13lm421v0ygyyv6"; + url = "http://www.sqlite.org/src/raw/tool/lemon.c?name=039f813b520b9395740c52f9cbf36c90b5d8df03"; + name = "lemon.c"; + }; + lempar = fetchurl { + sha256 = "09nki0cwc5zrm365g6plhjxz3byhl9w117ab3yvrpds43ks1j85z"; + url = "http://www.sqlite.org/src/raw/tool/lempar.c?name=3617143ddb9b176c3605defe6a9c798793280120"; + name = "lempar.c"; + }; + }; + +in stdenv.mkDerivation { + name = "lemon-${version}"; + + 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 stdenv.lib; { + inherit version; + 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; + maintainers = with maintainers; [ nckx ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d35555e19953..0c7c42f0ec06 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5565,6 +5565,8 @@ let leiningen = callPackage ../development/tools/build-managers/leiningen { }; + lemon = callPackage ../development/tools/parsing/lemon { }; + libtool = libtool_2; libtool_1_5 = callPackage ../development/tools/misc/libtool { };