forked from aantonw/docker-alpine-wkhtmltopdf-patched-qt
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
88 lines (84 loc) · 2.53 KB
/
Dockerfile
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
FROM alpine:3.8
MAINTAINER Matthias Langbein <matthias@movio.co>
# install qt build packages #
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk update \
&& apk add gtk+ openssl glib fontconfig bash vim \
&& apk add --virtual .deps git patch make g++ \
libc-dev gettext-dev zlib-dev bzip2-dev libffi-dev pcre-dev \
glib-dev atk-dev expat-dev libpng-dev freetype-dev fontconfig-dev \
libxau-dev libxdmcp-dev libxcb-dev xf86bigfontproto-dev libx11-dev \
libxrender-dev pixman-dev libxext-dev cairo-dev perl-dev \
libxfixes-dev libxdamage-dev graphite2-dev icu-dev harfbuzz-dev \
libxft-dev pango-dev gtk+-dev libdrm-dev \
libxxf86vm-dev libxshmfence-dev wayland-dev mesa-dev openssl-dev \
&& git clone --recursive https://github.com/wkhtmltopdf/wkhtmltopdf.git /tmp/wkhtmltopdf \
&& cd /tmp/wkhtmltopdf \
&& git checkout a8ba57e \
&& cd /tmp/wkhtmltopdf/qt \
&& git checkout wk_4.8.7 && git reset --hard 5db36ec
COPY conf/* /tmp/wkhtmltopdf/qt/
RUN cd /tmp/wkhtmltopdf/qt && \
patch -p1 -i qt-musl.patch && \
patch -p1 -i qt-musl-iconv-no-bom.patch && \
patch -p1 -i qt-recursive-global-mutex.patch && \
patch -p1 -i qt-font-pixel-size.patch && \
patch -p1 -i qt-gcc6.patch && \
sed -i "s|-O2|$CXXFLAGS|" mkspecs/common/g++.conf && \
sed -i "/^QMAKE_RPATH/s| -Wl,-rpath,||g" mkspecs/common/g++.conf && \
sed -i "/^QMAKE_LFLAGS\s/s|+=|+= $LDFLAGS|g" mkspecs/common/g++.conf && \
CFLAGS=-w CPPFLAGS=-w CXXFLAGS=-w LDFLAGS=-w \
./configure -confirm-license -opensource \
-prefix /usr \
-datadir /usr/share/qt \
-sysconfdir /etc \
-plugindir /usr/lib/qt/plugins \
-importdir /usr/lib/qt/imports \
-fast \
-release \
-static \
-largefile \
-glib \
-graphicssystem raster \
-qt-zlib \
-qt-libpng \
-qt-libmng \
-qt-libtiff \
-qt-libjpeg \
-svg \
-script \
-webkit \
-gtkstyle \
-xmlpatterns \
-script \
-scripttools \
-openssl-linked \
-nomake demos \
-nomake docs \
-nomake examples \
-nomake tools \
-nomake tests \
-nomake translations \
-no-qt3support \
-no-pch \
-no-icu \
-no-phonon \
-no-phonon-backend \
-no-rpath \
-no-separate-debug-info \
-no-dbus \
-no-opengl \
-no-openvg && \
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
export MAKEFLAGS=-j${NPROC} && \
export MAKE_COMMAND="make -j${NPROC}" && \
make --silent && \
make install && \
cd /tmp/wkhtmltopdf && \
qmake && \
make --silent && \
make install && \
rm -rf /tmp/*
# remove qt build packages #
RUN apk del .deps \
&& rm -rf /var/cache/apk/*