~ubuntu-branches/debian/sid/scribus/sid

« back to all changes in this revision

Viewing changes to BUILDING_win32_cmake.txt

  • Committer: Package Import Robot
  • Author(s): Oleksandr Moskalenko
  • Date: 2012-02-09 21:50:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120209215056-2wrx1ara0jbm7fi5
Tags: 1.4.0.dfsg+r17287-1
* New upstream stable release upload into Debian (Closes: #654703).
* Applied the Ubuntu armel patch.
* Removed non-free color swatches from resources.
* debian/control:
  - Moved icc-profiles from Recommends to Suggests (Closes: #655885).
  - Updated Standards-Version to 3.9.2.
  - Updated extended description per lintian warning.
* debian/rules:
  - Update mailcap (Closes: #630751). A request for mime.types update has
    been sent to the mime-support maintainer.
  - Added build-arch and build-indep targets per lintian warning.
* debian/patches:
  - top_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't install the non-free "doc" dir.
  - profiles_cmakelists.patch - don't install non-free sRGB profile.
* debian/copyright: 
  - Converted to the DEP5 machine readable foramt.
  - Added licenses for free color swatches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
BUILDING SCRIBUS ON MICROSOFT WINDOWS WITH CMAKE
 
2
================================================
 
3
 
 
4
Note : the informations provided in this file are outdated and kept for 
 
5
reference only. The preferred way to build Scribus on Windows is to use 
 
6
Microsoft Visual Studio. Please read BUILDING_WIN32_msvc.txt for 
 
7
instructions related to Visual Studio builds.
 
8
 
 
9
STATUS OF WIN32 CMAKE BUILDS
 
10
============================
 
11
 
 
12
Building Scribus on win32 with cmake is still rather poorly tested.
 
13
It's getting there, but for now the Visual Studio project based builds
 
14
maintained by Jean Ghali are much more stable. For instructions related
 
15
to building Scribus with Visual Studio, please report yourself to the 
 
16
BUILDING_WIN32_msvc.txt file located in same directory.
 
17
 
 
18
Known issues with this build:
 
19
 
 
20
        - It's hard to ensure that debug libs are used for debug builds
 
21
          and release libs for release builds, as not all CMake scripts
 
22
          do this sensibly.
 
23
 
 
24
        - The scripter isn't building yet.
 
25
 
 
26
        - The sxwim plugin isn't building yet.
 
27
 
 
28
HOW TO DO THE BUILD
 
29
===================
 
30
 
 
31
This documentation is minimal, and will be replaced by more detailed
 
32
information once the CMake-based win32 builds are better tested.
 
33
 
 
34
You will need:
 
35
        - Microsoft Windows XP (others may work but are untested)
 
36
        - Microsoft Visual C++ Express Edition 8 2005
 
37
        - The Microsoft Platform SDK
 
38
        - CMake 2.5.x (2.4.x WILL NOT WORK)
 
39
        - A recent Qt 4.6 snapshot built with Visual Studio 8 2005
 
40
          (see below)
 
41
        - cairo from cairographics.org (version >= 1.5.16)
 
42
        - libxml2 win32 binaries from the libxml project
 
43
        - libjpeg sources from jig.org
 
44
        - libtiff sources from libtiff.org
 
45
        - libpng sources from libpng.org
 
46
        - zlib sources from zlib.org
 
47
        - freetype sources from freetype.org
 
48
        - LittleCMS sources from www.littlecms.com
 
49
        - PoDoFo 0.8.0 (and ONLY 0.8.0) sources from podofo.sourceforge.net
 
50
        - A Python 2.7 Windows binary build.
 
51
          For debug builds, you'll need a release that contains the python27_d.dll .
 
52
 
 
53
Some more details can be found below in the section entitled GETTING DEPENDENCIES.
 
54
 
 
55
To build scribus its self, you should create a new empty build directory
 
56
outside the Scribus source tree. In this directory, create a new text file and
 
57
name it "build.cmd". Ignore the warning about changing the file extension.
 
58
 
 
59
Open build.cmd in a text editor, and paste the following into it:
 
60
 
 
61
---
 
62
rem Dependency paths:
 
63
set CMAKE=C:\Program Files\CMake 2.5\bin\cmake.exe
 
64
rem used for headers only; we get the lib from the libpng build
 
65
set ZLIBDIR=c:\developer\lib\zlib
 
66
rem provides both png and zlib .libs
 
67
set PNGDIR=C:\developer\lib\lpng1220-vc\
 
68
set QTDIR=C:\developer\Qt\qt-everywhere-opensource-src-4.6.3
 
69
set CAIRODIR=C:\developer\lib\cairo-1.6.0
 
70
set LCMSDIR=c:\developer\lib\lcms-1.16-vc
 
71
set JPEGDIR=c:\developer\lib\jpeg-6b-vc
 
72
set FREETYPEDIR=c:\developer\lib\freetype-2.3.5
 
73
set TIFFDIR=c:\developer\lib\tiff-3.8.2-vc
 
74
set PODOFODIR=c:\developer\podofo\080-vs-inst
 
75
set PODOFOSHARED=1
 
76
set LIBXMLDIR=c:\developer\lib\libxml2-2.6.30.win32
 
77
set SCRIBUSINSTALLDIR=c:\developer\scribus-bin
 
78
rem
 
79
rem
 
80
set PATH=%SYSTEMROOT%;%SYSTEMROOT%\system32;%QTDIR%\bin
 
81
set INCLUDE=
 
82
set LIB=
 
83
set SCPNGPROJ=%PNGDIR%\projects\visualc71\
 
84
del cmakecache.txt
 
85
"%CMAKE%" -G "Visual Studio 8 2005" -DCMAKE_INCLUDE_PATH:PATH=%QTDIR%\src\3rdparty\zlib;%QTDIR%\src\3rdparty\libpng;%ZLIBDIR%;%ZLIBDIR%\include;%PNGDIR%;%PNGDIR%\include;%CAIRODIR%;%CAIRODIR%\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;%LCMSDIR%\Lib\MS\dll;%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 -DJPEG_NAMES:STRING=libjpeg -DFREETYPE_LIBRARY_NAMES_RELEASE=freetype235MT -DFREETYPE_LIBRARY_NAMES_DEBUG=freetype235MT_D -DUSE_QT_ZLIB_PNGLIB=1 ..\scribus-trunk
 
86
---
 
87
 
 
88
The above script is designed to work with common arrangements of library
 
89
install directories, both build trees and installed copies. If you follow the
 
90
instructions here about setting up the libraries scribus requires, you should
 
91
be OK. [SEE: GETTING DEPENDENENCIES]
 
92
 
 
93
Update the dependency paths to match your system.  Now open a cmd.exe window,
 
94
cd into the build directory, and run build.cmd . If all goes well, it'll find
 
95
your libraries and exit successfully.
 
96
(Note: Some systems could have some environment related problems running this
 
97
from simple cmd.exe. Use SDK console instead then.)
 
98
 
 
99
Open the solution that CMake generated in Visual Studio and build it. On
 
100
Windows it's easier to do a release build as you don't need to build a debug
 
101
Qt, python, etc. 
 
102
 
 
103
If it all builds, manually build the INSTALL project to trigger an install. Now
 
104
copy the DLLs from the zlib, libpng, qt, lcms, freetype, libtiff, libjpeg,
 
105
libxml, and podofo directories into the Scribus install directory (where
 
106
scribus.exe is). It should now run.
 
107
 
 
108
Crash problems at runtime? Verify that Qt, freetype, lcms, and Scribus all use
 
109
the same runtime, and that all were built for debugging or all for release not
 
110
a mixture of the two. Windows does not permit you to mix debug and release
 
111
executables like other platforms do.
 
112
 
 
113
You can use depends.exe to check that the runtimes match.
 
114
 
 
115
GETTING DEPENDENCIES
 
116
====================
 
117
 
 
118
This is a quick and dirty set of notes that will be filled out once everything's
 
119
verified as correct and working. It asssumes that you'll be building all your
 
120
dependencies at a single root, like C:\Developer. The root *MUST* not have spaces
 
121
in its path.
 
122
 
 
123
----
 
124
Qt:
 
125
 
 
126
Download the latest qt 4.6 snapshot for windows and unpack it to C:\Developer.
 
127
 
 
128
Start a command line and import your Visual Studio environment:
 
129
\path\to\visual\studio\VC\vcvarsall.bat
 
130
\path\to\platform\sdk\setenv.cmd
 
131
 
 
132
now cd to C:\Developer\qt-everywhere-whatever and run configure:
 
133
configure -debug-and-release -fast -no-qt3support -platform win32-msvc2005
 
134
 
 
135
and nmake.
 
136
 
 
137
----
 
138
 
 
139
Zlib and LibPNG are both embedded in the QtCore library with symbols exported
 
140
for public use . If you're using a Qt binary redist you may still need to
 
141
download these libraries sources for their headers. In most cases your
 
142
copy of Qt will contain a directory called  %QTDIR%\src\3rdparty\zlib
 
143
(and one for libpng), in which case you need not worry about these libraries at
 
144
all.
 
145
 
 
146
----
 
147
 
 
148
jpeg:
 
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 sources from jig.org . Unpack to your libraries directory.
 
154
Now, in a command prompt:
 
155
 
 
156
cd 
 
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. Build the DLL ("lcmsdll"
 
170
project) in debug and release configurations.
 
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
While Qt also bundles libtiff, it's not linked to the main DLL but rather a plugin.
 
186
As such, we need to link to it directly.
 
187
 
 
188
Download libtiff sources from libtiff.org and unpack them.
 
189
 
 
190
in a vcvars/setenv window:
 
191
 
 
192
set INCLUDE=%INCLUDE%;\path\to\jpeg\include;\path\to\zlib\include
 
193
set LIB=%LIB%;\path\to\jpeg\lib;\path\to\zlib\lib
 
194
 
 
195
cd %LIBTIFFDIR%\libtiff
 
196
nmake /nologo /f Makefile.vc libtiff.lib
 
197
 
 
198
Since we're building libtiff as a static library, there's no need to worry
 
199
about which runtime it's linked to. You can build the DLL if you like
 
200
(you need to specify LIBS= to include Qt [for zlib] and libjpeg) but
 
201
the static library should be fine.
 
202
 
 
203
----
 
204
 
 
205
Freetype:
 
206
 
 
207
unpack freetype
 
208
open builds\win32\visualc
 
209
upgrade
 
210
build "Release Multithreaded" and "Debug Multithreaded"
 
211
 
 
212
Note that if you're not using Freetype 2.3.5 exactly, you will have
 
213
to change the freetype library names passed in the build.cmd script.
 
214
 
 
215
----
 
216
 
 
217
libxml:
 
218
 
 
219
download win32 binaries from libxml.org, unpack.
 
220
Note that these binaries do not use the same runtime
 
221
as the rest of the binaries we're building. Feel free to
 
222
rebuild libxml to fix this, but in practice it doesn't
 
223
matter since we never pass a FILE* nor do we allocate memory
 
224
to be deallocated in libxml or vice versa.
 
225
 
 
226
Remember that iconv from the same package must be on the
 
227
header search path too. If in doubt, just drop iconv.h
 
228
into the libxml tree.