From c261a688f71e5f819586d87514f13154b491043feb571e9fa0e430714e7dd70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Sat, 4 May 2024 00:29:17 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main sbc revision 3e536bde1203755bba8777af212b62fb --- .gitattributes | 23 +++++++++ baselibs.conf | 1 + fix-build-on-non-x86.patch | 45 ++++++++++++++++++ sbc-1.5.tar.xz | 3 ++ sbc.changes | 39 ++++++++++++++++ sbc.spec | 95 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 206 insertions(+) create mode 100644 .gitattributes create mode 100644 baselibs.conf create mode 100644 fix-build-on-non-x86.patch create mode 100644 sbc-1.5.tar.xz create mode 100644 sbc.changes create mode 100644 sbc.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..98d9c58 --- /dev/null +++ b/baselibs.conf @@ -0,0 +1 @@ +libsbc1 \ No newline at end of file diff --git a/fix-build-on-non-x86.patch b/fix-build-on-non-x86.patch new file mode 100644 index 0000000..f65260f --- /dev/null +++ b/fix-build-on-non-x86.patch @@ -0,0 +1,45 @@ +From 909a9bdf7ab143e1f0baaf9736baebd3cd79aacf Mon Sep 17 00:00:00 2001 +From: Marius Bakke +Date: Tue, 22 Dec 2020 11:04:26 +0000 +Subject: sbc_primitives: Fix build on non-x86. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Don't call __builtin_cpu_init unless targeting i386 or x86_64. +Otherwise we get an error at link time: + + CC sbc/sbc_primitives.lo +sbc/sbc_primitives.c: In function ‘sbc_init_primitives_x86’: +sbc/sbc_primitives.c:596:2: warning: implicit declaration of function ‘__builtin_cpu_init’; did you mean ‘__builtin_irint’? [-Wimplicit-function-declaration] +[...] + CCLD src/sbcdec +ld: sbc/.libs/libsbc-private.a(sbc_primitives.o): in function `sbc_init_primitives': +sbc_primitives.c:(.text+0x3a30): undefined reference to `__builtin_cpu_init' +--- + sbc/sbc_primitives.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sbc/sbc_primitives.c b/sbc/sbc_primitives.c +index 97a75be..09c214a 100644 +--- a/sbc/sbc_primitives.c ++++ b/sbc/sbc_primitives.c +@@ -593,6 +593,7 @@ static int sbc_calc_scalefactors_j( + + static void sbc_init_primitives_x86(struct sbc_encoder_state *state) + { ++#if defined(__x86_64__) || defined(__i386__) + __builtin_cpu_init(); + + #ifdef SBC_BUILD_WITH_MMX_SUPPORT +@@ -604,6 +605,7 @@ static void sbc_init_primitives_x86(struct sbc_encoder_state *state) + if (__builtin_cpu_supports("sse4.2")) + sbc_init_primitives_sse(state); + #endif ++#endif + } + + /* +-- +cgit 1.2.3-1.el7 + diff --git a/sbc-1.5.tar.xz b/sbc-1.5.tar.xz new file mode 100644 index 0000000..5c849a9 --- /dev/null +++ b/sbc-1.5.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cbad69823a99e8421fe0700e8cf9eeb8fa0c1ad28e8dbc2182b3353507931d2 +size 264472 diff --git a/sbc.changes b/sbc.changes new file mode 100644 index 0000000..b8c0f1d --- /dev/null +++ b/sbc.changes @@ -0,0 +1,39 @@ +------------------------------------------------------------------- +Sun Jan 17 14:11:57 UTC 2021 - Dirk Müller + +- add fix-build-on-non-x86.patch: fix build on non-x86 + +------------------------------------------------------------------- +Mon Jan 11 01:03:32 UTC 2021 - Dirk Müller + +- update to 1.5: + * Add support for SSE primitives. + +------------------------------------------------------------------- +Fri Aug 2 08:21:05 UTC 2019 - Martin Liška + +- Use FAT LTO objects in order to provide proper static library. + +------------------------------------------------------------------- +Thu Nov 15 07:45:56 UTC 2018 - Stefan Seyfried + +- update to version 1.4: + * Fix issue with stack overflow within sbc_crc8 function. + +------------------------------------------------------------------- +Fri Nov 7 16:13:05 UTC 2014 - hrvoje.senjan@gmail.com + +- Provide baselibs.conf +- Update to version 1.3: + * Fix issue with frame length calculation for dual-channel mode. +- Changes since 1.2: + * Add support for setup from A2DP configuration data. + * Add support for enabling high precision build. +- Changes since 1.1: + * Add support for mSBC encoding and decoding functionality. + +------------------------------------------------------------------- +Fri Aug 24 11:04:37 UTC 2012 - seife+obs@b1-systems.com + +- initial package, version 1.0 + diff --git a/sbc.spec b/sbc.spec new file mode 100644 index 0000000..3fa1c3e --- /dev/null +++ b/sbc.spec @@ -0,0 +1,95 @@ +# +# spec file for package sbc +# +# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2012 B1 Systems GmbH, Vohburg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define sonum 1 + +Name: sbc +Version: 1.5 +Release: 0 +Summary: Bluetooth Low-Complexity, Sub-Band Codec Utilities +License: GPL-2.0-or-later +Group: Hardware/Mobile +URL: https://www.kernel.org/pub/linux/bluetooth +Source: https://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.xz +Source1: baselibs.conf +Patch1: https://git.kernel.org/pub/scm/bluetooth/sbc.git/patch/?id=909a9bdf7ab143e1f0baaf9736baebd3cd79aacf#/fix-build-on-non-x86.patch +BuildRequires: libsndfile-devel +BuildRequires: pkg-config +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +The package contains utilities for using the SBC codec. + +%package -n libsbc%{sonum} +Summary: Bluetooth Low-Complexity, Sub-Band Codec Library +License: LGPL-2.1-or-later +Group: Hardware/Mobile + +%description -n libsbc%{sonum} +The package contains libraries for using the SBC codec. + +%package devel +Summary: Development files for libsbc%{sonum} +License: GPL-2.0-or-later +Group: Development/Sources +Requires: libsbc%{sonum} = %{version} + +%description devel +Development files for the SBC library + +%prep +%setup -q +%patch1 -p1 + +%build +%global _lto_cflags %{_lto_cflags} -ffat-lto-objects +%configure +make %{?_smp_mflags} V=1 + +%install +%make_install +rm %{buildroot}/%{_libdir}/libsbc.la + +%clean +%{?buildroot:%__rm -rf "%{buildroot}"} + +%post -n libsbc%{sonum} -p /sbin/ldconfig + +%postun -n libsbc%{sonum} -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%license COPYING +%doc ChangeLog README +/usr/bin/sbc* + +%files -n libsbc%{sonum} +%defattr(-,root,root) +%{_libdir}/libsbc.so.%{sonum} +%{_libdir}/libsbc.so.%{sonum}.* + +%files devel +%defattr(-,root,root) +%dir /usr/include/sbc +/usr/include/sbc/sbc.h +%{_libdir}/pkgconfig/sbc.pc +%{_libdir}/libsbc.a +%{_libdir}/libsbc.so + +%changelog