commit:     7862d63fa150758ec7d813ac27a3d0bb7740f847
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 24 08:43:05 2025 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Dec 24 10:13:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7862d63f

media-libs/subrandr: new package, add 1.0.0

New optional dependency of mpv-9999 to display some non-ASS subtitle
formats (currently mostly formats used by the web+youtube).

Unfortunately does not use cargo-c but rather builds some rust-written
builder (xtask) and then uses it to build+install and generate the
.pc file among other things.

Have not tested cross-compilation and there is good chances that it
will need fixing (aka, maybe either xtask is not built for CBUILD or
subrandr isn't built for CHOST and will need to pass some --target
w/ $(rust_abi) which xtask does support like cargo-c).

Not doing multilib for now, but we may end up wanting it in the future
if e.g. ffmpeg adds support... albeit it's unlikely old 32bit
applications will need this and we could leave support native-only.

Currently unknown if/when this will need a subslot, upstream claims
the C API should be stable unless packages set the SBR_ALLOW_UNSTABLE
macro. We *could* need it only on packages that set that if any.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-libs/subrandr/Manifest              |  2 ++
 media-libs/subrandr/metadata.xml          | 11 +++++++
 media-libs/subrandr/subrandr-1.0.0.ebuild | 50 +++++++++++++++++++++++++++++++
 profiles/base/package.use.mask            |  6 ++++
 4 files changed, 69 insertions(+)

diff --git a/media-libs/subrandr/Manifest b/media-libs/subrandr/Manifest
new file mode 100644
index 000000000000..5d1399841831
--- /dev/null
+++ b/media-libs/subrandr/Manifest
@@ -0,0 +1,2 @@
+DIST subrandr-1.0.0-vendor.tar.xz 9442460 BLAKE2B 
53fadfb75d6779cf17a643f6ff231f0612c10708e99fe6a1e5aa4b29aa60604a450ebcc2a4341865e84a6767675632187e7ad28866629683f538b1df0487e6b1
 SHA512 
731c7262400a93da12258893999e3b39ff6b973746d52d83b97e53576af121cfde30dc9fcf5dd2f90a5bb9b0ac65b56a42de37ea77d8198d5ecd4ccc30442f70
+DIST subrandr-1.0.0.tar.gz 341140 BLAKE2B 
7ae927717070ec193f12af976abcebd4b2213a16f5927cfbf1a2eb47674c234f101940747abddb348c20d58b5d81e6eeffc0064294a19379489209ba1873c699
 SHA512 
83a83b7eb0da22c2e4ff151d6ee01ed49cfdc77eb6a644854a105eca68e836f98cf9b3f05986eb4c82a0f9de97c5796f0b1561881e222a7b676e1e97bd739b2c

diff --git a/media-libs/subrandr/metadata.xml b/media-libs/subrandr/metadata.xml
new file mode 100644
index 000000000000..53172eb8529c
--- /dev/null
+++ b/media-libs/subrandr/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Ionen Wolkens</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">afishhh/subrandr</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/media-libs/subrandr/subrandr-1.0.0.ebuild 
b/media-libs/subrandr/subrandr-1.0.0.ebuild
new file mode 100644
index 000000000000..102470de75c4
--- /dev/null
+++ b/media-libs/subrandr/subrandr-1.0.0.ebuild
@@ -0,0 +1,50 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+RUST_MIN_VER=1.85.0
+inherit cargo edo
+
+DESCRIPTION="Subtitle rendering library for rendering non-ASS subtitles"
+HOMEPAGE="https://github.com/afishhh/subrandr/";
+SRC_URI="
+       https://github.com/afishhh/subrandr/archive/refs/tags/v${PV}.tar.gz
+               -> ${P}.tar.gz
+       https://dev.gentoo.org/~ionen/distfiles/${P}-vendor.tar.xz
+"
+
+LICENSE="MPL-2.0"
+LICENSE+=" MIT Unicode-3.0 Unicode-DFS-2016 ZLIB" # crates
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+       media-libs/fontconfig
+       media-libs/freetype
+       media-libs/harfbuzz:=
+"
+DEPEND="${RDEPEND}"
+
+QA_FLAGS_IGNORED="usr/lib.*/lib${PN}.*"
+
+src_compile() {
+       # xtask is bundled builder aliased in .cargo/config.toml
+       # - does not have its own test handler so regular `cargo test`
+       #   will end up rebuilding everything
+       # - cannot be easily configured to support cargo.eclass'
+       #   USE=debug and it is currently a no-op (masked)
+       edo cargo xtask build --verbose
+}
+
+src_install() {
+       local xtaskargs=(
+               # destdir currently expects the prefix to be included
+               --destdir="${ED}"/usr
+               --prefix="${EPREFIX}"/usr
+               --libdir="$(get_libdir)"
+               --verbose
+       )
+
+       edo cargo xtask install "${xtaskargs[@]}"
+}

diff --git a/profiles/base/package.use.mask b/profiles/base/package.use.mask
index f00f858308a9..c295f02595b0 100644
--- a/profiles/base/package.use.mask
+++ b/profiles/base/package.use.mask
@@ -6,6 +6,12 @@
 
 # New entries go on top.
 
+# Ionen Wolkens <[email protected]> (2025-12-24)
+# cargo.eclass' IUSE=debug cannot currently be easily supported by
+# the custom builder the package uses, mask to avoid no-op rebuilds
+# (use RUSTFLAGS if need debug symbols, see also bug #967921)
+media-libs/subrandr debug
+
 # Andreas Sturmlechner <[email protected]> (2025-12-21)
 # gui-libs/hyprland-qtutils fails to build against Qt 6.10, upstream
 # repository was archived.

Reply via email to