1SUMMARY="An audio time-stretching and pitch-shifting library"
2DESCRIPTION="Rubber Band is a library and utility program that permits \
3changing the tempo and pitch of an audio recording independently of one \
4another."
5HOMEPAGE="https://www.breakfastquay.com/rubberband/"
6COPYRIGHT="2007-2018 Particular Programs Ltd"
7LICENSE="GNU GPL v2"
8REVISION="2"
9SOURCE_URI="https://breakfastquay.com/files/releases/rubberband-$portVersion.tar.bz2"
10CHECKSUM_SHA256="86bed06b7115b64441d32ae53634fcc0539a50b9b648ef87443f936782f6c3ca"
11PATCHES="rubberband-$portVersion.patchset"
12
13ARCHITECTURES="all !x86_gcc2"
14SECONDARY_ARCHITECTURES="x86"
15
16commandSuffix=$secondaryArchSuffix
17commandBinDir=$binDir
18relativeCommandBinDir=$relativeBinDir
19if [ "$targetArchitecture" = x86_gcc2 ]; then
20	commandSuffix=
21	commandBinDir=$prefix/bin
22	relativeCommandBinDir=bin
23fi
24
25libVersion="2.1.1"
26libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
27
28PROVIDES="
29	rubberband$secondaryArchSuffix = $portVersion
30	cmd:rubberband$commandSuffix = $portVersion
31	lib:librubberband$secondaryArchSuffix = $libVersionCompat
32	"
33REQUIRES="
34	haiku$secondaryArchSuffix
35	lib:libfftw3$secondaryArchSuffix
36	lib:libsamplerate$secondaryArchSuffix
37	lib:libsndfile$secondaryArchSuffix
38	lib:libvamp_sdk$secondaryArchSuffix
39	"
40
41PROVIDES_devel="
42	rubberband${secondaryArchSuffix}_devel = $portVersion
43	devel:librubberband$secondaryArchSuffix = $libVersionCompat
44	"
45REQUIRES_devel="
46	rubberband$secondaryArchSuffix == $portVersion base
47	"
48
49BUILD_REQUIRES="
50	haiku${secondaryArchSuffix}_devel
51	devel:libfftw3$secondaryArchSuffix
52	devel:libsamplerate$secondaryArchSuffix
53	devel:libsndfile$secondaryArchSuffix
54	devel:libvamp_sdk$secondaryArchSuffix
55	ladspa_sdk${secondaryArchSuffix}_devel
56	"
57BUILD_PREREQUIRES="
58	cmd:aclocal
59	cmd:autoconf
60	cmd:automake
61	cmd:gcc$secondaryArchSuffix
62	cmd:ld$secondaryArchSuffix
63	cmd:libtoolize$secondaryArchSuffix
64	cmd:make
65	cmd:pkg_config$secondaryArchSuffix
66	"
67
68defineDebugInfoPackage rubberband$secondaryArchSuffix \
69	"$commandBinDir"/rubberband \
70	"$libDir"/librubberband.so.$libVersion \
71	"$libDir"/ladspa/ladspa-rubberband.so \
72	"$libDir"/vamp/vamp-rubberband.so \
73
74PATCH()
75{
76	# Don't try to install $(JNI_TARGET) if it was not built.
77	# (It can't be built without javac.)
78	sed -i \
79		-e "s/cp -f \(\$(JNI_TARGET)\) \$(DESTDIR).*/@[ -f \1 ] \&\& & || true/;" \
80		-e "/^INSTALL_BINDIR/ s|\(\$(PREFIX)/\)bin$|\1$relativeCommandBinDir|;" \
81		-e "/^INSTALL_INCDIR/ s|\(\$(PREFIX)/\)include/|\1$relativeIncludeDir/|;" \
82		-e "/^INSTALL_LRDFDIR/ s|\(\$(PREFIX)/\)share/|\1$relativeDataDir/|;" \
83		-e "/^INSTALL_/ s|\(\$(PREFIX)/\)lib|\1$relativeLibDir|;" \
84		Makefile.in
85}
86
87BUILD()
88{
89	autoreconf -fi
90	runConfigure --omit-dirs binDir ./configure --bindir=$commandBinDir
91	make $jobArgs
92}
93
94INSTALL()
95{
96	make install
97
98	# remove static library
99	rm -f $libDir/librubberband.a
100
101	prepareInstalledDevelLibs librubberband
102	fixPkgconfig
103
104	# devel package
105	packageEntries devel \
106		$developDir
107}
108
109TEST()
110{
111	bin/rubberband --version
112}
113