git.iko.soy/typeable/nixpkgs
on master help sign in
ocaml: add local copy of the ocamlbuild patch
a3fa690Vincent Laporte
pkgs/development/compilers/ocaml/4.02.nix+1−5
@@ -9,10 +9,6 @@ assert useX11 -> !stdenv.isArm && !stdenv.isMips;
9let
9let
10 useNativeCompilers = !stdenv.isMips;
10 useNativeCompilers = !stdenv.isMips;
11 inherit (stdenv.lib) optionals optionalString;
11 inherit (stdenv.lib) optionals optionalString;
12− patchOcamlBuild = fetchurl {
13− url = https://github.com/ocaml/ocaml/pull/117.patch;
14− sha256 = "0x2cdn2sgzq29qzqg5y2ial0jqy8gjg5a7jf8qqch55dc4vkyjw0";
15− };
16in
12in
17
13
18stdenv.mkDerivation rec {
14stdenv.mkDerivation rec {
@@ -28,7 +24,7 @@ stdenv.mkDerivation rec {
28 sha256 = "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3";
24 sha256 = "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3";
29 };
25 };
30
26
31− patches = [ patchOcamlBuild ];
27+ patches = [ ./ocamlbuild.patch ];
32
28
33 prefixKey = "-prefix ";
29 prefixKey = "-prefix ";
34 configureFlags = optionals useX11 [ "-x11lib" x11lib
30 configureFlags = optionals useX11 [ "-x11lib" x11lib
pkgs/development/compilers/ocaml/ocamlbuild.patchnew file+45
@@ -0,0 +1,45 @@
1+Author: Vincent Laporte <Vincent.Laporte@gmail.com>
2+Date: Sun Feb 1 11:19:50 2015 +0100
3+
4+ ocamlbuild: use ocamlfind to discover camlp4 path
5+
6+ and default to `+camlp4`
7+
8+diff --git a/ocamlbuild/ocaml_specific.ml b/ocamlbuild/ocaml_specific.ml
9+index b902810..a73b7a5 100644
10+--- a/ocamlbuild/ocaml_specific.ml
11++++ b/ocamlbuild/ocaml_specific.ml
12+@@ -698,15 +698,25 @@ ocaml_lib ~extern:true ~tag_name:"use_toplevel" "toplevellib";;
13+ ocaml_lib ~extern:true ~dir:"+ocamldoc" "ocamldoc";;
14+ ocaml_lib ~extern:true ~dir:"+ocamlbuild" ~tag_name:"use_ocamlbuild" "ocamlbuildlib";;
15+
16+-ocaml_lib ~extern:true ~dir:"+camlp4" ~tag_name:"use_camlp4" "camlp4lib";;
17+-ocaml_lib ~extern:true ~dir:"+camlp4" ~tag_name:"use_old_camlp4" "camlp4";;
18+-ocaml_lib ~extern:true ~dir:"+camlp4" ~tag_name:"use_camlp4_full" "camlp4fulllib";;
19++let camlp4dir =
20++ Findlib.(
21++ try
22++ if sys_command "sh -c 'ocamlfind list >/dev/null' 2>/dev/null" != 0
23++ then raise (Findlib_error Cannot_run_ocamlfind);
24++ (query "camlp4").location
25++ with Findlib_error _ ->
26++ "+camlp4"
27++ );;
28++
29++ocaml_lib ~extern:true ~dir:camlp4dir ~tag_name:"use_camlp4" "camlp4lib";;
30++ocaml_lib ~extern:true ~dir:camlp4dir ~tag_name:"use_old_camlp4" "camlp4";;
31++ocaml_lib ~extern:true ~dir:camlp4dir ~tag_name:"use_camlp4_full" "camlp4fulllib";;
32+ flag ["ocaml"; "compile"; "use_camlp4_full"]
33+- (S[A"-I"; A"+camlp4/Camlp4Parsers";
34+- A"-I"; A"+camlp4/Camlp4Printers";
35+- A"-I"; A"+camlp4/Camlp4Filters"]);;
36+-flag ["ocaml"; "use_camlp4_bin"; "link"; "byte"] (A"+camlp4/Camlp4Bin.cmo");;
37+-flag ["ocaml"; "use_camlp4_bin"; "link"; "native"] (A"+camlp4/Camlp4Bin.cmx");;
38++ (S[A"-I"; A(camlp4dir^"/Camlp4Parsers");
39++ A"-I"; A(camlp4dir^"/Camlp4Printers");
40++ A"-I"; A(camlp4dir^"/Camlp4Filters")]);;
41++flag ["ocaml"; "use_camlp4_bin"; "link"; "byte"] (A(camlp4dir^"/Camlp4Bin.cmo"));;
42++flag ["ocaml"; "use_camlp4_bin"; "link"; "native"] (A(camlp4dir^"/Camlp4Bin.cmx"));;
43+
44+ flag ["ocaml"; "debug"; "compile"; "byte"] (A "-g");;
45+ flag ["ocaml"; "debug"; "link"; "byte"; "program"] (A "-g");;