summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Arms2023-08-13 11:49:07 +1000
committerLuke Arms2023-08-13 11:49:07 +1000
commita07ece227ed2dc52002825b8c2291e9e5c33b0b5 (patch)
tree5d7e18141faa1d12f109873bda5d5de8febf1ad8
parent4475c1a1f6ad83379af346bc672713b0e2a12157 (diff)
downloadaur-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--.SRCINFO5
-rw-r--r--PKGBUILD22
2 files changed, 22 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3f03cd76250b..c215e5375e3d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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
diff --git a/PKGBUILD b/PKGBUILD
index 819fa02acee4..270b3de48be5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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
+}