Subversion Repositories Scribus

Rev

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