1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/ocaml-modules/camlpdf/default.nix
2019-09-30 21:52:34 +02:00

38 lines
932 B
Nix

{ stdenv, fetchFromGitHub, ocaml, findlib }:
if !stdenv.lib.versionAtLeast ocaml.version "4.02"
then throw "camlpdf is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
version = "2.3";
name = "ocaml${ocaml.version}-camlpdf-${version}";
src = fetchFromGitHub {
owner = "johnwhitington";
repo = "camlpdf";
rev = "v${version}";
sha256 = "1z8h6bjzmlscr6h6kdvzj8kspifb4n9dg7zi54z1cv2qi03kr8dk";
};
buildInputs = [ ocaml findlib ];
# Version number in META file is wrong
patchPhase = ''
patch -p 0 META <<EOF
3c3
< version="1.7.1"
---
> version="${version}"
EOF
'';
createFindlibDestdir = true;
meta = with stdenv.lib; {
description = "An OCaml library for reading, writing and modifying PDF files";
homepage = https://github.com/johnwhitington/camlpdf;
license = licenses.lgpl21Plus;
maintainers = with maintainers; [vbgl];
};
}