summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
authorcillianderoiste <cillian.deroiste@gmail.com>2014-11-03 13:59:26 +0100
committercillianderoiste <cillian.deroiste@gmail.com>2014-11-03 13:59:26 +0100
commit926cffa40001cb78498266f74547aab005aea462 (patch)
treec472009bf270f63501e05519d27b525d0f228cd5 /pkgs/development/ocaml-modules
parent950780a24f6102072e000ee863f931cfd0944432 (diff)
parentd9f0e1688301910d333528b84d46a6adae2f05a6 (diff)
downloadnixpkgs-926cffa40001cb78498266f74547aab005aea462.tar
nixpkgs-926cffa40001cb78498266f74547aab005aea462.tar.gz
nixpkgs-926cffa40001cb78498266f74547aab005aea462.tar.bz2
nixpkgs-926cffa40001cb78498266f74547aab005aea462.tar.lz
nixpkgs-926cffa40001cb78498266f74547aab005aea462.tar.xz
nixpkgs-926cffa40001cb78498266f74547aab005aea462.tar.zst
nixpkgs-926cffa40001cb78498266f74547aab005aea462.zip
Merge pull request #4731 from jirkamarsik/vg
Added ocaml-vg-0.8.1 and deps ocaml-otfm-0.2.0 and ocaml-gg-0.9.0
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/gg/default.nix48
-rw-r--r--pkgs/development/ocaml-modules/otfm/default.nix49
-rw-r--r--pkgs/development/ocaml-modules/vg/default.nix62
3 files changed, 159 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/gg/default.nix b/pkgs/development/ocaml-modules/gg/default.nix
new file mode 100644
index 00000000000..a40d4ae7978
--- /dev/null
+++ b/pkgs/development/ocaml-modules/gg/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, ocaml, findlib, opam }:
+
+let
+  inherit (stdenv.lib) getVersion versionAtLeast;
+
+  pname = "gg";
+  version = "0.9.0";
+  webpage = "http://erratique.ch/software/${pname}";
+in
+
+assert versionAtLeast (getVersion ocaml) "4.01.0";
+
+stdenv.mkDerivation rec {
+
+  name = "ocaml-${pname}-${version}";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "055pza6jbjjj7wgzf7pbn0ccxw76i8w5b2bcnaz8b9m4x6jaa6gh";
+  };
+
+  buildInputs = [ ocaml findlib opam ];
+
+  createFindlibDestdir = true;
+
+  unpackCmd = "tar xjf $src";
+
+  buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
+
+  installPhase = ''
+    opam-installer --script --prefix=$out ${pname}.install | sh
+    ln -s $out/lib/${pname} $out/lib/ocaml/${getVersion ocaml}/site-lib/${pname}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Basic types for computer graphics in OCaml";
+    longDescription = ''
+      Gg is an OCaml module providing basic types for computer graphics. It
+      defines types and functions for floats, vectors, points, sizes,
+      matrices, quaternions, axis aligned boxes, colors, color spaces, and
+      raster data.
+    '';
+    homepage = "${webpage}";
+    platforms = ocaml.meta.platforms;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/otfm/default.nix b/pkgs/development/ocaml-modules/otfm/default.nix
new file mode 100644
index 00000000000..5a118c0bcd8
--- /dev/null
+++ b/pkgs/development/ocaml-modules/otfm/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, ocaml, findlib, opam, uutf }:
+
+let
+  inherit (stdenv.lib) getVersion versionAtLeast;
+
+  pname = "otfm";
+  version = "0.2.0";
+  webpage = "http://erratique.ch/software/${pname}";
+in
+
+assert versionAtLeast (getVersion ocaml) "4.01.0";
+
+stdenv.mkDerivation rec {
+
+  name = "ocaml-${pname}-${version}";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "1wgi9plf98gd7x3b7fzjxds089sivsap97bl1bw2lj73nxwnyb9c";
+  };
+
+  buildInputs = [ ocaml findlib opam ];
+
+  propagatedBuildInputs = [ uutf ];
+
+  createFindlibDestdir = true;
+
+  unpackCmd = "tar xjf $src";
+
+  buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
+
+  installPhase = ''
+    opam-installer --script --prefix=$out ${pname}.install | sh
+    ln -s $out/lib/${pname} $out/lib/ocaml/${getVersion ocaml}/site-lib/${pname}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "OpenType font decoder for OCaml";
+    longDescription = ''
+      Otfm is an in-memory decoder for the OpenType font data format. It
+      provides low-level access to font tables and functions to decode some
+      of them.
+    '';
+    homepage = "${webpage}";
+    platforms = ocaml.meta.platforms;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/vg/default.nix b/pkgs/development/ocaml-modules/vg/default.nix
new file mode 100644
index 00000000000..bfff4c68cef
--- /dev/null
+++ b/pkgs/development/ocaml-modules/vg/default.nix
@@ -0,0 +1,62 @@
+{ stdenv, fetchurl, ocaml, findlib, opam, gg, uutf, otfm, js_of_ocaml,
+  pdfBackend ? true, # depends on uutf and otfm
+  htmlcBackend ? true # depends on js_of_ocaml
+}:
+
+let
+  inherit (stdenv.lib) getVersion optionals versionAtLeast;
+
+  pname = "vg";
+  version = "0.8.1";
+  webpage = "http://erratique.ch/software/${pname}";
+in
+
+assert versionAtLeast (getVersion ocaml) "4.01.0";
+
+stdenv.mkDerivation rec {
+
+  name = "ocaml-${pname}-${version}";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "1cdcvsr5z8845ndilnrz7p4n6yn4gv2p91z2mgi4vrailcmn5vzd";
+  };
+
+  buildInputs = [ ocaml findlib opam ];
+
+  propagatedBuildInputs = [ gg ]
+                          ++ optionals pdfBackend [ uutf otfm ]
+                          ++ optionals htmlcBackend [ js_of_ocaml ];
+
+  createFindlibDestdir = true;
+
+  unpackCmd = "tar xjf $src";
+
+  buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true"
+               + (if pdfBackend then " uutf=true otfm=true"
+                                else " uutf=false otfm=false")
+               + (if htmlcBackend then " jsoo=true"
+                                  else " jsoo=false");
+
+  installPhase = ''
+    opam-installer --script --prefix=$out ${pname}.install | sh
+    ln -s $out/lib/${pname} $out/lib/ocaml/${getVersion ocaml}/site-lib/${pname}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Declarative 2D vector graphics for OCaml";
+    longDescription = ''
+    Vg is an OCaml module for declarative 2D vector graphics. In Vg, images
+    are values that denote functions mapping points of the cartesian plane
+    to colors. The module provides combinators to define and compose these
+    values.
+
+    Renderers for PDF, SVG and the HTML canvas are distributed with the
+    module. An API allows to implement new renderers.
+    '';
+    homepage = "${webpage}";
+    platforms = ocaml.meta.platforms;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}