Subversion Repositories Scribus

Rev

Rev 21923 | Rev 22757 | 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:
20188 jghali 9
- Microsoft Vista, 7 or a more recent version
10
- Microsoft Visual Studio 2012 or later (for 32/64bit build)
22152 jghali 11
- A recent Qt release built with corresponding Visual Studio version (minimum 5.5, recommended >= 5.6.0)
20188 jghali 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
 
22152 jghali 15
It is possible to use Microsoft Visual Studio 2012, 2013 or 2015 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
 
20188 jghali 39
Now cd to C:\Developer\qt-everywhere-whatever and run configure:
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
22152 jghali 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
42
- Visual Studio 2015 : configure -platform win32-msvc2015 -prefix /path/where/you/want/qt5/to/be/installed -nomake examples -nomake tests -opengl desktop -opensource -mp
16720 jghali 43
 
19973 jghali 44
After configure has finished its work, run nmake. Depending on the number of processors available on your machine, a complete Qt build may
45
take from a few hours to several days. Once Qt has finished building, run following command to install Qt to its install directory:
46
nmake install
16720 jghali 47
 
19973 jghali 48
If you want to build Qt docs, you might want to run following command afterwards:
49
nmake docs
50
nmake install_docs
16720 jghali 51
 
19973 jghali 52
Once you finished building and installing Qt, you can run following command to clean Qt source directory:
53
nmake distclean
16720 jghali 54
 
19973 jghali 55
Building 3rd party libraries:
56
-----------------------------
16720 jghali 57
 
20188 jghali 58
Archives with ready-to-build solutions for scribus dependencies have been made available on Sourceforge:
59
http://sourceforge.net/projects/scribus/files/scribus-libs/
60
These archives can be used to compile all dependencies necessary for Scribus.
16720 jghali 61
 
19973 jghali 62
Two different archives are needed :
20188 jghali 63
- scribus-commmon-libs-YYYYMMDD.7z : common libraries for 14x and trunk, no compilation is required here
64
- scribus-15x-libs-msvcXXXX-YYYYMMDD.7z : Scribus 15x specific libraries used for current Scribus 1.5.x releases
16720 jghali 65
 
20188 jghali 66
These archives are named using a scheme where:
67
- msvcXXXX represents the Visual Studio version needed to compile provided Visual Studio solution
68
- YYYYMMDD represents the date where the archive has been prepared/uploaded to Sourceforge.
16720 jghali 69
 
22152 jghali 70
For building 15x dependencies, archives for Visual Studio 2012 and Visual Studio 2015 are provided. These archives allows to
71
build libraries  for 32bit and 64bit platforms using the different available toolsets, including the Windows XP compatible ones.
72
The default configuration  allows to build binaries compatible with Windows Vista and up.
16720 jghali 73
 
19973 jghali 74
Once you downloaded the two appropriate archives :
20188 jghali 75
- decompress them in the *same* directory so as to get a layout similar to this one :
76
    - your_script_libs_directory
22152 jghali 77
       |- scribus-1.5.x-libs-msvc2015
20188 jghali 78
       |- scribus-common-libs
79
- open the visual studio solution (*.sln) located in the scribus-1.5.x-libs-* directory
80
- build debug and release configurations for all platforms (Win32 and/or x64) you plan to execute scribus on
81
 
19973 jghali 82
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
83
build-all-platform-libs.bat script. For example :
22152 jghali 84
- to build with Visual Studio 2015 default toolset for x64 platform: build-all-platform-libs.bat x64 v140
85
- to build with Visual Studio 2015 Windows XP toolset for Win32 platform: build-all-platform-libs.bat Win32 v140_xp
17505 jghali 86
 
19973 jghali 87
BUILDING SCRIBUS
88
====================
17505 jghali 89
 
22152 jghali 90
After having compiled all dependencies, open the Scribus-build-props.props file located in Scribus\win32\msvc2012 or
91
Scribus\win32\msvc2015 depending on the Visual Studio version you are using in a text editor.
19973 jghali 92
Update the dependency paths to match your system.
17505 jghali 93
 
19973 jghali 94
Open the Visual Studio solution located in same directoy and start building. Note: if you built dependencies with a different
95
toolset than the default one, you should either modify toolset directly in all projects or build the solution through command
96
line using msbuild.
17505 jghali 97
 
19973 jghali 98
After building completed, you will find executables in a Scribus-builds\scribus-$(configuration)-$(platform)-$(platformtoolset)\
99
directory, located in same directory as Scribus sources. Those executables will not function yet. Scribus resources and
100
dependencies must be copied to install directory first.
17505 jghali 101
 
19973 jghali 102
INSTALLING RESOURCES AND DEPENDENCIES
103
=====================================
17505 jghali 104
 
19973 jghali 105
To copy resources to build directory, create a batch script and copy/paste following lines :
17505 jghali 106
 
19973 jghali 107
set SCRIBUS_SRC_PATH=.\Scribus
108
set SCRIBUS_BUILD_ROOT=.\Scribus-builds
22152 jghali 109
set SCRIBUS_INSTALL_PATH=.\Scribus-builds\scribus-debug-win32-v140
17505 jghali 110
 
20453 jghali 111
if not exist %SCRIBUS_INSTALL_PATH%\libs                mkdir %SCRIBUS_INSTALL_PATH%\libs
112
if not exist %SCRIBUS_INSTALL_PATH%\share               mkdir %SCRIBUS_INSTALL_PATH%\share
113
if not exist %SCRIBUS_INSTALL_PATH%\share\doc           mkdir %SCRIBUS_INSTALL_PATH%\share\doc
114
if not exist %SCRIBUS_INSTALL_PATH%\share\plugins       mkdir %SCRIBUS_INSTALL_PATH%\share\plugins
115
if not exist %SCRIBUS_INSTALL_PATH%\share\qml           mkdir %SCRIBUS_INSTALL_PATH%\share\qml
116
 
20188 jghali 117
 copy %SCRIBUS_SRC_PATH%\AUTHORS                        %SCRIBUS_INSTALL_PATH%\share\doc
118
 copy %SCRIBUS_SRC_PATH%\COPYING                        %SCRIBUS_INSTALL_PATH%\share\doc
119
 copy %SCRIBUS_SRC_PATH%\LINKS                          %SCRIBUS_INSTALL_PATH%\share\doc
120
 copy %SCRIBUS_SRC_PATH%\TRANSLATION                    %SCRIBUS_INSTALL_PATH%\share\doc
20453 jghali 121
xcopy %SCRIBUS_SRC_PATH%\doc                            %SCRIBUS_INSTALL_PATH%\share\doc /s /y /i /D
122
xcopy %SCRIBUS_SRC_PATH%\resources\dicts                %SCRIBUS_INSTALL_PATH%\share\dicts /s /y /i /D
123
xcopy %SCRIBUS_SRC_PATH%\resources\editorconfig         %SCRIBUS_INSTALL_PATH%\share\editorconfig /s /y /i /D
20611 jghali 124
xcopy %SCRIBUS_SRC_PATH%\resources\iconsets             %SCRIBUS_INSTALL_PATH%\share\icons /s /y /i /D
20188 jghali 125
 copy %SCRIBUS_SRC_PATH%\resources\iconsets\1_5_0\*.xml %SCRIBUS_INSTALL_PATH%\share\icons /y
126
 copy %SCRIBUS_SRC_PATH%\resources\iconsets\1_5_1\*.xml %SCRIBUS_INSTALL_PATH%\share\icons /y
21767 jghali 127
xcopy %SCRIBUS_SRC_PATH%\resources\keysets              %SCRIBUS_INSTALL_PATH%\share\keysets /s /y /i /D
20453 jghali 128
xcopy %SCRIBUS_SRC_PATH%\resources\loremipsum           %SCRIBUS_INSTALL_PATH%\share\loremipsum /s /y /i /D
129
xcopy %SCRIBUS_SRC_PATH%\resources\profiles             %SCRIBUS_INSTALL_PATH%\share\profiles /s /y /i /D
130
xcopy %SCRIBUS_SRC_PATH%\resources\swatches             %SCRIBUS_INSTALL_PATH%\share\swatches /s /y /i /D
131
xcopy %SCRIBUS_SRC_PATH%\resources\templates            %SCRIBUS_INSTALL_PATH%\share\templates /s /y /i /D
20188 jghali 132
 copy %SCRIBUS_SRC_PATH%\scribus\scribus.css            %SCRIBUS_INSTALL_PATH%\libs\scribus.css /y
21923 jghali 133
 copy %SCRIBUS_SRC_PATH%\scribus\plugins\tools\pathcut\*.png      %SCRIBUS_INSTALL_PATH%\share\icons\1_5_1 /y
134
 copy %SCRIBUS_SRC_PATH%\scribus\plugins\tools\pathfinder\*.png   %SCRIBUS_INSTALL_PATH%\share\icons\1_5_1 /y
20453 jghali 135
xcopy %SCRIBUS_SRC_PATH%\scribus\plugins\scriptplugin\scripts     %SCRIBUS_INSTALL_PATH%\share\scripts /s /y /i /D
136
xcopy %SCRIBUS_SRC_PATH%\scribus\plugins\scriptplugin\samples     %SCRIBUS_INSTALL_PATH%\share\samples /s /y /i /D
20188 jghali 137
copy  %SCRIBUS_SRC_PATH%\scribus\plugins\import\ps\import.prolog  %SCRIBUS_INSTALL_PATH%\libs\import.prolog
19973 jghali 138
copy  %SCRIBUS_SRC_PATH%\scribus\plugins\barcodegenerator\barcode.ps %SCRIBUS_INSTALL_PATH%\share\plugins\barcode.ps
20188 jghali 139
xcopy %SCRIBUS_SRC_PATH%\scribus\ui\qml                           %SCRIBUS_INSTALL_PATH%\share\qml /s /y
140
copy  %SCRIBUS_SRC_PATH%\scribus\unicodemap\unicodenameslist.txt  %SCRIBUS_INSTALL_PATH%\share\unicodenameslist.txt
20453 jghali 141
 
20076 jghali 142
del   %SCRIBUS_BUILD_ROOT%\*CMake* /s
143
del   %SCRIBUS_BUILD_ROOT%\*MakeFile* /s
17505 jghali 144
 
19973 jghali 145
Adjust SCRIBUS_SRC_PATH, SCRIBUS_BUILD_ROOT and SCRIBUS_INSTALL_PATH as needed and run batch script.
17505 jghali 146
 
19973 jghali 147
To install common libs:
20188 jghali 148
- open the scribus-common-libs directory where you uncompressed 15x/trunk libs
149
- open the copy-dlls-to-15x-build-dir.bat file from scribus-common-libs directory in a text editor
150
- modify the SCRIBUS_BUILDS_DIR, SCRIBUS_LIB_TOOLSET and PYTHON_DIR_* variables appropriately
151
- execute batch file
17505 jghali 152
 
19973 jghali 153
To install version specific libs:
20188 jghali 154
- open the scribus-15x-libs-msvc* directory where you uncompressed Scribus 15x libs
155
- open the copy-*-dlls-to-build-dir.bat file in a text editor
156
- modify the SCRIBUS_BUILDS_DIR and SCRIBUS_LIB_TOOLSET variables appropriately
157
- execute batch file
17505 jghali 158
 
19973 jghali 159
Finally copy Qt DLLs to build directory and Qt plugins directory to "qtplugins" directory.
160
Scribus should now run.
17505 jghali 161
 
19973 jghali 162
Crash problems at runtime? Verify that Scribus and all its dependencies use the same runtime, and that all were built
163
for debug or release configurations and not a mixture of the two. On Windows, it is strictly not recommended to mix
164
debug and release binaries. Doing so is not supported and will usually trigger unpredictable issues and crashes.
16720 jghali 165
 
19973 jghali 166
You can use depends.exe to check that the runtimes match.