ocamlPackages.camlimages: 5.0.4 → 5.0.5 (#383877)

This commit is contained in:
Arne Keller 2025-02-26 08:47:18 +01:00 committed by GitHub
commit f535647ef6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 37 deletions

View file

@ -50,13 +50,16 @@ stdenv.mkDerivation rec {
]);
postPatch = ''
for f in callbacks*/Makefile src/Makefile; do
substituteInPlace "$f" --replace "+camlp4" \
for f in callbacks*/Makefile; do
substituteInPlace "$f" --replace-warn "+camlp4" \
"${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4"
done
# Fatal error: exception Sys_error("Mutex.unlock: Operation not permitted")
sed -i "/gl_started/d" src/draw.ml* src/main.ml
# Compatibility with camlimages ≥ 5.0.5
substituteInPlace src/Makefile --replace-warn camlimages.all_formats camlimages.core
'';
installPhase = ''

View file

@ -1,5 +1,5 @@
diff --git a/config/xConfigurator.ml b/config/xConfigurator.ml
index 268df4a..73e1850 100644
index 766a35c..1d1aff5 100644
--- a/config/xConfigurator.ml
+++ b/config/xConfigurator.ml
@@ -8,7 +8,7 @@ let (!%) fmt = Printf.sprintf fmt
@ -30,8 +30,8 @@ index 268df4a..73e1850 100644
let find_program prog =
let prog = prog ^ exe in
@@ -45,13 +45,13 @@ module Configurator = struct
| s ->
(* findlib 1.7.3 installs META file for graphics
| s ->
(* findlib 1.7.3 installs META file for graphics
even when there is no graphics library installed. *)
- let dest = Caml.Filename.temp_file "test" ".cma" in
- let res = match Caml.Sys.command & !% "ocamlfind ocamlc -package %s -o %s -linkpkg" n dest with
@ -72,32 +72,6 @@ index 268df4a..73e1850 100644
- let fcalls = Caml.List.map (!% " ( (void(*)()) (%s) )();") fnames in
+ let includes = Stdlib.List.map (!% "#include <%s>") headers in
+ let fcalls = Stdlib.List.map (!% " ( (void(*)()) (%s) )();") fnames in
let code =
String.concat ~sep:"\n"
& includes
diff --git a/core/images.ml b/core/images.ml
index 563ab7e..a53a6a4 100644
--- a/core/images.ml
+++ b/core/images.ml
@@ -102,7 +102,7 @@ let get_extension s =
| _ -> s, ""
let guess_extension s =
- let s = String.lowercase s in
+ let s = String.lowercase_ascii s in
match s with
| "gif" -> Gif
| "bmp" -> Bmp
diff --git a/core/units.ml b/core/units.ml
index 634bc9c..ddd6eae 100644
--- a/core/units.ml
+++ b/core/units.ml
@@ -30,7 +30,7 @@ let parse_length s = (* return in pt *)
let digit,unit =
if l > 2 then String.sub s 0 2, String.sub s (l-2) 2 else "", "" in
try
- (List.assoc (String.lowercase unit) units) *. float_of_string digit
+ (List.assoc (String.lowercase_ascii unit) units) *. float_of_string digit
with
| Not_found -> (* think it is in "pt" *)
float_of_string s in
let code =
String.concat ~sep:"\n"
& includes

View file

@ -12,7 +12,7 @@
buildDunePackage rec {
pname = "camlimages";
version = "5.0.4";
version = "5.0.5";
minimalOCamlVersion = "4.07";
@ -20,10 +20,10 @@ buildDunePackage rec {
owner = "camlspotter";
repo = pname;
rev = version;
sha256 = "1m2c76ghisg73dikz2ifdkrbkgiwa0hcmp21f2fm2rkbf02rq3f4";
hash = "sha256-/Dkj8IBVPjGCJCXrLOuJtuaa+nD/a9e8/N+TN9ukw4k=";
};
# stdio v0.17 compatibility; also replaces `String.lowercase` with `String.lowercase_ascii`
# stdio v0.17 compatibility
patches = [ ./camlimages.patch ];
nativeBuildInputs = [ cppo ];

View file

@ -48,6 +48,9 @@ stdenv.mkDerivation {
postPatch = ''
substituteInPlace src/lang/dune \
--replace-warn "(run git rev-parse --short HEAD)" "(run echo -n nixpkgs)"
# Compatibility with camlimages 5.0.5
substituteInPlace src/core/dune \
--replace-warn camlimages.all_formats camlimages.core
'';
dontConfigure = true;