Skip to content

Commit

Permalink
Fix zlib version (#80)
Browse files Browse the repository at this point in the history
* Added test

* Update to 5.12; fix dynamic library inking for linux; testing for osx;

* Forget to leave directory in appveyor

* set libraries path

* Try again

* Actually missing sip for osx

* Adding plugins/platforms to LD_LIBRARY_PATH to fix linux missing xcb blah blah

* added xvbf service
  • Loading branch information
rllola authored Mar 13, 2019
1 parent 0e44441 commit 01786c8
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 40 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ matrix:
python: "2.7"
sudo: required
dist: xenial
services:
- xvfb
before_install:
- sudo add-apt-repository --yes ppa:beineri/opt-qt-5.11.3-xenial
- sudo add-apt-repository --yes ppa:beineri/opt-qt-5.12.0-xenial
- sudo apt-get update
- sudo apt-get install -y msgpack-python python-gevent python-dev build-essential libgl1-mesa-dev qt511-meta-minimal qt511webengine qt511svg
- sudo chmod +x /opt/qt511/bin/qt511-env.sh
- /opt/qt511/bin/qt511-env.sh
- sudo apt-get install -y msgpack-python python-gevent python-dev build-essential libgl1-mesa-dev qt512-meta-minimal qt512webengine qt512svg
- sudo chmod +x /opt/qt512/bin/qt512-env.sh
- /opt/qt512/bin/qt512-env.sh
- chmod +x get-pyqt5-linux.sh
- ./get-pyqt5-linux.sh
after_success:
- cp ./dist/ZeronetBrowser/PyQt5/Qt/resources/* ./dist/ZeronetBrowser/PyQt5/Qt/libexec/
- cp -r ./dist/ZeronetBrowser/PyQt5/Qt/translations/qtwebengine_locales/ ./dist/ZeronetBrowser/PyQt5/Qt/libexec/
- printenv
- export LD_LIBRARY_PATH=/opt/qt512/lib:/opt/qt512/plugins/platforms
- os: osx
language: generic
sudo: true
Expand All @@ -29,6 +30,7 @@ matrix:
- locate qt5
- chmod +x ./get-pyqt5-osx.sh
- ./get-pyqt5-osx.sh
- export DYLD_LIBRARY_PATH=/usr/local/opt/qt5/lib

install:
- sudo pip install pyinstaller cffi
Expand Down
31 changes: 19 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,34 @@ artifacts:
build: off

init:
- cmd: copy C:\windows\system32\libeay32.dll C:\Qt\5.11.3\msvc2017_64\bin
- cmd: copy C:\windows\system32\ssleay32.dll C:\Qt\5.11.3\msvc2017_64\bin
- SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\Qt\5.11.3\msvc2017_64\bin;%PATH%
- cmd: copy C:\windows\system32\libeay32.dll C:\Qt\5.12\msvc2017_64\bin
- cmd: copy C:\windows\system32\ssleay32.dll C:\Qt\5.12\msvc2017_64\bin
- SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\Qt\5.12\msvc2017_64\bin;%PATH%
- python -m pip install --upgrade pip setuptools
- python -m pip install pyinstaller pyinstaller-hooks msgpack gevent enum34 cffi pypiwin32

install:
- git submodule update --init --recursive
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
- set CL=/MP
- curl -LO https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.13/sip-4.19.13.zip
- 7z x sip-4.19.13.zip
- cd sip-4.19.13
- curl -LO https://www.riverbankcomputing.com/static/Downloads/sip/sip-4.19.14.zip
- 7z x sip-4.19.14.zip
- cd sip-4.19.14
- python configure.py --sip-module PyQt5.sip
- nmake
- nmake install
- cd ..
- curl -LO https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.11.3/PyQt5_gpl-5.11.3.zip
- 7z x PyQt5_gpl-5.11.3.zip
- cd PyQt5_gpl-5.11.3
- python configure.py --confirm-license --disable=QtNfc --qmake=C:\Qt\5.11.3\msvc2017_64\bin\qmake.exe
- curl -LO https://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt5_gpl-5.12.zip
- 7z x PyQt5_gpl-5.12.zip
- cd PyQt5_gpl-5.12
- python configure.py --confirm-license --no-docstrings --no-designer-plugin --no-tools --enable=QtWidgets --enable=QtCore --enable=QtGui --enable=QtPrintSupport --enable=QtPositioning --enable=QtNetwork --enable=QtQuick --enable=QtQuickWidgets --enable=QtWebChannel --enable=QtQml --qmake=C:\Qt\5.12\msvc2017_64\bin\qmake.exe --verbose
- nmake
- nmake install
- cd ..
- curl -LO https://www.riverbankcomputing.com/static/Downloads/PyQtWebEngine/PyQtWebEngine_gpl-5.12.zip
- 7z x PyQtWebEngine_gpl-5.12.zip
- cd PyQtWebEngine_gpl-5.12
- python configure.py --qmake=C:\Qt\5.12\msvc2017_64\bin\qmake.exe
- nmake
- nmake install
- cd ..
Expand All @@ -45,8 +52,8 @@ test_script:
- pyinstaller browser.spec

after_test:
- copy .\dist\ZeronetBrowser\PyQt5\Qt\resources\* .\dist\ZeronetBrowser\PyQt5\Qt\bin\
- copy .\dist\ZeronetBrowser\PyQt5\Qt\translations\qtwebengine_locales\ .\dist\ZeronetBrowser\PyQt5\Qt\bin\
#- copy .\dist\ZeronetBrowser\PyQt5\Qt\resources\* .\dist\ZeronetBrowser\PyQt5\Qt\bin\
#- copy .\dist\ZeronetBrowser\PyQt5\Qt\translations\qtwebengine_locales\ .\dist\ZeronetBrowser\PyQt5\Qt\bin\
- 7z a build-windows.zip dist/ZeronetBrowser/*

deploy:
Expand Down
37 changes: 28 additions & 9 deletions get-pyqt5-linux.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
#!/bin/bash

NP="$(nproc)"

PYQTSIP_VERSION=4.19.14

QT5_VERSION=5.12

QT5_PATH=/opt/qt512

echo "=========== Install SIP ==========="
wget -nv https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.13/sip-4.19.13.tar.gz
tar -xvzf sip-4.19.13.tar.gz
cd sip-4.19.13
wget -nv https://www.riverbankcomputing.com/static/Downloads/sip/sip-$PYQTSIP_VERSION.tar.gz
tar -xvzf sip-$PYQTSIP_VERSION.tar.gz
cd sip-$PYQTSIP_VERSION
python configure.py --sip-module=PyQt5.sip
make -j 8
make -j $NP
sudo make install
sudo touch /usr/lib/python2.7/dist-packages/PyQt5/__init__.py
echo "Done !"

cd ..

echo "=========== Install PyQt5 ==========="
wget -nv https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.11.3/PyQt5_gpl-5.11.3.tar.gz
tar -xvzf PyQt5_gpl-5.11.3.tar.gz
cd PyQt5_gpl-5.11.3
python configure.py --confirm-license --disable=QtNfc --qmake=/opt/qt511/bin/qmake -n PyQt5.sip
make -j 8
wget -nv https://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt5_gpl-$QT5_VERSION.tar.gz
tar -xvzf PyQt5_gpl-$QT5_VERSION.tar.gz
cd PyQt5_gpl-$QT5_VERSION
LD_LIBRARY_PATH=$QT5_PATH/lib python configure.py --confirm-license --no-docstrings --no-designer-plugin --no-tools --enable=QtWidgets --enable=QtCore --enable=QtGui --enable=QtPrintSupport --enable=QtPositioning --enable=QtNetwork --enable=QtQuick --enable=QtQuickWidgets --enable=QtWebChannel --enable=QtQml --qmake=$QT5_PATH/bin/qmake QMAKE_LFLAGS_RPATH=
make -j $NP
sudo make install
echo "Done !"

cd ..

echo "=========== Install PyQtWebEngine ==========="
wget -nv https://www.riverbankcomputing.com/static/Downloads/PyQtWebEngine/PyQtWebEngine_gpl-$QT5_VERSION.tar.gz
tar -xvzf PyQtWebEngine_gpl-$QT5_VERSION.tar.gz
cd PyQtWebEngine_gpl-$QT5_VERSION
LD_LIBRARY_PATH=$QT5_PATH/lib python configure.py --qmake=$QT5_PATH/bin/qmake
make -j $NP
sudo make install
echo "Done !"
34 changes: 25 additions & 9 deletions get-pyqt5-osx.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
#!/bin/bash
NP="$(sysctl -n hw.ncpu)"

PYQTSIP_VERSION=4.19.14

QT5_VERSION=5.12

echo "=========== Install SIP ==========="
wget -nv https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.13/sip-4.19.13.tar.gz
tar -xvzf sip-4.19.13.tar.gz
cd sip-4.19.13
wget -nv https://www.riverbankcomputing.com/static/Downloads/sip/sip-$PYQTSIP_VERSION.tar.gz
tar -xvzf sip-$PYQTSIP_VERSION.tar.gz
cd sip-$PYQTSIP_VERSION
python configure.py --sip-module=PyQt5.sip
make -j 8
make -j $NP
sudo make install
sudo touch /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyQt5/__init__.py
echo "Done !"

cd ..

echo "=========== Install PyQt5 ==========="
wget -nv https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.11.2/PyQt5_gpl-5.11.2.tar.gz
tar -xvzf PyQt5_gpl-5.11.2.tar.gz
cd PyQt5_gpl-5.11.2
wget -nv https://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt5_gpl-$QT5_VERSION.tar.gz
tar -xvzf PyQt5_gpl-$QT5_VERSION.tar.gz
cd PyQt5_gpl-$QT5_VERSION
ls /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/bin/
python configure.py --confirm-license --disable=QtNfc --qmake=/usr/local/opt/qt5/bin/qmake -n PyQt5.sip --sip=/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/bin/sip
make -j 8
DYLD_LIBRARY_PATH=/usr/local/opt/qt5/lib python configure.py --confirm-license --no-docstrings --no-designer-plugin --no-tools --enable=QtWidgets --enable=QtCore --enable=QtGui --enable=QtPrintSupport --enable=QtPositioning --enable=QtNetwork --enable=QtQuick --enable=QtQuickWidgets --enable=QtWebChannel --enable=QtQml --qmake=/usr/local/opt/qt5/bin/qmake --sip=/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/bin/sip QMAKE_LFLAGS_RPATH=
make -j $NP
sudo make install
echo "Done !"

cd ..

echo "=========== Install PyQtWebEngine ==========="
wget -nv https://www.riverbankcomputing.com/static/Downloads/PyQtWebEngine/PyQtWebEngine_gpl-$QT5_VERSION.tar.gz
tar -xvzf PyQtWebEngine_gpl-$QT5_VERSION.tar.gz
cd PyQtWebEngine_gpl-$QT5_VERSION
DYLD_LIBRARY_PATH=/usr/local/opt/qt5/lib python configure.py --qmake=/usr/local/opt/qt5/bin/qmake --sip=/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/bin/sip
make -j $NP
sudo make install
echo "Done !"
4 changes: 3 additions & 1 deletion launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import sys
import os
import ConfigParser
from src.MainWindow import MainWindow

from PyQt5.QtCore import QLibraryInfo, QCoreApplication
from PyQt5.QtWidgets import QApplication
from src.MainWindow import MainWindow
from multiprocessing import Process, freeze_support
from ZeroNet import zeronet
import time
Expand Down
9 changes: 7 additions & 2 deletions provision.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#!/usr/bin/env bash

QT5_VERSION=5.12.0

echo "===== INSTALL DEPENDENCIES ====="
sudo apt update
sudo apt install -y python-pip msgpack-python python-gevent python-dev
sudo pip install enum34

echo "===== INSTALL PYQT5 ====="
sudo add-apt-repository --yes ppa:beineri/opt-qt-5.11.2-xenial
sudo add-apt-repository --yes ppa:beineri/opt-qt-$QT5_VERSION-xenial
sudo apt-get update

# Install Qt5, QtWebEngine and QtSvg
sudo apt-get install -y msgpack-python python-gevent python-dev build-essential libgl1-mesa-dev qt511-meta-minimal qt511webengine qt511svg
sudo apt-get install -y build-essential libgl1-mesa-dev qt512-meta-minimal qt512webengine qt512svg

sudo chmod +x /opt/qt512/bin/qt512-env.sh
/opt/qt512/bin/qt512-env.sh

chmod +x ./Browser/get-pyqt5-linux.sh
./Browser/get-pyqt5-linux.sh
Expand Down
34 changes: 34 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
import unittest
import sys
import os

from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QLibraryInfo

print "PrefixPath : " + QLibraryInfo.location(QLibraryInfo.PrefixPath)
print "DocumentationPath : " + QLibraryInfo.location(QLibraryInfo.DocumentationPath)
print "HeadersPath : " + QLibraryInfo.location(QLibraryInfo.HeadersPath)
print "LibrariesPath : " + QLibraryInfo.location(QLibraryInfo.LibrariesPath)
print "LibraryExecutablesPath : " + QLibraryInfo.location(QLibraryInfo.LibraryExecutablesPath)
print "BinariesPath : " + QLibraryInfo.location(QLibraryInfo.BinariesPath)
print "PluginsPath : " + QLibraryInfo.location(QLibraryInfo.PluginsPath)
print "ImportsPath : " + QLibraryInfo.location(QLibraryInfo.ImportsPath)
print "Qml2ImportsPath : " + QLibraryInfo.location(QLibraryInfo.Qml2ImportsPath)
print "ArchDataPath : " + QLibraryInfo.location(QLibraryInfo.ArchDataPath)
print "DataPath : " + QLibraryInfo.location(QLibraryInfo.DataPath)
print "TranslationsPath : " + QLibraryInfo.location(QLibraryInfo.TranslationsPath)
print "ExamplesPath : " + QLibraryInfo.location(QLibraryInfo.ExamplesPath)
print "TestsPath : " + QLibraryInfo.location(QLibraryInfo.TestsPath)
print "SettingsPath : " + QLibraryInfo.location(QLibraryInfo.SettingsPath)

class TestBuild(unittest.TestCase):

Expand All @@ -13,6 +31,22 @@ def test_pyqt5(self):
def test_import_qtwebengine(self):
from PyQt5.QtWebEngineWidgets import QWebEngineView

def test_webview(self):
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtCore import QUrl, QTimer

app = QApplication([])
view = QWebEngineView()
# Use a raw string to avoid accidental special characters in Windows filenames:
# ``c:\temp`` is `c<tab>emp`!
view.load(QUrl("http://www.pyinstaller.org"))
view.show()

view.page().loadFinished.connect(
# Display the web page for one second after it loads.
lambda ok: QTimer.singleShot(5000, app.quit))
app.exec_()



if __name__ == '__main__':
Expand Down

0 comments on commit 01786c8

Please sign in to comment.