tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
ocaml-re2: add initial version (112.06.00) to the system
Eric Merritt
11 years ago
59b94c36
b7ea979a
+72
4 changed files
expand all
collapse all
unified
split
pkgs
development
ocaml-modules
re2
Makefile.patch
default.nix
myocamlbuild.patch
top-level
all-packages.nix
+17
pkgs/development/ocaml-modules/re2/Makefile.patch
reviewed
···
1
1
+
--- ./lib/Makefile 2014-11-18 08:16:19.000000000 -0800
2
2
+
+++ ./lib/Makefile 2015-05-23 14:48:31.000000000 -0700
3
3
+
@@ -6,12 +6,12 @@
4
4
+
all: libre2_stubs.a dllre2_stubs.so
5
5
+
6
6
+
dllre2_stubs.so libre2_stubs.a: stubs.o $(LIBRE2)
7
7
+
- ocamlmklib -oc re2_stubs stubs.o $(LIBRE2) -lstdc++
8
8
+
+ ocamlmklib -oc re2_stubs stubs.o $(LIBRE2) -lc++
9
9
+
rm libre2_stubs.a # ocamlmklib just includes $(LIBRE2) inside the stubs archive
10
10
+
cp $(LIBRE2) libre2_stubs.a && ar r libre2_stubs.a stubs.o
11
11
+
12
12
+
stubs.o: stubs.cpp stubs.h util.h enum_x_macro.h
13
13
+
- g++ -O2 -DPIC -fPIC -g -pipe -DCAML_NAME_SPACE -Wall -I. -I../../../include \
14
14
+
+ $(CXX) -O2 -DPIC -fPIC -g -pipe -DCAML_NAME_SPACE -Wall -I. -I../../../include \
15
15
+
-I$(RE2_HOME) -I$(ocaml-version-selected-include-path) -c stubs.cpp
16
16
+
17
17
+
#stubs.o: %.o: %.cpp %.h
+29
pkgs/development/ocaml-modules/re2/default.nix
reviewed
···
1
1
+
{stdenv, buildOcaml, fetchurl, ocaml, core, pa_ounit, pa_test,
2
2
+
bin_prot, comparelib, sexplib, rsync}:
3
3
+
4
4
+
buildOcaml rec {
5
5
+
name = "re2";
6
6
+
version = "112.06.00";
7
7
+
8
8
+
minimumSupportedOcamlVersion = "4.00";
9
9
+
10
10
+
src = fetchurl {
11
11
+
url = "https://github.com/janestreet/re2/archive/${version}.tar.gz";
12
12
+
sha256 = "a538765872363fcb67f12b95c07455a0afd68f5ae9008b59bb85a996d97cc752";
13
13
+
};
14
14
+
patches = if stdenv.isDarwin
15
15
+
then [./Makefile.patch ./myocamlbuild.patch]
16
16
+
else null;
17
17
+
18
18
+
buildInputs = [ pa_ounit pa_test rsync ];
19
19
+
propagatedBuildInputs = [ core bin_prot comparelib sexplib ];
20
20
+
21
21
+
hasSharedObjects = true;
22
22
+
23
23
+
meta = with stdenv.lib; {
24
24
+
homepage = https://github.com/janestreet/re2;
25
25
+
description = "OCaml bindings for RE2";
26
26
+
license = stdenv.lib.licenses.asl20;
27
27
+
maintainers = [ maintainers.ericbmerritt ];
28
28
+
};
29
29
+
}
+24
pkgs/development/ocaml-modules/re2/myocamlbuild.patch
reviewed
···
1
1
+
--- ./myocamlbuild.ml 2015-05-23 14:35:18.000000000 -0700
2
2
+
+++ ./myocamlbuild.ml 2015-05-23 15:05:24.000000000 -0700
3
3
+
@@ -626,16 +626,18 @@
4
4
+
rule "Generate lib/options.ml"
5
5
+
~prod:"lib/options.ml"
6
6
+
~deps:["lib/options.mlp"; "lib/enum_x_macro.h"]
7
7
+
- (fun _ _ -> Cmd (S[A"gcc"; A"-E"; A"-P"; A"-x"; A"c";
8
8
+
+ (fun _ _ -> Cmd (S[A"cc"; A"-E"; A"-P"; A"-x"; A"c";
9
9
+
P"lib/options.mlp"; A"-o"; P"lib/options.ml"]));
10
10
+
11
11
+
flag ["ocaml"; "link"; "library"; "native"] (S[A"-cclib"; A"-Llib";
12
12
+
A"-cclib"; A"-lre2_stubs";
13
13
+
- A"-cclib"; A"-lstdc++"]);
14
14
+
+ A"-ccopt"; A"--stdlib=libc++";
15
15
+
+ A"-cclib"; A"-lc++"]);
16
16
+
flag ["ocaml"; "link"; "library"; "byte"] (S[A"-dllib"; A"dllre2_stubs.so";
17
17
+
A"-cclib"; A"-Llib";
18
18
+
A"-cclib"; A"-lre2_stubs";
19
19
+
- A"-cclib"; A"-lstdc++"]);
20
20
+
+ A"-ccopt"; A"--stdlib=libc++";
21
21
+
+ A"-cclib"; A"-lc++"]);
22
22
+
| _ ->
23
23
+
()
24
24
+
+2
pkgs/top-level/all-packages.nix
reviewed
···
4315
4315
4316
4316
ounit = callPackage ../development/ocaml-modules/ounit { };
4317
4317
4318
4318
+
re2 = callPackage ../development/ocaml-modules/re2 { };
4319
4319
+
4318
4320
tyxml = callPackage ../development/ocaml-modules/tyxml { };
4319
4321
4320
4322
ulex = callPackage ../development/ocaml-modules/ulex { };