Files
gentoo/dev-php/theseer-Autoload/theseer-Autoload-1.26.3-r1.ebuild
Moritz Brunner 9cbfa6270a dev-php/theseer-Autoload: Do not symlink outside of EPREFIX
During the prepare step of the ebuild, symlinks are created to
previously installed PHP dependencies in the vendor subdirectory to
bootstap phpab. These symlinks lead to the real root filesystem in
/usr/share/php/... instead of the portage prefix $EPREFIX/usr/share/php,
thus being essentially broken in a Prefix installation.

By adding $EPREFIX to the link directory, the link is now correct
both inside and outside of Prefix installations.

Closes: https://bugs.gentoo.org/918933
Signed-off-by: Moritz Brunner <moritz.brunner+gentoo@posteo.de>
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2025-12-15 14:59:50 +01:00

83 lines
1.9 KiB
Bash

# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="Autoload"
DESCRIPTION="PHP Autoload Builder"
HOMEPAGE="https://github.com/theseer/Autoload"
SRC_URI="https://github.com/theseer/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 arm ~arm64 ~hppa ppc64 ~s390 ~sparc x86"
IUSE="test"
RESTRICT="!test? ( test )"
CDEPEND="dev-lang/php:*[cli,fileinfo(-),tokenizer(-)]
>=dev-php/theseer-DirectoryScanner-1.3
<dev-php/theseer-DirectoryScanner-2
>=dev-php/zetacomponents-Base-1.8
<dev-php/zetacomponents-Base-2
>=dev-php/zetacomponents-ConsoleTools-1.7.1
<dev-php/zetacomponents-ConsoleTools-2"
BDEPEND="${CDEPEND}
test? (
>=dev-php/phpunit-8
<dev-php/phpunit-9
)"
RDEPEND="${CDEPEND}"
PATCHES=( "${FILESDIR}"/${PN}-1.26.0-autoload.php.patch )
S="${WORKDIR}/${MY_PN}-${PV}"
src_prepare() {
default
# Set version
sed -i \
-e "s/%development%/${PV}/" \
phpab.php \
composer/bin/phpab \
|| die
cp --target-directory src/templates/ci \
"${FILESDIR}"/fedora.php.tpl \
"${FILESDIR}"/fedora2.php.tpl \
|| die
# Mimick layout to bootstrap phpab
mkdir --parents \
vendor/theseer/directoryscanner \
vendor/zetacomponents/base \
vendor/zetacomponents/console-tools \
|| die
ln -s "${EPREFIX}"/usr/share/php/TheSeer/DirectoryScanner vendor/theseer/directoryscanner/src || die
ln -s "${EPREFIX}"/usr/share/php/ezc/Base vendor/zetacomponents/base/src || die
ln -s "${EPREFIX}"/usr/share/php/ezc/ConsoleTools vendor/zetacomponents/console-tools/src || die
./phpab.php \
--output src/autoload.php \
--template "${FILESDIR}"/autoload.php.tpl \
--basedir src \
src || die
}
src_test() {
phpunit --no-coverage --verbose || die "Unit testing failed!"
}
src_install() {
insinto /usr/share/php/TheSeer/${MY_PN}
doins -r src/*
dobin "${S}"/composer/bin/phpab
einstalldocs
}