forked from Sigil-Ebook/Sigil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Building_Sigil_On_MacOSX_With_QT6.txt
95 lines (74 loc) · 5.19 KB
/
Building_Sigil_On_MacOSX_With_QT6.txt
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
89
90
91
92
93
94
# FIRST: See Building_Qt6_From_Source_on_MacOSX.txt
#
# SECOND: See Building_A_Relocatable_Python_3.9_Framework_on_MacOSX.txt
#
# Also make sure you have the latest XCode and ** Command Line tools** Installed
# via: xcode-select --install
#
# You will need to have CMake 3.22.1 or later installed and in your path
# standard deployment target
export MACOSX_DEPLOYMENT_TARGET=10.14
# Set the location of where the relocatable Python framework was installed
# See "Building_A_Relocatable_Python_3.9_Framework_on_MacOSX.txt
# Remember to stay away from /tmp locations as Mac OSX has a daemon that will delete
# files in tmp older than 3 days right out from underneath the user
export MYDEST=/Users/$USER/devpython/libraries/Frameworks
# Set the location of where Qt is installed
export MYQTHOME=~/Qt622
# Set the location of where you want your Sigil repo to be stored
export MYSIGILREPO=~/repo
# clone the Sigil git repo
cd ${MYSIGILREPO}
git clone https://github.com/Sigil-Ebook/Sigil.git
# Add Qt to the path
export PATH=${PATH}:${MYQTHOME}/bin
# Make sure the newly created relocatable python framework is found first
# **before** any system version of Python3
export PATH=${MYDEST}/Python.framework/Versions/3.9/bin:${PATH}
mkdir build
cd build
# Use the latest XCode version that is supported by your version of MacOS
# For example:
# Mac OS Catalina (OSX 10.15) use the following with XCode 12.4
cmake -DPKG_SYSTEM_PYTHON=1 \
-DUSE_QT6=1 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS=-Wno-inconsistent-missing-override \
-DCMAKE_PREFIX_PATH=${MYQTHOME}/lib/cmake \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/ \
../Sigil
# After cmake completes
make
make addframeworks
As of Qt6 and later there is one final step required.
Qt's macdeployqt does not properly add the rpaths needed for the
Qt plugins to find the Qt Frameworks when embedded
inside an app even one using the specified Qt app layout.
These installed Qt plugins need to have an specific @loader_path rpath added
as follows:
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/iconengines/libqsvgicon.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/imageformats/libqgif.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/imageformats/libqicns.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/imageformats/libqico.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/imageformats/libqjpeg.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/imageformats/libqmacheif.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/imageformats/libqmacjp2.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/imageformats/libqtga.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/imageformats/libqtiff.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/imageformats/libqwbmp.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/imageformats/libqwebp.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/platforminputcontexts/libqtvirtualkeyboardplugin.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/platforms/libqcocoa.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/position/libqtposition_cl.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/position/libqtposition_nmea.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/position/libqtposition_positionpoll.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/styles/libqmacstyle.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/virtualkeyboard/libqtvirtualkeyboard_hangul.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/virtualkeyboard/libqtvirtualkeyboard_openwnn.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/virtualkeyboard/libqtvirtualkeyboard_pinyin.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/virtualkeyboard/libqtvirtualkeyboard_tcime.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/virtualkeyboard/libqtvirtualkeyboard_thai.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/tls/libqcertonlybackend.dylib
install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Contents/PlugIns/tls/libqsecuretransportbackend.dylib
# In ${MYSIGILREPO}/build/bin you will find the newly built Sigil.app