From a08a2f45293c2deec97b77774739c6f9271172f2 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 19:13:23 +0100 Subject: [PATCH] fix build on arm archs; disable static library build [release 0.3.1-2mamba;Thu Sep 01 2022] --- README.md | 2 + ...g-0.3.1-fix-typedefs-on-other-arches.patch | 24 +++++ webrtc-audio-processing.spec | 87 +++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 webrtc-audio-processing-0.3.1-fix-typedefs-on-other-arches.patch create mode 100644 webrtc-audio-processing.spec diff --git a/README.md b/README.md index f74022b..7bd3249 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # webrtc-audio-processing +FreeDesktop implementation of the Audio Processing module from the WebRTC project. + diff --git a/webrtc-audio-processing-0.3.1-fix-typedefs-on-other-arches.patch b/webrtc-audio-processing-0.3.1-fix-typedefs-on-other-arches.patch new file mode 100644 index 0000000..81e5ae5 --- /dev/null +++ b/webrtc-audio-processing-0.3.1-fix-typedefs-on-other-arches.patch @@ -0,0 +1,24 @@ +diff -up webrtc-audio-processing-0.2/webrtc/typedefs.h.typedef webrtc-audio-processing-0.2/webrtc/typedefs.h +--- webrtc-audio-processing-0.2/webrtc/typedefs.h.typedef 2016-05-12 09:08:53.885000410 -0500 ++++ webrtc-audio-processing-0.2/webrtc/typedefs.h 2016-05-12 09:12:38.006851953 -0500 +@@ -48,7 +48,19 @@ + #define WEBRTC_ARCH_32_BITS + #define WEBRTC_ARCH_LITTLE_ENDIAN + #else +-#error Please add support for your architecture in typedefs.h ++/* instead of failing, use typical unix defines... */ ++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ++#define WEBRTC_ARCH_LITTLE_ENDIAN ++#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ++#define WEBRTC_ARCH_BIG_ENDIAN ++#else ++#error __BYTE_ORDER__ is not defined ++#endif ++#if defined(__LP64__) ++#define WEBRTC_ARCH_64_BITS ++#else ++#define WEBRTC_ARCH_32_BITS ++#endif + #endif + + #if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN)) diff --git a/webrtc-audio-processing.spec b/webrtc-audio-processing.spec new file mode 100644 index 0000000..eae895d --- /dev/null +++ b/webrtc-audio-processing.spec @@ -0,0 +1,87 @@ +Name: webrtc-audio-processing +Version: 0.3.1 +Release: 2mamba +Summary: FreeDesktop implementation of the Audio Processing module from the WebRTC project +Group: Applications/Multimedia +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing/ +Source: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing.git/v%{version}/webrtc-audio-processing-%{version}.tar.bz2 +Patch0: webrtc-audio-processing-0.3.1-fix-typedefs-on-other-arches.patch +License: BSD +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libgcc +BuildRequires: libstdc++6-devel +## AUTOBUILDREQ-END +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description +FreeDesktop implementation of the Audio Processing module from the WebRTC project. + +%package -n lib%{name} +Group: System/Libraries +Summary: Shared libraries for %{name} + +%description -n lib%{name} +This package contains shared libraries for %{name}. + +%package -n lib%{name}-devel +Group: Development/Libraries +Summary: Development files for %{name} +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} +Requires: pkg-config + +%description -n lib%{name}-devel +This package contains libraries and header files for developing applications that use %{name}. + +%debug_package + +%prep +%setup -q +%patch0 -p1 -b .fix-typedefs-on-other-arches + +NOCONFIGURE=1 ./autogen.sh + +%build +%configure \ +%ifarch %{arm} aarch64 + --enable-neon=no \ +%endif + --disable-silent-rules \ + --disable-static + +sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -n lib%{name} -p /sbin/ldconfig +%postun -n lib%{name} -p /sbin/ldconfig + +%files -n lib%{name} +%defattr(-,root,root) +%{_libdir}/libwebrtc_audio_processing.so.* +%doc AUTHORS COPYING + +%files -n lib%{name}-devel +%defattr(-,root,root) +%dir %{_includedir}/webrtc_audio_processing +%{_includedir}/webrtc_audio_processing/* +%{_libdir}/libwebrtc_audio_processing.la +%{_libdir}/libwebrtc_audio_processing.so +%{_libdir}/pkgconfig/webrtc-audio-processing.pc +%doc NEWS README README.md + +%changelog +* Thu Sep 01 2022 Silvan Calarco 0.3.1-2mamba +- fix build on arm archs; disable static library build + +* Thu Sep 01 2022 Silvan Calarco 0.3.1-1mamba +- package created using the webbuild interface