diff options
author | Luke Arms | 2023-08-13 11:49:07 +1000 |
---|---|---|
committer | Luke Arms | 2023-08-13 11:49:07 +1000 |
commit | a07ece227ed2dc52002825b8c2291e9e5c33b0b5 (patch) | |
tree | 5d7e18141faa1d12f109873bda5d5de8febf1ad8 | |
parent | 4475c1a1f6ad83379af346bc672713b0e2a12157 (diff) | |
download | aur-a07ece227ed2dc52002825b8c2291e9e5c33b0b5.tar.gz |
Fix dependency issues
- Move `composer` to makedeps because it's only required at build time
- Add `php-sodium` to makedeps to satisfy Box's dependencies
- Enable `php-sodium` via a temporary ini file if necessary
-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 +} |