summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatoro Mahri <matoro_gentoo@matoro.tk>2023-11-21 22:56:49 -0500
committerSam James <sam@gentoo.org>2023-11-22 18:28:35 +0000
commite1b8a96cfc24d46b49c58e3c9e2eb597fdf47574 (patch)
treeb2bb1031d4f8da9fc1b1eb46dd7b72097eac15a4 /media-sound
parentnet-analyzer/bmon: Fix DOCS for live ebuild (diff)
downloadgentoo-e1b8a96cfc24d46b49c58e3c9e2eb597fdf47574.tar.gz
gentoo-e1b8a96cfc24d46b49c58e3c9e2eb597fdf47574.tar.bz2
gentoo-e1b8a96cfc24d46b49c58e3c9e2eb597fdf47574.zip
media-sound/liblc3: wire up tests
The test/arm and test/neon suites actually run on non-ARM platforms, but the generic implementations are not endian-safe, and since they're supposed to test ARM assembly, there's not much point in running them on other platforms. Most of the tricks stolen from Debian: deps and rules. Tested on arm and arm64, as well as other 64-bit BE and LE platforms. Bug: https://bugs.gentoo.org/896130 Signed-off-by: Matoro Mahri <matoro_gentoo@matoro.tk> Closes: https://github.com/gentoo/gentoo/pull/33934 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-sound')
-rw-r--r--media-sound/liblc3/liblc3-1.0.4-r1.ebuild52
1 files changed, 52 insertions, 0 deletions
diff --git a/media-sound/liblc3/liblc3-1.0.4-r1.ebuild b/media-sound/liblc3/liblc3-1.0.4-r1.ebuild
new file mode 100644
index 000000000000..13bee49ab7af
--- /dev/null
+++ b/media-sound/liblc3/liblc3-1.0.4-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10,11,12} pypy3 )
+inherit meson python-any-r1
+
+DESCRIPTION="LC3 is an efficient low latency audio codec"
+HOMEPAGE="https://github.com/google/liblc3"
+SRC_URI="https://github.com/google/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="test tools"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+RESTRICT="!test? ( test )"
+
+DEPEND="test? (
+ $(python_gen_any_dep '
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/scipy[${PYTHON_USEDEP}]
+ ')
+)"
+
+python_check_deps() {
+ python_has_version -d "dev-python/numpy[${PYTHON_USEDEP}]" &&
+ python_has_version -d "dev-python/scipy[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ use arm || rm -rf "test/arm" || die
+ use arm64 || rm -rf "test/neon" || die
+ default
+}
+
+src_configure() {
+ local emesonargs=(
+ # We let users choose to enable LTO
+ -Db_lto=false
+ $(meson_use tools)
+ )
+ meson_src_configure
+}
+
+src_test() {
+ V= emake test CFLAGS:="${CPPFLAGS} ${CFLAGS} -I"$("${EPYTHON}" -c "import numpy;print(numpy.get_include())")""
+}