diff options
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 22 |
2 files changed, 22 insertions, 5 deletions
@@ -1,14 +1,15 @@ pkgbase = pretty-php pkgdesc = The opinionated formatter for modern, expressive PHP pkgver = 0.4.19 - pkgrel = 1 + pkgrel = 2 url = https://github.com/lkrms/pretty-php arch = any license = MIT + makedepends = php-sodium makedepends = git + makedepends = composer makedepends = jq depends = php - depends = composer source = pretty-php::git+https://github.com/lkrms/pretty-php.git#tag=v0.4.19 sha256sums = SKIP @@ -2,13 +2,13 @@ pkgname=pretty-php pkgver=0.4.19 -pkgrel=1 +pkgrel=2 pkgdesc="The opinionated formatter for modern, expressive PHP" arch=('any') license=('MIT') url='https://github.com/lkrms/pretty-php' -depends=('php' 'composer') -makedepends=('git' 'jq') +depends=('php') +makedepends=('php-sodium' 'git' 'composer' 'jq') source=("${pkgname}::git+https://github.com/lkrms/pretty-php.git#tag=v${pkgver}") sha256sums=('SKIP') @@ -18,6 +18,7 @@ prepare() { } build() { + _check_sodium cd "${srcdir}/${pkgname}" scripts/build.sh "v$pkgver" } @@ -45,3 +46,18 @@ _phar() { build/dist/manifest.json) printf 'build/dist/%s' "$phar" } + +_check_sodium() { + if ! php -m | grep -Fx sodium >/dev/null; then + local dir=${srcdir}/php.ini.d + mkdir -p "$dir" + echo 'extension=sodium' >"$dir/sodium.ini" + # If PHP_INI_SCAN_DIR is already in the environment, honour it, empty or + # otherwise + if [[ -n ${PHP_INI_SCAN_DIR+1} ]]; then + export PHP_INI_SCAN_DIR=${PHP_INI_SCAN_DIR:+$PHP_INI_SCAN_DIR:}$dir + return + fi + export PHP_INI_SCAN_DIR=:$dir + fi +} |