template 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Template file for 'php-codesniffer'
  2. pkgname=php-codesniffer
  3. _pkgname=PHP_CodeSniffer
  4. version=3.5.8
  5. revision=1
  6. wrksrc="${_pkgname}-${version}"
  7. build_style=fetch
  8. hostmakedepends="tar php"
  9. depends="php"
  10. short_desc="Tokenizes PHP files and detects violations of coding standards"
  11. maintainer="reback00 <reback00@protonmail.com>"
  12. license="BSD-3-Clause"
  13. homepage="https://github.com/squizlabs/PHP_CodeSniffer"
  14. distfiles="https://github.com/squizlabs/${_pkgname}/archive/${version}.tar.gz"
  15. checksum="012918447718067242aabd7669d54aceb91e78bdd928366744d629b6ae5fbe44"
  16. do_extract() {
  17. tar -xf "$XBPS_SRCDISTDIR/$pkgname-$version/$version.tar.gz" -C "$XBPS_BUILDDIR"
  18. }
  19. do_configure() {
  20. # Disable phar.readonly on PHP config. It allows to create .phar files.
  21. # It is enabled by default as a security feature. There is no other way to
  22. # disable it other than setting it on system .ini file. Details:
  23. # https://stackoverflow.com/a/35120728
  24. mkdir -p /etc/php/conf.d/
  25. echo -e "[Phar]\nphar.readonly = Off" > /etc/php/conf.d/phar_build.ini
  26. }
  27. do_build() {
  28. php -d extension=phar.so scripts/build-phar.php
  29. }
  30. do_install() {
  31. vbin phpcs.phar phpcs
  32. vbin phpcbf.phar phpcbf
  33. vlicense licence.txt
  34. }