summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2016-12-04 10:20:46 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-01-13 06:38:09 +0000
commit5dc59fbf383956d60eeae8a101f23984f6fa825c (patch)
tree16b36f01afbb368ed281805df8f9133f7488c977 /pkgs/development/ocaml-modules
parent110a0fb028438120447e1b1e6f359ca4ee9b398c (diff)
downloadnixlib-5dc59fbf383956d60eeae8a101f23984f6fa825c.tar
nixlib-5dc59fbf383956d60eeae8a101f23984f6fa825c.tar.gz
nixlib-5dc59fbf383956d60eeae8a101f23984f6fa825c.tar.bz2
nixlib-5dc59fbf383956d60eeae8a101f23984f6fa825c.tar.lz
nixlib-5dc59fbf383956d60eeae8a101f23984f6fa825c.tar.xz
nixlib-5dc59fbf383956d60eeae8a101f23984f6fa825c.tar.zst
nixlib-5dc59fbf383956d60eeae8a101f23984f6fa825c.zip
ocamlPackages.vg: 0.8.1 -> 0.9.0
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/vg/default.nix30
1 files changed, 14 insertions, 16 deletions
diff --git a/pkgs/development/ocaml-modules/vg/default.nix b/pkgs/development/ocaml-modules/vg/default.nix
index 17bb8eeb4645..aa6047c79014 100644
--- a/pkgs/development/ocaml-modules/vg/default.nix
+++ b/pkgs/development/ocaml-modules/vg/default.nix
@@ -1,17 +1,19 @@
-{ stdenv, fetchurl, ocaml, findlib, opam, gg, uutf, otfm, js_of_ocaml,
+{ stdenv, fetchurl, ocaml, findlib, opam, topkg
+, uchar, result, 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;
+  inherit (stdenv.lib) optionals versionAtLeast;
 
   pname = "vg";
-  version = "0.8.1";
+  version = "0.9.0";
   webpage = "http://erratique.ch/software/${pname}";
+  sob = b: if b then "true" else "false";
 in
 
-assert versionAtLeast (getVersion ocaml) "4.01.0";
+assert versionAtLeast ocaml.version "4.02.0";
 
 stdenv.mkDerivation rec {
 
@@ -19,12 +21,12 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${webpage}/releases/${pname}-${version}.tbz";
-    sha256 = "1cdcvsr5z8845ndilnrz7p4n6yn4gv2p91z2mgi4vrailcmn5vzd";
+    sha256 = "1czd2fq85hy24w5pllarsq4pvbx9rda5zdikxfxdng8s9kff2h3f";
   };
 
-  buildInputs = [ ocaml findlib opam ];
+  buildInputs = [ ocaml findlib opam topkg ];
 
-  propagatedBuildInputs = [ gg ]
+  propagatedBuildInputs = [ uchar result gg ]
                           ++ optionals pdfBackend [ uutf otfm ]
                           ++ optionals htmlcBackend [ js_of_ocaml ];
 
@@ -32,16 +34,12 @@ stdenv.mkDerivation rec {
 
   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");
+  buildPhase = topkg.buildPhase
+  + " --with-uutf ${sob pdfBackend} --with-otfm ${sob pdfBackend}"
+  + " --with-js_of_ocaml ${sob htmlcBackend}"
+  + " --with-cairo2 false";
 
-  installPhase = ''
-    opam-installer --script --prefix=$out ${pname}.install | sh
-    ln -s $out/lib/${pname} $out/lib/ocaml/${getVersion ocaml}/site-lib/${pname}
-  '';
+  inherit (topkg) installPhase;
 
   meta = with stdenv.lib; {
     description = "Declarative 2D vector graphics for OCaml";