ocamlPackages.cstruct: 1.6.0 -> 1.9.0, 2.3.0
This commit is contained in:
parent
72c1a6f0f4
commit
2d136204c4
@ -1,20 +1,31 @@
|
|||||||
{stdenv, writeText, fetchurl, ocaml, ocplib-endian, sexplib_p4, findlib,
|
{ stdenv, writeText, fetchFromGitHub, ocaml, ocplib-endian, sexplib_p4, findlib, ppx_tools
|
||||||
async_p4 ? null, lwt ? null, camlp4}:
|
, async_p4 ? null, lwt ? null, camlp4
|
||||||
|
}:
|
||||||
|
|
||||||
assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.01";
|
assert stdenv.lib.versionAtLeast ocaml.version "4.01";
|
||||||
|
|
||||||
|
let param =
|
||||||
|
if stdenv.lib.versionAtLeast ocaml.version "4.02"
|
||||||
|
then { version = "2.3.0"; sha256 = "19spsgkry41dhsbm6ij71kws90bqp7wiggc6lsqdl43xxvbgdmys"; }
|
||||||
|
else { version = "1.9.0"; sha256 = "1c1j21zgmxi9spq23imy7byn50qr7hlds1cfpzxlsx9dp309jngy"; };
|
||||||
|
in
|
||||||
|
|
||||||
|
let opt = b: "--${if b != null then "en" else "dis"}able"; in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "ocaml-cstruct-1.6.0";
|
name = "ocaml${ocaml.version}-cstruct-${param.version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchFromGitHub {
|
||||||
url = https://github.com/mirage/ocaml-cstruct/archive/v1.6.0.tar.gz;
|
owner = "mirage";
|
||||||
sha256 = "0f90a1b7a03091cf22a3ccb11a0cce03b6500f064ad3766b5ed81418ac008ece";
|
repo = "ocaml-cstruct";
|
||||||
|
rev = "v${param.version}";
|
||||||
|
inherit (param) sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
configureFlags = stdenv.lib.strings.concatStringsSep " " ((if lwt != null then ["--enable-lwt"] else []) ++
|
configureFlags = [ "${opt lwt}-lwt" "${opt async_p4}-async" "${opt ppx_tools}-ppx" ];
|
||||||
(if async_p4 != null then ["--enable-async"] else []));
|
|
||||||
buildInputs = [ocaml findlib camlp4];
|
buildInputs = [ ocaml findlib ppx_tools camlp4 lwt async_p4 ];
|
||||||
propagatedBuildInputs = [ocplib-endian sexplib_p4 lwt async_p4];
|
propagatedBuildInputs = [ ocplib-endian sexplib_p4 ];
|
||||||
|
|
||||||
createFindlibDestdir = true;
|
createFindlibDestdir = true;
|
||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchzip, ocaml, findlib, cstruct, type_conv, zarith, ounit }:
|
{ stdenv, fetchzip, ocaml, findlib, cstruct, type_conv, zarith, ocaml_lwt, ounit }:
|
||||||
|
|
||||||
assert stdenv.lib.versionAtLeast ocaml.version "4.01";
|
assert stdenv.lib.versionAtLeast ocaml.version "4.01";
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "15gffvixk12ghsfra9amfszd473c8h188zfj03ngvblbdm0d80m0";
|
sha256 = "15gffvixk12ghsfra9amfszd473c8h188zfj03ngvblbdm0d80m0";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ ocaml findlib type_conv ounit ];
|
buildInputs = [ ocaml findlib type_conv ocaml_lwt ounit ];
|
||||||
propagatedBuildInputs = [ cstruct zarith ];
|
propagatedBuildInputs = [ cstruct zarith ];
|
||||||
|
|
||||||
configureFlags = "--enable-tests";
|
configureFlags = "--enable-tests";
|
||||||
|
Loading…
Reference in New Issue
Block a user