diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2022-01-01 12:15:45 -0500 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2022-01-01 15:41:08 -0500 |
commit | 8d33a3e7342241d33a1d66b086019b391cd61d25 (patch) | |
tree | ac61a1be96579d76782205d3f87782e7ab95bdf1 /media-libs/cubeb | |
parent | xfce-extra/tumbler: Bump to 4.17.0 (diff) | |
download | gentoo-8d33a3e7342241d33a1d66b086019b391cd61d25.tar.gz gentoo-8d33a3e7342241d33a1d66b086019b391cd61d25.tar.bz2 gentoo-8d33a3e7342241d33a1d66b086019b391cd61d25.zip |
media-libs/cubeb: initial import, 2021-12-13 snapshot
Needed to unbundle on pcsx2, also used by some out-of-tree
packages like yuzu.
rust being optional may be questionable given non-rust pulseaudio
backend is deprecated and due for removal -- but most packages
that bundle this tend to use the C++ version and it may be useful
for testing. Also upstream spoke of releasing a LTS 1.x branch that
likely won't remove it anytime soon.
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'media-libs/cubeb')
-rw-r--r-- | media-libs/cubeb/Manifest | 14 | ||||
-rw-r--r-- | media-libs/cubeb/cubeb-0.2_p20211213.ebuild | 110 | ||||
-rw-r--r-- | media-libs/cubeb/files/cubeb-0.2_p20211213-automagic.patch | 51 | ||||
-rw-r--r-- | media-libs/cubeb/metadata.xml | 16 |
4 files changed, 191 insertions, 0 deletions
diff --git a/media-libs/cubeb/Manifest b/media-libs/cubeb/Manifest new file mode 100644 index 000000000000..3361c26d0708 --- /dev/null +++ b/media-libs/cubeb/Manifest @@ -0,0 +1,14 @@ +DIST bitflags-1.3.2.crate 23021 BLAKE2B eb990bb27b2bdeb66fd7212ce582cb36e1c616debbac85df642d0c82b25439e6bf9b1e811fac76b59e58ea3c1bbea6170d03a61e8f9a395e4334a0e2e2987eda SHA512 3c698f757b5cc62f815f9a1cce365c3d2dd88e4db71f331dff8bba86c2865f755b81cb4c9bfc59bd86b7643b0943f9e09a7c4f8ad75eb2ab0e714803d0129f62 +DIST cache-padded-1.2.0.crate 9125 BLAKE2B d50b506aca9cfad3117be593c33bba4a5240034a838610925f9eac969155f22e0064c91f8d3588333880d1f5b6b936df87c0728530f80cd1062c73d570bfd1e4 SHA512 5b67d06908981d0e1ba01912a973cc5c90ce6612f227b306d12b13500594f5d2376d437a046e10b9cf959b609cb67fa6e24193fc651cb2d84e1f77338c6823fc +DIST cc-1.0.72.crate 57495 BLAKE2B b2057ca53aacafa063a4eaa907bfb65aa32ce01a74a90b9085c8243a87723cee8ce79e4904f9d205f9d451598ee34495f8879d27c189477ca43bd39b88b5ea2e SHA512 e9a5b283b2a1fee1030009068c1f87291ec1dab7584a0892f27cc7e523c8fdfd5d986281d9aec1a00af706af1e61d7e64c245c74be7b39c8c022ae2d4f87de8d +DIST cmake-0.1.46.crate 15119 BLAKE2B 0889436835c16bc47cdc671615f421a50acf6c34a3ba3b6b8b4289e11bf1b803abd15d88a65ae9c1588586151f467524517e9c60d5dcc820e41ff21711f3a536 SHA512 e2749309055c85baa242cef8d0f4a91eb7e694664c5e42339df8ccc6644d1563337b835d3d931f5a0a75351efd299a21fe6eea497941802ea041916d665c7311 +DIST cubeb-0.2_p20211213.tar.gz 220413 BLAKE2B 65cf123351f1d465e15c3822f4ae2890cb62e7b5cec22beffd444ac452650b71c1bbc71e50836da6d0474ae6847fdf57c4ee85975f26a35f6db4e1f7a21fef76 SHA512 33abe2bc426b06c3c6cb557fe1be62725f1dc56776d02ec6651ef8710d3a5d302b1f730ceaefe516ff1974775cdabd3753f24436c705af3c6e98fd5dabb6b015 +DIST cubeb-backend-0.9.0.crate 5871 BLAKE2B ac8cfd9a43eefa336fbad67c7183c3bd2375f7de36dfe17df55aef0003b950cd8eb45c823b51302f60773ebafbe6de8a80f276f5bc4c2fe250be6073fe95ae1c SHA512 e02c4703b630cbecfbe20bf3193fa88a130385885fecc18c2a8d6e464b13f0f395251afb35049cd1371532e372a6a5addc856e959fd2d6da63615f1cfdb20f14 +DIST cubeb-core-0.9.0.crate 10782 BLAKE2B 60feec670c0d0d74f45a2c8ef4d0d564aae3e79f28087b7392f61baf3a0f31822929cdbbf1dd2506ea5d4249765eead516e6adb8d1867fbc2e77eeec9b06eb4a SHA512 2a7b660f6a1c36e6cbdaef4e26589240675d1e553f75d2093b39e4dfc4c82327ce080f68143e7c8383cb198796d7ab764cd4038532010847d9829b98f07f530e +DIST cubeb-pulse-rs-0.2_p20211213.tar.gz 37658 BLAKE2B 82b137df7072a048b6115a17a8f973f1464470094468f19c0e56835db6d8d7355115e712b02f29be3055868435c21915423cfc48c8b55f856e0b008f14802e3b SHA512 1bee7bbeacccf31e51a420cb28c37fb6747ff4b364cbf633e18e507959bbf46d4b706b35c7a200421b68295244289a56b4e8193c63f87c5996ddcdfd7c527054 +DIST cubeb-sys-0.9.1.crate 677935 BLAKE2B a6e10ee95e67ef03e2fa1915007a69227b28c0ade055cdff8e7941634690c6f34de8509e9b10b870097f3b17ca478794577a480232534aa1e593b6813eedbeee SHA512 594e7be07e2558ae81506ca52724bebaf51d2b99158af3808edee827f827dbfef24dc9f1a160bf23e3ac39043b17b920578164697f48a7e0fd544c0196b4f773 +DIST libc-0.2.112.crate 571445 BLAKE2B 3936f4fd08cda0ad5be7b1ff417b6dfc9abad14ea5cf647425d8a2e7306275e958fb5cab4de9eeaab95065176bc295065bafec3846ebadb6e15cba20de495280 SHA512 6c1a027eff21d3ef8078ad19b90b06d90790919a848e95a4c878e8c8b850d2e9be3fca36d8db39b24e472f15e5352ead1182d5491a0b382e06f8c3ead379c45f +DIST pkg-config-0.3.24.crate 16489 BLAKE2B d0bd099bcc39928b6758c22b14291f2dc4f4452c0837aeed8c3ff6086cdcf29518806e4f3f379804c998d752b717a26d5c0054c071c5f4c224a3e03cc6a3ee51 SHA512 be22c609b3d5a9a38bab1d30792cff397cc908f1c53fb2da68a9a7d1258e53ef64c1c5b26d840b0ed1d35b307c98ffb499c82e5796e88be0a6ecc0c6f3b5dbfb +DIST ringbuf-0.2.6.crate 18882 BLAKE2B 048402ee7e0fbe81597fa8450a50f89faaffac8dbe2cba1d1ddb870127e0a85f0e4f7553a806ea94530c00e113ee039a9c5df4d5e458bffdd3d483f09b39fc0a SHA512 e8a038342226f13c88137a91c27f14323b02dbafb8991c369c0332024a421edbb797db665e31ff9b35f40147fd1d71235a059930b574195add9a6613312472d6 +DIST semver-0.9.0.crate 17344 BLAKE2B ae782bc78f29e45577de8574ee58959c70b54bb0b6f45a5a7b09cc4d358d9a0a80bbefc6e0f2a330e2b55adfbbe5c1f64f4ec9bb94c4adf7bb3e4fc9c142db6c SHA512 03a2ea563456f812c301721c3572370fe4934a22db60079da0dd6ffa33fa789e5e2436ef09e62fc35e0b742b06fabc290992c74eed80419a353c9de9449928dc +DIST semver-parser-0.7.0.crate 10268 BLAKE2B e46b7cf9d292f8fc54561fca4df8534dc96f6be920a5c869c405ddb31b9d1a18eab0799207113cf4910a52cc0df5017ab1bc1883a7c3787ebf2d60f09ac0ab4f SHA512 17320468ec6b9862d595f358d70c09ac6e09db7885fe0ead7a1e596f79350a6306e8bfde5bbd6512008a7c5454da1c7ae55fe1e3bc1c1ff02ac9df54c0a6121f diff --git a/media-libs/cubeb/cubeb-0.2_p20211213.ebuild b/media-libs/cubeb/cubeb-0.2_p20211213.ebuild new file mode 100644 index 000000000000..46cafe446b91 --- /dev/null +++ b/media-libs/cubeb/cubeb-0.2_p20211213.ebuild @@ -0,0 +1,110 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CARGO_OPTIONAL=1 +CRATES=" + bitflags-1.3.2 + cache-padded-1.2.0 + cc-1.0.72 + cmake-0.1.46 + cubeb-backend-0.9.0 + cubeb-core-0.9.0 + cubeb-sys-0.9.1 + libc-0.2.112 + pkg-config-0.3.24 + ringbuf-0.2.6 + semver-0.9.0 + semver-parser-0.7.0" +inherit cargo cmake + +CUBEB_COMMIT="773f16b7ea308392c05be3e290163d1f636e6024" +PULSERS_COMMIT="f2456201dbfdc467b80f0ff6bbb1b8a6faf7df02" + +DESCRIPTION="Cross-platform audio library" +HOMEPAGE="https://github.com/mozilla/cubeb/" +SRC_URI=" + https://github.com/mozilla/cubeb/archive/${CUBEB_COMMIT}.tar.gz -> ${P}.tar.gz + pulseaudio? ( rust? ( + https://github.com/mozilla/cubeb-pulse-rs/archive/${PULSERS_COMMIT}.tar.gz -> ${PN}-pulse-rs-${PV}.tar.gz + $(cargo_crate_uris) + ) )" +S="${WORKDIR}/${PN}-${CUBEB_COMMIT}" + +LICENSE="ISC pulseaudio? ( rust? ( || ( Apache-2.0 MIT ) ) )" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="alsa doc jack pulseaudio +rust sndio test" +RESTRICT="!test? ( test )" + +RDEPEND=" + media-libs/speexdsp + alsa? ( media-libs/alsa-lib ) + jack? ( virtual/jack ) + pulseaudio? ( media-sound/pulseaudio ) + sndio? ( media-sound/sndio:= )" +DEPEND=" + ${RDEPEND} + test? ( dev-cpp/gtest )" +BDEPEND=" + doc? ( app-doc/doxygen ) + pulseaudio? ( rust? ( ${RUST_DEPEND} ) )" + +PATCHES=( + "${FILESDIR}"/${P}-automagic.patch +) + +src_unpack() { + use pulseaudio && use rust && cargo_src_unpack || default +} + +src_prepare() { + if use pulseaudio && use rust; then + mv ../${PN}-pulse-rs-${PULSERS_COMMIT} src/${PN}-pulse-rs || die + fi + + cmake_src_prepare + + use !debug || sed -i 's|/release/|/debug/|' CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + -DBUILD_RUST_LIBS=$(usex rust) + -DBUILD_TESTS=$(usex test) + -DCHECK_ALSA=$(usex alsa) + -DCHECK_JACK=$(usex jack) + -DCHECK_PULSE=$(usex pulseaudio) + -DCHECK_SNDIO=$(usex sndio) + -DLAZY_LOAD_LIBS=no + -DUSE_SANITIZERS=no + $(cmake_use_find_package doc Doxygen) + ) + + use pulseaudio && use rust && + cargo_src_configure --manifest-path src/${PN}-pulse-rs/Cargo.toml + + cmake_src_configure +} + +src_compile() { + use pulseaudio && use rust && cargo_src_compile + + cmake_src_compile +} + +src_test() { + use pulseaudio && use rust && cargo_src_test + + # these tests need access to audio devices and no sandbox + cmake_src_test -E '(audio|callback_ret|device_changed_callback|devices|duplex|latency|record|sanity|tone)' +} + +src_install() { + cmake_src_install + + use doc && dodoc -r "${BUILD_DIR}"/docs/html + + use !test || rm "${ED}"/usr/bin/test_* || die +} diff --git a/media-libs/cubeb/files/cubeb-0.2_p20211213-automagic.patch b/media-libs/cubeb/files/cubeb-0.2_p20211213-automagic.patch new file mode 100644 index 000000000000..5dd4a9553562 --- /dev/null +++ b/media-libs/cubeb/files/cubeb-0.2_p20211213-automagic.patch @@ -0,0 +1,51 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -175,38 +175,48 @@ + + find_package(PkgConfig REQUIRED) + ++ if(CHECK_PULSE) + pkg_check_modules(libpulse IMPORTED_TARGET libpulse) + if(libpulse_FOUND) + set(USE_PULSE ON) + target_compile_definitions(cubeb PRIVATE DISABLE_LIBPULSE_DLOPEN) + target_link_libraries(cubeb PRIVATE PkgConfig::libpulse) + endif() ++ endif() + ++ if(CHECK_ALSA) + pkg_check_modules(alsa IMPORTED_TARGET alsa) + if(alsa_FOUND) + set(USE_ALSA ON) + target_compile_definitions(cubeb PRIVATE DISABLE_LIBASOUND_DLOPEN) + target_link_libraries(cubeb PRIVATE PkgConfig::alsa) + endif() ++ endif() + ++ if(CHECK_JACK) + pkg_check_modules(jack IMPORTED_TARGET jack) + if(jack_FOUND) + set(USE_JACK ON) + target_compile_definitions(cubeb PRIVATE DISABLE_LIBJACK_DLOPEN) + target_link_libraries(cubeb PRIVATE PkgConfig::jack) + endif() ++ endif() + ++ if(CHECK_SNDIO) + check_include_files(sndio.h USE_SNDIO) + if(USE_SNDIO) + target_compile_definitions(cubeb PRIVATE DISABLE_LIBSNDIO_DLOPEN) + target_link_libraries(cubeb PRIVATE sndio) + endif() ++ endif() + ++ if(CHECK_AAUDIO) + check_include_files(aaudio/AAudio.h USE_AAUDIO) + if(USE_AAUDIO) + target_compile_definitions(cubeb PRIVATE DISABLE_LIBAAUDIO_DLOPEN) + target_link_libraries(cubeb PRIVATE aaudio) + endif() ++ endif() + endif() + + if(USE_PULSE) diff --git a/media-libs/cubeb/metadata.xml b/media-libs/cubeb/metadata.xml new file mode 100644 index 000000000000..2d8dcbf48bf3 --- /dev/null +++ b/media-libs/cubeb/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>ionen@gentoo.org</email> + <name>Ionen Wolkens</name> + </maintainer> + <use> + <flag name="rust">Use the newer rust-based audio backends if available</flag> + <flag name="sndio">Enable support for the <pkg>media-sound/sndio</pkg> backend</flag> + </use> + <upstream> + <remote-id type="github">mozilla/cubeb</remote-id> + <remote-id type="github">mozilla/cubeb-pulse-rs</remote-id> + </upstream> +</pkgmetadata> |