commit:     25c6c42bad25b01571cbcfad087e4ad8080173f6
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Mon Oct  2 05:46:38 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct 18 04:25:59 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25c6c42b

app-text/calibre: Use upstream buildsystem to integrate system fonts

The liberation fonts are removed and replaced with symlinks to the
system fonts. I've put quite a bit of work in upstream to make this work
in a supported manner; let's use that instead of fragile, unchecked
shell code.

In particular, upstream's buildsystem dies if the expected fonts do not
exist.

Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 app-text/calibre/calibre-5.44.0-r2.ebuild | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/app-text/calibre/calibre-5.44.0-r2.ebuild 
b/app-text/calibre/calibre-5.44.0-r2.ebuild
index 598bb98f4356..67eb556626cd 100644
--- a/app-text/calibre/calibre-5.44.0-r2.ebuild
+++ b/app-text/calibre/calibre-5.44.0-r2.ebuild
@@ -186,6 +186,16 @@ src_compile() {
        export QMAKE="$(qt5_get_bindir)/qmake"
 
        ${EPYTHON} setup.py build || die
+       ${EPYTHON} setup.py gui || die
+
+       # A few different resources are bundled in the distfile by default, 
because
+       # not all systems necessarily have them. We un-vendor them, using the
+       # upstream integrated approach if possible. See setup/revendor.py and
+       # consider migrating other resources to this if they do not use it, in
+       # *preference* over manual rm'ing.
+       ${EPYTHON} setup.py liberation_fonts \
+               --path-to-liberation_fonts 
"${EPREFIX}"/usr/share/fonts/liberation-fonts \
+               --system-liberation_fonts || die
 }
 
 src_test() {
@@ -233,13 +243,6 @@ src_install() {
 
        find "${ED}"/usr/share -type d -empty -delete
 
-       cd "${ED}"/usr/share/calibre/fonts/liberation || die
-       local x
-       for x in * ; do
-               [[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || 
continue
-               ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
-       done
-
        einfo "Converting python shebangs"
        python_fix_shebang --force "${ED}"
 

Reply via email to