net-print/cups-filters: make testfont optional
authorThomas Deutschmann <whissi@gentoo.org>
Sun, 12 Apr 2020 22:50:21 +0000 (00:50 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Sun, 12 Apr 2020 22:51:04 +0000 (00:51 +0200)
Closes: https://bugs.gentoo.org/717138
Package-Manager: Portage-2.3.98, Repoman-2.3.22
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
net-print/cups-filters/cups-filters-1.27.4.ebuild
net-print/cups-filters/cups-filters-9999.ebuild
net-print/cups-filters/files/cups-filters-1.27.4-make-missing-testfont-non-fatal.patch [new file with mode: 0644]

index 6cb600e6a3ad6c0cca106e0cbe4d0e8d91b71f17..7abb7a7fcbf00a07bf946c73a2b3ca68bd6b0630 100644 (file)
@@ -5,10 +5,10 @@ EAPI=7
 
 GENTOO_DEPEND_ON_PERL=no
 
-inherit perl-module systemd flag-o-matic
+inherit autotools perl-module systemd flag-o-matic
 
 if [[ "${PV}" == "9999" ]] ; then
-       inherit autotools git-r3
+       inherit git-r3
        EGIT_REPO_URI="https://github.com/OpenPrinting/cups-filters.git"
 else
        SRC_URI="http://www.openprinting.org/download/${PN}/${P}.tar.xz"
@@ -54,8 +54,18 @@ BDEPEND="
 "
 
 src_prepare() {
+       local need_eautoreconf=
+
        default
-       [[ "${PV}" == "9999" ]] && eautoreconf
+
+       if ! use test ; then
+               eapply "${FILESDIR}"/${PN}-1.27.4-make-missing-testfont-non-fatal.patch
+               need_eautoreconf=yes
+       elif [[ "${PV}" == "9999" ]] ; then
+               need_eautoreconf=yes
+       fi
+
+       [[ -n ${need_eautoreconf} ]] && eautoreconf
 
        # Bug #626800
        append-cxxflags -std=c++11
index 6cb600e6a3ad6c0cca106e0cbe4d0e8d91b71f17..7abb7a7fcbf00a07bf946c73a2b3ca68bd6b0630 100644 (file)
@@ -5,10 +5,10 @@ EAPI=7
 
 GENTOO_DEPEND_ON_PERL=no
 
-inherit perl-module systemd flag-o-matic
+inherit autotools perl-module systemd flag-o-matic
 
 if [[ "${PV}" == "9999" ]] ; then
-       inherit autotools git-r3
+       inherit git-r3
        EGIT_REPO_URI="https://github.com/OpenPrinting/cups-filters.git"
 else
        SRC_URI="http://www.openprinting.org/download/${PN}/${P}.tar.xz"
@@ -54,8 +54,18 @@ BDEPEND="
 "
 
 src_prepare() {
+       local need_eautoreconf=
+
        default
-       [[ "${PV}" == "9999" ]] && eautoreconf
+
+       if ! use test ; then
+               eapply "${FILESDIR}"/${PN}-1.27.4-make-missing-testfont-non-fatal.patch
+               need_eautoreconf=yes
+       elif [[ "${PV}" == "9999" ]] ; then
+               need_eautoreconf=yes
+       fi
+
+       [[ -n ${need_eautoreconf} ]] && eautoreconf
 
        # Bug #626800
        append-cxxflags -std=c++11
diff --git a/net-print/cups-filters/files/cups-filters-1.27.4-make-missing-testfont-non-fatal.patch b/net-print/cups-filters/files/cups-filters-1.27.4-make-missing-testfont-non-fatal.patch
new file mode 100644 (file)
index 0000000..50866e4
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -789,7 +789,7 @@ AC_ARG_WITH([test-font-path],
+       [with_test_font_path=`find /usr/share/fonts -name DejaVuSans.ttf || echo /usr/share/fonts/dejavu/DejaVuSans.ttf`]
+ )
+ AC_CHECK_FILE("$with_test_font_path", [], [
+-      AC_MSG_ERROR([Requested font file is missing. Please install a package providing it.])
++      AC_MSG_WARN([Specified font for tests not found. Expect test failures!])
+ ])
+ AC_DEFINE_UNQUOTED([TESTFONT], ["$with_test_font_path"], [Path to font used in tests])