2016-10-08 08:44:25 +02:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam }:
|
2014-10-29 20:15:39 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (stdenv.lib) getVersion versionAtLeast;
|
|
|
|
|
|
|
|
pname = "gg";
|
2015-10-12 07:54:37 +02:00
|
|
|
version = "0.9.1";
|
2014-10-29 20:15:39 +01:00
|
|
|
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";
|
2015-10-12 07:54:37 +02:00
|
|
|
sha256 = "0czj41sr8jsivl3z8wyblf9k971j3kx2wc3s0c1nhzcc8allg9i2";
|
2014-10-29 20:15:39 +01:00
|
|
|
};
|
|
|
|
|
2016-10-08 08:44:25 +02:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild opam ];
|
2014-10-29 20:15:39 +01:00
|
|
|
|
|
|
|
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}";
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-10-29 20:15:39 +01:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.jirkamarsik ];
|
|
|
|
};
|
|
|
|
}
|