2017-12-14 07:36:29 +00:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
|
2014-07-09 08:42:26 +01:00
|
|
|
let
|
|
|
|
pname = "xmlm";
|
|
|
|
webpage = "http://erratique.ch/software/${pname}";
|
|
|
|
in
|
2014-09-21 11:02:55 +01:00
|
|
|
|
2016-10-05 08:32:30 +01:00
|
|
|
assert stdenv.lib.versionAtLeast ocaml.version "3.12";
|
2014-09-21 11:02:55 +01:00
|
|
|
|
2017-10-07 06:15:50 +01:00
|
|
|
let param =
|
|
|
|
if stdenv.lib.versionAtLeast ocaml.version "4.02"
|
|
|
|
then {
|
|
|
|
version = "1.3.0";
|
|
|
|
sha256 = "1rrdxg5kh9zaqmgapy9bhdqyxbbvxxib3bdfg1vhw4rrkp1z0x8n";
|
|
|
|
buildInputs = [ topkg ];
|
|
|
|
inherit (topkg) buildPhase;
|
|
|
|
} else {
|
|
|
|
version = "1.2.0";
|
|
|
|
sha256 = "1jywcrwn5z3gkgvicr004cxmdaqfmq8wh72f81jqz56iyn5024nh";
|
|
|
|
buildInputs = [];
|
|
|
|
buildPhase = "./pkg/build true";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2014-07-09 08:42:26 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ocaml-${pname}-${version}";
|
2017-10-07 06:15:50 +01:00
|
|
|
inherit (param) version;
|
2014-07-09 08:42:26 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${webpage}/releases/${pname}-${version}.tbz";
|
2017-10-07 06:15:50 +01:00
|
|
|
inherit (param) sha256;
|
2014-07-09 08:42:26 +01:00
|
|
|
};
|
|
|
|
|
2017-12-14 07:36:29 +00:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ] ++ param.buildInputs;
|
2014-07-09 08:42:26 +01:00
|
|
|
|
|
|
|
unpackCmd = "tar xjf $src";
|
|
|
|
|
2017-10-07 06:15:50 +01:00
|
|
|
inherit (param) buildPhase;
|
2017-12-14 07:36:29 +00:00
|
|
|
inherit (topkg) installPhase;
|
2014-07-09 08:42:26 +01:00
|
|
|
|
2014-09-21 11:02:55 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-07-09 08:42:26 +01:00
|
|
|
description = "An OCaml streaming codec to decode and encode the XML data format";
|
|
|
|
homepage = "${webpage}";
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-09-21 11:02:55 +01:00
|
|
|
maintainers = [ maintainers.vbgl ];
|
|
|
|
license = licenses.bsd3;
|
2014-07-09 08:42:26 +01:00
|
|
|
};
|
|
|
|
}
|