about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/cstruct
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/ocaml-modules/cstruct
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/ocaml-modules/cstruct')
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/1.9.0.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/lwt.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/ppx.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/unix.nix14
5 files changed, 99 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/1.9.0.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/1.9.0.nix
new file mode 100644
index 000000000000..0122ec9ff61d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/1.9.0.nix
@@ -0,0 +1,36 @@
+{ stdenv, 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 [];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/default.nix
new file mode 100644
index 000000000000..37c7f660ca6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, buildDunePackage, sexplib, ocplib-endian }:
+
+buildDunePackage rec {
+  pname = "cstruct";
+  version = "3.1.1";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-cstruct/releases/download/v${version}/cstruct-${version}.tbz";
+    sha256 = "1x4jxsvd1lrfibnjdjrkfl7hqsc48rljnwbap6faanj9qhwwa6v2";
+  };
+
+  propagatedBuildInputs = [ sexplib ocplib-endian ];
+
+  meta = {
+    description = "Access C-like structures directly from OCaml";
+    license = stdenv.lib.licenses.isc;
+    homepage = "https://github.com/mirage/ocaml-cstruct";
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/lwt.nix
new file mode 100644
index 000000000000..5a10d7cae48d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/lwt.nix
@@ -0,0 +1,14 @@
+{ lib, buildDunePackage, cstruct, lwt }:
+
+if !lib.versionAtLeast (cstruct.version or "1") "3"
+then cstruct
+else
+
+buildDunePackage {
+	pname = "cstruct-lwt";
+	inherit (cstruct) version src meta;
+
+  minimumOCamlVersion = "4.02";
+
+	propagatedBuildInputs = [ cstruct lwt ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/ppx.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/ppx.nix
new file mode 100644
index 000000000000..78600b783068
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/ppx.nix
@@ -0,0 +1,15 @@
+{ lib, buildDunePackage, cstruct, ppx_tools_versioned }:
+
+if !lib.versionAtLeast (cstruct.version or "1") "3"
+then cstruct
+else
+
+buildDunePackage {
+	pname = "ppx_cstruct";
+	inherit (cstruct) version src meta;
+
+  minimumOCamlVersion = "4.02";
+
+	buildInputs = [ ppx_tools_versioned ];
+	propagatedBuildInputs = [ cstruct ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/unix.nix
new file mode 100644
index 000000000000..604ad4fb083b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/unix.nix
@@ -0,0 +1,14 @@
+{ lib, buildDunePackage, cstruct }:
+
+if !lib.versionAtLeast (cstruct.version or "1") "3"
+then cstruct
+else
+
+buildDunePackage {
+	pname = "cstruct-unix";
+	inherit (cstruct) version src meta;
+
+  minimumOCamlVersion = "4.02";
+
+	propagatedBuildInputs = [ cstruct ];
+}