Skip to content

Instantly share code, notes, and snippets.

@nmilford
Created August 9, 2017 13:27
Show Gist options
  • Save nmilford/6b661c0b4f2a6336c75c8e791385a8dd to your computer and use it in GitHub Desktop.
Save nmilford/6b661c0b4f2a6336c75c8e791385a8dd to your computer and use it in GitHub Desktop.
Create Native deb packages for Splash 3.0 dependencies for Ubuntu 16.04
# Make sure to have fpm installed as well as dependancies described here: https://github.com/scrapinghub/splash/blob/master/dockerfiles/splash/provision.sh
# Environment Setup
sudo mkdir -p /tmp/{downloads,build,target}
sudo mkdir -p /tmp/{downloads,build,target}
# Build qt-5.9.1 deb
sudo curl -L -o /tmp/downloads/qt-installer-noninteractive.qs https://raw.githubusercontent.com/scrapinghub/splash/master/dockerfiles/splash/qt-installer-noninteractive.qs
sudo sed -i 's|/opt/qt59|/tmp/target/opt/qt59|g' /tmp/downloads/qt-installer-noninteractive.qs
sudo curl -L -o /tmp/downloads/qt-installer.run http://download.qt.io/official_releases/qt/5.9/5.9.1/qt-opensource-linux-x64-5.9.1.run
sudo chmod +x /tmp/downloads/downloads/qt-installer.run
sudo xvfb-run /tmp/downloads/qt-installer.run --script /tmp/downloads/qt-installer-noninteractive.qs | egrep -v '\[[0-9]+\] Warning: (Unsupported screen format)|((QPainter|QWidget))'
sudo rm -rf /tmp/target/opt/qt59/{Docs,Tools,Examples}
sudo fpm -s dir -t deb -n qt-opensource -v 5.9.1 --iteration 1 -C /tmp/target
sudo dpkg -i ./qt-opensource_5.9.1-1_amd64.deb
sudo rm -rf /tmp/target/*
# Create qtwebkit deb
sudo mkdir -p /tmp/target/opt/qt59/5.9.1/gcc_64
sudo curl -L -o /tmp/downloads/qtwebkit.tar.xz https://github.com/annulen/webkit/releases/download/qtwebkit-5.212.0-alpha2/qtwebkit-5.212.0_alpha2-qt59-linux-x64.tar.xz
sudo tar xvfJ /tmp/downloads/qtwebkit.tar.xz --keep-newer-files -C /tmp/build/
sudo rsync -vaP /tmp/build/qtwebkit-5.212.0_alpha2-qt59-linux-x64/* /tmp/target/opt/qt59/5.9.1/gcc_64
sudo fpm -s dir -t deb -n qt-webkit5 -v 5.212.0-alpha2-qt59 --iteration 1 -C /tmp/target --depends 'qt-opensource = 5.9.1-1'
sudo dpkg -i qt-webkit5_5.212.0-alpha2-qt59-1_amd64.deb
sudo rm -rf /tmp/target/*
# Create sip deb
sudo curl -L -o /tmp/downloads/sip-4.19.3.tar.gz https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.3/sip-4.19.3.tar.gz
sudo tar xzf /tmp/downloads/sip-4.19.3.tar.gz --keep-newer-files -C /tmp/build/
cd /tmp/build/sip-4.19.3
sudo python3 configure.py
sudo make -j 2
sudo make DESTDIR=/tmp/target install
sudo fpm -s dir -t deb -n sip -v 4.19.3 --iteration 1 -C /tmp/target
sudo dpkg -i ./sip_4.19.3-1_amd64.deb
sudo rm -rf /tmp/target/*
# Create PyQT5 deb
sudo curl -L -o /tmp/downloads/PyQt5_gpl-5.9.tar.gz https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.9/PyQt5_gpl-5.9.tar.gz
sudo tar xzf /tmp/downloads/PyQt5_gpl-5.9.tar.gz --keep-newer-files -C /tmp/build/
cd /tmp/build/PyQt5_gpl-5.9/
sudo python3 configure.py -c \
--bindir=/tmp/target/usr/bin \
--destdir=/tmp/target/usr/lib/python3/dist-packages \
--sipdir=/tmp/target/usr/share/sip/PyQt5 \
--qmake /opt/qt59/5.9.1/gcc_64/bin/qmake \
--verbose \
--confirm-license \
--no-designer-plugin \
--no-qml-plugin \
--no-python-dbus \
-e QtCore \
-e QtGui \
-e QtWidgets \
-e QtNetwork \
-e QtWebKit \
-e QtWebKitWidgets \
-e QtSvg \
-e QtPrintSupport
sudo make -j 2
sudo make install
sudo fpm -s dir -t deb -n PyQt5-gpl -v 5.9 --iteration 1 -C /tmp/target
sudo rm -rf /tmp/target
sudo rm -rf /tmp/build
sudo rm -rf /tmp/download
# To run in a new environment:
sudo apt update
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
# New packages we just built from your private repo... or you can dpkg -i them.
sudo apt install pyqt5-gpl qt-opensource qt-webkit5 sip
sudo apt install flashplugin-installer python3-pip python3-dev ttf-mscorefonts-installer fonts-liberation \
ttf-wqy-zenhei fonts-arphic-gbsn00lp fonts-arphic-bsmi00lp fonts-arphic-gkai00mp \
fonts-arphic-bkai00mp gstreamer1.0-libav gstreamer1.0-plugins-good gstreamer1.0-x \
libc-dev libcurl3 libfontconfig1-dev libgbm1 libgl1-mesa-dev libglu1-mesa-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev \
libhyphen-dev libicu-dev libpng12-dev libpython3.5 libsqlite3-dev libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcomposite-dev libxi6 libxml2-dev \
libxrender-dev libxslt1-dev mesa-common-dev netbase pkg-config webp xvfb zlib1g
pip3 install splash
QT_PLUGIN_PATH=/opt/qt59/5.9.1/gcc_64/plugins/ python3 /usr/local/bin/splash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment