about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix')
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix17
1 files changed, 8 insertions, 9 deletions
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix
index cc2aad52d3d6..2a0fae4a1dbb 100644
--- a/nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix
+++ b/nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix
@@ -1,6 +1,10 @@
 { lib, stdenv, fetchFromGitHub, ocaml, findlib, camlpdf, ncurses }:
 
-let version = "2.3.1"; in
+if !lib.versionAtLeast ocaml.version "4.10"
+then throw "cpdf is not available for OCaml ${ocaml.version}"
+else
+
+let version = "2.4"; in
 
 stdenv.mkDerivation {
   name = "ocaml${ocaml.version}-cpdf-${version}";
@@ -9,19 +13,14 @@ stdenv.mkDerivation {
     owner = "johnwhitington";
     repo = "cpdf-source";
     rev = "v${version}";
-    sha256 = "1gwz0iy28f67kbqap2q10nf98dalwbi03vv5j893z2an7pb4w68z";
+    sha256 = "1a8lmfc76dr8x6pxgm4aypbys02pfma9yh4z3l1qxp2q1909na5l";
   };
 
-  prePatch = ''
-    substituteInPlace META --replace 'version="1.7"' 'version="${version}"'
-  '';
-
   buildInputs = [ ocaml findlib ncurses ];
   propagatedBuildInputs = [ camlpdf ];
 
-  createFindlibDestdir = true;
-
-  postInstall = ''
+  preInstall = ''
+    mkdir -p $OCAMLFIND_DESTDIR
     mkdir -p $out/bin
     cp cpdf $out/bin
     mkdir -p $out/share/