ocamlPackages.fontconfig: fix build with OCaml ≥ 5.0

This commit is contained in:
Vincent Laporte 2023-11-06 06:10:32 +01:00 committed by Vincent Laporte
parent bcd19c5881
commit f3fca40fd1

View File

@ -1,7 +1,7 @@
{ stdenv, lib, fetchFromGitHub, pkg-config, fontconfig, ocaml }:
stdenv.mkDerivation {
pname = "ocaml-fontconfig";
pname = "ocaml${ocaml.version}-fontconfig";
version = "unstable-2013-11-03";
src = fetchFromGitHub {
@ -11,6 +11,12 @@ stdenv.mkDerivation {
sha256 = "1fw6bzydmnyh2g4x35mcbg0hypnxqhynivk4nakcsx7prr8zr3yh";
};
postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "4.03") ''
substituteInPlace extract_consts.ml \
--replace String.lowercase String.lowercase_ascii \
--replace String.capitalize String.capitalize_ascii
'';
nativeBuildInputs = [ pkg-config ocaml ];
buildInputs = [ fontconfig ];
@ -24,7 +30,7 @@ stdenv.mkDerivation {
meta = {
description = "Fontconfig bindings for OCaml";
license = lib.licenses.gpl2Plus;
platforms = ocaml.meta.platforms or [ ];
platforms = ocaml.meta.platforms;
maintainers = with lib.maintainers; [ vbgl ];
};
}