Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-php/jpgraph/, dev-php/jpgraph/files/
Date: Tue, 03 Jan 2017 19:17:39
Message-Id: 1483470842.6e68c5351d74213a94d26626cd82fa478048c130.mjo@gentoo
1 commit: 6e68c5351d74213a94d26626cd82fa478048c130
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 3 18:48:21 2017 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 3 19:14:02 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e68c535
7
8 dev-php/jpgraph: new version 4.0.2 fixing a few bugs.
9
10 This new version fixes a few outstanding issues with the old 3.x
11 series ebuilds. First, the config file is now installed to /etc, where
12 the user will be able to edit it, and then merely symlinked to
13 /usr/share/php/jpgraph where it used to live. This lets the user
14 configure caching at any time, which brings us to the second
15 improvement: caching is disabled by default, and we make no attempt
16 to configure the web server user or cache directory. This fixes an
17 open bug.
18
19 Finally, all of the documentation and examples are now installed in
20 the correct place, and no copies wind up in the PHP include directory.
21 Other minor improvements were made, like an update to EAPI=6, and the
22 use of a patch instead of a call to sed.
23
24 Gentoo-Bug: 520566
25
26 Package-Manager: portage-2.3.0
27
28 dev-php/jpgraph/Manifest | 1 +
29 dev-php/jpgraph/files/gentoo_ttf_dir.patch | 31 +++++++++++++++
30 dev-php/jpgraph/jpgraph-4.0.2.ebuild | 64 ++++++++++++++++++++++++++++++
31 3 files changed, 96 insertions(+)
32
33 diff --git a/dev-php/jpgraph/Manifest b/dev-php/jpgraph/Manifest
34 index a4ae5cf..68fcb83 100644
35 --- a/dev-php/jpgraph/Manifest
36 +++ b/dev-php/jpgraph/Manifest
37 @@ -1 +1,2 @@
38 DIST jpgraph-3.0.7.tar.bz2 10541173 SHA256 412a1aaf47c7d70c5a4350d1c571ebb88c77138d9b95afd51895c44f188a03b6 SHA512 9385d8ac72a942faa4c2a46e7390c9b672fe45802ea37da8a90bca00e32d34421f7ce5dc8d78da934e2dfd8e748c21211af6556f11b3037898757555b0b529ee WHIRLPOOL 83cbd6fd4be742af70a0d2790a2defb8ef6e5c1d9fb66f18f5c5913e3c6986d9a4063671ec3b8d6a0aa08859d58ee710ab644433340e62d9a5689d7715118eda
39 +DIST jpgraph-4.0.2.tar.gz 13298314 SHA256 9cbcf565c2bfb211e1c85fef1ed4fac5a830435ab508d509d2f5cb724356e121 SHA512 db1877c09c13a26d24ef7df4aae50799f55c6d72ca0cdb0b8d8c05928c1bc860f8a86eb52a5fb05bdc1c07574931825baa2989f006e9a4cc57e60913e8b67a3e WHIRLPOOL e403e829058afb33606d393ad60e36a89018c94c4e46b235e6909679b1f53117753e99bcc528a5b13eaa132ff7587f0f2e5a1940d222c5f50600863a3aafe54a
40
41 diff --git a/dev-php/jpgraph/files/gentoo_ttf_dir.patch b/dev-php/jpgraph/files/gentoo_ttf_dir.patch
42 new file mode 100644
43 index 00000000..a10479b
44 --- /dev/null
45 +++ b/dev-php/jpgraph/files/gentoo_ttf_dir.patch
46 @@ -0,0 +1,31 @@
47 +From fd1fc5e3c72ac4511f86852b1704821c440bdb3d Mon Sep 17 00:00:00 2001
48 +From: Michael Orlitzky <michael@××××××××.com>
49 +Date: Tue, 3 Jan 2017 12:56:18 -0500
50 +Subject: [PATCH 1/1] Set TTF_DIR to the Gentoo corefonts location.
51 +
52 +The default value of TTF_DIR in jpg-config.inc.php points to
53 +/usr/share/fonts/truetype, a location that does not exist on
54 +Gentoo. Since JpGraph largely only supports the Microsoft
55 +corefonts, we point it to /usr/share/fonts/corefonts instead.
56 +If the user does not have the corefonts installed, this is no
57 +great loss: neither location exists.
58 +---
59 + src/jpg-config.inc.php | 2 +-
60 + 1 file changed, 1 insertion(+), 1 deletion(-)
61 +
62 +diff --git a/src/jpg-config.inc.php b/src/jpg-config.inc.php
63 +index ea16c1e..98cbdc7 100755
64 +--- a/src/jpg-config.inc.php
65 ++++ b/src/jpg-config.inc.php
66 +@@ -36,7 +36,7 @@
67 + //
68 + //------------------------------------------------------------------------
69 + // define('CACHE_DIR','/tmp/jpgraph_cache/');
70 +-// define('TTF_DIR','/usr/share/fonts/TrueType/');
71 ++define('TTF_DIR','/usr/share/fonts/corefonts/');
72 + // define('MBTTF_DIR','/usr/share/fonts/TrueType/');
73 +
74 + //-------------------------------------------------------------------------
75 +--
76 +2.10.2
77 +
78
79 diff --git a/dev-php/jpgraph/jpgraph-4.0.2.ebuild b/dev-php/jpgraph/jpgraph-4.0.2.ebuild
80 new file mode 100644
81 index 00000000..17112d1
82 --- /dev/null
83 +++ b/dev-php/jpgraph/jpgraph-4.0.2.ebuild
84 @@ -0,0 +1,64 @@
85 +# Copyright 1999-2017 Gentoo Foundation
86 +# Distributed under the terms of the GNU General Public License v2
87 +# $Id$
88 +
89 +EAPI=6
90 +
91 +DESCRIPTION="Object-oriented graphing library for PHP"
92 +HOMEPAGE="http://jpgraph.net/"
93 +# Upstream didn't have a stable download URL when this was packaged.
94 +SRC_URI="https://dev.gentoo.org/~mjo/distfiles/${P}.tar.gz"
95 +LICENSE="QPL-1.0"
96 +SLOT="0"
97 +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
98 +IUSE="truetype examples"
99 +
100 +DEPEND=""
101 +RDEPEND="truetype? ( media-fonts/corefonts )
102 + dev-lang/php[gd,truetype?]"
103 +
104 +src_prepare() {
105 + default
106 +
107 + # The DejaVu fonts are now bundled with the library and don't need
108 + # to be found in TTF_DIR. Since most of the fonts supported by
109 + # JpGraph are corefonts, we point the sole TTF_DIR towards them for
110 + # maximum impact. Why not apply the patch unconditionally? We want
111 + # to avoid a situation where TTF fonts appear to work, but then
112 + # break without warning when the user e.g. removes corefonts. By
113 + # applying the patch conditionally, we ensure a dependency on
114 + # media-fonts/corefonts before anything will work.
115 + use truetype && eapply "${FILESDIR}/gentoo_ttf_dir.patch"
116 +
117 + # Some of the documentation and examples are shipped in the "src"
118 + # directory. We want them outside of that tree so that we can simply
119 + # call doins recursively on "src". First, rename the existing "docs"
120 + # directory which contains the HTML manual and class reference.
121 + mv docs html || die 'failed to rename "docs" directory'
122 + mv src/README ./ || die 'failed to relocate the README'
123 + mv src/Examples ./examples || die 'failed to relocate the examples'
124 +
125 + # These are present (duplicated) in the other Examples directory,
126 + # and don't work anyway.
127 + rm -r src/barcode || die 'failed to remove some barcode examples'
128 +
129 + # We'll also want to install the config file to /etc, since it may
130 + # need to be edited by the user.
131 + mv src/jpg-config.inc.php ./ || die 'failed to relocate the config file'
132 + rm src/jpg-config.inc.php.orig || die 'failed to remove original config file'
133 +}
134 +
135 +src_install() {
136 + dodoc README
137 + dodoc -r html
138 + use examples && dodoc -r examples
139 +
140 + insinto "/usr/share/php/${PN}"
141 + doins -r src/*
142 +
143 + insinto /etc
144 + doins jpg-config.inc.php
145 + # Create a symlink for the config file, because the library will only
146 + # look for it in its own source tree (not in /etc where we've put it).
147 + dosym /etc/jpg-config.inc.php "/usr/share/php/${PN}/jpg-config.inc.php"
148 +}