Subversion Repositories Scribus

Rev

Rev 10780 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10780 craig 1
BUILDING SCRIBUS ON MICROSOFT WINDOWS
2
=====================================
3
 
10797 craig 4
STATUS OF WIN32 CMAKE BUILDS
5
============================
6
 
7
Building Scribus on win32 with cmake is still rather poorly tested.
8
It's getting there, but for now the Visual Studio project based builds
9
maintained by Jean Ghali are much more stable.
10
 
11
Known issues with this build:
12
 
13
	- It's hard to ensure that debug libs are used for debug builds
14
	  and release libs for release builds, as not all CMake scripts
15
	  do this sensibly.
16
 
17
	- The scripter isn't building yet.
18
 
19
	- The sxwim plugin isn't building yet.
20
 
21
HOW TO DO THE BUILD
22
===================
23
 
10780 craig 24
This documentation is minimal, and will be replaced by more detailed
25
information once the CMake-based win32 builds are better tested.
26
 
27
You will need:
28
	- Microsoft Windows XP (others may work but are untested)
29
	- Microsoft Visual Studio Express Edition 8 2005
30
	- The Microsoft Platform SDK
10797 craig 31
	- CMake 2.5.x (2.4.x WILL NOT WORK)
32
	- A recent Qt 4.3 snapshot built with Visual Studio 8 2005
33
	- libxml2 win32 binaries from the libxml project
34
	- libjpeg sources from jig.org
35
	- libtiff sources
36
	- libpng sources
37
	- zlib sources
10780 craig 38
	- freetype sources
39
	- LittleCMS sources
40
	- PoDoFo 0.5.0 (and ONLY 0.5.0) sources.
10797 craig 41
	- A Python 2.5 Windows binary build.
42
          For debug builds, you'll need a release that contains the python25_d.dll .
10780 craig 43
 
10797 craig 44
Some more details can be found below in the section entitled GETTING DEPENDENCIES.
10780 craig 45
 
46
To build scribus its self, you should create a new empty build directory
47
outside the Scribus source tree. In this directory, create a new text file and
48
name it "build.cmd". Ignore the warning about changing the file extension.
49
 
50
Open build.cmd in a text editor, and paste the following into it:
51
 
52
---
53
rem Dependency paths:
54
set CMAKE=C:\Program Files\CMake 2.5\bin\cmake.exe
10797 craig 55
rem used for headers only; we get the lib from the libpng build
56
set ZLIBDIR=c:\developer\lib\zlib
57
rem provides both png and zlib .libs
58
set PNGDIR=C:\developer\lib\lpng1220-vc\
10780 craig 59
set QTDIR=C:\developer\Qt\qt-win-opensource-src-4.3.2-snapshot-20070929
10797 craig 60
set LCMSDIR=c:\developer\lib\lcms-1.16-vc
61
set JPEGDIR=c:\developer\lib\jpeg-6b-vc
62
set FREETYPEDIR=c:\developer\lib\freetype-2.3.5
63
set TIFFDIR=c:\developer\lib\tiff-3.8.2-vc
64
set PODOFODIR=c:\developer\podofo\050-vs-inst
10780 craig 65
set PODOFOSHARED=1
10797 craig 66
set LIBXMLDIR=c:\developer\lib\libxml2-2.6.30.win32
10780 craig 67
set SCRIBUSINSTALLDIR=c:\developer\scribus-bin
68
rem
69
rem
10797 craig 70
set PATH=%SYSTEMROOT%;%SYSTEMROOT%\system32;%QTDIR%\bin
71
set INCLUDE=
72
set LIB=
73
set SCPNGPROJ=%PNGDIR%\projects\visualc71\
10780 craig 74
del cmakecache.txt
10797 craig 75
"%CMAKE%" -G "Visual Studio 8 2005" -DCMAKE_INCLUDE_PATH:PATH=%ZLIBDIR%;%ZLIBDIR%\include;%PNGDIR%;%PNGDIR%\include;%LCMSDIR%\include;%JPEGDIR%;%JPEGDIR%\include;%TIFFDIR%\libtiff;%TIFFDIR%\include;%FREETYPEDIR%\include;%FREETYPEDIR%\include\freetype2;%PODOFODIR%\include;%LIBXMLDIR%\include -DCMAKE_LIBRARY_PATH:PATH=%ZLIBDIR%\lib;%SCPNGPROJ%\Win32_DLL_Debug\Zlib;%SCPNGPROJ%\Win32_DLL_Release\Zlib;%PNGDIR%\lib;%SCPNGPROJ%\Win32_DLL_Debug;%SCPNGPROJ%\Win32_DLL_Release;%LCMSDIR%\lib;%LCMSDIR%\Lib\MS;%JPEGDIR%;%JPEGDIR%\lib;%TIFFDIR%\libtiff;%TIFFDIR%\lib;%FREETYPEDIR%\objs;%FREETYPEDIR%\lib;%PODOFODIR%\lib;%LIBXMLDIR%\lib -DLIBPODOFO_SHARED=%PODOFOSHARED% -DCMAKE_INSTALL_PREFIX=c:\developer\scribus-bin -DPNG_NAMES:STRING=libpng13 -DJPEG_NAMES:STRING=libjpeg -DFREETYPE_LIBRARY_NAMES=freetype235MT ..\scribus-trunk
10780 craig 76
---
77
 
10797 craig 78
The above script is designed to work with common arrangements of library
79
install directories, both build trees and installed copies. If you follow the
80
instructions here about setting up the libraries scribus requires, you should
81
be OK. [SEE: GETTING DEPENDENENCIES]
10780 craig 82
 
10797 craig 83
Update the dependency paths to match your system.  Now open a cmd.exe window,
84
cd into the build directory, and run build.cmd . If all goes well, it'll find
85
your libraries and exit successfully.
86
 
10780 craig 87
Open the solution that CMake generated in Visual Studio and build it. On
88
Windows it's easier to do a release build as you don't need to build a debug
89
Qt, python, etc.
90
 
91
If it all builds, manually build the INSTALL project to trigger an install. Now
10797 craig 92
copy the DLLs from the zlib, libpng, qt, lcms, freetype, libtiff, libjpeg,
93
libxml, and podofo directories into the Scribus install directory (where
94
scribus.exe is). It should now run.
10780 craig 95
 
96
Crash problems at runtime? Verify that Qt, freetype, lcms, and Scribus all use
97
the same runtime, and that all were built for debugging or all for release not
98
a mixture of the two. Windows does not permit you to mix debug and release
99
executables like other platforms do.
100
 
101
You can use depends.exe to check that the runtimes match.
102
 
10797 craig 103
GETTING DEPENDENCIES
104
====================
105
 
106
This is a quick and dirty set of notes that will be filled out once everything's
107
verified as correct and working. It asssumes that you'll be building all your
108
dependencies at a single root, like C:\Developer. The root *MUST* not have spaces
109
in its path.
110
 
111
----
112
Qt:
113
 
114
\visual\studio\VC\vcvarsall.bat
115
\platform\sdk\setenv.cmd
116
configure -debug-and-release -fast -no-qt3support -platform win32-msvc2005
117
 
118
----
119
 
120
zlib:
121
 
122
download the sources from from www.zlib.net and unpack.
123
Use the directory name 'zlib' (just 'zlib') since libpng
124
relies on this.
125
 
126
Don't bother building it. libpng will do that for us.
127
 
128
----
129
 
130
libpng:
131
 
132
get sources from:
133
http://www.libpng.org/pub/png/libpng.html
134
 
135
unpack with the same parent directory as zlib.
136
 
137
open projects\visualc71\libpng.sln
138
upgrade
139
build all
140
 
141
**WARNING**
142
If you build libpng and zlib with Visual Studio 8, you will
143
get DLLs with the official names, but they will not be fully
144
binary compatible with the official DLLs. We can get away
145
with using them privately for Scribus, but for a release
146
it's recommended that you rebuild the DLLs with different
147
names.
148
**WARNING**
149
 
150
----
151
 
152
jpeg:
153
 
154
Get jpeg sources setup from gnuwin32. Install.
155
In %GNUWIN32%\src\jpeg\6b\jpeg-6b-src:
156
 
157
copy Makefile.vc Makefile
158
copy jconfig.vc jconfig.h
159
nmake
160
 
161
(you might have to use vcvars.bat from vc and setvars.bat from the platform sdk)
162
 
163
 
164
----
165
 
166
lcms:
167
 
168
Get lcms sources.
169
Build using VC project in Projects dir. Only build the DLL
170
(right click -> build on lcmsdll).
171
 
172
Now modify lcms.h and remove:
173
 
174
#define unlink _unlink
175
 
176
You must modify lcms.h to prevent it from defining `cdecl'. [TODO: other
177
changes] [ TODO: line numbers / patch ]. This is only required to use the
178
header with Scribus; it's Ok to use a library built without these changes.
179
 
180
 
181
----
182
 
183
Libtiff
184
 
185
download and unpack libtiff
186
 
187
in a vcvars/setenv window:
188
 
189
set INCLUDE=%INCLUDE%;\path\to\jpeg\include;\path\to\zlib\include
190
set LIB=%LIB%;\path\to\jpeg\lib;\path\to\zlib\lib
191
 
192
cd %LIBTIFFDIR%\libtiff
193
nmake /nologo /f Makefile.vc libtiff.lib
194
 
195
----
196
 
197
Freetype:
198
 
199
unpack freetype
200
open builds\win32\visualc
201
upgrade
202
build "Release Multithreaded" and "Debug Multithreaded"
203
 
204
----
205
 
206
libxml:
207
 
208
download win32 binaries from libxml.org, unpack.
209
Note that these binaries do not use the same runtime
210
as the rest of the binaries we're building. Feel free to
211
rebuild libxml to fix this, but in practice it doesn't
212
matter since we never pass a FILE* nor do we allocate memory
213
to be deallocated in libxml or vice versa.
214
 
215
Remember that iconv from the same package must be on the
216
header search path too. If in doubt, just drop iconv.h
217
into the libxml tree.
218
 
219
 
220
 
221
 
222
Notes:
223
 
224
CMake doesn't find zlib; you have to tell it it's zlib1  by modifying FindZLIB.cmake
225
 
226