mirror of
https://github.com/qpdf/qpdf.git
synced 2024-09-27 12:39:06 +00:00
Convert AppImage build to use cmake
This commit is contained in:
parent
3a902ad20a
commit
1b85faa61a
@ -462,10 +462,12 @@ rsync -vrlcO ./ jay_berkenbilt,qpdf@frs.sourceforge.net:/home/frs/project/q/qp/q
|
|||||||
OTHER NOTES
|
OTHER NOTES
|
||||||
|
|
||||||
For local iteration on the AppImage generation, it works to just
|
For local iteration on the AppImage generation, it works to just
|
||||||
./build-scripts/build-appimage and get the resulting AppImage from
|
./build-scripts/build-appimage and get the resulting AppImage from the
|
||||||
the distribution directory. You can also pass -e SKIP_TESTS=1
|
distribution directory. You can pass additional arguments to
|
||||||
build-appimage, which passes it along to to docker, to skip the test
|
build-appimage, which passes them along to to docker.
|
||||||
suite, which useful for rapid iteration.
|
|
||||||
|
Use -e SKIP_TESTS=1 to skip the test suite.
|
||||||
|
Use -ti -e RUN_SHELL=1 to run a shell instead of the build script.
|
||||||
|
|
||||||
|
|
||||||
GENERAL BUILD STUFF
|
GENERAL BUILD STUFF
|
||||||
|
@ -1,13 +1,28 @@
|
|||||||
FROM ubuntu:18.04
|
FROM ubuntu:18.04 as start
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get update && \
|
RUN apt-get update
|
||||||
apt-get -y install screen autoconf git sudo \
|
RUN apt-get -y install screen git sudo \
|
||||||
build-essential zlib1g-dev libjpeg-dev libgnutls28-dev \
|
build-essential pkg-config \
|
||||||
python3-pip texlive-latex-extra latexmk \
|
zlib1g-dev libjpeg-dev libgnutls28-dev \
|
||||||
inkscape imagemagick busybox-static wget fuse && \
|
python3-pip texlive-latex-extra latexmk \
|
||||||
apt-get clean && \
|
inkscape imagemagick busybox-static wget fuse
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
# 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
|
RUN pip3 install sphinx sphinx_rtd_theme
|
||||||
|
|
||||||
|
FROM ubuntu:18.04 as run
|
||||||
|
COPY --from=start / /
|
||||||
COPY entrypoint /entrypoint
|
COPY entrypoint /entrypoint
|
||||||
RUN chmod +x /entrypoint
|
RUN chmod +x /entrypoint
|
||||||
ENTRYPOINT [ "/entrypoint" ]
|
ENTRYPOINT [ "/entrypoint" ]
|
||||||
|
@ -82,32 +82,35 @@ appdir=$here/build/appdir
|
|||||||
rm -rf $here/build
|
rm -rf $here/build
|
||||||
|
|
||||||
# Prepare build of QPDF from sources:
|
# Prepare build of QPDF from sources:
|
||||||
./configure --prefix=/usr --enable-werror \
|
rm -rf build.appimage
|
||||||
--enable-crypto-gnutls --disable-implicit-crypto \
|
mkdir build.appimage
|
||||||
--enable-show-failed-test-output \
|
cd build.appimage
|
||||||
--enable-html-doc --enable-pdf-doc "$CUSTOM_CONFIGURE"
|
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!
|
# Build!
|
||||||
make -j$(nproc)
|
cmake --build . -j$(nproc)
|
||||||
|
|
||||||
if [ "$SKIP_TESTS" = "" ]; then
|
if [ "$SKIP_TESTS" = "" ]; then
|
||||||
# Run built-in QPDF checks:
|
# Run built-in QPDF checks:
|
||||||
make -k check
|
ctest --verbose
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prepare AppDir which is the basis for the AppImage:
|
# Prepare AppDir which is the basis for the AppImage:
|
||||||
mkdir -p $appdir
|
mkdir -p $appdir
|
||||||
|
|
||||||
# Install build result into AppDir:
|
# Install build result into AppDir:
|
||||||
make install DESTDIR=$appdir; find $appdir
|
for i in lib cli doc; do
|
||||||
make doc-dist DOC_DEST=appdir/usr/share/doc/qpdf
|
DESTDIR=$appdir cmake --install . --prefix /usr --component $i
|
||||||
|
done
|
||||||
|
find $appdir
|
||||||
|
|
||||||
# Change into build directory:
|
# Change into build directory:
|
||||||
cd $here/build
|
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:
|
# Copy icon which is needed for desktop integration into place:
|
||||||
for width in 64 128 256 512; do
|
for width in 64 128 256 512; do
|
||||||
dir=appdir/usr/share/icons/hicolor/${width}x${width}/apps
|
dir=appdir/usr/share/icons/hicolor/${width}x${width}/apps
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
if [ "$SKIP_TESTS" = "1" ]; then
|
|
||||||
touch /tmp/skip-tests
|
|
||||||
fi
|
|
||||||
if [ $(id -u) = 0 ]; then
|
if [ $(id -u) = 0 ]; then
|
||||||
if [ ! -d /tmp/build ]; then
|
if [ ! -d /tmp/build ]; then
|
||||||
echo "/tmp/build must exist"
|
echo "/tmp/build must exist"
|
||||||
@ -10,6 +7,10 @@ if [ $(id -u) = 0 ]; then
|
|||||||
fi
|
fi
|
||||||
id=$(stat -c %u /tmp/build)
|
id=$(stat -c %u /tmp/build)
|
||||||
adduser --home /tmp/build --no-create-home --uid $id --disabled-password --gecos build 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 "$@"
|
exec sudo -iu build $0 "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -22,7 +23,9 @@ if [ ! -d qpdf ]; then
|
|||||||
git clone "$@" qpdf
|
git clone "$@" qpdf
|
||||||
fi
|
fi
|
||||||
cd qpdf
|
cd qpdf
|
||||||
if [ -f /tmp/skip-tests ]; then
|
source /tmp/.env
|
||||||
export SKIP_TESTS=1
|
if [ "$RUN_SHELL" = "1" ]; then
|
||||||
|
bash
|
||||||
|
else
|
||||||
|
./appimage/build-appimage
|
||||||
fi
|
fi
|
||||||
./appimage/build-appimage
|
|
||||||
|
Loading…
Reference in New Issue
Block a user