Continuing to use the autotools build instead of new CMake

https://gitlab.com/soundtouch/soundtouch/-/issues/45
This commit is contained in:
Sérgio M. Basto 2021-08-31 22:36:19 +01:00
parent b7c49ac115
commit 94bd6dc031
2 changed files with 42 additions and 7 deletions

13
configure.ac.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/configure.ac b/configure.ac
index c15e348..06ac3e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,7 +33,7 @@ AC_LANG(C++)
# Compiler flags. Apply -ffast-math to allow gcc autovectorization
# generate effective SIMD code.
-CXXFLAGS="-O3 -ffast-math"
+CXXFLAGS+=" -O3 -ffast-math"
# Set AR_FLAGS to avoid build warning "ar: `u' modifier ignored since `D' is the default (see `U')"
AR_FLAGS='cr'

View File

@ -1,13 +1,14 @@
Name: soundtouch
Version: 2.3.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Audio Processing library for changing Tempo, Pitch and Playback Rates
License: LGPLv2+
URL: http://www.surina.net/soundtouch/
Source0: https://gitlab.com/soundtouch/soundtouch/-/archive/%{version}/%{name}-%{version}.tar.gz
Patch0: soname.patch
BuildRequires: make
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: autoconf automake libtool
Patch0: configure.ac.patch
%description
SoundTouch is a LGPL-licensed open-source audio processing library for
@ -32,15 +33,32 @@ Libraries, include files, etc you can use to develop soundtouch applications.
%prep
%autosetup -p1
autoreconf -iv
# Remove -O3 because we have our default optimizations.
sed -i 's|-O3||' source/SoundTouch/Makefile.*
sed -i 's|-O3||' source/SoundStretch/Makefile.*
# set correct version for .so build
%define ltversion %(echo %{version} | tr '.' ':')
sed -i 's/-rpath $(libdir)/-rpath $(libdir) -version-number %{ltversion}/' \
source/SoundTouch/Makefile.in
# cleanup a bit
sed -i 's|\r||g' README.html source/SoundTouch/RateTransposer.cpp
%build
%cmake
%cmake_build
%configure --disable-dependency-tracking --disable-static --enable-shared
# Don't use rpath!
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_build
%install
%cmake_install
%make_install
rm %{buildroot}%{_libdir}/*.la
# remove redundant installed docs
rm -rf %{buildroot}%{_docdir}/%{name}
# pkgconfig compat links for compat with older (API compatible) releases
# dunno why upstream keeps changing the pkgconfig name
@ -65,10 +83,14 @@ ln -s soundtouch.pc %{buildroot}%{_libdir}/pkgconfig/soundtouch-1.0.pc
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/%{name}
%{_libdir}/cmake/SoundTouch
%{_datadir}/aclocal/%{name}.m4
%changelog
* Tue Aug 31 2021 Sérgio Basto <sergio@serjux.com> - 2.3.0-2
- Continuing to use the autotools build instead of new CMake
https://gitlab.com/soundtouch/soundtouch/-/issues/45
* Sun Aug 29 2021 Sérgio Basto <sergio@serjux.com> - 2.3.0-1
- Update to 2.3.0 (#1998849)