3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #212039 from Et7f3/fix_ocamlPackages.megam

Fix ocaml packages.megam
This commit is contained in:
Nick Cao 2023-01-23 09:18:58 +08:00 committed by GitHub
commit ffa956cb00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -12,6 +12,14 @@ stdenv.mkDerivation {
patches = [ ./ocaml-includes.patch ./ocaml-3.12.patch ];
postPatch = ''
# Deprecated in ocaml 3.10 https://github.com/ocaml/ocaml/commit/f6190f3d0c49c5220d443ee8d03ca5072d68aa87
# Deprecated in ocaml 3.08 https://github.com/ocaml/ocaml/commit/0c7aecb88dc696f66f49f3bed54a037361a26b8d
substituteInPlace fastdot_c.c --replace copy_double caml_copy_double --replace Bigarray_val Caml_ba_array_val --replace caml_bigarray caml_ba_array
# They were already deprecated in 3.12 https://v2.ocaml.org/releases/3.12/htmlman/libref/Array.html
substituteInPlace abffs.ml main.ml --replace create_matrix make_matrix
substituteInPlace intHashtbl.ml --replace Array.create Array.make
'';
strictDeps = true;
nativeBuildInputs = [ makeWrapper ocaml ];
@ -20,7 +28,7 @@ stdenv.mkDerivation {
makeFlags = [
"CAML_INCLUDES=${ocaml}/lib/ocaml/caml"
"WITHBIGARRAY=bigarray.cma"
("WITHBIGARRAY=" + lib.optionalString (lib.versionOlder ocaml.version "4.08.0") "bigarray.cma")
];
# see https://bugzilla.redhat.com/show_bug.cgi?id=435559

View file

@ -15,7 +15,7 @@ diff -ru megam_0.92/Makefile megam_0.92-b/Makefile
#WITHCLIBS =-I /usr/lib/ocaml/3.09.2/caml
-WITHCLIBS =-I /usr/lib/ocaml/caml
+WITHCLIBS =-I $(CAML_INCLUDES)
+WITHCLIBS =-I $(CAML_INCLUDES) -I +unix -I +str
################ End of user's variables #####################