From 3d90f961b4eb37076c3b112816760fd0134ae8be Mon Sep 17 00:00:00 2001 From: Martin Bravenboer Date: Wed, 9 Jun 2004 14:23:05 +0000 Subject: [PATCH] Added Happy parser generator and HaRP: Haskell Regular Patterns svn path=/nixpkgs/trunk/; revision=1043 --- pkgs/development/compilers/harp/builder.sh | 18 ++++++++++++++++++ pkgs/development/compilers/harp/default.nix | 11 +++++++++++ .../tools/parsing/happy/default.nix | 10 ++++++++++ pkgs/system/all-packages-generic.nix | 8 ++++++++ 4 files changed, 47 insertions(+) create mode 100644 pkgs/development/compilers/harp/builder.sh create mode 100644 pkgs/development/compilers/harp/default.nix create mode 100644 pkgs/development/tools/parsing/happy/default.nix diff --git a/pkgs/development/compilers/harp/builder.sh b/pkgs/development/compilers/harp/builder.sh new file mode 100644 index 000000000000..9180d143c6a0 --- /dev/null +++ b/pkgs/development/compilers/harp/builder.sh @@ -0,0 +1,18 @@ +. $stdenv/setup + +unzip $src + +happy Language/Haskell/Harp/Parser.ly +ghc --make TrHarp.hs -o trharp + + +mkdir $out +mkdir $out/bin +cp trharp $out/bin/ + +ghc -c Language/Haskell/Harp/Match.hs + +mkdir -p $out/hslibs/Language/Haskell/Harp/ +cp Language/Haskell/Harp/Match.hs $out/hslibs/Language/Haskell/Harp/ +cp Language/Haskell/Harp/Match.hi $out/hslibs/Language/Haskell/Harp/ +cp Language/Haskell/Harp/Match.o $out/hslibs/Language/Haskell/Harp/ diff --git a/pkgs/development/compilers/harp/default.nix b/pkgs/development/compilers/harp/default.nix new file mode 100644 index 000000000000..674fcda1ba86 --- /dev/null +++ b/pkgs/development/compilers/harp/default.nix @@ -0,0 +1,11 @@ +{stdenv, fetchurl, unzip, ghc, happy}: + +stdenv.mkDerivation { + name = "harp-0.1"; + builder = ./builder.sh; + src = fetchurl { + url = http://www.dtek.chalmers.se/~d00nibro/harp/harp-0.1-src.zip; + md5 = "8fc8552b7c05b5828b2e1b07f8c1f063"; + }; + buildInputs = [unzip ghc happy]; +} diff --git a/pkgs/development/tools/parsing/happy/default.nix b/pkgs/development/tools/parsing/happy/default.nix new file mode 100644 index 000000000000..ac3fb088bbab --- /dev/null +++ b/pkgs/development/tools/parsing/happy/default.nix @@ -0,0 +1,10 @@ +{stdenv, fetchurl, perl, ghc}: + +stdenv.mkDerivation { + name = "happy-1.14"; + src = fetchurl { + url = http://www.haskell.org/happy/dist/1.14/happy-1.14-src.tar.gz; + md5 = "501b5b63533b2e2838de18085e8c4492"; + }; + buildInputs = [ghc perl]; +} diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix index af650798ef12..eed2d876ae8e 100644 --- a/pkgs/system/all-packages-generic.nix +++ b/pkgs/system/all-packages-generic.nix @@ -261,6 +261,14 @@ rec { inherit fetchurl stdenv ghc; }; + happy = (import ../development/tools/parsing/happy) { + inherit fetchurl stdenv perl ghc; + }; + + harp = (import ../development/compilers/harp) { + inherit fetchurl stdenv unzip ghc happy; + }; + perl = (import ../development/interpreters/perl) { inherit fetchurl stdenv; patch = gnupatch;