Skip to content

Instantly share code, notes, and snippets.

@hbrunn
Last active November 8, 2017 10:41
Show Gist options
  • Save hbrunn/9a6a577fd8a3ef9d9ce268f3a340a290 to your computer and use it in GitHub Desktop.
Save hbrunn/9a6a577fd8a3ef9d9ce268f3a340a290 to your computer and use it in GitHub Desktop.
build_wkhtmltopdf_stretch
mkdir build_wkhtmltopdf_chroot
sudo debootstrap --include=git,python,ca-certificates stretch build_wkhtmltopdf_chroot
sudo chroot build_wkhtmltopdf_chroot
# add a deb-src line to /etc/apt/source.list
grep ^deb /etc/apt/sources.list | sed 's/^deb/deb-src/' >> /etc/apt/sources.list
apt-get update
apt-get build-dep wkhtmltopdf qt5-default
cd /root
git clone --recursive https://github.com/wkhtmltopdf/wkhtmltopdf.git -b 0.12.1
cd wkhtmltopdf
# we need to patch qt to compile with gcc 6
patch -p0 <<HEREDOC
diff -up qt/configure.gcc6 qt/configure
--- qt/configure.old
+++ qt/configure
@@ -7729,7 +7729,7 @@ case "$XPLATFORM" in
*-g++*)
$(printf '\t')# Check gcc's version
$(printf '\t')case "\$(\${QMAKE_CONF_COMPILER} -dumpversion)" in
-$(printf '\t') 4*|3.4*)
+$(printf '\t') 8*|7*|6*|5*|4*|3.4*)
$(printf '\t')$(printf '\t');;
3.3*)
canBuildWebKit="no"
@@ -8060,7 +8060,7 @@ g++*)
3.*)
COMPILER_VERSION="3.*"
;;
- 4.*)
+ 8*|7*|6*|5*|4.*)
COMPILER_VERSION="4"
;;
*)
diff -up qt/src/xmlpatterns/api/qcoloroutput_p.h qt/src/xmlpatterns/api/qcoloroutput_p.h
--- qt/src/xmlpatterns/api/qcoloroutput_p.h
+++ qt/src/xmlpatterns/api/qcoloroutput_p.h
@@ -70,8 +70,8 @@ namespace QPatternist
ForegroundShift = 10,
BackgroundShift = 20,
SpecialShift = 20,
- ForegroundMask = ((1 << ForegroundShift) - 1) << ForegroundShift,
- BackgroundMask = ((1 << BackgroundShift) - 1) << BackgroundShift
+ ForegroundMask = 0x1f << ForegroundShift,
+ BackgroundMask = 0x7 << BackgroundShift
};
public:
HEREDOC
# and we need to force old style C++
echo "QMAKE_CXXFLAGS += -std=gnu++98 -Wno-unused-local-typedefs -Wno-c++11-compat" >> qt/mkspecs/common/g++-unix.conf
scripts/build.py posix-local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment