#!/bin/bash set -e #set -o pipefail export V=1 VERBOSE=1 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig export ACLOCAL_PATH=/usr/local/share/aclocal # Arch Linux specific packages and environment pacman -Sy --needed curl git icu libxml2 autoconf automake flex gawk gcc libtool libxslt pcre pkgconfig python3 swig zlib libzip unzip zip make cmake perl boost readline bison libarchive xxhash sqlite python-lxml utf8cpp python-setuptools patch export LANG=C.UTF-8 LC_ALL=C.UTF-8 echo '/usr/local/lib' > /etc/ld.so.conf.d/usr-local.conf ldconfig rm -rf /tmp/apertium-all-dev mkdir -pv /tmp/apertium-all-dev pushd /tmp/apertium-all-dev git clone --depth 1 https://github.com/TinoDidriksen/cg3 pushd cg3 cmake -DENABLE_PYTHON_BINDINGS=ON . make -j ./test/runall.pl make install ldconfig popd git clone --depth 1 https://github.com/TinoDidriksen/transfuse pushd transfuse cmake . make -j make test make install ldconfig popd git clone --depth 1 https://github.com/mhulden/foma pushd foma/foma cmake . make -j make install ldconfig popd git clone --depth 1 https://github.com/TinoDidriksen/openfst pushd openfst curl https://raw.githubusercontent.com/apertium/packaging/refs/heads/main/tools/openfst/debian/patches/unique-ptr-reset.diff > 01.patch curl https://raw.githubusercontent.com/apertium/packaging/refs/heads/main/tools/openfst/debian/patches/openfst-cxx17.diff > 02.patch patch -p1 < 01.patch patch -p1 < 02.patch autoreconf -fvi ./configure --enable-bin --enable-compact-fsts --enable-compress --enable-const-fsts --enable-far --enable-fsts --enable-grm --enable-linear-fsts --enable-lookahead-fsts --enable-mpdt --enable-ngram-fsts --enable-pdt --enable-special --disable-static make -j make check make install ldconfig popd git clone --depth 1 https://github.com/hfst/hfst pushd hfst autoreconf -fvi ./configure --disable-static --enable-all-tools --with-readline --enable-python-bindings make -j make check make install ldconfig popd git clone --depth 1 https://github.com/hfst/hfst-ospell pushd hfst-ospell autoreconf -fvi ./configure --disable-static --enable-zhfst --without-libxmlpp --without-tinyxml2 make -j make check make install ldconfig popd git clone --depth 1 https://github.com/apertium/lttoolbox pushd lttoolbox cmake . make -j make test make install ldconfig popd for PKG in apertium apertium-lex-tools apertium-anaphora apertium-separable apertium-recursive lexd do git clone --depth 1 https://github.com/apertium/$PKG pushd $PKG autoreconf -fvi ./configure --disable-static --enable-python-bindings make -j make test make install ldconfig popd done git clone --depth 1 https://github.com/apertium/apertium-get pushd apertium-get cmake . make -j make install popd git clone --depth 1 https://github.com/apertium/apertium-init pushd apertium-init make install popd echo "" echo "" echo "Remember to add to your ~/.profile or global environment:" echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig" echo "export ACLOCAL_PATH=/usr/local/share/aclocal" echo "" echo "Also remember you MUST use a UTF-8 locale (envvar LANG and LC_ALL) for all Apertium work."