@@ -34,25 +34,34 @@ Directories
34
34
cr3gui - CR3 with CR3GUI for e-ink devices sources
35
35
cr3qt - CR3 with Qt based GUI
36
36
cr3wx - CR3 with wxWidgets based GUI
37
- thirdparty - third party libraries, to use if not found in system (zlib, libpng, libjpeg, freetype, harfbuzz )
37
+ thirdparty - third party libraries, to use if not found in system (zlib, libpng, libjpeg, freetype, etc... )
38
38
thirdparty_repo - repository for third party libraries deployments
39
39
thirdparty_unman - unmanaged third party libraries
40
40
tinydict - small library for .dict file format support
41
41
tools - miscellaneous configuration files
42
- android - Android port
42
+ android - Android frontend
43
43
44
44
External dependencies
45
45
---------------------
46
46
47
- common: zlib, libpng, libjpeg, freetype, harfbuzz
47
+ common: zlib, libpng, libjpeg, freetype, harfbuzz, fribidi, libunibreak, utf8proc, zstd
48
48
cr3gui/xcb: libxcb, fontconfig
49
49
cr3gui/nanoX: libnanoX
50
- cr3/Qt: qt4-core, qt4-gui
51
- cr3/wx: wxWidgets 2.8
50
+ cr3/Qt: fontconfig, qt5-base, qt5-tools
51
+ cr3/wx: fontconfig, wxWidgets 3.0
52
52
53
53
e.g., for Ubuntu you may use
54
54
55
- > sudo apt-get install git-core cmake libqt4-dev libpng12-dev libfreetype6-dev libjpeg62-dev libfontconfig1-dev zlib1g-dev
55
+ $ sudo apt install build-essential git cmake curl pkg-config zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libunibreak-dev libzstd-dev libutf8proc-dev
56
+
57
+ To build Qt frontend:
58
+
59
+ $ sudo apt install qtbase5-dev qttools5-dev
60
+
61
+ To build wxWidgets frontend:
62
+
63
+ $ sudo apt install libwxgtk3.0-gtk3-dev
64
+
56
65
57
66
Packaging
58
67
---------
@@ -75,47 +84,161 @@ Android Build Instructions
75
84
76
85
In Windows can be used git bash terminal
77
86
78
- > ./thirdparty-deploy.sh
87
+ $ ./thirdparty-deploy.sh
79
88
80
89
* Use Android Studio - open subdirectory "android" as Android Studio project
81
90
82
91
Ensure that you have Android SDK and NDK installed
83
92
84
93
85
94
86
- CMake Build Instructions
95
+ CMake Build Instructions (Linux)
87
96
------------------------
88
97
89
- # Building QT version
90
- # libqt4-dev should be installed
91
- mkdir qtbuild
92
- cd qtbuild
93
- cmake -D GUI=QT -D CMAKE_BUILD_TYPE=Release -D MAX_IMAGE_SCALE_MUL=2 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1400000 -D CMAKE_INSTALL_PREFIX=/usr ..
94
- make
95
- sudo make install
98
+ In case the installed libraries are outdated, run the ` thirdparty-deploy.sh ` script to download libraries sources of the recommended versions. In this case, the build system will build static libraries that were not found in the system.
99
+
100
+ $ ./thirdparty-deploy.sh
96
101
102
+ Building Qt version (qtbase5-dev, qttools5-dev should be installed)
97
103
98
- # Building QT version, in DEBUG mode
99
104
mkdir qtbuild
100
105
cd qtbuild
101
- cmake -D GUI=QT -D CMAKE_BUILD_TYPE=Debug -D MAX_IMAGE_SCALE_MUL=2 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1400000 -D CMAKE_INSTALL_PREFIX=/usr ..
106
+ cmake -D GUI=QT5 -D CMAKE_BUILD_TYPE=Release -D MAX_IMAGE_SCALE_MUL=2 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1400000 -D CMAKE_INSTALL_PREFIX=/usr ..
102
107
make
103
108
sudo make install
104
109
105
- # Building QT version, in DEBUG mode, ANTIWORD development
110
+
111
+ Building Qt version, in DEBUG mode
112
+
106
113
mkdir qtbuild
107
114
cd qtbuild
108
- cmake -D GUI=QT -D CMAKE_BUILD_TYPE=Debug -D ENABLE_ANTIWORD=1 -D MAX_IMAGE_SCALE_MUL=2 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1400000 -D CMAKE_INSTALL_PREFIX=/usr ..
115
+ cmake -D GUI=QT5 -D CMAKE_BUILD_TYPE=Debug -D MAX_IMAGE_SCALE_MUL=2 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1400000 -D CMAKE_INSTALL_PREFIX=/usr ..
109
116
make
110
117
sudo make install
111
118
112
- # Building wxWidgets version
113
- # libwxgtk2.8-dev should be installed
119
+ Building wxWidgets version (libwxgtk3.0-gtk3-dev should be installed)
120
+
114
121
mkdir wxbuild
115
122
cd wxbuild
116
- cmake -D GUI=WX -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr ..
123
+ cmake -D GUI=WX -D CMAKE_BUILD_TYPE=Release -D MAX_IMAGE_SCALE_MUL=2 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1400000 -D CMAKE_INSTALL_PREFIX=/usr ..
117
124
make
118
125
126
+
127
+ Qt Build under Windows (Using MSYS2)
128
+ ======================
129
+
130
+ - Download and install msys2 from https://www.msys2.org/
131
+ - Update MSYS2:
132
+
133
+ Run "MSYS2 MSYS" from start menu
134
+
135
+ $ pacman -Sy
136
+ $ pacman -Su
137
+
138
+ Run "MSYS2 MSYS" from Start menu again.<br />
139
+ Update the rest of the base packages:
140
+
141
+ $ pacman -Su
142
+
143
+ - Install build tools & dependencies:
144
+
145
+ Run "MSYS2 MSYS" from start menu.<br />
146
+ Using pacman package manager install required packages:
147
+
148
+ $ pacman -S --needed base-devel mingw-w64-x86_64-toolchain
149
+ $ pacman -S git curl
150
+ $ pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-pkgconf mingw-w64-x86_64-zlib mingw-w64-x86_64-libpng mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-freetype mingw-w64-x86_64-fontconfig mingw-w64-x86_64-harfbuzz mingw-w64-x86_64-fribidi mingw-w64-x86_64-zstd
151
+
152
+ To build Qt frontend:
153
+
154
+ $ pacman -S mingw-w64-x86_64-qt5
155
+
156
+ - Prepare:
157
+
158
+ Run "MSYS2 MinGW 64-bit" from start menu
159
+
160
+ $ git clone https://github.com/buggins/coolreader.git
161
+ $ cd coolreader
162
+
163
+ Since package libunibreak not exists in MSYS2, we must build static version of this library, to do this, we need to call the script thirdparty-deploy.sh to download sources:
164
+
165
+ $ ./thirdparty-deploy.sh
166
+
167
+ Build system will build static libraries that were not found in the system.
168
+
169
+ - Compile:
170
+
171
+ Now we can build program:
172
+
173
+ $ mkdir qtbuild
174
+ $ cd qtbuild
175
+ $ cmake -G "MSYS Makefiles" -D CMAKE_BUILD_TYPE=Release -D GUI=QT5 -D MAX_IMAGE_SCALE_MUL=2 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1400000 -D CMAKE_INSTALL_PREFIX=dist ..
176
+ $ make
177
+ $ make install
178
+
179
+ Now in qtbuild/dist directory we have CoolReader binary & data.<br />
180
+ To add Qt runtime libraries, call:
181
+
182
+ $ cd dist
183
+ $ windeployqt --compiler-runtime --no-webkit2 --no-angle --no-opengl-sw --no-quick-import .
184
+
185
+ To add thirdparty runtime libraries, call:
186
+
187
+ $ cp -pv /mingw64/bin/{libfontconfig-1.dll,libexpat-1.dll,libfreetype-6.dll,libbz2-1.dll,libbrotlidec.dll,libbrotlicommon.dll,libharfbuzz-0.dll,libglib-2.0-0.dll,libintl-8.dll,libiconv-2.dll,libpcre-1.dll,libgraphite2.dll,libpng16-16.dll,zlib1.dll,libfribidi-0.dll,libjpeg-8.dll,libutf8proc.dll,libzstd.dll,libdouble-conversion.dll,libicuin68.dll,libicuuc68.dll,libicudt68.dll,libpcre2-16-0.dll} .
188
+
189
+ After updating any library in MSYS 2, this list may need to be corrected. If after that the program does not start with an error about the missing dll, then you need to copy this library from ` /mingw64/bin/ ` to ` qtbuild/dist ` .
190
+
191
+ Qt Build under Windows (Using Qt SDK, obsolete)
192
+ ======================
193
+
194
+ Using Qt SDK
195
+
196
+ Environment setup:
197
+
198
+ - Download and install Qt SDK, git, cmake, msys
199
+ - Copy contents of git and cmake dirs to QT/mingw/
200
+ - Copy make.exe from msys/bin to QT/mingw/bin
201
+
202
+ Run Qt SDK / Qt Command Prompt. Execute:
203
+
204
+ > sh
205
+ > git clone https://github.com/buggins/coolreader.git
206
+ > cd coolreader
207
+ > mkdir qtbuild
208
+ > cd qtbuild
209
+ > cmake -D GUI=QT -D CMAKE_BUILD_TYPE=Release -G "MSYS Makefiles" -D USE_QT_ZLIB=1 -D CMAKE_INSTALL_PREFIX=dist ..
210
+ > make
211
+ > make install
212
+
213
+ cmake -D GUI=QT -D CMAKE_BUILD_TYPE=Release -G "Visual Studio 9 2008" -D USE_QT_ZLIB=1 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1500000 -D CMAKE_INSTALL_PREFIX=dist ..
214
+ cmake -D GUI=QT -D CMAKE_BUILD_TYPE=Release -G "Visual Studio 10" -D USE_QT_ZLIB=1 -D MAX_IMAGE_SCALE_MUL=2 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1500000 -D CMAKE_INSTALL_PREFIX=dist ..
215
+
216
+ to disable console, use /SUBSYSTEM: WINDOWS linker option instead of /SUBSYSTEM: CONSOLE
217
+
218
+ For Qt5, use GUI=QT5 instead of GUI=QT
219
+
220
+ For building Qt5 app from QtCreator remove -G (generator) parameter:
221
+
222
+ Release build:
223
+
224
+ -D GUI=QT5 -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=dist ..
225
+
226
+ Debug build:
227
+
228
+ -D GUI=QT5 -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=dist ..
229
+
230
+ It will put built cr3.exe and all necessary distribution files to directory qtbuild/dist.
231
+
232
+ You need also add following DLLs to this directory in order to get cr3.exe working:
233
+
234
+ - mingwm10.dll
235
+ - QtCore4.dll
236
+ - QtGui4.dll
237
+ - libz.dll
238
+
239
+ CMake Build Instructions (obsolete)
240
+ ------------------------
241
+
119
242
# Building ARM version on OpenInkpot:
120
243
mkdir armbuild
121
244
cd armbuild
@@ -214,55 +337,7 @@ CMake Build Instructions
214
337
make
215
338
216
339
217
- QT Build under Windows
218
- ======================
219
-
220
- Using QT SDK
221
-
222
- Environment setup:
223
-
224
- - Download and install QT SDK, git, cmake, msys
225
- - Copy contents of git and cmake dirs to QT/mingw/
226
- - Copy make.exe from msys/bin to QT/mingw/bin
227
-
228
- Run Qt SDK / Qt Command Prompt. Execute:
229
-
230
- > sh
231
- > git clone git://crengine.git.sourceforge.net/gitroot/crengine/crengine cr3
232
- > cd cr3
233
- > mkdir qtbuild
234
- > cd qtbuild
235
- > cmake -D GUI=QT -D CMAKE_BUILD_TYPE=Release -G "MSYS Makefiles" -D USE_QT_ZLIB=1 -D CMAKE_INSTALL_PREFIX=dist ..
236
- > make
237
- > make install
238
-
239
- cmake -D GUI=QT -D CMAKE_BUILD_TYPE=Release -G "Visual Studio 9 2008" -D USE_QT_ZLIB=1 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1500000 -D CMAKE_INSTALL_PREFIX=dist ..
240
- cmake -D GUI=QT -D CMAKE_BUILD_TYPE=Release -G "Visual Studio 10" -D USE_QT_ZLIB=1 -D MAX_IMAGE_SCALE_MUL=2 -D DOC_DATA_COMPRESSION_LEVEL=3 -D DOC_BUFFER_SIZE=0x1500000 -D CMAKE_INSTALL_PREFIX=dist ..
241
-
242
- to disable console, use /SUBSYSTEM: WINDOWS linker option instead of /SUBSYSTEM: CONSOLE
243
-
244
- For QT5, use GUI=QT5 instead of GUI=QT
245
-
246
- For building Qt5 app from QtCreator remove -G (generator) parameter:
247
-
248
- Release build:
249
-
250
- -D GUI=QT5 -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=dist ..
251
-
252
- Debug build:
253
-
254
- -D GUI=QT5 -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=dist ..
255
-
256
- It will put built cr3.exe and all necessary distribution files to directory qtbuild/dist.
257
-
258
- You need also add following DLLs to this directory in order to get cr3.exe working:
259
-
260
- - mingwm10.dll
261
- - QtCore4.dll
262
- - QtGui4.dll
263
- - libz.dll
264
-
265
- Qt Build under Mac OSX
340
+ Qt Build under Mac OSX (obsolete)
266
341
======================
267
342
268
343
#configure and make Qt as static libraries
0 commit comments