summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Fredric <kentnl@gentoo.org>2020-09-17 13:47:06 +1200
committerKent Fredric <kentnl@gentoo.org>2020-09-17 13:47:38 +1200
commit1d4c1e9575c0d95a488795974150ffa550d97716 (patch)
tree1bf4bb07e7a51ce1a41337fa2778de330d245aff /dev-perl/Font-AFM
parentnet-misc/cfengine: drop old 2.x ebuilds (diff)
downloadgentoo-1d4c1e9575c0d95a488795974150ffa550d97716.tar.gz
gentoo-1d4c1e9575c0d95a488795974150ffa550d97716.tar.bz2
gentoo-1d4c1e9575c0d95a488795974150ffa550d97716.zip
dev-perl/Font-AFM: -r bump to use urw-fonts instead for tests
- Add patch allowing use of arbitrary font names and arbitrary metrics - Augment tests and deps to use a font from the urw-fonts pack Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Kent Fredric <kentnl@gentoo.org>
Diffstat (limited to 'dev-perl/Font-AFM')
-rw-r--r--dev-perl/Font-AFM/Font-AFM-1.200.0-r3.ebuild30
-rw-r--r--dev-perl/Font-AFM/files/Font-AFM-1.20-custom-test-font.patch46
2 files changed, 76 insertions, 0 deletions
diff --git a/dev-perl/Font-AFM/Font-AFM-1.200.0-r3.ebuild b/dev-perl/Font-AFM/Font-AFM-1.200.0-r3.ebuild
new file mode 100644
index 000000000000..b279f82659d6
--- /dev/null
+++ b/dev-perl/Font-AFM/Font-AFM-1.200.0-r3.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DIST_AUTHOR=GAAS
+DIST_VERSION=1.20
+inherit perl-module
+
+DESCRIPTION="Parse Adobe Font Metric files"
+
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~ppc ~sparc ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+BDEPEND="
+ test? (
+ media-fonts/urw-fonts
+ )
+"
+PATCHES=(
+ "${FILESDIR}/${PN}-1.20-custom-test-font.patch"
+)
+src_test() {
+ # nimbus sans l medium r normal iso8859-1
+ TEST_FONT="n019003l" \
+ TEST_FONT_WIDTH="4279" \
+ METRICS="${EPREFIX}/usr/share/fonts/urw-fonts" \
+ perl-module_src_test
+}
diff --git a/dev-perl/Font-AFM/files/Font-AFM-1.20-custom-test-font.patch b/dev-perl/Font-AFM/files/Font-AFM-1.20-custom-test-font.patch
new file mode 100644
index 000000000000..3e674599c33f
--- /dev/null
+++ b/dev-perl/Font-AFM/files/Font-AFM-1.20-custom-test-font.patch
@@ -0,0 +1,46 @@
+From 6291356c29004b58b7d0f18ce39738ebc2412ff9 Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentnl@gentoo.org>
+Date: Thu, 17 Sep 2020 13:28:34 +1200
+Subject: Allow overriding test font name
+
+This allows us to use helvetica-compatible fonts without needing an
+actual font called "Helvetica"
+---
+ t/afm.t | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/t/afm.t b/t/afm.t
+index 40addff..60ddcb8 100644
+--- a/t/afm.t
++++ b/t/afm.t
+@@ -1,7 +1,13 @@
+ require Font::AFM;
+
++my $test_font = $ENV{TEST_FONT};
++my $test_width = $ENV{TEST_FONT_WIDTH};
++
++$test_font = "Helvetica" unless defined $test_font and length $test_font;
++$test_width = 4279 unless defined $test_width and length $test_width;
++
+ eval {
+- $font = Font::AFM->new("Helvetica");
++ $font = Font::AFM->new($test_font);
+ };
+ if ($@) {
+ if ($@ =~ /Can't find the AFM file for/) {
+@@ -18,9 +24,9 @@ print "1..1\n";
+
+ $sw = $font->stringwidth("Gisle Aas");
+
+-if ($sw == 4279) {
+- print "ok 1 Stringwith for Helvetica seems to work\n";
++if ($sw == $test_width) {
++ print "ok 1 Stringwith for \"$test_font\"(font) seems to work\n";
+ } else {
+- print "not ok 1 The stringwidth of 'Gisle Aas' should be 4279 (it was $sw)\n";
++ print "not ok 1 The stringwidth of 'Gisle Aas' should be $test_width (it was $sw)\n";
+ }
+
+--
+2.28.0
+