2017-10-22 07:29:13 +01:00
|
|
|
{ stdenv, fetchzip, ocaml, findlib, jbuilder, cppo, easy-format, biniou }:
|
2014-07-05 07:50:47 +01:00
|
|
|
let
|
|
|
|
pname = "yojson";
|
2017-10-22 07:18:32 +01:00
|
|
|
param =
|
2017-10-22 07:29:13 +01:00
|
|
|
if stdenv.lib.versionAtLeast ocaml.version "4.02" then {
|
2018-03-31 06:11:03 +01:00
|
|
|
version = "1.4.1";
|
|
|
|
sha256 = "0nwsfkmqpyfab4rxq76q8ff7giyanghw08094jyrp275v99zdjr9";
|
2017-10-22 07:29:13 +01:00
|
|
|
buildInputs = [ jbuilder ];
|
|
|
|
extra = { inherit (jbuilder) installPhase; };
|
2017-10-22 07:18:32 +01:00
|
|
|
} else {
|
|
|
|
version = "1.2.3";
|
|
|
|
sha256 = "10dvkndgwanvw4agbjln7kgb1n9s6lii7jw82kwxczl5rd1sgmvl";
|
2017-10-22 07:29:13 +01:00
|
|
|
buildInputs = [];
|
|
|
|
extra = {
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
makeFlags = "PREFIX=$(out)";
|
|
|
|
|
|
|
|
preBuild = "mkdir $out/bin";
|
|
|
|
};
|
2017-10-22 07:18:32 +01:00
|
|
|
};
|
2014-07-05 07:50:47 +01:00
|
|
|
in
|
2017-10-22 07:29:13 +01:00
|
|
|
stdenv.mkDerivation ({
|
2014-07-05 07:50:47 +01:00
|
|
|
|
2017-10-22 07:18:32 +01:00
|
|
|
name = "ocaml${ocaml.version}-${pname}-${param.version}";
|
2014-07-05 07:50:47 +01:00
|
|
|
|
2015-11-30 17:07:36 +00:00
|
|
|
src = fetchzip {
|
2017-10-22 07:18:32 +01:00
|
|
|
url = "https://github.com/mjambon/${pname}/archive/v${param.version}.tar.gz";
|
|
|
|
inherit (param) sha256;
|
2014-07-05 07:50:47 +01:00
|
|
|
};
|
|
|
|
|
2017-10-22 07:29:13 +01:00
|
|
|
buildInputs = [ ocaml findlib ] ++ param.buildInputs;
|
2014-08-19 17:39:45 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ cppo easy-format biniou ];
|
2014-07-05 07:50:47 +01:00
|
|
|
|
2014-09-21 11:02:55 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-07-05 07:50:47 +01:00
|
|
|
description = "An optimized parsing and printing library for the JSON format";
|
2015-11-30 17:07:36 +00:00
|
|
|
homepage = "http://mjambon.com/${pname}.html";
|
2014-09-21 11:02:55 +01:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-07-05 07:50:47 +01:00
|
|
|
};
|
2017-10-22 07:29:13 +01:00
|
|
|
} // param.extra)
|