From 05560cb8acb003cb3db11a4ca37781087d95285e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 15 Sep 2022 09:11:49 +0700 Subject: [PATCH 1/2] id3lib: patch for c99 bool id3/globals.h has a typedef for bool which is incompatible with c99 stdbool. This is a known issue, but upstream is effectively unmaintained. See https://sourceforege.net/p/id3lib/mailman/message/30500558/ Close: #39275 --- srcpkgs/id3lib/patches/c99-bool.patch | 36 +++++++++++++++++++++++++++ srcpkgs/id3lib/patches/test-io.patch | 22 ++++++++++++++++ srcpkgs/id3lib/template | 2 +- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/id3lib/patches/c99-bool.patch create mode 100644 srcpkgs/id3lib/patches/test-io.patch diff --git a/srcpkgs/id3lib/patches/c99-bool.patch b/srcpkgs/id3lib/patches/c99-bool.patch new file mode 100644 index 000000000000..59b68c7381c9 --- /dev/null +++ b/srcpkgs/id3lib/patches/c99-bool.patch @@ -0,0 +1,36 @@ +First hunk fix build for C99 since C99 typedef bool for _Bool + +Second hunk re-correct ABI for C99, since sizeof(_Bool) is 1, +So privatebit, copyrighted, and original will be squeezed into single word + +Second hunk also fix ABI for C++ since in C++, sizeof(bool) also 1 +--- a/include/id3/globals.h ++++ b/include/id3/globals.h +@@ -82,13 +82,7 @@ + + #define ID3_C_VAR extern + +-#ifndef __cplusplus +- +-typedef int bool; +-# define false (0) +-# define true (!false) +- +-#endif /* __cplusplus */ ++#include + + ID3_C_VAR const char * const ID3LIB_NAME; + ID3_C_VAR const char * const ID3LIB_RELEASE; +@@ -532,9 +526,9 @@ ID3_STRUCT(Mp3_Headerinfo) + uint32 framesize; + uint32 frames; // nr of frames + uint32 time; // nr of seconds in song +- bool privatebit; +- bool copyrighted; +- bool original; ++ int privatebit; // bool upstream, change to int for stable ABI ++ int copyrighted; // bool upstream, change to int for stable ABI ++ int original; // bool upstream, change to int for stable ABI + }; + + #define ID3_NR_OF_V1_GENRES 148 diff --git a/srcpkgs/id3lib/patches/test-io.patch b/srcpkgs/id3lib/patches/test-io.patch new file mode 100644 index 000000000000..7b18b4a9e0fa --- /dev/null +++ b/srcpkgs/id3lib/patches/test-io.patch @@ -0,0 +1,22 @@ +diff --git a/examples/test_io.cpp b/examples/test_io.cpp +index bee1a27..80020eb 100644 +--- a/examples/test_io.cpp ++++ b/examples/test_io.cpp +@@ -24,7 +24,7 @@ main(size_t argc, const char** argv) + ID3D_INIT_WARNING(); + ID3D_INIT_NOTICE(); + +- ID3_IStreamReader isr(cin); ++ ID3_IStreamReader isr(std::cin); + BString orig = io::readAllBinary(isr); + + cout << "input size: " << orig.size() << endl; +@@ -116,7 +116,7 @@ main(size_t argc, const char** argv) + cout << "binary number:"; + for (size_t i = 0; i < number.size(); ++i) + { +- cout << " 0x" << hex << (size_t) (0xFF & number[i]) << dec; ++ cout << " 0x" << std::hex << (size_t) (0xFF & number[i]) << std::dec; + } + cout << endl; + diff --git a/srcpkgs/id3lib/template b/srcpkgs/id3lib/template index 44cb7f55f1dd..ad9a60665e7e 100644 --- a/srcpkgs/id3lib/template +++ b/srcpkgs/id3lib/template @@ -1,7 +1,7 @@ # Template file for 'id3lib' pkgname=id3lib version=3.8.3 -revision=6 +revision=7 build_style=gnu-configure hostmakedepends="libtool automake" makedepends="zlib-devel" From c072887105c866a06bce0d83c4b161ce6173b847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 15 Sep 2022 09:13:17 +0700 Subject: [PATCH 2/2] kid3: rebuild for id3lib C++ ABI --- srcpkgs/kid3/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/kid3/template b/srcpkgs/kid3/template index 81633262dc03..456206d90e16 100644 --- a/srcpkgs/kid3/template +++ b/srcpkgs/kid3/template @@ -1,7 +1,7 @@ # Template file for 'kid3' pkgname=kid3 version=3.9.1 -revision=1 +revision=2 build_style=cmake configure_args="-DWITH_APPS='CLI;$(vopt_if KDE KDE Qt)' -DWITH_DOCBOOKDIR=/usr/share/xsl/docbook -DWITH_FLAC=$(vopt_if flac ON OFF)