Subversion Repositories Scribus

Rev

Rev 16720 | Rev 17379 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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