flac: bump to 1.4.2 (#7292)

- update patchset to maintain GCC 2.95 compatibility (variables not declared at the top of blocks)
- attention: SONAME change
- Keep FLAC 1.3.4 recipe for compatibility
This commit is contained in:
Robert Kausch
2022-11-05 09:50:26 +01:00
committed by GitHub
parent 74e1a73a57
commit 3ca7810ba2
3 changed files with 170 additions and 11 deletions

View File

@@ -12,7 +12,7 @@ LICENSE="GNU LGPL v2.1
BSD (3-clause)"
REVISION="1"
SOURCE_URI="http://downloads.xiph.org/releases/flac/flac-$portVersion.tar.xz"
CHECKSUM_SHA256="8ff0607e75a322dd7cd6ec48f4f225471404ae2730d0ea945127b1355155e737"
CHECKSUM_SHA256="e322d58a1f48d23d9dd38f432672865f6f79e73a6f9cc5a5f57fcaa83eb5a8e4"
PATCHES="flac-$portVersion.patchset"
ARCHITECTURES="all"
@@ -20,8 +20,8 @@ SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PROVIDES="
flac$secondaryArchSuffix = $portVersion compat >= 1
lib:libFLAC$secondaryArchSuffix = 8.3.0 compat >= 8
lib:libFLAC++$secondaryArchSuffix = 6.3.0 compat >= 6
lib:libFLAC$secondaryArchSuffix = 12.0.0 compat >= 12
lib:libFLAC++$secondaryArchSuffix = 10.0.0 compat >= 10
"
if [ -z "$secondaryArchSuffix" ]; then
PROVIDES="$PROVIDES
@@ -37,8 +37,8 @@ REQUIRES="
PROVIDES_devel="
flac${secondaryArchSuffix}_devel = $portVersion compat >= 1
devel:libFLAC$secondaryArchSuffix = 8.3.0 compat >= 8
devel:libFLAC++$secondaryArchSuffix = 6.3.0 compat >= 6
devel:libFLAC$secondaryArchSuffix = 12.0.0 compat >= 12
devel:libFLAC++$secondaryArchSuffix = 10.0.0 compat >= 10
"
REQUIRES_devel="
flac$secondaryArchSuffix == $portVersion base
@@ -53,7 +53,6 @@ BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:nasm
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
"
@@ -64,17 +63,16 @@ TEST_REQUIRES="
BUILD()
{
cmake -S. -Bbuilddir -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_SHARED_LIBS=ON \
-DWITH_STACK_PROTECTOR=OFF \
$cmakeDirArgs
echo "#include <inttypes.h>" >> builddir/config.h
cmake --build builddir $jobArgs
ninja -C builddir $jobArgs
}
INSTALL()
{
cmake --install builddir
ninja -C builddir install
install -Dm 644 src/*/*.m4 -t $dataDir/aclocal
@@ -92,5 +90,5 @@ INSTALL()
TEST()
{
FLAC__TEST_LEVEL=0 cmake --build build --target test
FLAC__TEST_LEVEL=0 ninja -C builddir test
}

View File

@@ -0,0 +1,72 @@
SUMMARY="The free lossless audio codec"
DESCRIPTION="FLAC stands for Free Lossless Audio Codec, an audio format \
similar to MP3, but lossless, meaning that audio is compressed in FLAC \
without any loss in quality. This is similar to how Zip works, except with \
FLAC you will get much better compression because it is designed specifically \
for audio, and you can play back compressed FLAC files in your favorite player \
(or your car or home stereo) just like you would an MP3 file."
HOMEPAGE="http://flac.sourceforge.net/"
COPYRIGHT="2000-2007 Josh Coalson"
LICENSE="GNU LGPL v2.1
GNU GPL v2
BSD (3-clause)"
REVISION="1"
SOURCE_URI="http://downloads.xiph.org/releases/flac/flac-$portVersion.tar.xz"
CHECKSUM_SHA256="8ff0607e75a322dd7cd6ec48f4f225471404ae2730d0ea945127b1355155e737"
SOURCE_DIR="flac-$portVersion"
PATCHES="flac-$portVersion.patchset"
ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PROVIDES="
flac13$secondaryArchSuffix = $portVersion compat >= 1
lib:libFLAC$secondaryArchSuffix = 8.3.0 compat >= 8
lib:libFLAC++$secondaryArchSuffix = 6.3.0 compat >= 6
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libogg$secondaryArchSuffix
lib:libstdc++$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libogg$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:nasm
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cmake -S. -Bbuilddir -GNinja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_PROGRAMS=OFF \
-DINSTALL_MANPAGES=OFF \
-DWITH_STACK_PROTECTOR=OFF \
$cmakeDirArgs
ninja -C builddir $jobArgs
}
INSTALL()
{
ninja -C builddir install
install -Dm 644 src/*/*.m4 -t $dataDir/aclocal
if [ -n "$secondaryArchSuffix" ]; then
rm -rf $binDir $documentationDir
fi
prepareInstalledDevelLibs libFLAC libFLAC++
fixPkgconfig
rm -rf $dataDir $developDir
}

View File

@@ -0,0 +1,89 @@
From c3238b4cd6aac6442534ba2f219312d9c45d5db9 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 26 Aug 2017 11:50:31 +0200
Subject: gcc2 fixes
diff --git a/include/FLAC++/decoder.h b/include/FLAC++/decoder.h
index fee6a3b..c1fbb13 100644
--- a/include/FLAC++/decoder.h
+++ b/include/FLAC++/decoder.h
@@ -225,11 +225,15 @@ namespace FLAC {
File();
virtual ~File();
+#if __GNUC__ > 2
using Stream::init;
+#endif
virtual ::FLAC__StreamDecoderInitStatus init(FILE *file); ///< See FLAC__stream_decoder_init_FILE()
virtual ::FLAC__StreamDecoderInitStatus init(const char *filename); ///< See FLAC__stream_decoder_init_file()
virtual ::FLAC__StreamDecoderInitStatus init(const std::string &filename); ///< See FLAC__stream_decoder_init_file()
+#if __GNUC__ > 2
using Stream::init_ogg;
+#endif
virtual ::FLAC__StreamDecoderInitStatus init_ogg(FILE *file); ///< See FLAC__stream_decoder_init_ogg_FILE()
virtual ::FLAC__StreamDecoderInitStatus init_ogg(const char *filename); ///< See FLAC__stream_decoder_init_ogg_file()
virtual ::FLAC__StreamDecoderInitStatus init_ogg(const std::string &filename); ///< See FLAC__stream_decoder_init_ogg_file()
diff --git a/include/FLAC++/encoder.h b/include/FLAC++/encoder.h
index acd5230..8ec88b5 100644
--- a/include/FLAC++/encoder.h
+++ b/include/FLAC++/encoder.h
@@ -237,11 +237,15 @@ namespace FLAC {
File();
virtual ~File();
+#if __GNUC__ > 2
using Stream::init;
+#endif
virtual ::FLAC__StreamEncoderInitStatus init(FILE *file); ///< See FLAC__stream_encoder_init_FILE()
virtual ::FLAC__StreamEncoderInitStatus init(const char *filename); ///< See FLAC__stream_encoder_init_file()
virtual ::FLAC__StreamEncoderInitStatus init(const std::string &filename); ///< See FLAC__stream_encoder_init_file()
+#if __GNUC__ > 2
using Stream::init_ogg;
+#endif
virtual ::FLAC__StreamEncoderInitStatus init_ogg(FILE *file); ///< See FLAC__stream_encoder_init_ogg_FILE()
virtual ::FLAC__StreamEncoderInitStatus init_ogg(const char *filename); ///< See FLAC__stream_encoder_init_ogg_file()
virtual ::FLAC__StreamEncoderInitStatus init_ogg(const std::string &filename); ///< See FLAC__stream_encoder_init_ogg_file()
diff --git a/src/libFLAC++/metadata.cpp b/src/libFLAC++/metadata.cpp
index c6dd937..a5af90e 100644
--- a/src/libFLAC++/metadata.cpp
+++ b/src/libFLAC++/metadata.cpp
@@ -827,7 +827,7 @@ namespace FLAC {
clear_field_name();
clear_field_value();
- const char *p = static_cast<const char *>(std::memchr(entry_.entry, '=', entry_.length));
+ const char *p = (const char *)(std::memchr(entry_.entry, '=', entry_.length));
if(0 == p)
p = reinterpret_cast<const char *>(entry_.entry) + entry_.length;
--
2.37.3
From c32963d51b87ec4cbd2e17c5ca93eb5040973862 Mon Sep 17 00:00:00 2001
From: Robert Kausch <robert.kausch@freac.org>
Date: Wed, 12 Oct 2022 15:07:52 +0000
Subject: gcc2 fixes
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ec6e26..64c7b02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -83,11 +83,11 @@ if(NOT WIN32)
endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
- set(CMAKE_C_FLAGS "-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Winline ${CMAKE_C_FLAGS}")
+ set(CMAKE_C_FLAGS "-Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Winline ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG ${CMAKE_C_FLAGS_RELEASE}")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
- set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef ${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "-Wall -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${CMAKE_CXX_FLAGS_RELEASE}")
endif()
if(MSVC)
--
2.37.3