diff --git a/postgres-appliance/build_scripts/dependencies.sh b/postgres-appliance/build_scripts/dependencies.sh index c3bbf4ca6..59b50d3f6 100644 --- a/postgres-appliance/build_scripts/dependencies.sh +++ b/postgres-appliance/build_scripts/dependencies.sh @@ -16,38 +16,24 @@ fi export DEBIAN_FRONTEND=noninteractive MAKEFLAGS="-j $(grep -c ^processor /proc/cpuinfo)" export MAKEFLAGS -ARCH="$(dpkg --print-architecture)" +ARCH=$(uname -m) + +# We want to remove all libgdal30 debs except one that is for current architecture. +printf "shopt -s extglob\nrm /builddeps/!(*_%s.deb)" "$(dpkg --print-architecture)" | bash -s echo -e 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01norecommend apt-get update apt-get install -y curl ca-certificates -apt-get install -y software-properties-common gpg-agent -add-apt-repository ppa:longsleep/golang-backports -apt-get update -apt-get install -y golang-go liblzo2-dev brotli libsodium-dev git make cmake gcc libc-dev -go version - -git clone -b "$WALG_VERSION" --recurse-submodules https://github.com/wal-g/wal-g.git -cd /wal-g -go get -v -t -d ./... -go mod vendor - -bash link_brotli.sh - -sed -i -e 's/1.0.17/1.0.18/g' link_libsodium.sh -sed -i -e "s/download\/\$LIBSODIUM_VERSION/download\/\$LIBSODIUM_VERSION-RELEASE/g" link_libsodium.sh - -bash link_libsodium.sh - -export USE_LIBSODIUM=1 -export USE_LZO=1 -make pg_build - -# We want to remove all libgdal30 debs except one that is for current architecture. -printf "shopt -s extglob\nrm /builddeps/!(*_%s.deb)" "$ARCH" | bash -s - mkdir /builddeps/wal-g -cp /wal-g/main/pg/wal-g /builddeps/wal-g/ +if [ "$ARCH" = "amd64" ]; then + DISTRIB_RELEASE='ubuntu-20.04' +else + DISTRIB_RELEASE='ubuntu20.04' +fi + +curl -sL "https://github.com/wal-g/wal-g/releases/download/$WALG_VERSION/wal-g-pg-$DISTRIB_RELEASE-$ARCH.tar.gz" \ + | tar -C /builddeps/wal-g -xz +mv "/builddeps/wal-g/wal-g-pg-$DISTRIB_RELEASE-$ARCH" /builddeps/wal-g/wal-g