about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
authorUlrik Strid <ulrik.strid@outlook.com>2023-06-13 08:37:57 +0200
committerGitHub <noreply@github.com>2023-06-13 08:37:57 +0200
commitf5f4bba439da59cc612b2f1cc5798b1960ec1add (patch)
treec1c4be57a25b9710b294cb2ab0ec457bcf7d2d85 /pkgs/development/ocaml-modules
parent2dd9125a84c0a88e52d7338e096115c51c0bbdab (diff)
parent03dc92bce19848f26edf53c662845a60a129b811 (diff)
downloadnixlib-f5f4bba439da59cc612b2f1cc5798b1960ec1add.tar
nixlib-f5f4bba439da59cc612b2f1cc5798b1960ec1add.tar.gz
nixlib-f5f4bba439da59cc612b2f1cc5798b1960ec1add.tar.bz2
nixlib-f5f4bba439da59cc612b2f1cc5798b1960ec1add.tar.lz
nixlib-f5f4bba439da59cc612b2f1cc5798b1960ec1add.tar.xz
nixlib-f5f4bba439da59cc612b2f1cc5798b1960ec1add.tar.zst
nixlib-f5f4bba439da59cc612b2f1cc5798b1960ec1add.zip
Merge pull request #237304 from vbgl/ocaml-mariadb-fix-for-ocaml-5
ocamlPackages: fixes for OCaml ≥ 5.0
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/ansiterminal/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/bz2/default.nix1
-rw-r--r--pkgs/development/ocaml-modules/mariadb/default.nix15
3 files changed, 18 insertions, 2 deletions
diff --git a/pkgs/development/ocaml-modules/ansiterminal/default.nix b/pkgs/development/ocaml-modules/ansiterminal/default.nix
index f421e59ce7da..8b8833b14eb6 100644
--- a/pkgs/development/ocaml-modules/ansiterminal/default.nix
+++ b/pkgs/development/ocaml-modules/ansiterminal/default.nix
@@ -9,6 +9,10 @@ buildDunePackage rec {
     hash = "sha256-q3OyGLajAmfSu8QzEtzzE5gbiwvsVV2SsGuHZkst0w4=";
   };
 
+  postPatch = ''
+    substituteInPlace src/dune --replace 'libraries unix bytes' 'libraries unix'
+  '';
+
   doCheck = true;
 
   meta = with lib; {
diff --git a/pkgs/development/ocaml-modules/bz2/default.nix b/pkgs/development/ocaml-modules/bz2/default.nix
index 835570dc9ab6..7e5f256a1a74 100644
--- a/pkgs/development/ocaml-modules/bz2/default.nix
+++ b/pkgs/development/ocaml-modules/bz2/default.nix
@@ -1,6 +1,7 @@
 { lib, stdenv, fetchFromGitLab, ocaml, findlib, bzip2, autoreconfHook }:
 
 if lib.versionOlder ocaml.version "4.02"
+|| lib.versionAtLeast ocaml.version "5.0"
 then throw "bz2 is not available for OCaml ${ocaml.version}"
 else
 
diff --git a/pkgs/development/ocaml-modules/mariadb/default.nix b/pkgs/development/ocaml-modules/mariadb/default.nix
index 4aaaf11450bb..397402481839 100644
--- a/pkgs/development/ocaml-modules/mariadb/default.nix
+++ b/pkgs/development/ocaml-modules/mariadb/default.nix
@@ -1,5 +1,6 @@
 { lib, fetchurl, stdenv
-, ocaml, findlib, ocamlbuild
+, fetchpatch
+, ocaml, findlib, ocamlbuild, camlp-streams
 , ctypes, mariadb, libmysqlclient }:
 
 lib.throwIfNot (lib.versionAtLeast ocaml.version "4.07")
@@ -14,8 +15,18 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-3/C1Gz6luUzS7oaudLlDHMT6JB2v5OdbLVzJhtayHGM=";
   };
 
+  patches = fetchpatch {
+    url = "https://github.com/andrenth/ocaml-mariadb/commit/9db2e4d8dec7c584213d0e0f03d079a36a35d9d5.patch";
+    hash = "sha256-heROtU02cYBJ5edIHMdYP1xNXcLv8h79GYGBuudJhgE=";
+  };
+
+  postPatch = ''
+    substituteInPlace setup.ml --replace '#use "topfind"' \
+      '#directory "${findlib}/lib/ocaml/${ocaml.version}/site-lib/";; #use "topfind"'
+  '';
+
   nativeBuildInputs = [ ocaml findlib ocamlbuild ];
-  buildInputs = [ mariadb libmysqlclient ];
+  buildInputs = [ mariadb libmysqlclient camlp-streams ocamlbuild ];
   propagatedBuildInputs = [ ctypes ];
 
   strictDeps = true;