libsndfile: bump to 1.0.31 (#5776)

* libsndfile: bump to 1.0.31

* libsndfile: switch to cmake build system

* libsndfile: minor updates to recipe
This commit is contained in:
Robert Kausch
2021-03-12 17:18:13 +01:00
committed by GitHub
parent 2bced9399f
commit dc48d06a69
3 changed files with 15 additions and 122 deletions

View File

@@ -1,13 +1,12 @@
SUMMARY="C library for reading and writing of sampled sound"
DESCRIPTION="libsndfile is a library of C routines for reading and writing \
files containing sampled audio data."
HOMEPAGE="http://www.mega-nerd.com/libsndfile"
COPYRIGHT="1999-2011 Erik de Castro Lopo"
HOMEPAGE="http://libsndfile.github.io/libsndfile/"
COPYRIGHT="1999-2021 Erik de Castro Lopo"
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="http://www.mega-nerd.com/libsndfile/files/libsndfile-$portVersion.tar.gz"
CHECKSUM_SHA256="1ff33929f042fa333aed1e8923aa628c3ee9e1eb85512686c55092d1e5a9dfa9"
PATCHES="libsndfile-$portVersion.patchset"
SOURCE_URI="https://github.com/libsndfile/libsndfile/releases/download/$portVersion/libsndfile-$portVersion.tar.bz2"
CHECKSUM_SHA256="a8cfb1c09ea6e90eff4ca87322d4168cdbe5035cb48717b40bf77e751cc02163"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"
@@ -23,7 +22,6 @@ PROVIDES="
cmd:sndfile_metadata_get$secondaryArchSuffix
cmd:sndfile_metadata_set$secondaryArchSuffix
cmd:sndfile_play$secondaryArchSuffix
cmd:sndfile_regtest$secondaryArchSuffix
cmd:sndfile_salvage$secondaryArchSuffix
lib:libsndfile$secondaryArchSuffix = $portVersion compat >= 1
"
@@ -31,6 +29,8 @@ REQUIRES="
haiku$secondaryArchSuffix
lib:libflac$secondaryArchSuffix
lib:libogg$secondaryArchSuffix
lib:libopus$secondaryArchSuffix
lib:libspeex$secondaryArchSuffix
lib:libvorbis$secondaryArchSuffix
"
@@ -41,39 +41,36 @@ PROVIDES_devel="
REQUIRES_devel="
libsndfile$secondaryArchSuffix == $portVersion base
devel:libflac$secondaryArchSuffix
devel:libopus$secondaryArchSuffix
devel:libspeex$secondaryArchSuffix
devel:libvorbis$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
# libsndfile requires flac 1.3.1 but the soname is the same as 1.3.0...
flac${secondaryArchSuffix}_devel >= 1.3.1
devel:libflac$secondaryArchSuffix
devel:libogg$secondaryArchSuffix
devel:libopus$secondaryArchSuffix
devel:libspeex$secondaryArchSuffix
devel:libvorbis$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:automake
cmd:find
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:python3
"
BUILD()
{
libtoolize --force --copy --install
aclocal -I M4
autoconf
automake
if [ $effectiveTargetArchitecture = x86_gcc2 ]; then
export CFLAGS=-O1
fi
runConfigure ./configure
cmake $cmakeDirArgs \
-DBUILD_SHARED_LIBS=TRUE \
.
make $jobArgs
}
@@ -81,23 +78,9 @@ INSTALL()
{
make install
# remove libtool library files
rm $libDir/libsndfile.la
prepareInstalledDevelLibs libsndfile
fixPkgconfig
# The pkgconfig files reference other libraries using the wrong paths, which
# creates a lot of confusion. Fix them so correct paths are used.
local develPackageName="${portName}_devel-$portFullVersion"
local packageLinksDir=$(dirname $portPackageLinksDir)
local linksDir="$packageLinksDir/${develPackageName}/devel~libflac$secondaryArchSuffix/$relativeDevelopLibDir"
sed -i -e "s,^\(Libs.private.*\)-L.* \(-lFLAC.*\)$,\1-L$linksDir \2," \
$developLibDir/pkgconfig/sndfile.pc
linksDir="$packageLinksDir/${develPackageName}/devel~libvorbis$secondaryArchSuffix/$relativeDevelopLibDir"
sed -i -e "s,^\(Libs.private.* -lFLAC .*\) -L.* \(-lvorbis.*\)$,\1-L$linksDir \2," \
$developLibDir/pkgconfig/sndfile.pc
# devel package
packageEntries devel \
$developDir

View File

@@ -1,44 +0,0 @@
diff -Naur libsndfile-1.0.21/programs/Makefile.am libsndfile-1.0.21-haiku/programs/Makefile.am
--- libsndfile-1.0.21/programs/Makefile.am 2009-12-09 10:56:35.001048576 +0000
+++ libsndfile-1.0.21-haiku/programs/Makefile.am 2010-08-09 17:15:51.864813056 +0000
@@ -16,8 +16,8 @@
sndfile_info_SOURCES = sndfile-info.c
sndfile_info_LDADD = $(top_builddir)/src/libsndfile.la
-sndfile_play_SOURCES = sndfile-play.c
-sndfile_play_LDADD = $(top_builddir)/src/libsndfile.la $(OS_SPECIFIC_LINKS) $(ALSA_LIBS)
+sndfile_play_SOURCES = sndfile-play-beos.cpp test-sndfile-metadata-set.py
+sndfile_play_LDADD = $(top_builddir)/src/libsndfile.la $(OS_SPECIFIC_LINKS) $(ALSA_LIBS) -lbe -lmedia
sndfile_convert_SOURCES = sndfile-convert.c common.c common.h
sndfile_convert_LDADD = $(top_builddir)/src/libsndfile.la
diff -Naur libsndfile-1.0.21/programs/sndfile-play-beos.cpp libsndfile-1.0.21-haiku/programs/sndfile-play-beos.cpp
--- libsndfile-1.0.21/programs/sndfile-play-beos.cpp 2009-03-22 19:17:13.066846720 +0000
+++ libsndfile-1.0.21-haiku/programs/sndfile-play-beos.cpp 2010-08-09 16:57:35.000000000 +0000
@@ -30,7 +30,7 @@
** BeOS functions for playing a sound.
*/
-#if defined (__BEOS__)
+#if defined(__BEOS__) || defined(__HAIKU__)
struct shared_data
{
@@ -60,7 +60,7 @@
{ for (m = readcount ; m < count ; m++)
buffer [m] = 0 ;
}
- if (data->sfinfo.pcmbitwidth < 16)
+ if (readcount > count)
{ for (m = 0 ; m < count ; m++)
buffer [m] *= 256 ;
}
@@ -78,7 +78,7 @@
for (k = 1 ; k < argc ; k++)
{ printf ("Playing %s\n", argv [k]) ;
- if (! (data.sndfile = sf_open_read (argv [k], &data.sfinfo)))
+ if (! (data.sndfile = sf_open (argv [k], SFM_READ, &data.sfinfo)))
{ sf_perror (NULL) ;
continue ;
} ;

View File

@@ -1,46 +0,0 @@
From 0dbcc82d33d7ea41b14dadec906ce0d0081c2c2d Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 20 May 2014 16:43:24 +0000
Subject: haiku patch
diff --git a/src/sndfile.h.in b/src/sndfile.h.in
index 985cc7d..ecb3d16 100644
--- a/src/sndfile.h.in
+++ b/src/sndfile.h.in
@@ -29,6 +29,7 @@
/* This is the version 1.0.X header file. */
#define SNDFILE_1
+#include <stdint.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
--
2.2.2
From 16d8db8eb7e838b393d6e518c014985466fa4a60 Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Sun, 8 Jun 2014 17:05:44 +0200
Subject: Fix documentation path
diff --git a/configure.ac b/configure.ac
index ef14780..daf76cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -482,6 +482,10 @@ if test x"$ac_cv_prog_HAVE_AUTOGEN" = "xno" ; then
#====================================================================================
# Settings for the HTML documentation.
+if test $host_os = "haiku" ; then
+ htmldocdir=$prefix/documentation/packages/libsndfile
+fi
+
if test x$enable_bow_docs = "xyes" ; then
HTML_BGCOLOUR="white"
HTML_FGCOLOUR="black"
--
2.2.2