CI: Improve system architecture detection in build scripts
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
1e11d8986e
commit
b45b20aa53
8 changed files with 29 additions and 15 deletions
5
scripts/dist/build-libheif.sh
vendored
5
scripts/dist/build-libheif.sh
vendored
|
@ -3,18 +3,19 @@
|
|||
# Build "heif-convert", "heif-enc", "heif-info", and "heif-thumbnailer" from source.
|
||||
CURRENT_DIR=$(pwd)
|
||||
|
||||
# Query architecture.
|
||||
# Determine the system architecture.
|
||||
if [[ $PHOTOPRISM_ARCH ]]; then
|
||||
SYSTEM_ARCH=$PHOTOPRISM_ARCH
|
||||
else
|
||||
SYSTEM_ARCH=$(uname -m)
|
||||
fi
|
||||
|
||||
DESTARCH=${BUILD_ARCH:-$SYSTEM_ARCH}
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
LATEST=$(curl --silent "https://api.github.com/repos/strukturag/libheif/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||
LIBHEIF_VERSION=${1:-$LATEST}
|
||||
DESTARCH=${2:-$SYSTEM_ARCH}
|
||||
|
||||
BUILD="libheif-$VERSION_CODENAME-$DESTARCH-$LIBHEIF_VERSION"
|
||||
|
||||
|
|
5
scripts/dist/install-chrome.sh
vendored
5
scripts/dist/install-chrome.sh
vendored
|
@ -11,13 +11,14 @@ if [[ $(id -u) != "0" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Determine the system architecture.
|
||||
if [[ $PHOTOPRISM_ARCH ]]; then
|
||||
SYSTEM_ARCH=$PHOTOPRISM_ARCH
|
||||
else
|
||||
SYSTEM_ARCH=$(uname -m)
|
||||
fi
|
||||
|
||||
DESTARCH=${2:-$SYSTEM_ARCH}
|
||||
DESTARCH=${BUILD_ARCH:-$SYSTEM_ARCH}
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
|
@ -32,7 +33,7 @@ case $DESTARCH in
|
|||
;;
|
||||
|
||||
*)
|
||||
echo "Unsupported Machine Architecture: \"$BUILD_ARCH\"" 1>&2
|
||||
echo "Unsupported Machine Architecture: \"$DESTARCH\"" 1>&2
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
|
5
scripts/dist/install-darktable.sh
vendored
5
scripts/dist/install-darktable.sh
vendored
|
@ -11,13 +11,14 @@ if [[ $(id -u) != "0" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Determine the system architecture.
|
||||
if [[ $PHOTOPRISM_ARCH ]]; then
|
||||
SYSTEM_ARCH=$PHOTOPRISM_ARCH
|
||||
else
|
||||
SYSTEM_ARCH=$(uname -m)
|
||||
fi
|
||||
|
||||
DESTARCH=${2:-$SYSTEM_ARCH}
|
||||
DESTARCH=${BUILD_ARCH:-$SYSTEM_ARCH}
|
||||
|
||||
set -e
|
||||
|
||||
|
@ -56,7 +57,7 @@ case $DESTARCH in
|
|||
;;
|
||||
|
||||
*)
|
||||
echo "Unsupported Machine Architecture: \"$BUILD_ARCH\"" 1>&2
|
||||
echo "Unsupported Machine Architecture: \"$DESTARCH\"" 1>&2
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
|
3
scripts/dist/install-go-tools.sh
vendored
3
scripts/dist/install-go-tools.sh
vendored
|
@ -17,13 +17,14 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Determine the system architecture.
|
||||
if [[ $PHOTOPRISM_ARCH ]]; then
|
||||
SYSTEM_ARCH=$PHOTOPRISM_ARCH
|
||||
else
|
||||
SYSTEM_ARCH=$(uname -m)
|
||||
fi
|
||||
|
||||
DESTARCH=${2:-$SYSTEM_ARCH}
|
||||
DESTARCH=${BUILD_ARCH:-$SYSTEM_ARCH}
|
||||
|
||||
if [ -d "/go" ]; then
|
||||
GOPATH="/go"
|
||||
|
|
6
scripts/dist/install-go.sh
vendored
6
scripts/dist/install-go.sh
vendored
|
@ -22,14 +22,14 @@ echo "Installing ${GOLANG_VERSION} in \"${DESTDIR}\"..."
|
|||
|
||||
set -e
|
||||
|
||||
# Query architecture.
|
||||
# Determine the system architecture.
|
||||
if [[ $PHOTOPRISM_ARCH ]]; then
|
||||
SYSTEM_ARCH=$PHOTOPRISM_ARCH
|
||||
else
|
||||
SYSTEM_ARCH=$(uname -m)
|
||||
fi
|
||||
|
||||
DESTARCH=${2:-$SYSTEM_ARCH}
|
||||
DESTARCH=${BUILD_ARCH:-$SYSTEM_ARCH}
|
||||
|
||||
mkdir -p "$DESTDIR"
|
||||
|
||||
|
@ -49,7 +49,7 @@ case $DESTARCH in
|
|||
;;
|
||||
|
||||
*)
|
||||
echo "Unsupported Machine Architecture: \"$BUILD_ARCH\"" 1>&2
|
||||
echo "Unsupported Machine Architecture: \"$DESTARCH\"" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
4
scripts/dist/install-gpu.sh
vendored
4
scripts/dist/install-gpu.sh
vendored
|
@ -13,13 +13,15 @@ fi
|
|||
|
||||
set -e
|
||||
|
||||
# Determine the system architecture.
|
||||
if [[ $PHOTOPRISM_ARCH ]]; then
|
||||
SYSTEM_ARCH=$PHOTOPRISM_ARCH
|
||||
else
|
||||
SYSTEM_ARCH=$(uname -m)
|
||||
fi
|
||||
|
||||
DESTARCH=${DESTARCH:-$SYSTEM_ARCH}
|
||||
DESTARCH=${BUILD_ARCH:-$SYSTEM_ARCH}
|
||||
|
||||
TMPDIR=${TMPDIR:-/tmp}
|
||||
|
||||
. /etc/os-release
|
||||
|
|
6
scripts/dist/install-jxl.sh
vendored
6
scripts/dist/install-jxl.sh
vendored
|
@ -11,15 +11,17 @@ if [[ $(id -u) != "0" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Determine the system architecture.
|
||||
if [[ $PHOTOPRISM_ARCH ]]; then
|
||||
SYSTEM_ARCH=$PHOTOPRISM_ARCH
|
||||
else
|
||||
SYSTEM_ARCH=$(uname -m)
|
||||
fi
|
||||
|
||||
DESTARCH=${BUILD_ARCH:-$SYSTEM_ARCH}
|
||||
|
||||
LIB_VERSION=${2:-v0.8.1}
|
||||
SYSTEM_ARCH=$("$(dirname "$0")/arch.sh")
|
||||
DESTARCH=${DESTARCH:-$SYSTEM_ARCH}
|
||||
|
||||
set -e
|
||||
|
||||
|
@ -66,7 +68,7 @@ case $DESTARCH in
|
|||
;;
|
||||
|
||||
*)
|
||||
echo "Unsupported Machine Architecture: \"$BUILD_ARCH\"" 1>&2
|
||||
echo "Unsupported Machine Architecture: \"$DESTARCH\"" 1>&2
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
|
10
scripts/dist/install-tensorflow.sh
vendored
10
scripts/dist/install-tensorflow.sh
vendored
|
@ -9,8 +9,14 @@ set -e
|
|||
|
||||
TF_VERSION=${TF_VERSION:-1.15.2}
|
||||
|
||||
SYSTEM_ARCH=$(uname -m)
|
||||
DESTARCH=${DESTARCH:-$SYSTEM_ARCH}
|
||||
# Determine the system architecture.
|
||||
if [[ $PHOTOPRISM_ARCH ]]; then
|
||||
SYSTEM_ARCH=$PHOTOPRISM_ARCH
|
||||
else
|
||||
SYSTEM_ARCH=$(uname -m)
|
||||
fi
|
||||
|
||||
DESTARCH=${BUILD_ARCH:-$SYSTEM_ARCH}
|
||||
|
||||
case $DESTARCH in
|
||||
amd64 | AMD64 | x86_64 | x86-64)
|
||||
|
|
Loading…
Reference in a new issue