weblate/ci/apt-install
2023-01-11 09:25:24 +01:00

58 lines
1.4 KiB
Bash
Executable file

#!/bin/sh
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -e -x
CI_DATABASE="$1"
mkdir -p /run/user/1000
chown -R 1000:1000 /run/user/1000
# Add PostgreSQL repo
echo "deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list
curl -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
# Update package lists
apt-get --option="APT::Acquire::Retries=3" update
# Remove non-installable git packages. There git-svn can not be installed
# because the image contains newer versions which do not have matching git-svn
# in enabled repositories.
apt-get purge git git-man
# Install dependencies
apt-get --option="APT::Acquire::Retries=3" install -y \
gir1.2-pango-1.0 \
gettext \
git \
git-svn \
gnupg \
subversion \
postgresql-client-15 \
pkg-config \
python-dev \
libxml2-dev \
libacl1-dev \
libxmlsec1-dev \
libleptonica-dev \
libtesseract-dev \
libsasl2-dev \
libldap2-dev \
libssl-dev \
libffi-dev \
libenchant1c2a \
libgirepository1.0-dev \
libcairo-dev \
liblz4-dev \
gir1.2-pango-1.0 \
cython \
tesseract-ocr
# Remove MySQL 8.x client, use older MariaDB one to ensure compatibility
if [ "$CI_DATABASE" = "mariadb" ] ; then
apt-get purge 'mysql-client.*'
apt-get --option="APT::Acquire::Retries=3" install -y mariadb-client
fi