rubberband: add recipe for version 1.8.1.

* disabled mlock() and co.
This commit is contained in:
Jerome Duval
2016-08-02 22:23:00 +02:00
parent 5e0e0304f8
commit 1b071a3594
2 changed files with 139 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
From 441f6f21603ba14785ebd49bb51b446363592fd3 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 1 Aug 2016 23:49:39 +0000
Subject: Haiku patch
diff --git a/Makefile.in b/Makefile.in
index 413d075..d92019f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -2,7 +2,7 @@
CXX := @CXX@
CXXFLAGS := -DHAVE_LIBSAMPLERATE -DHAVE_FFTW3 -DFFTW_DOUBLE_ONLY -DNO_THREAD_CHECKS -DUSE_PTHREADS -DNO_TIMING -DNDEBUG @CXXFLAGS@ @SRC_CFLAGS@ @SNDFILE_CFLAGS@ @FFTW_CFLAGS@ @Vamp_CFLAGS@ -Irubberband -I. -Isrc $(OPTFLAGS)
CFLAGS := @CFLAGS@ $(OPTFLAGS)
-LDFLAGS := @LDFLAGS@ -lpthread $(LDFLAGS)
+LDFLAGS := @LDFLAGS@ @LIBPTHREAD@ $(LDFLAGS)
LIBRARY_LIBS := @SRC_LIBS@ @FFTW_LIBS@
PROGRAM_LIBS := @SNDFILE_LIBS@ $(LIBRARY_LIBS)
diff --git a/configure.ac b/configure.ac
index 1339294..1dadebd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,6 +6,10 @@ AC_PROG_CXX
AC_HEADER_STDC
AC_C_BIGENDIAN
+AC_CHECK_LIB([pthread], [pthread_create], [LIBPTHREAD="-lpthread"],
+ [LIBPTHREAD=""])
+AC_SUBST(LIBPTHREAD)
+
PKG_CHECK_MODULES([SRC],[samplerate])
AC_SUBST(SRC_CFLAGS)
AC_SUBST(SRC_LIBS)
diff --git a/src/system/sysutils.h b/src/system/sysutils.h
index 371736b..1c66999 100644
--- a/src/system/sysutils.h
+++ b/src/system/sysutils.h
@@ -135,9 +135,15 @@ extern void system_memorybarrier();
#include <dlfcn.h>
#include <stdio.h>
+#ifdef __HAIKU__
+#define MLOCK(a,b) (0)
+#define MUNLOCK(a,b) (0)
+#define MUNLOCK_SAMPLEBLOCK(a) do { ; } while(0);
+#else
#define MLOCK(a,b) ::mlock((char *)(a),(b))
#define MUNLOCK(a,b) (::munlock((char *)(a),(b)) ? (::perror("munlock failed"), 0) : 0)
#define MUNLOCK_SAMPLEBLOCK(a) do { if (!(a).empty()) { const float &b = *(a).begin(); MUNLOCK(&b, (a).capacity() * sizeof(float)); } } while(0);
+#endif
#ifdef __APPLE__
#include <libkern/OSAtomic.h>
--
2.7.0

View File

@@ -0,0 +1,82 @@
SUMMARY="An audio time-stretching and pitch-shifting library"
DESCRIPTION="Rubber Band is a library and utility program that permits \
changing the tempo and pitch of an audio recording independently of one \
another."
HOMEPAGE="http://www.breakfastquay.com/rubberband/"
COPYRIGHT="2007-2012 Particular Programs Ltd"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="http://code.breakfastquay.com/attachments/download/34/rubberband-$portVersion.tar.bz2"
CHECKSUM_SHA256="ff0c63b0b5ce41f937a8a3bc560f27918c5fe0b90c6bc1cb70829b86ada82b75"
PATCHES="rubberband-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
rubberband$secondaryArchSuffix = $portVersion
cmd:rubberband
lib:librubberband$secondaryArchSuffix = 2.1.0 compat >= 2
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libfftw3$secondaryArchSuffix
lib:libsamplerate$secondaryArchSuffix
lib:libsndfile$secondaryArchSuffix
lib:libvamp_sdk$secondaryArchSuffix
"
PROVIDES_devel="
rubberband${secondaryArchSuffix}_devel = $portVersion
devel:librubberband$secondaryArchSuffix = 2.1.0 compat >= 2
"
REQUIRES_devel="
rubberband$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libfftw3$secondaryArchSuffix
devel:libsamplerate$secondaryArchSuffix
devel:libsndfile$secondaryArchSuffix
devel:libvamp_sdk$secondaryArchSuffix
ladspa_sdk${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:automake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
autoreconf -fi
runConfigure ./configure
make $jobArgs
}
INSTALL()
{
make install
mkdir -p $(dirname $includeDir) $dataDir
mv $prefix/include $includeDir
mv $prefix/share/ladspa $dataDir
prepareInstalledDevelLibs librubberband
fixPkgconfig
# devel package
packageEntries devel \
$developDir
}
TEST()
{
make check
}