1.1.6
by Oleksandr Moskalenko
Import upstream version 1.4.0.dfsg+r17287 |
1 |
BUILDING SCRIBUS ON MICROSOFT WINDOWS WITH MICROSOFT VISUAL STUDIO |
2 |
================================================================== |
|
3 |
||
4 |
HOW TO DO THE BUILD |
|
5 |
=================== |
|
6 |
||
7 |
This documentation is minimal and assume you have a decent knowledge of |
|
8 |
Microsoft Visual Studio. No help regarding use of Visual Studio and |
|
9 |
related tools will be provided. |
|
10 |
||
11 |
You will need: |
|
12 |
- Microsoft Windows XP, Vista or 7 |
|
13 |
- Microsoft Visual Studio 2008 or Visual C++ Express Edition 2008 |
|
1.1.8
by Oleksandr Moskalenko
Import upstream version 1.4.2.dfsg+r18267 |
14 |
- A recent Qt release built with Visual Studio 2008 (version >= 4.6) |
1.1.6
by Oleksandr Moskalenko
Import upstream version 1.4.0.dfsg+r17287 |
15 |
- Cairo sources from cairographics.org (version >= 1.8.0) |
16 |
- Pixman sources from cairographics.org (version >= 0.12.0) |
|
17 |
- Boost from www.boost.org (version >= 1.35.0) |
|
1.1.8
by Oleksandr Moskalenko
Import upstream version 1.4.2.dfsg+r18267 |
18 |
- Freetype sources from freetype.org (version >= 2.4.0) |
19 |
- Libhunspell sources from http://hunspell.sourceforge.net/ (version >= 1.3.2) |
|
1.1.6
by Oleksandr Moskalenko
Import upstream version 1.4.0.dfsg+r17287 |
20 |
- Libjpeg win32 libs and binaries from the GnuWin32 project |
21 |
- Libtiff win32 libs and binaries from the GnuWin32 project |
|
1.1.8
by Oleksandr Moskalenko
Import upstream version 1.4.2.dfsg+r18267 |
22 |
- Libxml2 win32 binaries from the Libxml project |
1.1.6
by Oleksandr Moskalenko
Import upstream version 1.4.0.dfsg+r17287 |
23 |
- LittleCMS sources from www.littlecms.com (version >= 2.1) |
1.1.8
by Oleksandr Moskalenko
Import upstream version 1.4.2.dfsg+r18267 |
24 |
- PoDoFo sources from podofo.sourceforge.net (version >= 0.8.x) |
1.1.6
by Oleksandr Moskalenko
Import upstream version 1.4.0.dfsg+r17287 |
25 |
- A Python 2.7 Windows binary build. |
26 |
For debug builds, you'll need a release that contains the python27_d.dll . |
|
27 |
||
28 |
Some more details can be found below in the section entitled GETTING DEPENDENCIES. |
|
29 |
||
1.1.8
by Oleksandr Moskalenko
Import upstream version 1.4.2.dfsg+r18267 |
30 |
After having installed all dependencies, open Scribus-build-props.vsprops files located |
1.1.6
by Oleksandr Moskalenko
Import upstream version 1.4.0.dfsg+r17287 |
31 |
in Scribus\win32\vc9 and update the dependency paths to match your system. |
32 |
||
33 |
Open the Visual Studio solution located in Scribus\win32\vc9 and start building. The *-cairo |
|
34 |
configurations will build Scribus with cairo renderer. The *-arthur configurations will buid |
|
35 |
Scribus using qt arthur renderer. Note : official Scribus builds use cairo as render. |
|
36 |
||
37 |
After building completed, you will find executables in a Scribus-builds\scribus-vc9-*\scribus |
|
38 |
directory located in same directory as Scribus sources. Those executables will not function yet. |
|
39 |
Scribus resources must be copied from source directory to install directory first. |
|
40 |
||
41 |
In order to do that, create a batch script and copy/paste following lines : |
|
42 |
||
43 |
set SCRIBUS_SRC_PATH=.\Scribus |
|
44 |
set SCRIBUS_BUILD_ROOT=.\Scribus-builds |
|
45 |
set SCRIBUS_INSTALL_PATH=.\Scribus-builds\scribus-vc9-debug-cairo\scribus |
|
46 |
||
47 |
copy %SCRIBUS_SRC_PATH%\AUTHORS %SCRIBUS_INSTALL_PATH%\share\doc |
|
48 |
copy %SCRIBUS_SRC_PATH%\COPYING %SCRIBUS_INSTALL_PATH%\share\doc |
|
49 |
copy %SCRIBUS_SRC_PATH%\LINKS %SCRIBUS_INSTALL_PATH%\share\doc |
|
50 |
copy %SCRIBUS_SRC_PATH%\TRANSLATION %SCRIBUS_INSTALL_PATH%\share\doc |
|
51 |
xcopy %SCRIBUS_SRC_PATH%\scribus\doc %SCRIBUS_INSTALL_PATH%\share\doc /s /y /D |
|
52 |
xcopy %SCRIBUS_SRC_PATH%\resources\dicts %SCRIBUS_INSTALL_PATH%\share\dicts /s /y /D |
|
53 |
xcopy %SCRIBUS_SRC_PATH%\resources\editorconfig %SCRIBUS_INSTALL_PATH%\share\editorconfig /s /y |
|
54 |
xcopy %SCRIBUS_SRC_PATH%\resources\icons %SCRIBUS_INSTALL_PATH%\share\icons /s /y /D |
|
55 |
xcopy %SCRIBUS_SRC_PATH%\resources\loremipsum %SCRIBUS_INSTALL_PATH%\share\loremipsum /s /y |
|
56 |
xcopy %SCRIBUS_SRC_PATH%\resources\profiles %SCRIBUS_INSTALL_PATH%\libs\profiles /s /y |
|
57 |
xcopy %SCRIBUS_SRC_PATH%\resources\swatches %SCRIBUS_INSTALL_PATH%\libs\swatches /s /y |
|
58 |
xcopy %SCRIBUS_SRC_PATH%\resources\templates %SCRIBUS_INSTALL_PATH%\share\templates /s /y /D |
|
59 |
copy %SCRIBUS_SRC_PATH%\scribus\plugins\tools\pathcut\*.png %SCRIBUS_INSTALL_PATH%\share\icons\ /y |
|
60 |
copy %SCRIBUS_SRC_PATH%\scribus\plugins\tools\pathfinder\*.png %SCRIBUS_INSTALL_PATH%\share\icons\ /y |
|
61 |
xcopy %SCRIBUS_SRC_PATH%\scribus\plugins\scriptplugin\scripts %SCRIBUS_INSTALL_PATH%\share\scripts /s /y /D |
|
62 |
xcopy %SCRIBUS_SRC_PATH%\scribus\plugins\scriptplugin\samples %SCRIBUS_INSTALL_PATH%\share\samples /s /y |
|
63 |
copy %SCRIBUS_SRC_PATH%\scribus\plugins\psimport\import.prolog %SCRIBUS_INSTALL_PATH%\libs\import.prolog |
|
64 |
copy %SCRIBUS_SRC_PATH%\scribus\plugins\barcodegenerator\barcode.ps %SCRIBUS_INSTALL_PATH%\share\plugins\barcode.ps |
|
65 |
copy %SCRIBUS_SRC_PATH%\scribus\unicodemap\unicodenameslist.txt %SCRIBUS_INSTALL_PATH%\share\unicodenameslist.txt |
|
66 |
del %SCRIBUS_BUILD_ROOT%\*CMake* /s |
|
67 |
del %SCRIBUS_BUILD_ROOT%\*MakeFile* /s |
|
68 |
||
69 |
Adjust SCRIBUS_SRC_PATH, SCRIBUS_BUILD_ROOT and SCRIBUS_INSTALL_PATH as needed and run batch script. |
|
70 |
||
71 |
Now copy the DLLs from the zlib, libpng, qt, lcms, freetype, libtiff, libjpeg, |
|
72 |
libxml, and podofo directories into the Scribus install directory (where |
|
73 |
scribus.exe is). Copy also the Dlls, lib and tcl directories from your python |
|
74 |
install to scribus install path. Finally copy python27.dll. Scribus should now run. |
|
75 |
||
76 |
Crash problems at runtime? Verify that Qt, freetype, lcms, and Scribus all use |
|
77 |
the same runtime, and that all were built for debugging or all for release not |
|
78 |
a mixture of the two. Windows does not permit you to mix debug and release |
|
79 |
executables like other platforms do. |
|
80 |
||
81 |
You can use depends.exe to check that the runtimes match. |
|
82 |
||
83 |
GETTING DEPENDENCIES |
|
84 |
==================== |
|
85 |
||
86 |
This is a quick and dirty set of notes that will be filled out once everything's |
|
87 |
verified as correct and working. It asssumes that you'll be building all your |
|
88 |
dependencies at a single root, like C:\Developer. The root *MUST* not have spaces |
|
89 |
in its path. |
|
90 |
||
91 |
---- |
|
92 |
Qt: |
|
93 |
||
94 |
Download the latest qt >= 4.6 snapshot from ftp://ftp.qt.nokia.com/qt/source |
|
95 |
and unpack it to C:\Developer. |
|
96 |
||
97 |
Start a command line and import your Visual Studio environment: |
|
98 |
\path\to\visual\studio\VC\vcvarsall.bat |
|
99 |
||
100 |
now cd to C:\Developer\qt-everywhere-whatever and run configure: |
|
101 |
configure -debug-and-release -fast -no-qt3support -platform win32-msvc2008 |
|
102 |
||
103 |
and nmake. |
|
104 |
||
105 |
---- |
|
106 |
Boost: |
|
107 |
||
108 |
Download the latest boost libraries from www.boost.org. Unpack, no need to compile |
|
109 |
anything as Scribus only use functionnalities embedded in C++ templates. |
|
110 |
||
111 |
---- |
|
112 |
Zlib and LibPNG : |
|
113 |
||
114 |
Zlib and LibPNG are both embedded in the QtCore library with symbols exported |
|
115 |
for public use . If you're using a Qt binary redist you may still need to |
|
116 |
download these libraries sources for their headers. In most cases your |
|
117 |
copy of Qt will contain a directory called %QTDIR%\src\3rdparty\zlib |
|
118 |
(and one for libpng), in which case you need not worry about these libraries at |
|
119 |
all. |
|
120 |
||
121 |
--- |
|
122 |
Cairo and Pixman |
|
123 |
||
124 |
Cairo and pixman sources can be downloaded from cairographics.org at following address : |
|
125 |
||
126 |
http://cairographics.org/releases/ |
|
127 |
||
128 |
Follow instructions in sources packages to build pixman, then cairo. |
|
129 |
||
130 |
You will however probably find easier to directly download packages with Visual Studio 2008 |
|
131 |
solutions ready to build. You can find required file at following address : |
|
132 |
||
133 |
https://sourceforge.net/projects/scribus/files/scribus-libs/win32-msvc2008/ |
|
134 |
||
135 |
Download the both scribus-pixman-* and scribus-cairo-* zip files. Unpack them. |
|
136 |
||
137 |
Build pixman first : open the PixManWin32 solution located in pixman-whatever\win32 |
|
138 |
directory and build Debug and Release configurations. |
|
139 |
||
140 |
Build cairo afterwards : open the CairoWin32 solution located in cairo-whatever\win32 |
|
141 |
directory and build Debug and Release configurations. |
|
142 |
||
143 |
---- |
|
144 |
Freetype: |
|
145 |
||
146 |
Unpack freetype |
|
147 |
||
148 |
Open include\freetype\config\ftoption.h and replace the DLL export compilation section |
|
149 |
by following lines : |
|
150 |
||
151 |
#ifndef __GNUC__ |
|
152 |
# define __DLL_IMPORT__ __declspec(dllimport) |
|
153 |
# define __DLL_EXPORT__ __declspec(dllexport) |
|
154 |
#else |
|
155 |
# define __DLL_IMPORT__ __attribute__((dllimport)) extern |
|
156 |
# define __DLL_EXPORT__ __attribute__((dllexport)) extern |
|
157 |
#endif |
|
158 |
||
159 |
#if (defined __WIN32__) || (defined _WIN32) |
|
160 |
# ifdef BUILD_FREETYPE2_DLL |
|
161 |
# define FREETYPE2_DLL_IMPEXP __DLL_EXPORT__ |
|
162 |
# elif defined(FREETYPE2_STATIC) |
|
163 |
# define FREETYPE2_DLL_IMPEXP |
|
164 |
# elif defined (USE_FREETYPE2_DLL) |
|
165 |
# define FREETYPE2_DLL_IMPEXP __DLL_IMPORT__ |
|
166 |
# elif defined (USE_FREETYPE2_STATIC) |
|
167 |
# define FREETYPE2_DLL_IMPEXP |
|
168 |
# else /* assume USE_FREETYPE2_DLL */ |
|
169 |
# define FREETYPE2_DLL_IMPEXP __DLL_IMPORT__ |
|
170 |
# endif |
|
171 |
#else /* __WIN32__ */ |
|
172 |
# define FREETYPE2_DLL_IMPEXP |
|
173 |
#endif |
|
174 |
||
175 |
#define FT_EXPORT(x) FREETYPE2_DLL_IMPEXP x |
|
176 |
#define FT_BASE(x) FREETYPE2_DLL_IMPEXP x |
|
177 |
||
178 |
Open builds\win32\vc2008 |
|
179 |
Build "Release Multithreaded" and "Debug Multithreaded" |
|
180 |
||
181 |
At the end of the process you must have those files in your freetype lib |
|
182 |
directory : |
|
183 |
- freetype.dll |
|
184 |
- freetype.lib |
|
185 |
- freetypeD.dll |
|
186 |
- freetypeD.lib |
|
187 |
||
188 |
---- |
|
1.1.8
by Oleksandr Moskalenko
Import upstream version 1.4.2.dfsg+r18267 |
189 |
Libhunspell : |
190 |
||
191 |
You will probably find easier to directly download packages with Visual |
|
192 |
Studio 2008 solutions ready to build. You can find required file at |
|
193 |
following address : |
|
194 |
||
195 |
https://sourceforge.net/projects/scribus/files/scribus-libs/win32-msvc2008/ |
|
196 |
||
197 |
Download the scribus-hunspell-*.zip archive. Unpack it. |
|
198 |
||
199 |
Open the visual studio solution located in hunspell-whatever/src/win-api directory and build |
|
200 |
Debug and Release configurations of Libhunspell project. |
|
201 |
||
202 |
---- |
|
203 |
Libjpeg : |
|
204 |
||
205 |
While Qt also bundles libjpeg, it's not linked to the main DLL but rather a plugin. |
|
206 |
As such, we need to link to it directly. |
|
207 |
||
208 |
Get jpeg libraries from GnuWin32 project on Sourceforge : |
|
209 |
||
210 |
http://sourceforge.net/projects/gnuwin32/files/jpeg/6b-3/jpeg-6b-3-lib.zip/download |
|
211 |
||
212 |
Unpack in C:\Developer. After unpacking you directory layout must be as following : |
|
213 |
||
214 |
C:\Developer |
|
215 |
|- libjpeg-6b-3 |
|
216 |
|- include |
|
217 |
|- lib |
|
218 |
|- manifest |
|
219 |
||
220 |
---- |
|
221 |
LittleCMS : |
|
222 |
||
223 |
Get lcms sources (>= 2.1). Although it is possible to build Scribus with lcms 1, |
|
224 |
you can only do so without modifying lcms sources with lcms >= 2.1. |
|
225 |
We will only describe here instructions related to lcms >= 2.1. |
|
226 |
||
227 |
Build using VC project in Projects\VC2008 dir. Modify projects if necessary so |
|
228 |
as to make them use the multithreaded dll runtim libraries. |
|
229 |
Build the static libraries in debug and release configurations. |
|
230 |
||
231 |
After building you must have a lcms2_static.lib and lcms2_staticd.lib in |
|
232 |
your lcms source directory. If this is not the case modify projects as necessary. |
|
233 |
||
234 |
---- |
|
235 |
Libtiff |
|
236 |
||
237 |
While Qt also bundles libtiff, it's not linked to the main DLL but rather a plugin. |
|
238 |
As such, we need to link to it directly. |
|
239 |
||
240 |
Download libtiff libraries, binaries and dependency packages from GnuWin32 project |
|
241 |
on sourceforge : |
|
242 |
||
243 |
http://sourceforge.net/projects/gnuwin32/files/tiff/3.8.2/ |
|
244 |
||
245 |
Unpack them in C:\Developer. After unpacking you directory layout must be as following : |
|
246 |
||
247 |
C:\Developer |
|
248 |
|- libtiff-3.8.2 |
|
249 |
|- bin |
|
250 |
|- contrib |
|
251 |
|- include |
|
252 |
|- lib |
|
253 |
|- man |
|
254 |
|- manifest |
|
255 |
||
256 |
---- |
|
1.1.6
by Oleksandr Moskalenko
Import upstream version 1.4.0.dfsg+r17287 |
257 |
Libxml2 / iconv : |
258 |
||
259 |
Download libxml2 and icon win32 binaries from following address : |
|
260 |
||
261 |
ftp://ftp.zlatkovic.com/libxml/ |
|
262 |
||
263 |
Note that these binaries do not use the same runtime |
|
264 |
as the rest of the binaries we're building. Feel free to |
|
265 |
rebuild libxml to fix this, but in practice it doesn't |
|
266 |
matter since we never pass a FILE* nor do we allocate memory |
|
267 |
to be deallocated in libxml or vice versa. |
|
268 |
||
269 |
Remember that iconv from the same package must be on the |
|
270 |
header search path too. If in doubt, just drop iconv.h |
|
271 |
into the libxml tree. |
|
272 |
||
273 |
--- |
|
274 |
Podofo : |
|
275 |
||
276 |
Podofo sources can be downloaded from podofo.sourceforge.net. At the moment |
|
277 |
those instructions are written, the recommended version to build Scribus on |
|
278 |
Windows is one of the 0.8.x series. |
|
279 |
||
280 |
Follow instructions in sources packages to build Podofo. |
|
281 |
||
282 |
You will however probably find easier to directly download packages with Visual |
|
283 |
Studio 2008 solutions ready to build. You can find required file at |
|
284 |
following address : |
|
285 |
||
286 |
https://sourceforge.net/projects/scribus/files/scribus-libs/win32-msvc2008/ |
|
287 |
||
288 |
Download the scribus-podofo-*.zip archive. Unpack it. |
|
289 |
||
290 |
Open the podofo solution located in podofo-whatever directory and build |
|
291 |
Debug and Release configurations of PoDoFoLib project. |
|
292 |
||
293 |
Note : freetype, libtiff and libjpeg must have been installed and if |
|
294 |
necessary compiled before attempting to build podofo. |
|
295 |
||
296 |
--- |
|
297 |
Python : |
|
298 |
||
299 |
Download latest Python 2.7 binaries (and only 2.7, 3.x will not work). |
|
300 |
Unpack or install. |
|
301 |
Copy the python27.lib file in python 'libs' directory to python27_d.lib |
|
302 |
||
303 |
Open pyconfig.h in python include directory |
|
304 |
||
305 |
Replace those lines : |
|
306 |
||
307 |
#ifdef _DEBUG |
|
308 |
# define Py_DEBUG |
|
309 |
#endif |
|
310 |
||
311 |
by : |
|
312 |
||
313 |
#ifdef _DEBUG |
|
314 |
# //define Py_DEBUG |
|
315 |
#endif |