gnu: simg2img: Fix compilation with GCC 14.

* gnu/packages/android.scm (simg2img)[arguments]<#:phases>:
Add 'patch-calloc-order.

Change-Id: Ia5dc3a0dc23e1fbbd3a0bfe008c6e50fa4a04795
Signed-off-by: Andreas Enge <andreas@enge.fr>
This commit is contained in:
Aiden Isik 2025-08-27 22:20:29 +01:00 committed by Andreas Enge
parent 5b88c11c3e
commit 6c654afd88
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3

View file

@ -1358,7 +1358,23 @@ mounted via FUSE.")
#:tests? #f ; no tests provided upstream
#:phases
;; There is no configure step.
#~(modify-phases %standard-phases (delete 'configure))))
#~(modify-phases %standard-phases
(delete 'configure)
(add-before 'build 'patch-calloc-order
;; As of the 1.1.5 release, the calloc argument order is
;; wrong, and GCC 14 recognises this. We correct it here.
;; When updating this package, remove these patches
;; (fixed in master).
(lambda _
(substitute* "backed_block.cpp"
(("calloc[(]sizeof[(]struct backed_block_list[)], 1[)]")
"calloc(1, sizeof(struct backed_block_list))"))
(substitute* "simg2simg.cpp"
(("calloc[(]sizeof[(]struct sparse_file[*][)], files[)]")
"calloc(files, sizeof(struct sparse_file*))"))
(substitute* "sparse.cpp"
(("calloc[(]sizeof[(]struct sparse_file[)], 1[)]")
"calloc(1, sizeof(struct sparse_file))")))))))
(inputs (list zlib))
(home-page "https://github.com/anestisb/android-simg2img")
(synopsis "Convert Android sparse images to raw ext4 images")