Skip to content

Commit

Permalink
AppImage: Build using Ubuntu 18.04 (Bionic)
Browse files Browse the repository at this point in the history
Updates the Docker build to Ubuntu 18.04 (Bionic) and removes the
`libfontconfig1` / `libfreetype6` workarounds.

This is a backport of Electron-Cash#2144
  • Loading branch information
EchterAgo authored and PiRK committed Feb 15, 2021
1 parent b9236cd commit 8eca577
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 242 deletions.
57 changes: 0 additions & 57 deletions contrib/build-linux/appimage/Dockerfile_ub1604

This file was deleted.

34 changes: 21 additions & 13 deletions contrib/build-linux/appimage/Dockerfile_ub1804
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
FROM ubuntu:18.04@sha256:5f4bdc3467537cbbe563e80db2c3ec95d548a9145d64453b06939c4592d67b6d
FROM ubuntu:18.04@sha256:2aeed98f2fa91c365730dc5d70d18e95e8d53ad4f1bbf4269c3bb625060383f0

ENV LC_ALL=C.UTF-8 LANG=C.UTF-8

RUN apt-get update -q && \
RUN echo deb mirror://mirrors.ubuntu.com/mirrors.txt bionic main restricted universe multiverse > /etc/apt/sources.list && \
echo deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-updates main restricted universe multiverse >> /etc/apt/sources.list && \
echo deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-backports main restricted universe multiverse >> /etc/apt/sources.list && \
echo deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-security main restricted universe multiverse >> /etc/apt/sources.list && \
apt-get update -q && \
apt-get install -qy \
git=1:2.17.1-1ubuntu0.5 \
wget=1.19.4-1ubuntu2.1 \
git=1:2.17.1-1ubuntu0.7 \
wget=1.19.4-1ubuntu2.2 \
make=4.1-9.1ubuntu1 \
autotools-dev=20180224.1 \
autoconf=2.69-11 \
libtool=2.4.6-2 \
xz-utils=5.2.2-1.3 \
libssl-dev=1.1.0g-2ubuntu4.3 \
zlib1g-dev=1:1.2.11.dfsg-0ubuntu2 \
libffi6=3.2.1-8 \
libffi-dev=3.2.1-8 \
libncurses5-dev=6.1-1ubuntu1.18.04 \
libsqlite3-dev=3.22.0-1 \
libsqlite3-dev=3.22.0-1ubuntu0.4 \
libusb-1.0-0-dev=2:1.0.21-2 \
libudev-dev=237-3ubuntu10.38 \
gettext=0.19.8.1-6ubuntu0.1 \
libzbar0=0.10+doc-10.1build2 \
faketime=0.9.7-2 \
libxkbcommon-x11-0=0.8.0-1ubuntu0.1 \
libudev-dev=237-3ubuntu10.44 \
gettext=0.19.8.1-6ubuntu0.3 \
pkg-config=0.29.1-0ubuntu2 \
libdbus-1-3=1.12.2-1ubuntu1.2 \
libpcsclite-dev=1.8.23-1 \
swig=3.0.12-1 \
libxkbcommon-x11-0=0.8.2-1~ubuntu18.04.1 \
autopoint=0.19.8.1-6ubuntu0.3 \
zlib1g-dev=1:1.2.11.dfsg-0ubuntu2 \
libfreetype6=2.8.1-2ubuntu2.1 \
libfontconfig1=2.12.6-0ubuntu2 \
libssl-dev=1.1.1-1ubuntu2.1~18.04.7 \
&& \
rm -rf /var/lib/apt/lists/* && \
apt-get autoremove -y && \
Expand Down
13 changes: 1 addition & 12 deletions contrib/build-linux/appimage/_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ cp -fp "$PROJECT_ROOT/icons/electron-cash.png" "$APPDIR/electron-cash.png"

# add launcher
info "Adding launcher"
cp -fp "$CONTRIB/build-linux/appimage/scripts/common.conf" "$APPDIR/common.conf" || fail "Could not copy python script"
cp -fp "$CONTRIB/build-linux/appimage/scripts/common.sh" "$APPDIR/common.sh" || fail "Could not copy python script"
cp -fp "$CONTRIB/build-linux/appimage/scripts/apprun.sh" "$APPDIR/AppRun" || fail "Could not copy AppRun script"
cp -fp "$CONTRIB/build-linux/appimage/scripts/python.sh" "$APPDIR/python" || fail "Could not copy python script"

Expand All @@ -152,17 +152,6 @@ info "Copying additional libraries"
# On some systems it can cause problems to use the system libusb
cp -fp /usr/lib/x86_64-linux-gnu/libusb-1.0.so "$APPDIR"/usr/lib/x86_64-linux-gnu/. || fail "Could not copy libusb"

# Ubuntu 14.04 lacks a recent enough libfreetype / libfontconfig, so we include one here
mkdir -p "$APPDIR"/usr/lib/fonts/freetype
mkdir -p "$APPDIR"/usr/lib/fonts/fontconfig
cp -fp /usr/lib/x86_64-linux-gnu/libfreetype.so.6 "$APPDIR"/usr/lib/fonts/freetype/. || fail "Could not copy libfreetype"
cp -fp /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 "$APPDIR"/usr/lib/fonts/fontconfig/. || fail "Could not copy libfontconfig"
cp -f "$CONTRIB/build-linux/appimage/scripts/test-freetype.py" "$APPDIR" || fail "Could not copy test-freetype.py"
cp -f "$CONTRIB/build-linux/appimage/scripts/test-fontconfig.py" "$APPDIR" || fail "Could not copy test-fontconfig.py"

# libfreetype needs a recent enough zlib
cp -f /lib/x86_64-linux-gnu/libz.so.1 "$APPDIR"/usr/lib/x86_64-linux-gnu || fail "Could not copy zlib"

# some distros lack libxkbcommon-x11
cp -f /usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 "$APPDIR"/usr/lib/x86_64-linux-gnu || fail "Could not copy libxkbcommon-x11"

Expand Down
13 changes: 1 addition & 12 deletions contrib/build-linux/appimage/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,7 @@ if [ -z ${SUDO+x} ] ; then
fi
fi

# Ubuntu 18.04 based docker file. Seems to have trouble on older systems
# due to incompatible GLIBC and other libs being too new inside the squashfs.
# BUT it has OpenSSL 1.1. We will switch to this one sometime in the future
# "when the time is ripe".
#DOCKER_SUFFIX=ub1804
# Ubuntu 16.04 based docker file. Works on a wide variety of older and newer
# systems but only has OpenSSL 1.0. We will use this one for now until
# the world upgrades -- and since OpenSSL 1.1 isn't a hard requirement
# for us, we'll live. (Note that it's also possible to build our own OpenSSL
# in the docker image if we get desperate for OpenSSL 1.1 but still want to
# benefit from the compatibility granted to us by using an older Ubuntu).
DOCKER_SUFFIX=ub1604
DOCKER_SUFFIX=ub1804
IMGNAME="electrumabc-appimage-builder-img-$DOCKER_SUFFIX"
CONTAINERNAME="electrumabc-appimage-builder-cont-$DOCKER_SUFFIX"

Expand Down
2 changes: 1 addition & 1 deletion contrib/build-linux/appimage/scripts/apprun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
set -e

APPDIR="$(dirname "$(readlink -e "$0")")"
. "$APPDIR"/common.conf
. "$APPDIR"/common.sh

exec "$PYTHON" -s "${APPDIR}/usr/bin/electrum-abc" "$@"
15 changes: 0 additions & 15 deletions contrib/build-linux/appimage/scripts/common.conf

This file was deleted.

7 changes: 7 additions & 0 deletions contrib/build-linux/appimage/scripts/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -e

PYTHON="${APPDIR}/usr/bin/python3.6"

export LD_LIBRARY_PATH="${APPDIR}/usr/lib/:${APPDIR}/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
export PATH="${APPDIR}/usr/bin:${PATH}"
export LDFLAGS="-L${APPDIR}/usr/lib/x86_64-linux-gnu -L${APPDIR}/usr/lib"
2 changes: 1 addition & 1 deletion contrib/build-linux/appimage/scripts/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
set -e

APPDIR="$(dirname "$(readlink -e "$0")")"
. "$APPDIR"/common.conf
. "$APPDIR"/common.sh

exec "$PYTHON" "$@"
55 changes: 0 additions & 55 deletions contrib/build-linux/appimage/scripts/test-fontconfig.py

This file was deleted.

76 changes: 0 additions & 76 deletions contrib/build-linux/appimage/scripts/test-freetype.py

This file was deleted.

0 comments on commit 8eca577

Please sign in to comment.