summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2020-10-22 08:14:16 +0200
committerVincent Laporte <vbgl@users.noreply.github.com>2020-10-29 06:35:15 +0100
commit2ccfc2962ea81b40dae4fc1f2b191ea6daba5284 (patch)
tree7c45376b260ea524485e6d6cf9144f406c993716
parent8305cce21076ad95c9cd8af42f94a2f774279103 (diff)
downloadnixpkgs-2ccfc2962ea81b40dae4fc1f2b191ea6daba5284.tar
nixpkgs-2ccfc2962ea81b40dae4fc1f2b191ea6daba5284.tar.gz
nixpkgs-2ccfc2962ea81b40dae4fc1f2b191ea6daba5284.tar.bz2
nixpkgs-2ccfc2962ea81b40dae4fc1f2b191ea6daba5284.tar.lz
nixpkgs-2ccfc2962ea81b40dae4fc1f2b191ea6daba5284.tar.xz
nixpkgs-2ccfc2962ea81b40dae4fc1f2b191ea6daba5284.tar.zst
nixpkgs-2ccfc2962ea81b40dae4fc1f2b191ea6daba5284.zip
opa: build with OCaml 4.03
-rw-r--r--pkgs/development/compilers/opa/default.nix6
-rw-r--r--pkgs/development/compilers/opa/ocaml-4.03.patch35
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 41 insertions, 2 deletions
diff --git a/pkgs/development/compilers/opa/default.nix b/pkgs/development/compilers/opa/default.nix
index c20e0d0ef99..864bb8e1b26 100644
--- a/pkgs/development/compilers/opa/default.nix
+++ b/pkgs/development/compilers/opa/default.nix
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
     sha256 = "1qs91rq9xrafv2mf2v415k8lv91ab3ycz0xkpjh1mng5ca3pjlf3";
   };
 
+  patches = [ ./ocaml-4.03.patch ];
+
   # Paths so the opa compiler code generation will use the same programs as were
   # used to build opa.
   codeGeneratorPaths = stdenv.lib.makeBinPath [ ocamlPackages.ocaml gcc binutils gnumake nodejs ];
@@ -23,7 +25,7 @@ stdenv.mkDerivation rec {
     patchShebangs .
     (
     cat ./compiler/buildinfos/buildInfos.ml.pre
-    ./compiler/buildinfos/generate_buildinfos.sh . --release --version ./compiler/buildinfos/version_major.txt 
+    ./compiler/buildinfos/generate_buildinfos.sh . --release --version ./compiler/buildinfos/version_major.txt
     echo let opa_git_version = ${version}
     echo 'let opa_git_sha = "xxxx"'
     cat ./compiler/buildinfos/buildInfos.ml.post
@@ -34,6 +36,8 @@ stdenv.mkDerivation rec {
     done
     export CAMLP4O=${ocamlPackages.camlp4}/bin/camlp4o
     export CAMLP4ORF=${ocamlPackages.camlp4}/bin/camlp4orf
+    export OCAMLBUILD=${ocamlPackages.ocamlbuild}/bin/ocamlbuild
+    substituteInPlace _tags --replace ', warn_error_A' ""
   '';
 
   prefixKey = "-prefix ";
diff --git a/pkgs/development/compilers/opa/ocaml-4.03.patch b/pkgs/development/compilers/opa/ocaml-4.03.patch
new file mode 100644
index 00000000000..5e2a3e2522e
--- /dev/null
+++ b/pkgs/development/compilers/opa/ocaml-4.03.patch
@@ -0,0 +1,35 @@
+--- a/compiler/passes/surfaceAstRenaming.ml
++++ b/compiler/passes/surfaceAstRenaming.ml
+@@ -1110,7 +1110,7 @@ let find_opt_local_or_global name all_env =
+     | None -> find_opt_global name all_env
+     | v -> v
+ 
+-let path_expr_to_module_aux p = function
++let path_expr_to_module_aux p : _ -> _ result = function
+   | Some (OpenedIdent (tree, ident, path)) ->
+       (match Tree.get_path_opt tree p with
+            (* the path is not in the tree, which means a 'dot' access
+diff --git a/ocamllib/libbase/baseInt64.mli b/ocamllib/libbase/baseInt64.mli
+index fb544706..734437f9 100644
+--- a/ocamllib/libbase/baseInt64.mli
++++ b/ocamllib/libbase/baseInt64.mli
+@@ -40,7 +40,9 @@ external shift_right_logical : int64 -> int -> int64 = "%int64_lsr"
+ external of_int : int -> int64 = "%int64_of_int"
+ external to_int : int64 -> int = "%int64_to_int"
+ external of_float : float -> int64 = "caml_int64_of_float"
++ "caml_int64_of_float_unboxed" [@@unboxed] [@@noalloc]
+ external to_float : int64 -> float = "caml_int64_to_float"
++ "caml_int64_to_float_unboxed" [@@unboxed] [@@noalloc]
+ external of_int32 : int32 -> int64 = "%int64_of_int32"
+ external to_int32 : int64 -> int32 = "%int64_to_int32"
+ external of_nativeint : nativeint -> int64 = "%int64_of_nativeint"
+@@ -48,7 +50,9 @@ external to_nativeint : int64 -> nativeint = "%int64_to_nativeint"
+ external of_string : string -> int64 = "caml_int64_of_string"
+ val to_string : int64 -> string
+ external bits_of_float : float -> int64 = "caml_int64_bits_of_float"
++ "caml_int64_bits_of_float_unboxed" [@@unboxed] [@@noalloc]
+ external float_of_bits : int64 -> float = "caml_int64_float_of_bits"
++ "caml_int64_float_of_bits_unboxed" [@@unboxed] [@@noalloc]
+ type t = int64
+ val compare : t -> t -> int
+ external format : string -> int64 -> string = "caml_int64_format"
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 2f70602bc36..104f8e8d4cb 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9698,7 +9698,7 @@ in
   ocsigen-i18n = callPackage ../development/tools/ocaml/ocsigen-i18n { };
 
   opa = callPackage ../development/compilers/opa {
-    ocamlPackages = ocaml-ng.ocamlPackages_4_02;
+    ocamlPackages = ocaml-ng.ocamlPackages_4_03;
   };
 
   opaline = callPackage ../development/tools/ocaml/opaline { };