~ruther/guix-local

6c654afd889a36ad0c307fd0caf5425f10f3a11f — Aiden Isik 7 months ago 5b88c11
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>
1 files changed, 17 insertions(+), 1 deletions(-)

M gnu/packages/android.scm
M gnu/packages/android.scm => gnu/packages/android.scm +17 -1
@@ 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")