From 75b5f4b106e04e47611d7309d0e7531d5c07840a Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 12 Jun 2023 08:48:11 +0200 Subject: [PATCH 1/3] ocamlPackages.mariadb: fix for OCaml 5.0 --- .../development/ocaml-modules/mariadb/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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; From a70967020f7a6d0584aa8058526d8a5cbf91cf87 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 12 Jun 2023 08:48:16 +0200 Subject: [PATCH 2/3] =?UTF-8?q?ocamlPackages.bz2:=20disable=20for=20OCaml?= =?UTF-8?q?=20=E2=89=A5=205.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/bz2/default.nix | 1 + 1 file changed, 1 insertion(+) 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 From 03dc92bce19848f26edf53c662845a60a129b811 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 12 Jun 2023 08:48:20 +0200 Subject: [PATCH 3/3] ocamlPackages.ansiterminal: fix for OCaml 5.0 --- pkgs/development/ocaml-modules/ansiterminal/default.nix | 4 ++++ 1 file changed, 4 insertions(+) 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; {