This repository has been archived by the owner on Feb 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build_osx_qt5.6_py2.7.sh
65 lines (52 loc) · 2.25 KB
/
build_osx_qt5.6_py2.7.sh
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
# Always review the official build instructions before updating:
# https://wiki.qt.io/PySide2_GettingStarted#Building_PySide2
# Homebrew already provided by Travis CI
# /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Homebrew if not already installed
if test ! $(which brew)
then
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Xcode already provided by Travis CI
# xcode-select --install
# sudo xcodebuild -license
# Check so that Python 2.7 is installed
if which python > /dev/null 2>&1;
then
if ! [[ $(python --version 2>&1) =~ 2\.7 ]]
then
echo "Python 2.7.x not installed."
exit 1
fi
else
echo "No Python executable is found."
exit 1
fi
# Install pip (with wheel) unless it already exists
# This was added for Travis CI osx image "xcode6.4",
# which is equipped with Python 2.7.10 but does not
# have pip installed.
if test ! $(which pip)
then
wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install --upgrade pip
sudo pip install --upgrade wheel
fi
# Install via Homebrew
# brew update
brew install https://raw.githubusercontent.com/fredrikaverpil/pyside2-wheels/master/homebrew/qt5/5.6.1-1/qt5.rb
brew install libxslt libxml2
# OpenSSL already provided by Travis CI
# brew install openssl
# CMake 3.0 already provided by Travis CI
# brew install cmake
git clone --recursive --branch 5.6 https://codereview.qt-project.org/pyside/pyside-setup ~/pyside-setup
# Fix bug https://bugreports.qt.io/browse/PYSIDE-552
sed -i.bak $'s/if(Qt5Designer_FOUND)/find_package(Qt5Designer)\\\nif(Qt5Designer_FOUND)/g' ~/pyside-setup/sources/pyside2/CMakeLists.txt
# Fix bug https://bugreports.qt.io/browse/PYSIDE-357
sed -i.bak $"s/packages = \['PySide2', 'pyside2uic'\],/packages = \['PySide2', 'pyside2uic'\, \'pyside2uic.Compiler\', \'pyside2uic.port_v\' + str(sys.version_info[0])],/g" ~/pyside-setup/setup.py
# Verify sed hacks
cat ~/pyside-setup/sources/pyside2/CMakeLists.txt
cat ~/pyside-setup/setup.py
python ~/pyside-setup/setup.py bdist_wheel --ignore-git --qmake=/usr/local/Cellar/qt5/5.6.1-1/bin/qmake --cmake=/usr/local/bin/cmake --openssl=/usr/local/Cellar/openssl/1.0.2h_1/bin --jobs=3