2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline }:
|
2014-10-29 19:15:39 +00:00
|
|
|
|
|
|
|
let
|
2021-01-11 12:49:15 +00:00
|
|
|
inherit (lib) getVersion versionAtLeast;
|
2014-10-29 19:15:39 +00:00
|
|
|
|
|
|
|
pname = "gg";
|
2015-10-12 05:54:37 +00:00
|
|
|
version = "0.9.1";
|
2019-04-22 08:14:28 +00:00
|
|
|
webpage = "https://erratique.ch/software/${pname}";
|
2014-10-29 19:15:39 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
assert versionAtLeast (getVersion ocaml) "4.01.0";
|
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
stdenv.mkDerivation {
|
2014-10-29 19:15:39 +00:00
|
|
|
|
|
|
|
name = "ocaml-${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${webpage}/releases/${pname}-${version}.tbz";
|
2015-10-12 05:54:37 +00:00
|
|
|
sha256 = "0czj41sr8jsivl3z8wyblf9k971j3kx2wc3s0c1nhzcc8allg9i2";
|
2014-10-29 19:15:39 +00:00
|
|
|
};
|
|
|
|
|
2018-05-28 05:50:12 +00:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild opaline ];
|
2014-10-29 19:15:39 +00:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
|
|
|
|
|
2018-05-28 05:50:12 +00:00
|
|
|
installPhase = "opaline -libdir $OCAMLFIND_DESTDIR";
|
2014-10-29 19:15:39 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-10-29 19:15:39 +00:00
|
|
|
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.
|
|
|
|
'';
|
2019-09-08 23:38:31 +00:00
|
|
|
homepage = webpage;
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-10-29 19:15:39 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.jirkamarsik ];
|
|
|
|
};
|
|
|
|
}
|