From 0537b7ba360e96effbfa86362c8e736bd9e305ef Mon Sep 17 00:00:00 2001 From: s3lph Date: Thu, 9 May 2024 02:17:24 +0200 Subject: [PATCH] fix: build architecture-specific memories packages --- nextcloud-28-app-memories/package.sh | 47 ++++++++++++++++++++++++++++ nextcloud-29-app-memories/package.sh | 47 ++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/nextcloud-28-app-memories/package.sh b/nextcloud-28-app-memories/package.sh index fde4ee6..0b98929 100755 --- a/nextcloud-28-app-memories/package.sh +++ b/nextcloud-28-app-memories/package.sh @@ -2,9 +2,56 @@ . ../.skel/nextcloud-app/build-nextcloud-app +export ARCHS=(amd64 arm64) + +function _ncarch() { + case "$1" in + amd64) + echo x86_64 + ;; + arm64) + echo aarch64 + ;; + *) + echo no such architecture + exit 1 + esac +} + +function _binarch() { + case "$1" in + amd64) + echo amd64 + ;; + arm64) + echo aarch64 + ;; + *) + echo no such architecture + exit 1 + esac +} + +function post_chown() { + chmod 0755 "${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/memories/bin-ext/exiftool/build_tag_lookup" + chmod 0755 "${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/memories/bin-ext/exiftool/exiftool" + chmod 0755 "${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/memories/bin-ext/exiftool/validate" +} + post_prepare() { + NCARCH=$(_ncarch $ARCH) + for oarch in ${ARCHS[@]}; do + if [[ "$(_ncarch $oarch)" == "${NCARCH}" ]]; then + continue + fi + binarch=$(_binarch $oarch) + rm -f ${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/memories/bin-ext/*-${binarch}* + rm -f ${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/memories/bin-ext/exiftool/*-${binarch}* + done github_changelog pulsejet/memories } +export ADDITIONAL_DEPS=", sensible-utils" + build_nextcloud_app memories 28 diff --git a/nextcloud-29-app-memories/package.sh b/nextcloud-29-app-memories/package.sh index f7cdbfa..915bc9f 100755 --- a/nextcloud-29-app-memories/package.sh +++ b/nextcloud-29-app-memories/package.sh @@ -2,9 +2,56 @@ . ../.skel/nextcloud-app/build-nextcloud-app +export ARCHS=(amd64 arm64) + +function _ncarch() { + case "$1" in + amd64) + echo x86_64 + ;; + arm64) + echo aarch64 + ;; + *) + echo no such architecture + exit 1 + esac +} + +function _binarch() { + case "$1" in + amd64) + echo amd64 + ;; + arm64) + echo aarch64 + ;; + *) + echo no such architecture + exit 1 + esac +} + +function post_chown() { + chmod 0755 "${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/memories/bin-ext/exiftool/build_tag_lookup" + chmod 0755 "${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/memories/bin-ext/exiftool/exiftool" + chmod 0755 "${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/memories/bin-ext/exiftool/validate" +} + post_prepare() { + NCARCH=$(_ncarch $ARCH) + for oarch in ${ARCHS[@]}; do + if [[ "$(_ncarch $oarch)" == "${NCARCH}" ]]; then + continue + fi + binarch=$(_binarch $oarch) + rm -f ${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/memories/bin-ext/*-${binarch}* + rm -f ${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/memories/bin-ext/exiftool/*-${binarch}* + done github_changelog pulsejet/memories } +export ADDITIONAL_DEPS=", sensible-utils" + build_nextcloud_app memories 29