summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2019-11-25 10:57:11 -0500
committerBrian Evans <grknight@gentoo.org>2019-11-25 10:57:11 -0500
commitd1382bb9c74d035c1daf63ad57351b91151f0b99 (patch)
tree6d30c77d42d13edaa6a8626bd61af5f57abb7288 /dev-php/twig
parentsys-kernel/gentoo-sources: Linux patch 5.4.0 and additional patches (diff)
downloadgentoo-d1382bb9c74d035c1daf63ad57351b91151f0b99.tar.gz
gentoo-d1382bb9c74d035c1daf63ad57351b91151f0b99.tar.bz2
gentoo-d1382bb9c74d035c1daf63ad57351b91151f0b99.zip
dev-php/twig: Fix install locations of PSR-0 files
Signed-off-by: Brian Evans <grknight@gentoo.org>
Diffstat (limited to 'dev-php/twig')
-rw-r--r--dev-php/twig/twig-1.42.3-r1.ebuild49
1 files changed, 49 insertions, 0 deletions
diff --git a/dev-php/twig/twig-1.42.3-r1.ebuild b/dev-php/twig/twig-1.42.3-r1.ebuild
new file mode 100644
index 000000000000..6e54e7688809
--- /dev/null
+++ b/dev-php/twig/twig-1.42.3-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MY_PN="Twig"
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+DESCRIPTION="PHP templating engine with syntax similar to Django"
+HOMEPAGE="http://twig.sensiolabs.org/"
+SRC_URI="https://github.com/twigphp/${MY_PN}/archive/v${PV}.tar.gz
+ -> ${P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc test"
+
+RDEPEND="dev-lang/php:*[ctype] dev-php/fedora-autoloader"
+DEPEND="test? ( dev-php/phpunit ${RDEPEND} )"
+# Test fail due to missing Symphony dependencies
+RESTRICT="test"
+
+src_install(){
+ # The autoloader requires the 'T' in "Twig" capitalized.
+ insinto "/usr/share/php/${MY_PN}/lib/${MY_PN}"
+ doins -r lib/"${MY_PN}"/*
+ insinto "/usr/share/php/${MY_PN}/src"
+ doins -r src/*
+ insinto "/usr/share/php/${MY_PN}"
+ doins "${FILESDIR}/Autoloader.php"
+
+ dodoc README.rst CHANGELOG
+
+ # This installs the reStructuredText source documents. There's got
+ # to be some way to turn them into HTML using Sphinx, but upstream
+ # doesn't provide for it.
+ use doc && dodoc -r doc
+}
+
+src_test(){
+ cp "${FILESDIR}/Autoloader.php" "${S}" || die
+ phpunit --bootstrap Autoloader.php || die "test suite failed"
+ rm "${S}/Autoloader.php" || die
+}
+
+pkg_postinst(){
+ elog "${PN} has been installed in /usr/share/php/${MY_PN}/."
+ elog "To use it in a script, require('${MY_PN}/Autoloader.php')"
+}