guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 646c1918e6b25b784638c91e71a83a8ad9c7bb47
Author: Simon Tournier <[email protected]>
AuthorDate: Wed Aug 20 16:10:07 2025 +0200

    gnu: ocaml-ctypes: Update to 0.23.0.
    
    * gnu/packages/ocaml.scm (ocaml-ctypes): Update to 0.23.0.
    [source]: Register patch.
    [build-system]: Replace ocaml-build-system by dune-build-system.
    [patches]: Fix OO tests failure because of the stricter compiler.
    * gnu/packages/patches/ocaml-ctypes-test-oo.patch: New file.
    * gnu/local.mk: Add it.
    
    Fixes: guix/guix#1493
    Reported-by: jahierwan
    Change-Id: I0db64bffade8d78bc92d8b9b9f3206961b35840d
    Signed-off-by: Andreas Enge <[email protected]>
---
 gnu/local.mk                                    |  1 +
 gnu/packages/ocaml.scm                          |  9 +++--
 gnu/packages/patches/ocaml-ctypes-test-oo.patch | 49 +++++++++++++++++++++++++
 3 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 1f26871a13..953b1403bc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1942,6 +1942,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/nvi-db4.patch                           \
   %D%/packages/patches/nyacc-binary-literals.patch             \
   %D%/packages/patches/obs-modules-location.patch              \
+  %D%/packages/patches/ocaml-ctypes-test-oo.patch              \
   %D%/packages/patches/ocaml-multiple-definitions.patch                \
   %D%/packages/patches/ogre-next-add-riscv64-support.patch             \
   %D%/packages/patches/ocaml-4.07-dynamically-allocate-signal-stack.patch      
\
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 88c9241e20..16ff501bdb 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -15,7 +15,7 @@
 ;;; Copyright © 2019 Ricardo Wurmus <[email protected]>
 ;;; Copyright © 2020 Brett Gilio <[email protected]>
 ;;; Copyright © 2020 Marius Bakke <[email protected]>
-;;; Copyright © 2020, 2021 Simon Tournier <[email protected]>
+;;; Copyright © 2020, 2021, 2025 Simon Tournier <[email protected]>
 ;;; Copyright © 2020 divoplade <[email protected]>
 ;;; Copyright © 2020, 2021, 2022 pukkamustard <[email protected]>
 ;;; Copyright © 2021 aecepoglu <[email protected]>
@@ -5698,7 +5698,7 @@ long and size_t whose sizes depend on the host platform.")
 (define-public ocaml-ctypes
   (package
    (name "ocaml-ctypes")
-   (version "0.20.1")
+   (version "0.23.0")
    (home-page "https://github.com/ocamllabs/ocaml-ctypes";)
    (source (origin
              (method git-fetch)
@@ -5708,8 +5708,9 @@ long and size_t whose sizes depend on the host platform.")
              (file-name (git-file-name name version))
              (sha256
               (base32
-               "0ilzq9qzvwv9rc08cc9wchsx636zp870i7qvqmbigaa2qb812m0z"))))
-   (build-system ocaml-build-system)
+               "16dxz2r070vlrkbqhza0c5y6izxpjn080vqmxj47i919wfqd75vx"))
+             (patches (search-patches "ocaml-ctypes-test-oo.patch"))))
+   (build-system dune-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
diff --git a/gnu/packages/patches/ocaml-ctypes-test-oo.patch 
b/gnu/packages/patches/ocaml-ctypes-test-oo.patch
new file mode 100644
index 0000000000..7cb797d07d
--- /dev/null
+++ b/gnu/packages/patches/ocaml-ctypes-test-oo.patch
@@ -0,0 +1,49 @@
+Backport upstream commit fe4be538e389d5caf6c0a562cd02e58fda9361cb.
+
+    Add an explicit upcast in the OO-style test.
+
+https://github.com/yallop/ocaml-ctypes/commit/fe4be538e389d5caf6c0a562cd02e58fda9361cb
+
+It allows to deal with GCC@14 stricter than the previous versions.
+
+diff --git a/tests/clib/test_functions.c b/tests/clib/test_functions.c
+index d19db2b..486b7d1 100644
+--- a/tests/clib/test_functions.c
++++ b/tests/clib/test_functions.c
+@@ -293,6 +293,11 @@ struct chorse *new_chorse(int colour)
+   h->colour = (enum colour)colour;
+   return h;
+ }
++
++struct animal *new_chorse_as_animal(int colour)
++{
++  return (struct animal *)new_chorse(colour);
++}
+ /* (End of OO-style example) */
+ 
+ int accept_pointers(float *float_p,
+diff --git a/tests/clib/test_functions.h b/tests/clib/test_functions.h
+index 5022e98..579f622 100644
+--- a/tests/clib/test_functions.h
++++ b/tests/clib/test_functions.h
+@@ -79,6 +79,8 @@ extern char *chorse_colour(struct chorse *);
+ extern char *chorse_say(struct animal *);
+ extern char *chorse_identify(struct animal *);
+ extern struct chorse *new_chorse(int);
++extern struct animal *new_chorse_as_animal(int);
++
+ extern int accept_pointers(float *,
+                            double *,
+                            short *,
+diff --git a/tests/test-oo_style/stubs/functions.ml 
b/tests/test-oo_style/stubs/functions.ml
+index 4434331..6a8e7bd 100644
+--- a/tests/test-oo_style/stubs/functions.ml
++++ b/tests/test-oo_style/stubs/functions.ml
+@@ -82,6 +82,6 @@ struct
+   let check_name = foreign "check_name"
+     (ptr animal @-> string @-> returning int)
+ 
+-    let new_chorse = foreign "new_chorse"
++    let new_chorse = foreign "new_chorse_as_animal"
+       (int @-> returning (ptr animal))
+ end

Reply via email to