• Bug#1065759: Retitle libbio-samtools-perl: FTBFS on arm{el,hf}: lib/Bio

    From Andreas Tille@21:1/5 to All on Tue Mar 12 18:40:01 2024
    Control: retitle -1 libbio-samtools-perl: FTBFS: lib/Bio/DB/Sam.xs:324:4: error: implicit declaration of function ‘bam_sort_core’; did you mean ‘bam_format1_core’? [-Werror=implicit-function-declaration]
    Control: tags -1 help
    thanks

    I can confirm that this bug also occures on amd64 thus removing the arm-restriction from the title. Unfortunately I have no idea how to fix
    this (except by possibly suppressing the -Werror=implicit-function-declaration option). Thus tagging 'help'

    Kind regards
    Andreas.

    --
    http://fam-tille.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Niko Tyni@21:1/5 to Andreas Tille on Tue Mar 12 22:10:01 2024
    Control: tag -1 patch

    On Tue, Mar 12, 2024 at 06:31:20PM +0100, Andreas Tille wrote:

    I can confirm that this bug also occures on amd64 thus removing the arm-restriction from the title. Unfortunately I have no idea how to fix
    this (except by possibly suppressing the -Werror=implicit-function-declaration
    option). Thus tagging 'help'

    Looks like bam_view1() and bam_sort_core() don't have prototypes in
    any header file in libbam-dev. Copying them from the actual .c files
    in samtools-legacy seems to work.

    Patch attached, this builds and passes the test suite for me.
    --
    Niko

    From 3ddc905c9ceb635c6c876de1d372eedaa45de425 Mon Sep 17 00:00:00 2001
    From: Niko Tyni <ntyni@debian.org>
    Date: Tue, 12 Mar 2024 20:53:33 +0000
    Subject: [PATCH] Lift prototypes of bam_view1 and bam_sort_core from bam.c in
    samtools-legacy

    This fixes builds with gcc -Werror=implicit-function-declaration .

    Bug-Debian: https://bugs.debian.org/1065759
    ---
    lib/Bio/DB/Sam.xs | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/lib/Bio/DB/Sam.xs b/lib/Bio/DB/Sam.xs
    index 023f655..2231477 100644
    --- a/lib/Bio/DB/Sam.xs
    +++ b/lib/Bio/DB/Sam.xs
    @@ -32,6 +32,11 @@
    /* stolen from bam_aux.c */
    #define MAX_REGION 1<<29

    +/* stolen from bam.c */
    +extern void bam_view1(const bam_header_t *header, const bam1_t *b);
    +/* stolen from bam_sort.c */
    +extern void bam_sort_core(int is_by_qname, const char *fn, const char *prefix, size_t max_mem);
    +
    typedef tamFile Bio__DB__Tam;
    typedef faidx_t* Bio__DB__Sam__Fai;
    typedef bamFile Bio__DB__Bam;
    --
    2.43.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)