Files
photoview/dependencies/prepare.sh
Kostiantyn a8edb30ae4 Refactor Docker build workflows (#1221)
* Initial implementation

* Multiple fixes and improvemens

* Better `curl` retries timing

* Remove unused `TARGETOS` and `TARGETVARIANT` vars; add the version fetch fallback code to the build scripts

* Move the fallback code before the var usage

* Use double braces to make the code compatible with the `set -u`

---------

Co-authored-by: Konstantin Koval
2025-06-26 11:58:50 +03:00

33 lines
716 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
: "${TARGETPLATFORM:=linux/$(dpkg --print-architecture)}"
: "${DEB_HOST_MULTIARCH:=$(uname -m)-linux-gnu}"
TARGETARCH="$(echo "$TARGETPLATFORM" | cut -d"/" -f2)"
DEBIAN_ARCH=$TARGETARCH
if [ "$TARGETARCH" = "arm" ]; then
DEBIAN_ARCH=armel
fi
dpkg --add-architecture "$DEBIAN_ARCH"
apt-get update
apt-get install -y --no-install-recommends \
curl \
ca-certificates \
crossbuild-essential-"${DEBIAN_ARCH}" \
libc-dev:"${DEBIAN_ARCH}" \
autoconf \
automake \
libtool \
m4 \
pkg-config \
cmake
dpkg-architecture -a "$DEBIAN_ARCH" >/env
echo "PKG_CONFIG_PATH=/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig" >>/env
# shellcheck disable=SC2046
export $(cat /env)
cat /env