File: msys.t2t

package info (click to toggle)
qgis 2.18.28%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,007,948 kB
  • sloc: cpp: 671,774; python: 158,539; xml: 35,690; ansic: 8,346; sh: 1,766; perl: 1,669; sql: 999; yacc: 836; lex: 461; makefile: 292
file content (383 lines) | stat: -rw-r--r-- 9,958 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383

== Building using MinGW ==

**Note:** This section might be outdated as nowadays Visual C++ is use to build
the "official" packages.

**Note:** For a detailed account of building all the dependencies yourself you
can visit Marco Pasetti's website here:

http://www.webalice.it/marco.pasetti/qgis+grass/BuildFromSource.html

Read on to use the simplified approach with pre-built libraries...

=== MSYS ===

MSYS provides a unix style build environment under windows. We have created a
zip archive that contains just about all dependencies.

Get this: 

http://download.osgeo.org/qgis/win32/msys.zip

and unpack to c:\msys


If you wish to prepare your msys environment yourself rather than using 
our pre-made one, detailed instructions are provided elsewhere in this
document.

=== Qt ===

Download Qt opensource precompiled edition exe and install (including the
download and install of mingw) from here:

http://qt.nokia.com/downloads/

When the installer will ask for MinGW, you don't need to download and install
it, just point the installer to c:\msys\mingw

When Qt installation is complete:

Edit C:\Qt\4.8.0\bin\qtvars.bat and add the following lines:

``` 
set PATH=%PATH%;C:\msys\local\bin;c:\msys\local\lib 
set PATH=%PATH%;"C:\Program Files\Subversion\bin" 
```

I suggest you also add C:\Qt\4.8.0\bin\ to your Environment Variables Path in
the windows system preferences.

If you plan to do some debugging, you'll need to compile debug version of Qt:
C:\Qt\4.8.0\bin\qtvars.bat compile_debug

Note: there is a problem when compiling debug version of Qt 4.7, the script ends with
this message  "mingw32-make: *** No rule to make target `debug'.  Stop.". To 
compile the debug version you have to go out of src directory and execute the
following command:

``` 
c:\Qt\4.8.0 make 
```

=== Flex and Bison ===

Get Flex
http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16424
(the zip bin) and extract it into c:\msys\mingw\bin

=== Python stuff (optional) ===

Follow this section in case you would like to use Python bindings for QGIS.  To
be able to compile bindings, you need to compile SIP and PyQt4 from sources as
their installer doesn't include some development files which are necessary.

==== Download and install Python - use Windows installer ====

(It doesn't matter to what folder you'll install it)

http://python.org/download/

==== Download SIP and PyQt4 sources ====

http://www.riverbankcomputing.com/software/sip/download
http://www.riverbankcomputing.com/software/pyqt/download

Extract each of the above zip files in a temporary directory. Make sure
to get versions that match your current Qt installed version.
   
==== Compile SIP ====

``` 
c:\Qt\4.8.0\bin\qtvars.bat 
python configure.py -p win32-g++ 
make 
make install 
```

==== Compile PyQt ====

``` 
c:\Qt\4.8.0\bin\qtvars.bat 
python configure.py 
make 
make install 
```

==== Final python notes ====

/!\ You can delete the directories with unpacked SIP and PyQt4 sources after a
successful install, they're not needed anymore.

=== git ===

In order to check out QGIS sources from the repository, you need a git client.
This installer should work fine:

http://msysgit.googlecode.com/files/Git-1.7.4-preview20110204.exe

=== CMake ===

CMake is build system used by QGIS. Download it from here:

http://www.cmake.org/files/v2.8/cmake-2.8.2-win32-x86.exe

=== QGIS ===

Start a cmd.exe window ( Start -> Run -> cmd.exe ) Create development 
directory and move into it

``` 
md c:\dev\cpp 
cd c:\dev\cpp 
```
   
Check out sources from GIT:

```
git clone git://github.com/qgis/QGIS.git
```

=== Compiling ===

As a background read the generic building with CMake notes at the end of 
this document.

Start a cmd.exe window ( Start -> Run -> cmd.exe ) if you don't have one
already.  Add paths to compiler and our MSYS environment:
  
``` 
c:\Qt\4.8.0\bin\qtvars.bat 
```

For ease of use add c:\Qt\4.8.0\bin\ to your system path in system
properties so you can just type qtvars.bat when you open the cmd console.
Create build directory and set it as current directory:


``` 
cd c:\dev\cpp\qgis 
md build 
cd build 
```

=== Configuration ===

```
cmakesetup ..  
```

**Note:** You must include the '..' above.

Click 'Configure' button.  When asked, you should choose 'MinGW Makefiles' as
generator.

There's a problem with MinGW Makefiles on Win2K. If you're compiling on this
platform, use 'MSYS Makefiles' generator instead.

All dependencies should be picked up automatically, if you have set up the
Paths correctly. The only thing you need to change is the installation
destination (CMAKE_INSTALL_PREFIX) and/or set 'Debug'.

For compatibility with NSIS packaging scripts I recommend to leave the install
prefix to its default c:\program files\

When configuration is done, click 'OK' to exit the setup utility.

=== Compilation and installation ===
 
``` 
 make make install 
```

=== Run qgis.exe from the directory where it's installed (CMAKE_INSTALL_PREFIX) ===

Make sure to copy all .dll:s needed to the same directory as the qgis.exe
binary is installed to, if not already done so, otherwise QGIS will complain
about missing libraries when started.

A possibility is to run qgis.exe when your path contains c:\msys\local\bin and
c:\msys\local\lib directories, so the DLLs will be used from that place.

=== Create the installation package: (optional) ===

Download and install NSIS from (http://nsis.sourceforge.net/Main_Page)

Now using windows explorer, enter the win_build directory in your QGIS source
tree. Read the READMEfile there and follow the instructions. Next right click
on qgis.nsi and choose the option 'Compile NSIS Script'. 

== Creation of MSYS environment for compilation of QGIS ==

=== Initial setup ===

==== MSYS ====

This is the environment that supplies many utilities from UNIX world in Windows and is needed
by many dependencies to be able to compile.

Download from here:
	http://puzzle.dl.sourceforge.net/sourceforge/mingw/MSYS-1.0.11-2004.04.30-1.exe

Install to ``c:\msys``

All stuff we're going to compile is going to get to this directory (resp. its subdirs).

==== MinGW ====

Download from here:
	http://puzzle.dl.sourceforge.net/sourceforge/mingw/MinGW-5.1.3.exe

Install to ``c:\msys\mingw``

It suffices to download and install only ``g++`` and ``mingw-make`` components.

==== Flex and Bison ====

Flex and Bison are tools for generation of parsers, they're needed for GRASS and also QGIS compilation.

Download the following packages:
	http://gnuwin32.sourceforge.net/downlinks/flex-bin-zip.php
	
	http://gnuwin32.sourceforge.net/downlinks/bison-bin-zip.php
	
	http://gnuwin32.sourceforge.net/downlinks/bison-dep-zip.php

Unpack them all to ``c:\msys\local``

=== Installing dependencies ===
 
==== Getting ready ====

Paul Kelly did a great job and prepared a package of precompiled libraries for GRASS.
The package currently includes:

- zlib-1.2.3
- libpng-1.2.16-noconfig
- xdr-4.0-mingw2
- freetype-2.3.4
- fftw-2.1.5
- PDCurses-3.1
- proj-4.5.0
- gdal-1.4.1


It's available for download here:
	http://www.stjohnspoint.co.uk/grass/wingrass-extralibs.tar.gz

Moreover he also left the notes how to compile it (for those interested):
	http://www.stjohnspoint.co.uk/grass/README.extralibs

Unpack the whole package to ``c:\msys\local``


==== GRASS ====

Grab sources from CVS or use a weekly snapshot, see:
	http://grass.itc.it/devel/cvs.php

In MSYS console go to the directory where you've unpacked or checked out sources
(e.g. ``c:\msys\local\src\grass-6.3.cvs``)

Run these commands:
```
export PATH="/usr/local/bin:/usr/local/lib:$PATH"
./configure --prefix=/usr/local --bindir=/usr/local --with-includes=/usr/local/include --with-libs=/usr/local/lib --with-cxx --without-jpeg \
--without-tiff --with-postgres=yes --with-postgres-includes=/local/pgsql/include --with-pgsql-libs=/local/pgsql/lib --with-opengl=windows --with-fftw \
--with-freetype --with-freetype-includes=/mingw/include/freetype2 --without-x --without-tcltk --enable-x11=no --enable-shared=yes \
--with-proj-share=/usr/local/share/proj
make
make install
```

It should get installed to ``c:\msys\local\grass-6.3.cvs``

By the way, these pages might be useful:
- http://grass.gdf-hannover.de/wiki/WinGRASS_Current_Status
- http://geni.ath.cx/grass.html


==== GEOS ====

Download the sources:
	http://geos.refractions.net/geos-2.2.3.tar.bz2

Unpack to e.g. ``c:\msys\local\src``

To compile, I had to patch the sources: in file ``source/headers/timeval.h`` line 13.
Change it from:
```
#ifdef _WIN32
```
to:
```
#if defined(_WIN32) && defined(_MSC_VER)
```

Now, in MSYS console, go to the source directory and run:

```
./configure --prefix=/usr/local
make
make install
```


==== SQLITE ====

You can use precompiled DLL, no need to compile from source:

Download this archive:
	http://www.sqlite.org/sqlitedll-3_3_17.zip

and copy sqlite3.dll from it to ``c:\msys\local\lib``

Then download this archive:
	http://www.sqlite.org/sqlite-source-3_3_17.zip

and copy sqlite3.h to ``c:\msys\local\include``


==== GSL ====

Download sources:
	ftp://ftp.gnu.org/gnu/gsl/gsl-1.9.tar.gz

Unpack to ``c:\msys\local\src``

Run from MSYS console in the source directory:

```
./configure
make
make install
```

==== EXPAT ====

Download sources:
	http://dfn.dl.sourceforge.net/sourceforge/expat/expat-2.0.0.tar.gz

Unpack to ``c:\msys\local\src``

Run from MSYS console in the source directory:

```
./configure
make
make install
```

==== POSTGRES ====

We're going to use precompiled binaries. Use the link below for download:
	http://wwwmaster.postgresql.org/download/mirrors-ftp?file=%2Fbinary%2Fv8.2.4%2Fwin32%2Fpostgresql-8.2.4-1-binaries-no-installer.zip

copy contents of pgsql directory from the archive to ``c:\msys\local``

=== Cleanup ===

We're done with preparation of MSYS environment. Now you can delete all stuff in ``c:\msys\local\src`` - it takes quite a lot
of space and it's not necessary at all.