ocamlPackages.cstruct: 2.3.2 -> 3.0.2
This commit is contained in:
parent
e7f4979270
commit
bfc0959511
36
pkgs/development/ocaml-modules/cstruct/1.9.0.nix
Normal file
36
pkgs/development/ocaml-modules/cstruct/1.9.0.nix
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{ stdenv, writeText, fetchFromGitHub, ocaml, ocamlbuild, ocplib-endian, sexplib, findlib, ppx_tools
|
||||||
|
, async ? null, lwt ? null
|
||||||
|
}:
|
||||||
|
|
||||||
|
assert stdenv.lib.versionAtLeast ocaml.version "4.01";
|
||||||
|
|
||||||
|
let version = "1.9.0"; in
|
||||||
|
|
||||||
|
let opt = b: "--${if b != null then "en" else "dis"}able"; in
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "ocaml${ocaml.version}-cstruct-${version}";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "mirage";
|
||||||
|
repo = "ocaml-cstruct";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "1c1j21zgmxi9spq23imy7byn50qr7hlds1cfpzxlsx9dp309jngy";
|
||||||
|
};
|
||||||
|
|
||||||
|
configureFlags = [ "${opt lwt}-lwt" "${opt async}-async" "${opt ppx_tools}-ppx" ];
|
||||||
|
|
||||||
|
buildInputs = [ ocaml findlib ocamlbuild ppx_tools lwt async ];
|
||||||
|
propagatedBuildInputs = [ ocplib-endian sexplib ];
|
||||||
|
|
||||||
|
createFindlibDestdir = true;
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = https://github.com/mirage/ocaml-cstruct;
|
||||||
|
description = "Map OCaml arrays onto C-like structs";
|
||||||
|
license = stdenv.lib.licenses.isc;
|
||||||
|
maintainers = [ maintainers.vbgl maintainers.ericbmerritt ];
|
||||||
|
platforms = ocaml.meta.platforms or [];
|
||||||
|
};
|
||||||
|
}
|
@ -1,40 +1,28 @@
|
|||||||
{ stdenv, writeText, fetchFromGitHub, ocaml, ocamlbuild, ocplib-endian, sexplib, findlib, ppx_tools
|
{ stdenv, fetchurl, ocaml, jbuilder, findlib, sexplib, ocplib-endian }:
|
||||||
, async ? null, lwt ? null
|
|
||||||
}:
|
|
||||||
|
|
||||||
assert stdenv.lib.versionAtLeast ocaml.version "4.01";
|
stdenv.mkDerivation rec {
|
||||||
|
name = "ocaml${ocaml.version}-cstruct-${version}";
|
||||||
|
version = "3.0.2";
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://github.com/mirage/ocaml-cstruct/releases/download/v${version}/cstruct-${version}.tbz";
|
||||||
|
sha256 = "03caxcyzfjmbnnwa15zy9s1ckkl4sc834d1qkgi4jcs3zqchvd8z";
|
||||||
|
};
|
||||||
|
|
||||||
let param =
|
unpackCmd = "tar -xjf $curSrc";
|
||||||
if stdenv.lib.versionAtLeast ocaml.version "4.02"
|
|
||||||
then { version = "2.3.2"; sha256 = "1fykack86hvvqhwngddyxxqlwm3xjljfaszsjbdrvjlrd1nlg079"; }
|
|
||||||
else { version = "1.9.0"; sha256 = "1c1j21zgmxi9spq23imy7byn50qr7hlds1cfpzxlsx9dp309jngy"; };
|
|
||||||
in
|
|
||||||
|
|
||||||
let opt = b: "--${if b != null then "en" else "dis"}able"; in
|
buildInputs = [ ocaml jbuilder findlib ];
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
propagatedBuildInputs = [ sexplib ocplib-endian ];
|
||||||
name = "ocaml${ocaml.version}-cstruct-${param.version}";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
buildPhase = "jbuilder build -p cstruct";
|
||||||
owner = "mirage";
|
|
||||||
repo = "ocaml-cstruct";
|
|
||||||
rev = "v${param.version}";
|
|
||||||
inherit (param) sha256;
|
|
||||||
};
|
|
||||||
|
|
||||||
configureFlags = [ "${opt lwt}-lwt" "${opt async}-async" "${opt ppx_tools}-ppx" ];
|
inherit (jbuilder) installPhase;
|
||||||
|
|
||||||
buildInputs = [ ocaml findlib ocamlbuild ppx_tools lwt async ];
|
meta = {
|
||||||
propagatedBuildInputs = [ ocplib-endian sexplib ];
|
description = "Access C-like structures directly from OCaml";
|
||||||
|
license = stdenv.lib.licenses.isc;
|
||||||
createFindlibDestdir = true;
|
maintainers = [ stdenv.lib.maintainers.vbgl ];
|
||||||
dontStrip = true;
|
inherit (src.meta) homepage;
|
||||||
|
inherit (ocaml.meta) platforms;
|
||||||
meta = with stdenv.lib; {
|
};
|
||||||
homepage = https://github.com/mirage/ocaml-cstruct;
|
|
||||||
description = "Map OCaml arrays onto C-like structs";
|
|
||||||
license = stdenv.lib.licenses.isc;
|
|
||||||
maintainers = [ maintainers.vbgl maintainers.ericbmerritt ];
|
|
||||||
platforms = ocaml.meta.platforms or [];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
12
pkgs/development/ocaml-modules/cstruct/lwt.nix
Normal file
12
pkgs/development/ocaml-modules/cstruct/lwt.nix
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{ stdenv, ocaml, cstruct, lwt }:
|
||||||
|
|
||||||
|
assert stdenv.lib.versionAtLeast ocaml.version "4.02";
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "ocaml${ocaml.version}-cstruct-lwt-${version}";
|
||||||
|
inherit (cstruct) version src unpackCmd buildInputs installPhase meta;
|
||||||
|
|
||||||
|
propagatedBuildInputs = [ cstruct lwt ];
|
||||||
|
|
||||||
|
buildPhase = "${cstruct.buildPhase}-lwt";
|
||||||
|
}
|
13
pkgs/development/ocaml-modules/cstruct/ppx.nix
Normal file
13
pkgs/development/ocaml-modules/cstruct/ppx.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{ stdenv, ocaml, cstruct, ppx_tools_versioned }:
|
||||||
|
|
||||||
|
assert stdenv.lib.versionAtLeast ocaml.version "4.02";
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "ocaml${ocaml.version}-ppx_cstruct-${version}";
|
||||||
|
inherit (cstruct) version src unpackCmd installPhase meta;
|
||||||
|
|
||||||
|
buildInputs = cstruct.buildInputs ++ [ ppx_tools_versioned ];
|
||||||
|
propagatedBuildInputs = [ cstruct ];
|
||||||
|
|
||||||
|
buildPhase = "jbuilder build -p ppx_cstruct";
|
||||||
|
}
|
12
pkgs/development/ocaml-modules/cstruct/unix.nix
Normal file
12
pkgs/development/ocaml-modules/cstruct/unix.nix
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{ stdenv, ocaml, cstruct }:
|
||||||
|
|
||||||
|
assert stdenv.lib.versionAtLeast ocaml.version "4.02";
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "ocaml${ocaml.version}-cstruct-unix-${version}";
|
||||||
|
inherit (cstruct) version src unpackCmd buildInputs installPhase meta;
|
||||||
|
|
||||||
|
propagatedBuildInputs = [ cstruct ];
|
||||||
|
|
||||||
|
buildPhase = "${cstruct.buildPhase}-unix";
|
||||||
|
}
|
@ -1,11 +1,11 @@
|
|||||||
{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, opam, topkg
|
{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, opam, topkg
|
||||||
, cpuid, ocb-stubblr
|
, cpuid, ocb-stubblr
|
||||||
, cstruct, zarith, ppx_sexp_conv, sexplib
|
, cstruct, zarith, ppx_sexp_conv, sexplib
|
||||||
, lwt ? null
|
, cstruct-lwt ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
let withLwt = lwt != null; in
|
let withLwt = cstruct-lwt != null; in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "ocaml${ocaml.version}-nocrypto-${version}";
|
name = "ocaml${ocaml.version}-nocrypto-${version}";
|
||||||
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
buildInputs = [ ocaml findlib ocamlbuild topkg opam cpuid ocb-stubblr
|
buildInputs = [ ocaml findlib ocamlbuild topkg opam cpuid ocb-stubblr
|
||||||
ppx_sexp_conv ];
|
ppx_sexp_conv ];
|
||||||
propagatedBuildInputs = [ cstruct zarith sexplib ] ++ optional withLwt lwt;
|
propagatedBuildInputs = [ cstruct zarith sexplib ] ++ optional withLwt cstruct-lwt;
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
LD_LIBRARY_PATH=${cpuid}/lib/ocaml/${ocaml.version}/site-lib/stubslibs/ \
|
LD_LIBRARY_PATH=${cpuid}/lib/ocaml/${ocaml.version}/site-lib/stubslibs/ \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{stdenv, buildOcaml, fetchFromGitHub, ocamlbuild, findlib, topkg, ocaml, opam,
|
{stdenv, buildOcaml, fetchFromGitHub, ocamlbuild, findlib, topkg, ocaml, opam,
|
||||||
ppx_tools, ppx_sexp_conv, cstruct, sexplib, result, nocrypto, astring}:
|
ppx_tools, ppx_sexp_conv, cstruct, ppx_cstruct, sexplib, result, nocrypto, astring}:
|
||||||
|
|
||||||
let ocamlFlags = "-I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/"; in
|
let ocamlFlags = "-I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/"; in
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ buildOcaml rec {
|
|||||||
sha256 = "07zzix5mfsasqpqdx811m0x04gp8mq1ayf4b64998k98027v01rr";
|
sha256 = "07zzix5mfsasqpqdx811m0x04gp8mq1ayf4b64998k98027v01rr";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ ocamlbuild findlib topkg ppx_tools ppx_sexp_conv opam ];
|
buildInputs = [ ocamlbuild findlib topkg ppx_tools ppx_sexp_conv opam ppx_cstruct ];
|
||||||
propagatedBuildInputs = [ cstruct sexplib result nocrypto astring ];
|
propagatedBuildInputs = [ cstruct sexplib result nocrypto astring ];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, buildOcaml, fetchFromGitHub, findlib, ocamlbuild, ocaml_oasis
|
{ stdenv, buildOcaml, fetchFromGitHub, findlib, ocamlbuild, ocaml_oasis
|
||||||
, ppx_tools, ppx_sexp_conv, result, x509, nocrypto, cstruct, ounit
|
, ppx_tools, ppx_sexp_conv, result, x509, nocrypto, cstruct, ppx_cstruct, cstruct-unix, ounit
|
||||||
, lwt ? null}:
|
, lwt ? null}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
@ -19,7 +19,7 @@ buildOcaml rec {
|
|||||||
sha256 = "19q2hzxiasz9pzczgb63kikg0mc9mw98dfvch5falf2rincycj24";
|
sha256 = "19q2hzxiasz9pzczgb63kikg0mc9mw98dfvch5falf2rincycj24";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ ocamlbuild findlib ocaml_oasis ppx_sexp_conv ounit ];
|
buildInputs = [ ocamlbuild findlib ocaml_oasis ppx_sexp_conv ounit ppx_cstruct cstruct-unix ];
|
||||||
propagatedBuildInputs = [ cstruct nocrypto result x509 ] ++
|
propagatedBuildInputs = [ cstruct nocrypto result x509 ] ++
|
||||||
optional withLwt lwt;
|
optional withLwt lwt;
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
{stdenv, buildOcaml, fetchFromGitHub, ocaml, findlib, asn1-combinators, nocrypto, ounit, ocaml_oasis, ppx_sexp_conv}:
|
{ stdenv, buildOcaml, fetchFromGitHub, ocaml, findlib, asn1-combinators, nocrypto
|
||||||
|
, ounit, ocaml_oasis, ppx_sexp_conv, cstruct-unix
|
||||||
|
}:
|
||||||
|
|
||||||
buildOcaml rec {
|
buildOcaml rec {
|
||||||
name = "x509";
|
name = "x509";
|
||||||
@ -13,7 +15,7 @@ buildOcaml rec {
|
|||||||
sha256 = "07cc3z6h87460z3f4vz8nlczw5jkc4vjhix413z9x6nral876rn7";
|
sha256 = "07cc3z6h87460z3f4vz8nlczw5jkc4vjhix413z9x6nral876rn7";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ ocaml ocaml_oasis findlib ounit ppx_sexp_conv ];
|
buildInputs = [ ocaml ocaml_oasis findlib ounit ppx_sexp_conv cstruct-unix ];
|
||||||
propagatedBuildInputs = [ asn1-combinators nocrypto ];
|
propagatedBuildInputs = [ asn1-combinators nocrypto ];
|
||||||
|
|
||||||
configureFlags = "--enable-tests";
|
configureFlags = "--enable-tests";
|
||||||
|
@ -176,10 +176,17 @@ let
|
|||||||
|
|
||||||
cryptokit = callPackage ../development/ocaml-modules/cryptokit { };
|
cryptokit = callPackage ../development/ocaml-modules/cryptokit { };
|
||||||
|
|
||||||
cstruct = callPackage ../development/ocaml-modules/cstruct {
|
cstruct =
|
||||||
|
if lib.versionAtLeast ocaml.version "4.2"
|
||||||
|
then callPackage ../development/ocaml-modules/cstruct {}
|
||||||
|
else callPackage ../development/ocaml-modules/cstruct/1.9.0.nix { lwt = ocaml_lwt; };
|
||||||
|
|
||||||
|
cstruct-lwt = callPackage ../development/ocaml-modules/cstruct/lwt.nix {
|
||||||
lwt = ocaml_lwt;
|
lwt = ocaml_lwt;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cstruct-unix = callPackage ../development/ocaml-modules/cstruct/unix.nix {};
|
||||||
|
|
||||||
csv =
|
csv =
|
||||||
if lib.versionAtLeast ocaml.version "4.2"
|
if lib.versionAtLeast ocaml.version "4.2"
|
||||||
then callPackage ../development/ocaml-modules/csv { }
|
then callPackage ../development/ocaml-modules/csv { }
|
||||||
@ -380,9 +387,7 @@ let
|
|||||||
|
|
||||||
mtime = callPackage ../development/ocaml-modules/mtime { };
|
mtime = callPackage ../development/ocaml-modules/mtime { };
|
||||||
|
|
||||||
nocrypto = callPackage ../development/ocaml-modules/nocrypto {
|
nocrypto = callPackage ../development/ocaml-modules/nocrypto { };
|
||||||
lwt = ocaml_lwt;
|
|
||||||
};
|
|
||||||
|
|
||||||
notty = callPackage ../development/ocaml-modules/notty {
|
notty = callPackage ../development/ocaml-modules/notty {
|
||||||
lwt = ocaml_lwt;
|
lwt = ocaml_lwt;
|
||||||
@ -570,6 +575,8 @@ let
|
|||||||
then callPackage ../development/ocaml-modules/ppx_blob {}
|
then callPackage ../development/ocaml-modules/ppx_blob {}
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
|
ppx_cstruct = callPackage ../development/ocaml-modules/cstruct/ppx.nix {};
|
||||||
|
|
||||||
ppx_derivers = callPackage ../development/ocaml-modules/ppx_derivers {};
|
ppx_derivers = callPackage ../development/ocaml-modules/ppx_derivers {};
|
||||||
|
|
||||||
ppx_deriving =
|
ppx_deriving =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user