From 1b071a359456244b39bccef78f6ca4ca372d4a32 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Tue, 2 Aug 2016 22:23:00 +0200 Subject: [PATCH] rubberband: add recipe for version 1.8.1. * disabled mlock() and co. --- .../patches/rubberband-1.8.1.patchset | 57 +++++++++++++ media-libs/rubberband/rubberband-1.8.1.recipe | 82 +++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 media-libs/rubberband/patches/rubberband-1.8.1.patchset create mode 100644 media-libs/rubberband/rubberband-1.8.1.recipe diff --git a/media-libs/rubberband/patches/rubberband-1.8.1.patchset b/media-libs/rubberband/patches/rubberband-1.8.1.patchset new file mode 100644 index 000000000..79a13db69 --- /dev/null +++ b/media-libs/rubberband/patches/rubberband-1.8.1.patchset @@ -0,0 +1,57 @@ +From 441f6f21603ba14785ebd49bb51b446363592fd3 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +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 + #include + ++#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 +-- +2.7.0 + diff --git a/media-libs/rubberband/rubberband-1.8.1.recipe b/media-libs/rubberband/rubberband-1.8.1.recipe new file mode 100644 index 000000000..f57b681bd --- /dev/null +++ b/media-libs/rubberband/rubberband-1.8.1.recipe @@ -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 +}