1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
#!/bin/bash
set -e
set -o pipefail
set -x
export CFLAGS="-Wall -Werror=format-security"
export BUILD_TYPE=scripts
export DISTRO_NAME=ubuntu
export DISTRO_VERSION=latest
export START_DIR=/rootdir
export BUILD_DIR=/rootdir
export TRAVIS=false
export OWNER_NAME=crosswire
export REPO_NAME=xiphos
export CONTAINER_NAME=xiphos-ubuntu-build
export CPU_COUNT=2
cd /rootdir
START_DIR="$(pwd)"
WORK_DIR="/dep_build"
mkdir -p "${WORK_DIR}"
if [ "${DISTRO_NAME}" == "archlinux" ];then
cd "${WORK_DIR}"
id -u aur_install &>/dev/null || useradd -r -m -U -G wheel -k /dev/null aur_install
install -m600 /dev/stdin /etc/sudoers.d/70-wheel <<< '%wheel ALL=(ALL) ALL'
install -m600 /dev/stdin /etc/sudoers.d/99-aur_install <<< 'Defaults:aur_install !authenticate'
curl -o /home/aur_install/aur_install https://raw.githubusercontent.com/gik0geck0/aur_install/master/aur_install.sh
chmod +x /home/aur_install/aur_install
aur_install() {
su -l aur_install -c "./aur_install $1"
}
aur_install biblesync
aur_install gtkhtml4
fi
if [ "${DISTRO_NAME}" == "debian" -o "${DISTRO_NAME}" == "ubuntu" ]; then
# build gtkhtml4 from source
cd "${WORK_DIR}"
curl -Ls -o gtkhtml-4.10.0.tar.xz https://download.gnome.org/sources/gtkhtml/4.10/gtkhtml-4.10.0.tar.xz
tar xf gtkhtml-4.10.0.tar.xz
cd gtkhtml-4.10.0
./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/gtkhtml4 --localstatedir=/var --disable-static
make -j$(nproc)
make install
fi
if [ "${DISTRO_NAME}" == "ubuntu" ];then
# build biblesync from source
cd "${WORK_DIR}"
curl -Ls -o biblesync-1.2.0.tar.gz https://github.com/karlkleinpaste/biblesync/archive/1.2.0.tar.gz
tar xf biblesync-1.2.0.tar.gz
cd biblesync-1.2.0
mkdir -p build
cd build
cmake -DBUILD_SHARED_LIBS=TRUE -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=/usr/lib ..
make -j$(nproc)
make install
# update sword from 1.7.3 to 1.8.1
cd "${WORK_DIR}"
curl -Ls -o sword-1.8.1.tar.gz https://www.crosswire.org/ftpmirror/pub/sword/source/v1.8/sword-1.8.1.tar.gz
curl -Ls -o sword-1.8.1-cmake.diff https://src.fedoraproject.org/rpms/sword/raw/master/f/sword-1.8.1-cmake.diff
curl -Ls -o sword-1.8.1-icu61.diff https://src.fedoraproject.org/rpms/sword/raw/master/f/sword-1.8.1-icu61.diff
curl -Ls -o sword-1.8.1-swig.diff https://src.fedoraproject.org/rpms/sword/raw/master/f/sword-1.8.1-swig.diff
tar xf sword-1.8.1.tar.gz
cd sword-1.8.1
patch -p1 -i ../sword-1.8.1-cmake.diff
patch -p1 -i ../sword-1.8.1-icu61.diff
patch -p1 -i ../sword-1.8.1-swig.diff
mkdir -p build
cd build
cmake -DLIBSWORD_LIBRARY_TYPE="Shared" -DSYSCONF_INSTALL_DIR='/etc' -DSWORD_BUILD_TESTS="Yes" -DSWORD_BINDINGS="Python" -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=/usr/lib/x86_64-linux-gnu ..
make -j$(nproc)
make install
fi
|