Skip to content

Commit

Permalink
Adding async
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitz-other committed Nov 26, 2012
1 parent ebe216b commit fd598f1
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pkgs/development/ocaml-modules/opam-modules/async/108.07.01.nix
@@ -0,0 +1,22 @@
{stdenv, fetchurl, ocaml, findlib, opam_async_core_108_07_01, opam_async_unix_108_07_01, opam_async_extra_108_07_01 }:

stdenv.mkDerivation {
name = "opam-async-108.07.01";

src = fetchurl {
url = "https://ocaml.janestreet.com/ocaml-core/108.07.01/individual/async-108.07.01.tar.gz";
md5 = "f2b85b8a497d16c32b221aa984f425fe";
};

patches = [ ./setup.patch ];

propagatedBuildInputs = [ocaml findlib opam_async_core_108_07_01 opam_async_unix_108_07_01 opam_async_extra_108_07_01];

propagatedUserEnvPackages = [ocaml findlib opam_async_core_108_07_01 opam_async_unix_108_07_01 opam_async_extra_108_07_01];

createFindlibDestdir = true;

meta = {
platforms = ocaml.meta.platforms;
};
}
39 changes: 39 additions & 0 deletions pkgs/development/ocaml-modules/opam-modules/async/setup.patch
@@ -0,0 +1,39 @@
--- a/setup.ml
+++ b/setup.ml
@@ -5950,13 +5950,13 @@ let protectx x ~f ~finally =
finally x; r

let rm_rf dir =
- ignore (Printf.ksprintf Sys.command "/bin/rm -rf %S" dir : int)
+ ignore (Printf.ksprintf Sys.command "rm -rf %S" dir : int)

let temp_dir ?(in_dir = Filename.temp_dir_name) prefix suffix =
let base = Filename.concat in_dir prefix in
let rec loop i =
let dir = base ^ string_of_int i ^ suffix in
- let ret = Printf.ksprintf Sys.command "/bin/mkdir %S 2>/dev/null" dir in
+ let ret = Printf.ksprintf Sys.command "mkdir %S 2>/dev/null" dir in
if ret = 0 then dir
else if Sys.file_exists dir then loop (i + 1)
else failwith ("mkdir failed on " ^ dir)
@@ -6012,15 +6012,15 @@ let () =
let touch = Filename.concat dir "touch" in
protectx (open_out touch) ~finally:close_out_noerr ~f:(fun oc ->
output_string oc "\
-#!/bin/bash
+#!/bin/sh
if [[ \"$(basename \"$1\")\" == async.mli ]]; then
exit 0
else
- exec /bin/touch \"$@\"
+ exec touch \"$@\"
fi
");

- if 0 <> Printf.ksprintf Sys.command "/bin/chmod +x %S" touch then
+ if 0 <> Printf.ksprintf Sys.command "chmod +x %S" touch then
failwith ("can't chmod " ^ touch ^ "to be executable");

Sys.command


@@ -0,0 +1,20 @@
{stdenv, fetchurl, ocaml, findlib, opam_core_108_07_01 }:

stdenv.mkDerivation {
name = "opam-async_core-108.07.01";

src = fetchurl {
url = "https://ocaml.janestreet.com/ocaml-core/108.07.01/individual/async_core-108.07.01.tar.gz";
md5 = "6fac99d205e41de0206cbd8862325302";
};

propagatedBuildInputs = [ocaml findlib opam_core_108_07_01];

propagatedUserEnvPackages = [ocaml findlib opam_core_108_07_01];

createFindlibDestdir = true;

meta = {
platforms = ocaml.meta.platforms;
};
}
@@ -0,0 +1,20 @@
{stdenv, fetchurl, ocaml, findlib, opam_async_core_108_07_01, opam_async_unix_108_07_01 }:

stdenv.mkDerivation {
name = "opam-async_extra-108.07.01";

src = fetchurl {
url = "https://ocaml.janestreet.com/ocaml-core/108.07.01/individual/async_extra-108.07.01.tar.gz";
md5 = "94106a48edcb32acb9d3161682aa3a39";
};

propagatedBuildInputs = [ocaml findlib opam_async_core_108_07_01 opam_async_unix_108_07_01];

propagatedUserEnvPackages = [ocaml findlib opam_async_core_108_07_01 opam_async_unix_108_07_01];

createFindlibDestdir = true;

meta = {
platforms = ocaml.meta.platforms;
};
}
@@ -0,0 +1,20 @@
{stdenv, fetchurl, ocaml, findlib, opam_async_core_108_07_01 }:

stdenv.mkDerivation {
name = "opam-async_unix-108.07.01";

src = fetchurl {
url = "https://ocaml.janestreet.com/ocaml-core/108.07.01/individual/async_unix-108.07.01.tar.gz";
md5 = "128c46c2b0dadfc9145b481b9119d0ed";
};

propagatedBuildInputs = [ocaml findlib opam_async_core_108_07_01];

propagatedUserEnvPackages = [ocaml findlib opam_async_core_108_07_01];

createFindlibDestdir = true;

meta = {
platforms = ocaml.meta.platforms;
};
}
4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -2596,6 +2596,10 @@ let
opam_comparelib_108_07_01 = callPackage ../development/ocaml-modules/opam-modules/comparelib/108.07.01.nix {};
opam_core_108_07_01 = callPackage ../development/ocaml-modules/opam-modules/core/108.07.01.nix {};
opam_core_extended_108_07_01 = callPackage ../development/ocaml-modules/opam-modules/core_extended/108.07.01.nix {};
opam_async_core_108_07_01 = callPackage ../development/ocaml-modules/opam-modules/async_core/108.07.01.nix {};
opam_async_unix_108_07_01 = callPackage ../development/ocaml-modules/opam-modules/async_unix/108.07.01.nix {};
opam_async_extra_108_07_01 = callPackage ../development/ocaml-modules/opam-modules/async_extra/108.07.01.nix {};
opam_async_108_07_01 = callPackage ../development/ocaml-modules/opam-modules/async/108.07.01.nix {};
};

ocamlPackages = recurseIntoAttrs ocamlPackages_3_12_1;
Expand Down

0 comments on commit fd598f1

Please sign in to comment.