summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Herbrich2022-05-26 19:31:23 +0200
committerDennis Herbrich2022-05-26 19:31:23 +0200
commitbc6b291fce546d518cb3d84583cef446eea1df45 (patch)
tree7a2840346ae5fdd517c89f489c4df64eb95a2d45
parentda2d6be346da499b30ff1a0c9b21e610ccc0ce0b (diff)
downloadaur-bc6b291fce546d518cb3d84583cef446eea1df45.tar.gz
refactor(package): prepare for more architectures
Properly handle the case of building for an unsupported architecture by exiting with an error instead of silently installing i686 binaries.
-rw-r--r--PKGBUILD7
1 files changed, 6 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 5e05e20ecd26..1583e68ebcaa 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -63,9 +63,14 @@ package() {
if [[ "$CARCH" == "x86_64" ]]; then
install -Dm755 "${srcdir}/sunvox/sunvox/linux_x86_64/sunvox" "${pkgdir}/usr/bin/sunvox"
install -Dm755 "${srcdir}/sunvox/sunvox/linux_x86_64/sunvox_opengl" "${pkgdir}/usr/bin/sunvox_opengl"
- else
+ elif [[ "$CARCH" == "i686" ]]; then
install -Dm755 "${srcdir}/sunvox/sunvox/linux_x86/sunvox" "${pkgdir}/usr/bin/sunvox"
install -Dm755 "${srcdir}/sunvox/sunvox/linux_x86/sunvox_lofi" "${pkgdir}/usr/bin/sunvox_lofi"
+ else
+ printf -v _archlist -- "%s, " "${arch[@]}"
+ printf -- ":: error: unsupported architecture '%s', must be one of " "${CARCH}"
+ printf -- "%s\n" "${_archlist%, }"
+ exit 2
fi
# preserve distributed structure of source package to install all