aboutsummaryrefslogtreecommitdiffstats
path: root/appimage
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-03-12 02:54:48 +0100
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-03-19 00:53:18 +0100
commit1b85faa61abcec253f9fb5aab6f94c844e4df816 (patch)
treea4950664fd2c4942e348cf8e37791e79b3a4c9bc /appimage
parent3a902ad20afd385955e0d094d00bf7f385b1c3f0 (diff)
downloadqpdf-1b85faa61abcec253f9fb5aab6f94c844e4df816.tar.zst
Convert AppImage build to use cmake
Diffstat (limited to 'appimage')
-rw-r--r--appimage/Dockerfile31
-rwxr-xr-xappimage/build-appimage25
-rwxr-xr-xappimage/entrypoint15
3 files changed, 46 insertions, 25 deletions
diff --git a/appimage/Dockerfile b/appimage/Dockerfile
index 0b7232f9..da0b8b72 100644
--- a/appimage/Dockerfile
+++ b/appimage/Dockerfile
@@ -1,13 +1,28 @@
-FROM ubuntu:18.04
+FROM ubuntu:18.04 as start
ENV DEBIAN_FRONTEND=noninteractive
-RUN apt-get update && \
- apt-get -y install screen autoconf git sudo \
- build-essential zlib1g-dev libjpeg-dev libgnutls28-dev \
- python3-pip texlive-latex-extra latexmk \
- inkscape imagemagick busybox-static wget fuse && \
- apt-get clean && \
- rm -rf /var/lib/apt/lists/*
+RUN apt-get update
+RUN apt-get -y install screen git sudo \
+ build-essential pkg-config \
+ zlib1g-dev libjpeg-dev libgnutls28-dev \
+ python3-pip texlive-latex-extra latexmk \
+ inkscape imagemagick busybox-static wget fuse
+
+# Until we move to ubuntu:20.04, we need a newer cmake. After 20.04,
+# we can remove this and add cmake to the install above.
+RUN apt-get -y install software-properties-common wget
+RUN wget -O /etc/apt/trusted.gpg.d/kitware.asc \
+ https://apt.kitware.com/keys/kitware-archive-latest.asc
+RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
+RUN apt-get update
+RUN apt-get -y install cmake
+# End cmake
+
+RUN apt-get clean && rm -rf /var/lib/apt/lists/*
+
RUN pip3 install sphinx sphinx_rtd_theme
+
+FROM ubuntu:18.04 as run
+COPY --from=start / /
COPY entrypoint /entrypoint
RUN chmod +x /entrypoint
ENTRYPOINT [ "/entrypoint" ]
diff --git a/appimage/build-appimage b/appimage/build-appimage
index 19a2247b..82c82812 100755
--- a/appimage/build-appimage
+++ b/appimage/build-appimage
@@ -82,32 +82,35 @@ appdir=$here/build/appdir
rm -rf $here/build
# Prepare build of QPDF from sources:
-./configure --prefix=/usr --enable-werror \
- --enable-crypto-gnutls --disable-implicit-crypto \
- --enable-show-failed-test-output \
- --enable-html-doc --enable-pdf-doc "$CUSTOM_CONFIGURE"
+rm -rf build.appimage
+mkdir build.appimage
+cd build.appimage
+cmake -DWERROR=1 -DBUILD_DOC=1 -DCMAKE_BUILD_TYPE=Release \
+ -DBUILD_DOC_DIST=1 -DINSTALL_MANUAL=1 \
+ -DREQUIRE_CRYPTO_GNUTLS=1 -DUSE_IMPLICIT_CRYPTO=0 \
+ -DSHOW_FAILED_TEST_OUTPUT=1 -DBUILD_STATIC_LIBRARIES=0 \
+ "$CUSTOM_CONFIGURE" ..
# Build!
-make -j$(nproc)
+cmake --build . -j$(nproc)
if [ "$SKIP_TESTS" = "" ]; then
# Run built-in QPDF checks:
- make -k check
+ ctest --verbose
fi
# Prepare AppDir which is the basis for the AppImage:
mkdir -p $appdir
# Install build result into AppDir:
-make install DESTDIR=$appdir; find $appdir
-make doc-dist DOC_DEST=appdir/usr/share/doc/qpdf
+for i in lib cli doc; do
+ DESTDIR=$appdir cmake --install . --prefix /usr --component $i
+done
+find $appdir
# Change into build directory:
cd $here/build
-# Don't bundle developer stuff
-rm -rf appdir/usr/include appdir/usr/lib/pkgconfig appdir/usr/lib/*.{a,la,so}
-
# Copy icon which is needed for desktop integration into place:
for width in 64 128 256 512; do
dir=appdir/usr/share/icons/hicolor/${width}x${width}/apps
diff --git a/appimage/entrypoint b/appimage/entrypoint
index b1ee7eb0..12ed9387 100755
--- a/appimage/entrypoint
+++ b/appimage/entrypoint
@@ -1,8 +1,5 @@
#!/bin/bash
set -e
-if [ "$SKIP_TESTS" = "1" ]; then
- touch /tmp/skip-tests
-fi
if [ $(id -u) = 0 ]; then
if [ ! -d /tmp/build ]; then
echo "/tmp/build must exist"
@@ -10,6 +7,10 @@ if [ $(id -u) = 0 ]; then
fi
id=$(stat -c %u /tmp/build)
adduser --home /tmp/build --no-create-home --uid $id --disabled-password --gecos build build
+ touch /tmp/.env
+ echo "export SKIP_TESTS=$SKIP_TESTS" >> /tmp/.env
+ echo "export RUN_SHELL=$RUN_SHELL" >> /tmp/.env
+ chown build /tmp/.env
exec sudo -iu build $0 "$@"
fi
@@ -22,7 +23,9 @@ if [ ! -d qpdf ]; then
git clone "$@" qpdf
fi
cd qpdf
-if [ -f /tmp/skip-tests ]; then
- export SKIP_TESTS=1
+source /tmp/.env
+if [ "$RUN_SHELL" = "1" ]; then
+ bash
+else
+ ./appimage/build-appimage
fi
-./appimage/build-appimage