From 12b7e04fc75163015cea709e0f4e0a93c2ed65b4 Mon Sep 17 00:00:00 2001 From: reback00 Date: Thu, 4 Mar 2021 01:30:28 +0600 Subject: [PATCH] New package: php-codesniffer-3.5.8 --- srcpkgs/php-codesniffer/template | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 srcpkgs/php-codesniffer/template diff --git a/srcpkgs/php-codesniffer/template b/srcpkgs/php-codesniffer/template new file mode 100644 index 00000000000..bb4261042a0 --- /dev/null +++ b/srcpkgs/php-codesniffer/template @@ -0,0 +1,39 @@ +# Template file for 'php-codesniffer' +pkgname=php-codesniffer +_pkgname=PHP_CodeSniffer +version=3.5.8 +revision=1 +wrksrc="${_pkgname}-${version}" +build_style=fetch +hostmakedepends="tar php" +depends="php" +short_desc="Tokenizes PHP files and detects violations of coding standards" +maintainer="reback00 " +license="BSD-3-Clause" +homepage="https://github.com/squizlabs/PHP_CodeSniffer" +distfiles="https://github.com/squizlabs/${_pkgname}/archive/${version}.tar.gz" +checksum="012918447718067242aabd7669d54aceb91e78bdd928366744d629b6ae5fbe44" + +do_extract() { + tar -xf "$XBPS_SRCDISTDIR/$pkgname-$version/$version.tar.gz" -C "$XBPS_BUILDDIR" +} + +do_configure() { + # Disable phar.readonly on PHP config. It allows to create .phar files. + # It is enabled by default as a security feature. There is no other way to + # disable it other than setting it on system .ini file. Details: + # https://stackoverflow.com/a/35120728 + mkdir -p /etc/php/conf.d/ + echo -e "[Phar]\nphar.readonly = Off" > /etc/php/conf.d/phar_build.ini +} + +do_build() { + php -d extension=phar.so scripts/build-phar.php +} + +do_install() { + vbin phpcs.phar phpcs + vbin phpcbf.phar phpcbf + + vlicense licence.txt +}