diff --git a/.gitignore b/.gitignore index e69de29..ceff8bf 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/qm-dsp-1.7.tar.gz diff --git a/qm-dsp-cxx-build.patch b/qm-dsp-cxx-build.patch new file mode 100644 index 0000000..3a80b1b --- /dev/null +++ b/qm-dsp-cxx-build.patch @@ -0,0 +1,34 @@ +Fix build with gcc 4.6 + +diff -r 410f9e18a249 -r 915365c58758 build/linux/Makefile.linux +--- a/build/linux/Makefile.linux Fri Oct 14 09:41:38 2011 +0100 ++++ b/build/linux/Makefile.linux Fri Oct 14 09:48:47 2011 +0100 +@@ -1,5 +1,5 @@ + +-CFLAGS := -DNDEBUG -O3 -fno-exceptions -fPIC -ffast-math -msse -mfpmath=sse -ftree-vectorize -fomit-frame-pointer -DUSE_PTHREADS ++CFLAGS := -DNDEBUG -O3 -fno-exceptions -fPIC -ffast-math -msse -mfpmath=sse -ftree-vectorize -fomit-frame-pointer -DUSE_PTHREADS -I./include + CXXFLAGS := $(CFLAGS) + + include build/general/Makefile.inc +diff -r 410f9e18a249 -r 915365c58758 dsp/tempotracking/DownBeat.h +--- a/dsp/tempotracking/DownBeat.h Fri Oct 14 09:41:38 2011 +0100 ++++ b/dsp/tempotracking/DownBeat.h Fri Oct 14 09:48:47 2011 +0100 +@@ -17,6 +17,7 @@ + #define DOWNBEAT_H + + #include ++#include + + #include "dsp/rateconversion/Decimator.h" + +diff -r 410f9e18a249 -r 915365c58758 dsp/tempotracking/TempoTrackV2.h +--- a/dsp/tempotracking/TempoTrackV2.h Fri Oct 14 09:41:38 2011 +0100 ++++ b/dsp/tempotracking/TempoTrackV2.h Fri Oct 14 09:48:47 2011 +0100 +@@ -18,6 +18,7 @@ + #define TEMPOTRACKV2_H + + #include ++#include + + using std::vector; + diff --git a/qm-dsp-flags.patch b/qm-dsp-flags.patch new file mode 100644 index 0000000..abebd1d --- /dev/null +++ b/qm-dsp-flags.patch @@ -0,0 +1,27 @@ +Build flags and not using internal lapack headers. + +diff --git a/build/linux/Makefile.linux b/build/linux/Makefile.linux +index 5f2b331..a60a4ee 100644 +--- a/build/linux/Makefile.linux ++++ b/build/linux/Makefile.linux +@@ -1,6 +1,7 @@ + +-CFLAGS := -DNDEBUG -O3 -fno-exceptions -fPIC -ffast-math -msse -mfpmath=sse -ftree-vectorize -fomit-frame-pointer -DUSE_PTHREADS -I./include ++CFLAGS := -DNDEBUG -fno-exceptions -fPIC -ffast-math -ftree-vectorize -fomit-frame-pointer -DUSE_PTHREADS $(CFLAGS) + CXXFLAGS := $(CFLAGS) ++LDFLAGS := $(LDFLAGS) + + include build/general/Makefile.inc + +diff --git a/build/linux/Makefile.linux64 b/build/linux/Makefile.linux64 +deleted file mode 100644 +index b5460d4..0000000 +--- a/build/linux/Makefile.linux64 ++++ /dev/null +@@ -1,6 +0,0 @@ +- +-CFLAGS := -DNDEBUG -O3 -fno-exceptions -fPIC -ffast-math -msse -mfpmath=sse -ftree-vectorize -fomit-frame-pointer -DUSE_PTHREADS -Ibuild/linux/amd64 +-CXXFLAGS := $(CFLAGS) +- +-include build/general/Makefile.inc +- diff --git a/qm-dsp-install.patch b/qm-dsp-install.patch new file mode 100644 index 0000000..495e8be --- /dev/null +++ b/qm-dsp-install.patch @@ -0,0 +1,35 @@ +Install header files and static library, add missing header. + +diff --git a/build/general/Makefile.inc b/build/general/Makefile.inc +index 77d4b65..e887471 100644 +--- a/build/general/Makefile.inc ++++ b/build/general/Makefile.inc +@@ -4,6 +4,7 @@ CXX ?= g++ + CC ?= gcc + AR ?= ar + RANLIB ?= ranlib ++INSTALL ?= install -p + + CFLAGS := $(CFLAGS) -I. + CXXFLAGS := $(CXXFLAGS) -I. +@@ -42,6 +43,7 @@ HEADERS := base/Pitch.h \ + maths/KLDivergence.h \ + maths/MathAliases.h \ + maths/MathUtilities.h \ ++ maths/nan-inf.h \ + maths/Polyfit.h \ + maths/pca/pca.h \ + thread/AsynchronousTask.h \ +@@ -89,6 +91,12 @@ $(LIBRARY): $(OBJECTS) + $(AR) cr $@ $^ + $(RANLIB) $@ + ++install: ++ $(INSTALL) -D -m 0644 $(LIBRARY) $(DESTDIR)$(LIBDIR)/$(LIBRARY) ++ for h in $(HEADERS); do \ ++ $(INSTALL) -D -m 0644 $$h $(DESTDIR)$(PREFIX)/include/qm-dsp/$$h; \ ++ done ++ + clean: + rm $(OBJECTS) + diff --git a/qm-dsp.spec b/qm-dsp.spec new file mode 100644 index 0000000..d7e861e --- /dev/null +++ b/qm-dsp.spec @@ -0,0 +1,81 @@ +# debuginfo not supported for static libraries, RB #209316 +%global debug_package %{nil} + +Name: qm-dsp +Version: 1.7 +Release: 2%{?dist} +Summary: Library for DSP and Music Informatics purposes + +# some source files with different original licenses, see README.txt +License: GPLv2+ +URL: http://isophonics.net/QMVampPlugins +Source0: https://code.soundsoftware.ac.uk/attachments/download/103/%{name}-%{version}.tar.gz +# C++ build fix +# https://code.soundsoftware.ac.uk/projects/qm-dsp/repository/revisions/915365c58758 +Patch0: qm-dsp-cxx-build.patch +# build flags +# (not intended for upstream) +Patch1: qm-dsp-flags.patch +# install header files +# http://vamp-plugins.org/forum/index.php/topic,270.0.html +Patch2: qm-dsp-install.patch + +BuildRequires: atlas-devel + +%description +%{name} is a C++ library of functions for DSP and Music Informatics purposes +developed at Queen Mary, University of London. It is used by the QM Vamp +Plugins (q.v.) among other things. + + +%package devel +Summary: %{summary} +Provides: %{name}-static = %{version}-%{release} + +%description devel +%{name} is a C++ library of functions for DSP and Music Informatics purposes +developed at Queen Mary, University of London. It is used by the QM Vamp +Plugins (q.v.) among other things. + +This package contains header files and static library for development with +qm-dsp. + + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +ln -s build/linux/Makefile.linux Makefile + + +%build +# extra cflags used in upstream +%ifarch %{ix86} +EXTRA_CFLAGS="-msse -mfpmath=sse" +%endif +%ifarch x86_64 +EXTRA_CFLAGS="-msse -msse2 -mfpmath=sse" +%endif + +CFLAGS="$EXTRA_CFLAGS %{?optflags}" \ +LDFLAGS="%{?__global_ldflags}" \ +make %{?_smp_mflags} + + +%install +make install DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} + + +%files devel +%doc COPYING README.txt +%{_libdir}/libqm-dsp.a +%{_includedir}/%{name} + + +%changelog +* Wed Nov 05 2014 František Dvořák - 1.7-2 +- Update patches and add comments + +* Sun Aug 3 2014 František Dvořák - 1.7-1 +- Initial package diff --git a/sources b/sources index e69de29..9b505c1 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +d167a1477ab40cc3df965ed338dcd6a5 qm-dsp-1.7.tar.gz