[packages/audiofile] debian patch for fixing build with gcc >= 6

atler atler at pld-linux.org
Sat Oct 17 19:48:20 CEST 2020


commit 8a53b99cb5c40db7c9cbcdaeaa0abb1c79e701a3
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Oct 17 19:47:34 2020 +0200

    debian patch for fixing build with gcc >= 6

 audiofile.spec |   2 ++
 gcc6.patch     | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+)
---
diff --git a/audiofile.spec b/audiofile.spec
index 10fa54c..8cec9ee 100644
--- a/audiofile.spec
+++ b/audiofile.spec
@@ -17,6 +17,7 @@ Group:		Libraries
 Source0:	http://ftp.gnome.org/pub/GNOME/sources/audiofile/0.3/%{name}-%{version}.tar.xz
 # Source0-md5:	235dde14742317328f0109e9866a8008
 Patch0:		libm.patch
+Patch1:		gcc6.patch
 URL:		http://www.68k.org/~michael/audiofile/
 BuildRequires:	asciidoc
 BuildRequires:	autoconf >= 2.50
@@ -157,6 +158,7 @@ audiofile.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{__libtoolize}
diff --git a/gcc6.patch b/gcc6.patch
new file mode 100644
index 0000000..fbb237c
--- /dev/null
+++ b/gcc6.patch
@@ -0,0 +1,102 @@
+Description: Fix FTBFS with GCC 6
+Author: Michael Schwendt <mschwendt at fedoraproject.org>
+Origin: vendor, https://github.com/mpruett/audiofile/pull/27
+Bug-Debian: https://bugs.debian.org/812055
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+
+--- a/libaudiofile/modules/SimpleModule.h
++++ b/libaudiofile/modules/SimpleModule.h
+@@ -123,7 +123,7 @@ struct signConverter
+ 	typedef typename IntTypes<Format>::UnsignedType UnsignedType;
+ 
+ 	static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
+-	static const int kMinSignedValue = -1 << kScaleBits;
++	static const int kMinSignedValue = 0-(1U<<kScaleBits);
+ 
+ 	struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
+ 	{
+--- a/test/FloatToInt.cpp
++++ b/test/FloatToInt.cpp
+@@ -115,7 +115,7 @@ TEST_F(FloatToIntTest, Int16)
+ 		EXPECT_EQ(readData[i], expectedData[i]);
+ }
+ 
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = 0-(1U<<23);
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+ 
+ TEST_F(FloatToIntTest, Int24)
+--- a/test/IntToFloat.cpp
++++ b/test/IntToFloat.cpp
+@@ -117,7 +117,7 @@ TEST_F(IntToFloatTest, Int16)
+ 		EXPECT_EQ(readData[i], expectedData[i]);
+ }
+ 
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = 0-(1U<<23);
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+ 
+ TEST_F(IntToFloatTest, Int24)
+--- a/test/NeXT.cpp
++++ b/test/NeXT.cpp
+@@ -37,13 +37,13 @@
+ 
+ #include "TestUtilities.h"
+ 
+-const char kDataUnspecifiedLength[] =
++const signed char kDataUnspecifiedLength[] =
+ {
+ 	'.', 's', 'n', 'd',
+ 	0, 0, 0, 24, // offset of 24 bytes
+-	0xff, 0xff, 0xff, 0xff, // unspecified length
++	-1, -1, -1, -1, // unspecified length
+ 	0, 0, 0, 3, // 16-bit linear
+-	0, 0, 172, 68, // 44100 Hz
++	0, 0, -84, 68, // 44100 Hz (0xAC44)
+ 	0, 0, 0, 1, // 1 channel
+ 	0, 1,
+ 	0, 1,
+@@ -57,13 +57,13 @@ const char kDataUnspecifiedLength[] =
+ 	0, 55
+ };
+ 
+-const char kDataTruncated[] =
++const signed char kDataTruncated[] =
+ {
+ 	'.', 's', 'n', 'd',
+ 	0, 0, 0, 24, // offset of 24 bytes
+ 	0, 0, 0, 20, // length of 20 bytes
+ 	0, 0, 0, 3, // 16-bit linear
+-	0, 0, 172, 68, // 44100 Hz
++	0, 0, -84, 68, // 44100 Hz (0xAC44)
+ 	0, 0, 0, 1, // 1 channel
+ 	0, 1,
+ 	0, 1,
+@@ -152,13 +152,13 @@ TEST(NeXT, Truncated)
+ 	ASSERT_EQ(::unlink(testFileName.c_str()), 0);
+ }
+ 
+-const char kDataZeroChannels[] =
++const signed char kDataZeroChannels[] =
+ {
+ 	'.', 's', 'n', 'd',
+ 	0, 0, 0, 24, // offset of 24 bytes
+ 	0, 0, 0, 2, // 2 bytes
+ 	0, 0, 0, 3, // 16-bit linear
+-	0, 0, 172, 68, // 44100 Hz
++	0, 0, -84, 68, // 44100 Hz (0xAC44)
+ 	0, 0, 0, 0, // 0 channels
+ 	0, 1
+ };
+--- a/test/Sign.cpp
++++ b/test/Sign.cpp
+@@ -116,7 +116,7 @@ TEST_F(SignConversionTest, Int16)
+ 		EXPECT_EQ(readData[i], expectedData[i]);
+ }
+ 
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = 0-(1U<<23);
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+ static const uint32_t kMaxUInt24 = (1<<24) - 1;
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/audiofile.git/commitdiff/8a53b99cb5c40db7c9cbcdaeaa0abb1c79e701a3



More information about the pld-cvs-commit mailing list