diff options
author | Marc Weber <marco-oweber@gmx.de> | 2013-06-17 12:33:25 +0200 |
---|---|---|
committer | Evgeny Egorochkin <phreedom@yandex.ru> | 2013-06-19 03:07:27 +0300 |
commit | d25d1e4d24468f4ffd286675505db35d57052d1b (patch) | |
tree | 5d6b99034085d612e977879ae2707a1ae88e1d8d /pkgs/development/tools/ocaml | |
parent | ccb2e9a8328097283cfb0c9866c34c3abb7813dd (diff) | |
download | nixpkgs-d25d1e4d24468f4ffd286675505db35d57052d1b.tar nixpkgs-d25d1e4d24468f4ffd286675505db35d57052d1b.tar.gz nixpkgs-d25d1e4d24468f4ffd286675505db35d57052d1b.tar.bz2 nixpkgs-d25d1e4d24468f4ffd286675505db35d57052d1b.tar.lz nixpkgs-d25d1e4d24468f4ffd286675505db35d57052d1b.tar.xz nixpkgs-d25d1e4d24468f4ffd286675505db35d57052d1b.tar.zst nixpkgs-d25d1e4d24468f4ffd286675505db35d57052d1b.zip |
ocaml adding deriving
Diffstat (limited to 'pkgs/development/tools/ocaml')
-rw-r--r-- | pkgs/development/tools/ocaml/deriving/default.nix | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/pkgs/development/tools/ocaml/deriving/default.nix b/pkgs/development/tools/ocaml/deriving/default.nix new file mode 100644 index 00000000000..baa6bce4d43 --- /dev/null +++ b/pkgs/development/tools/ocaml/deriving/default.nix @@ -0,0 +1,72 @@ +{stdenv, fetchurl, zlib, ocaml, findlib, ncurses +, versionedDerivation, unzip +, version ? + let match = { + "ocaml-3.10.0" = "for-3.10.0"; + "ocaml-3.12.1" = "for-3.12.1"; + }; in stdenv.lib.maybeAttr ocaml.name (throw "no matching source of ocaml-deriving for ocaml version: ${ocaml.name}") match +}: + +/* +Usage example: + +== main.ml == +type t = | A | B + deriving (Show) + +print_string (Show.show<t> (A));; +== + +ocamlopt -pp $out/bin/deriving -I $d/lib -I $d/syntax nums.cmxa show.cmx main.ml +*/ + +versionedDerivation "ocaml-deriving" version { + + "for-3.10.0" = { + name = "deriving-0.1.1a"; + # ocaml: 3.10.0 + src = fetchurl { + url = https://deriving.googlecode.com/files/deriving-0.1.1a.tar.gz; + sha256 = "0ppmqhc23kccfjn3cnd9n205ky627ni8f5djf8sppmc3lc1m97mb"; + }; + }; + + "for-3.12.1" = { + name = "deriving-more-recent"; + + # https://github.com/jaked/deriving + src = fetchurl { + name = "for-3.12.0.zip"; + url = https://codeload.github.com/jaked/deriving/zip/c7b9cea3eb4bbfb9e09673faf725f70247c9df78; + sha256 = "1zrmpqb5lsjmizqs68czmfpsbz9hz30pf97w11kkby175hhj84gi"; + }; + + buildInputs = [ unzip ]; + }; + +} +{ + buildInputs = [ocaml findlib]; + + installPhase = '' + # not all tests compile !? + # (cd tests; make) + + ensureDir $out/bin + cp -a lib $out/ + cp -a syntax $out + + # this allows -pp deriving + ln -s $out/syntax/deriving $out/bin/deriving + ''; + + meta = { + homepage = "https://code.google.com/p/deriving/source/checkout"; + description = "A library of cryptographic primitives for OCaml"; + license = stdenv.lib.licenses.mit; + platforms = ocaml.meta.platforms; + maintainers = [ + stdenv.lib.maintainers.z77z + ]; + }; +} |