summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorEric Merritt <eric@afiniate.com>2015-05-15 09:32:33 -0500
committerEric Merritt <eric@afiniate.com>2015-05-24 12:33:16 -0700
commitea41b6eec8a6b2f191d79de36416672c6ec8d3d7 (patch)
treef25b85ea44a94d4778358fddb6fb4d9887d257aa /pkgs/development
parent09c6cc19f2a906968546d54f7dd0feed06b95b63 (diff)
downloadnixlib-ea41b6eec8a6b2f191d79de36416672c6ec8d3d7.tar
nixlib-ea41b6eec8a6b2f191d79de36416672c6ec8d3d7.tar.gz
nixlib-ea41b6eec8a6b2f191d79de36416672c6ec8d3d7.tar.bz2
nixlib-ea41b6eec8a6b2f191d79de36416672c6ec8d3d7.tar.lz
nixlib-ea41b6eec8a6b2f191d79de36416672c6ec8d3d7.tar.xz
nixlib-ea41b6eec8a6b2f191d79de36416672c6ec8d3d7.tar.zst
nixlib-ea41b6eec8a6b2f191d79de36416672c6ec8d3d7.zip
ocaml-cstruct: fix various build problems
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/ocaml-modules/cstruct/default.nix30
1 files changed, 17 insertions, 13 deletions
diff --git a/pkgs/development/ocaml-modules/cstruct/default.nix b/pkgs/development/ocaml-modules/cstruct/default.nix
index 194a852e7ef9..d62b9397a733 100644
--- a/pkgs/development/ocaml-modules/cstruct/default.nix
+++ b/pkgs/development/ocaml-modules/cstruct/default.nix
@@ -1,27 +1,31 @@
-{ stdenv, fetchzip, ocaml, findlib, sexplib, ocplib-endian, lwt, camlp4 }:
+{stdenv, writeText, fetchurl, ocaml, ocplib-endian, sexplib, findlib,
+ async ? null, lwt ? null, camlp4}:
 
-let version = "1.6.0"; in
+let
+  ocaml_version = (builtins.parseDrvName ocaml.name).version;
+in
 
 stdenv.mkDerivation {
-  name = "ocaml-cstruct-${version}";
+  name = "ocaml-cstruct-1.6.0";
 
-  src = fetchzip {
-    url = "https://github.com/mirage/ocaml-cstruct/archive/v${version}.tar.gz";
-    sha256 = "09qw3rhfiq2kkns6660p9cwm5610k72md52a04cy91gr6gsig6ic";
+  src = fetchurl {
+    url = https://github.com/mirage/ocaml-cstruct/archive/v1.6.0.tar.gz;
+    sha256 = "0f90a1b7a03091cf22a3ccb11a0cce03b6500f064ad3766b5ed81418ac008ece";
   };
 
-  buildInputs = [ ocaml findlib lwt camlp4 ];
-  propagatedBuildInputs = [ ocplib-endian sexplib ];
-
-  configureFlags = "--enable-lwt";
+  configureFlags = stdenv.lib.strings.concatStringsSep " " ((if lwt != null then ["--enable-lwt"] else []) ++
+                                          (if async != null then ["--enable-async"] else []));
+  buildInputs = [ocaml findlib camlp4];
+  propagatedBuildInputs = [ocplib-endian sexplib lwt async];
 
   createFindlibDestdir = true;
+  dontStrip = true;
 
-  meta = {
-    description = "Map OCaml arrays onto C-like structs";
+  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 = with stdenv.lib.maintainers; [ vbgl ];
+    maintainers = [ maintainers.vbgl maintainers.ericbmerritt ];
     platforms = ocaml.meta.platforms;
   };
 }