Subversion Repositories Scribus

Rev

Rev 19974 | Rev 20132 | 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
 
19973 jghali 4
This documentation is minimal and assume you have a decent knowledge of
16720 jghali 5
Microsoft Visual Studio. No help regarding use of Visual Studio and
6
related tools will be provided.
7
 
8
You will need:
19973 jghali 9
	- Microsoft Vista, 7 or a more recent version
10
	- Microsoft Visual Studio 2012 or later (for 32/64bit build)
11
	- A recent Qt release built with corresponding Visual Studio version (minimum 5.2, recommended >= 5.3.2)
12
	- Scribus common libraries kit downloaded from http://sourceforge.net/projects/scribus/files/scribus-libs/
13
	- Scribus 15x libraries kit downloaded from http://sourceforge.net/projects/scribus/files/scribus-libs/
14
 
15
It is possible to use Microsoft Visual Studio 2012 or 2013 Express editions.
16720 jghali 16
 
17
GETTING DEPENDENCIES
18
====================
19
 
20
This is a quick and dirty set of notes that will be filled out once everything's
19104 jghali 21
verified as correct and working. It assumes that you'll be building all your
19973 jghali 22
dependencies at a single root such as C:\Developer. The root *MUST NOT* have spaces
16720 jghali 23
in its path.
24
 
25
 
19973 jghali 26
Building Qt:
27
------------
16720 jghali 28
 
19973 jghali 29
Download the latest Qt 5 release from http://download.qt.io/official_releases/qt/ and unpack it to C:\Developer.
16720 jghali 30
 
19973 jghali 31
Follow instructions in following pages to get Qt build dependencies, noticeably perl, python and ruby:
32
http://doc.qt.io/qt-5/windows-requirements.html
33
http://doc.qt.io/qt-5/windows-building.html
16720 jghali 34
 
19973 jghali 35
Start a command line and import your Visual Studio environment:
36
- for building 32bit : \path\to\visual\studio\VC\vcvarsall.bat x86
37
- for building 64bit : \path\to\visual\studio\VC\vcvarsall.bat x86_amd64
16720 jghali 38
 
19973 jghali 39
now cd to C:\Developer\qt-everywhere-whatever and run configure:
19974 jghali 40
	- Visual Studio 2012 : configure -platform win32-msvc2012 -prefix /path/where/you/want/qt5/to/be/installed -nomake examples -nomake tests -opengl desktop -opensource -mp
41
	- Visual Studio 2013 : configure -platform win32-msvc2013 -prefix /path/where/you/want/qt5/to/be/installed -nomake examples -nomake tests -opengl desktop -opensource -mp
16720 jghali 42
 
19973 jghali 43
After configure has finished its work, run nmake. Depending on the number of processors available on your machine, a complete Qt build may
44
take from a few hours to several days. Once Qt has finished building, run following command to install Qt to its install directory:
45
nmake install
16720 jghali 46
 
19973 jghali 47
If you want to build Qt docs, you might want to run following command afterwards:
48
nmake docs
49
nmake install_docs
16720 jghali 50
 
19973 jghali 51
Once you finished building and installing Qt, you can run following command to clean Qt source directory:
52
nmake distclean
16720 jghali 53
 
19973 jghali 54
Building 3rd party libraries:
55
-----------------------------
16720 jghali 56
 
19973 jghali 57
Archives with ready-to-build solutions for scribus dependencies have been made available on sourceforge. These archives can be used to
58
compile all dependencies necessary for Scribus.
16720 jghali 59
 
19973 jghali 60
Two different archives are needed :
61
	- common libraries for 14x and trunk : contains boost and python, no compilation is required here
62
	- Scribus 15x specific libraries : libraries used to compile current Scribus 1.5.x releases
16720 jghali 63
 
19973 jghali 64
Common libraries and version specific libraries can be downloaded on Sourceforge from this directory:
65
http://sourceforge.net/projects/scribus/files/scribus-libs/
16720 jghali 66
 
19973 jghali 67
Common libraries are named with following scheme : scribus-commmon-libs-XXXXXX where XXXXX represents a date.
68
Archives with version specific libraries are named using following scheme scribus-15x-libs-msvcXXXX-XXXXXX where :
69
	- msvcXXXX represent the Visual Studio version needed to compile provided Visual Studio solution
70
	- XXXXXX is a series of numbers representing a date.
16720 jghali 71
 
19973 jghali 72
For building 15x dependencies,  an archive for Visual Studio 2012 is provided. The Visual Studio 2012 archive allows to build
20076 jghali 73
libraries for 32bit and 64bit platforms using the different available toolsets, excluding the v110_xp and v120_xp ones. The default
74
configuration, corresponding to the msvc 2012 default toolset (v110), allows to build binaries compatible with Windows Vista and up.
16720 jghali 75
 
19973 jghali 76
Once you downloaded the two appropriate archives :
77
	- decompress them in the *same* directory.
78
	- open the visual studio solution (*.sln) located in the scribus-1.5.x-libs-* directory
79
	- build debug and release configurations for all platforms (Win32 and/or x64) you plan to execute scribus on
80
 
81
If you want to build using a different toolset, you can use msbuild through the command line. To do so you can use the provided
82
build-all-platform-libs.bat script. For example :
83
- to build with Visual Studio 2010 toolset for Win32 platform: build-all-platform-libs.bat Win32 v100
84
- to build with Visual Studio 2012 XP compatible toolset for Win32 platform: build-all-platform-libs.bat Win32 v110_xp
17505 jghali 85
 
19973 jghali 86
BUILDING SCRIBUS
87
====================
17505 jghali 88
 
19973 jghali 89
After having installed all dependencies, open Scribus-build-props.props files located in Scribus\win32\vc11 in a text editor
90
Update the dependency paths to match your system.
17505 jghali 91
 
19973 jghali 92
Open the Visual Studio solution located in same directoy and start building. Note: if you built dependencies with a different
93
toolset than the default one, you should either modify toolset directly in all projects or build the solution through command
94
line using msbuild.
17505 jghali 95
 
19973 jghali 96
After building completed, you will find executables in a Scribus-builds\scribus-$(configuration)-$(platform)-$(platformtoolset)\
97
directory, located in same directory as Scribus sources. Those executables will not function yet. Scribus resources and
98
dependencies must be copied to install directory first.
17505 jghali 99
 
19973 jghali 100
INSTALLING RESOURCES AND DEPENDENCIES
101
=====================================
17505 jghali 102
 
19973 jghali 103
To copy resources to build directory, create a batch script and copy/paste following lines :
17505 jghali 104
 
19973 jghali 105
set SCRIBUS_SRC_PATH=.\Scribus
106
set SCRIBUS_BUILD_ROOT=.\Scribus-builds
107
set SCRIBUS_INSTALL_PATH=.\Scribus-builds\scribus-debug-win32-v110
17505 jghali 108
 
19973 jghali 109
 copy %SCRIBUS_SRC_PATH%\AUTHORS %SCRIBUS_INSTALL_PATH%\share\doc
110
 copy %SCRIBUS_SRC_PATH%\COPYING %SCRIBUS_INSTALL_PATH%\share\doc
111
 copy %SCRIBUS_SRC_PATH%\LINKS %SCRIBUS_INSTALL_PATH%\share\doc
112
 copy %SCRIBUS_SRC_PATH%\TRANSLATION %SCRIBUS_INSTALL_PATH%\share\doc
113
xcopy %SCRIBUS_SRC_PATH%\scribus\doc %SCRIBUS_INSTALL_PATH%\share\doc /s /y /D
114
xcopy %SCRIBUS_SRC_PATH%\resources\dicts %SCRIBUS_INSTALL_PATH%\share\dicts /s /y /D
115
xcopy %SCRIBUS_SRC_PATH%\resources\editorconfig %SCRIBUS_INSTALL_PATH%\share\editorconfig /s /y
116
xcopy %SCRIBUS_SRC_PATH%\resources\icons %SCRIBUS_INSTALL_PATH%\share\icons /s /y /D
117
xcopy %SCRIBUS_SRC_PATH%\resources\loremipsum %SCRIBUS_INSTALL_PATH%\share\loremipsum /s /y
118
xcopy %SCRIBUS_SRC_PATH%\resources\profiles %SCRIBUS_INSTALL_PATH%\share\profiles /s /y
119
xcopy %SCRIBUS_SRC_PATH%\resources\swatches %SCRIBUS_INSTALL_PATH%\share\swatches /s /y
120
xcopy %SCRIBUS_SRC_PATH%\resources\templates %SCRIBUS_INSTALL_PATH%\share\templates /s /y /D
121
 copy %SCRIBUS_SRC_PATH%\scribus\scribus.css %SCRIBUS_INSTALL_PATH%\libs\scribus.css /y
122
 copy %SCRIBUS_SRC_PATH%\scribus\plugins\tools\pathcut\*.png %SCRIBUS_INSTALL_PATH%\share\icons\ /y
123
 copy %SCRIBUS_SRC_PATH%\scribus\plugins\tools\pathfinder\*.png %SCRIBUS_INSTALL_PATH%\share\icons\ /y
124
xcopy %SCRIBUS_SRC_PATH%\scribus\plugins\scriptplugin\scripts %SCRIBUS_INSTALL_PATH%\share\scripts /s /y /D
125
xcopy %SCRIBUS_SRC_PATH%\scribus\plugins\scriptplugin\samples %SCRIBUS_INSTALL_PATH%\share\samples /s /y
126
copy  %SCRIBUS_SRC_PATH%\scribus\plugins\import\ps\import.prolog %SCRIBUS_INSTALL_PATH%\libs\import.prolog
127
copy  %SCRIBUS_SRC_PATH%\scribus\plugins\barcodegenerator\barcode.ps %SCRIBUS_INSTALL_PATH%\share\plugins\barcode.ps
128
xcopy %SCRIBUS_SRC_PATH%\scribus\ui\qml %SCRIBUS_INSTALL_PATH%\share\qml /s /y
129
copy  %SCRIBUS_SRC_PATH%\scribus\unicodemap\unicodenameslist.txt %SCRIBUS_INSTALL_PATH%\share\unicodenameslist.txt
20076 jghali 130
del   %SCRIBUS_BUILD_ROOT%\*CMake* /s
131
del   %SCRIBUS_BUILD_ROOT%\*MakeFile* /s
17505 jghali 132
 
19973 jghali 133
Adjust SCRIBUS_SRC_PATH, SCRIBUS_BUILD_ROOT and SCRIBUS_INSTALL_PATH as needed and run batch script.
17505 jghali 134
 
19973 jghali 135
To install common libs:
136
	- open the scribus-common-libs directory where you uncompressed 15x/trunk libs
137
	- open the copy-dlls-to-15x-build-dir.bat file from scribus-common-libs directory in a text editor
138
	- modify the SCRIBUS_BUILDS_DIR, SCRIBUS_LIB_TOOLSET and PYTHON_DIR_* variables appropriately
139
	- execute batch file
17505 jghali 140
 
19973 jghali 141
To install version specific libs:
142
	- open the scribus-15x-libs-msvc* directory where you uncompressed Scribus 15x libs
143
	- open the copy-*-dlls-to-build-dir.bat file in a text editor
144
	- modify the SCRIBUS_BUILDS_DIR and SCRIBUS_LIB_TOOLSET variables appropriately
145
	- execute batch file
17505 jghali 146
 
19973 jghali 147
Finally copy Qt DLLs to build directory and Qt plugins directory to "qtplugins" directory.
148
Scribus should now run.
17505 jghali 149
 
19973 jghali 150
Crash problems at runtime? Verify that Scribus and all its dependencies use the same runtime, and that all were built
151
for debug or release configurations and not a mixture of the two. On Windows, it is strictly not recommended to mix
152
debug and release binaries. Doing so is not supported and will usually trigger unpredictable issues and crashes.
16720 jghali 153
 
19973 jghali 154
You can use depends.exe to check that the runtimes match.