Gentoo Archives: gentoo-soc

From: Fabian Groffen <grobian@g.o>
To: brahmajit.xyz@×××××.com
Cc: gentoo-soc@l.g.o
Subject: Re: [gentoo-soc] [GSoC] [WIP PATCH] build mp3info on musl profile
Date: Sat, 12 Mar 2022 13:46:19
Message-Id: YiykJOSgXSn50zGI@gentoo.org
In Reply to: [gentoo-soc] [GSoC] [WIP PATCH] build mp3info on musl profile by brahmajit.xyz@gmail.com
1 On 12-03-2022 16:44:54 +0530, brahmajit.xyz@×××××.com wrote:
2 > This patch fixes bug 828919. Initially package mp3info could not be
3 > built with musl with error `uint undeclared`. The fix is to move to
4 > `usinged int` from `uint` (thanks to *sam_*). The extra `-lintfo` is
5 > because it was failing to build with only `-lncurses`, I'm guessing this
6 > due to incorrect USE flags on my system.
7 >
8 > I'm hoping to get started with this simple patch and get reviews from
9 > maintainers.
10 >
11 > ---
12 > diff --git a/Makefile b/Makefile
13 > index e4e632d..e970f05 100644
14 > --- a/Makefile
15 > +++ b/Makefile
16 > @@ -43,7 +43,7 @@ RM = /bin/rm
17 > INSTALL = /usr/bin/install -c
18 > STRIP = strip
19 >
20 > -LIBS = -lncurses
21 > +LIBS = -lncurses -ltinfo
22
23 I think you don't want to do this unconditionally, perhaps you want to
24 call ncurses6-config --libs or pkg-config ncurses --libs to get the
25 necessary libraries.
26
27 > CC = gcc
28 > CFLAGS = -g -O2 -Wall
29 >
30 > diff --git a/mp3tech.c b/mp3tech.c
31 > index a1ae218..710491d 100644
32 > --- a/mp3tech.c
33 > +++ b/mp3tech.c
34 > @@ -279,7 +279,7 @@ char *header_mode(mp3header *h) {
35 > }
36 >
37 > int sameConstant(mp3header *h1, mp3header *h2) {
38 > - if((*(uint*)h1) == (*(uint*)h2)) return 1;
39 > + if((*(unsigned int*)h1) == (*(unsigned int*)h2)) return 1;
40
41 While this is an enormously dubious check (mp3header is a struct with as
42 first field an unsigned long), it seems from the code that this check
43 (whatever it may establish) is intended.
44
45 This change, for what's worth, is language wise the correct approach and
46 fully portable.
47
48 Thanks,
49 Fabian
50
51 >
52 > if((h1->version == h2->version ) &&
53 > (h1->layer == h2->layer ) &&
54 > ---
55 >
56
57 --
58 Fabian Groffen
59 Gentoo on a different level

Attachments

File name MIME type
signature.asc application/pgp-signature