source: subsurface/INSTALL @ ca819b2

Mtestandroid_testdcDownloadforatdotdegitMergegitdebuggitpicturesiosmergeKirigamiPortpictimeshiftresolutionIndependencespinnertestTomaztestingv4.0-branchv4.0.3-branchv4.2-branchv4.4-branchv4.5-branch
Last change on this file since ca819b2 was ca819b2, checked in by Dirk Hohndel <dirk@…>, 4 years ago

Updated instructions for cross building Windows binaries under Linux

Signed-off-by: Dirk Hohndel <dirk@…>

  • Property mode set to 100644
File size: 7.4 KB
Line 
1Building the Qt version under Linux
2-----------------------------------
3
4On Debian you need libqt4-dev, libmarble-dev, libzip-dev.
5Unfortunately the marble version in Debian stable (and possibly
6Ubuntu) appears broken and missing essential header files used in the
7current git version of Subsurface. We hack around this right now by
8including this header file but this needs to be revisited before an
9actual release.
10
11On Fedora you need qt-devel, marble-devel, libzip-devel,
12libxml2-devel, libxslt-devel, libsqlite3x-devel. If you are going to
13compile libdivecomputer, you need to libusb-devel too.
14
15On Debian the package names are different; try libxml2-dev,
16libsqlite3-dev, libxslt1-dev, libzip-dev (and libusb-1.0-0-dev if
17you're going to compile libdivecomputer).
18
19To compile libdivecomputer:
20$ git clone git://git.libdivecomputer.org/libdivecomputer
21$ cd libdivecomputer
22$ git checkout release-0.4
23$ autoreconf --install
24$ ./configure --disable-shared
25$ make
26$ sudo make install
27
28To compile Subsurface:
29$ git clone git://subsurface.hohndel.org/subsurface.git
30$ cd subsurface
31$ qmake
32$ make
33$ sudo make install     [optionally, add: prefix=/usr/local]
34
35Building the Qt version under MacOSX
36------------------------------------
37
381)  Install Homebrew
39
40$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
41
422) Install needed dependencies
43
44$ brew install asciidoc libzip qt sqlite cmake libusb pkg-config
45
463) Make the brew version of sqlite the default
47
48$ brew link --force sqlite
49
504) Install Marble
51
52$ mkdir -p ~/src/marble/build
53$ git clone -b KDE/4.11 git://anongit.kde.org/marble ~/src/marble/sources
54$ cd ~/src/marble/build
55$ cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local ../sources
56 - or -
57$ cmake -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local ../sources
58$ cd src/lib
59$ make -j4
60$ install_name_tool -id /usr/local/lib/`echo libmarblewidget.??.dylib` libmarblewidget.dylib
61$ cp *dylib /usr/local/lib/
62$ mkdir -p /usr/local/include/marble
63$ cd ../../../sources/src/lib
64$ cp $(find . -name '*.h') /usr/local/include/marble/
65
665) Install Libdivecomputer
67
68$ brew install automake libtool
69$ cd ~/src
70$ git clone git://git.libdivecomputer.org/libdivecomputer
71$ cd libdivecomputer
72$ git checkout release-0.4
73$ autoreconf --install
74$ ./configure --disable-shared
75$ make
76$ make install
77
786) Compile Subsurface
79
80$ cd ~/src
81$ git clone git://subsurface.hohndel.org/subsurface.git
82$ cd subsurface
83$ qmake
84$ make
85$ make install_mac_bundle
86
87After the above is done, Subsurface will be installed to
88/Applications.
89
90Another option is to create a .dmg for distribution:
91
92$ qmake
93$ make
94$ make mac-create-dmg
95
96NOTES: macdeployqt assumes that the plugins are located "next" to the
97frameworks. The frameworks are linked from /usr/local/lib - but the
98plugins are not in /usr/local/plugins.
99The easiest workaround is to create a symbolic link from
100/usr/local/plugins to /usr/local/Cellar/qt/4.8.5/plugins (or whatever
101version of Qt you have built earlier).
102
103Cross-building Subsurface on Linux for Windows
104----------------------------------------------
105
106Subsurface builds nicely with MinGW - the official builds are done as
107cross builds under Linux (currently on Fedora 17). A shell script to do
108that (plus the .nsi file to create the installer with makensis) are
109included in the packaging/Windows directory.
110
111The best way to get libdivecomputer to build appears to be
112
113$ git clone git://git.libdivecomputer.org/libdivecomputer
114$ cd libdivecomputer
115$ git checkout release-0.4
116$ mingw32-configure --disable-shared
117$ mingw32-make
118$ sudo mingw32-make install
119
120To compile Marble, use:
121
122$ mkdir -p ~/src/marble/build
123$ git clone -b v4.11.2 git://anongit.kde.org/marble ~/src/marble/sources
124$ cd ~/src/marble/build
125$ mingw32-cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=TRUE ../sources
126 - or -
127$ mingw32-cmake -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE ../sources
128$ mingw32-make -j4
129$ mingw32-make install
130
131To compile Subsurface, use:
132
133$ git clone git://subsurface.hohndel.org/subsurface.git
134$ cd subsurface
135$ packaging/windows/mingw-make.sh
136$ packaging/windows/mingw-make.sh install
137$ packaging/windows/mingw-make.sh installer
138
139The last step assumes that you have a link from packaging/windows/dll to
140the correct directory in your MinGW installation. On my machine that is
141/usr/i686-w64-mingw32/sys-root/mingw/bin
142Similarly, the paths used in packaging/windows/mingw-make.sh may need to
143be adjusted according to your distributions layout
144
145
146Building Subsurface on Windows
147------------------------------
148
1491) Install msys-git:
150http://msysgit.github.io
151
152Tools part of MSYS are required for building Subsurface, while you also
153need Git to be upstream and contribute to the project.
154Make sure that the msys/bin (or git/bin) folder is in PATH.
155
1562) Install Qt
157http://qt-project.org/downloads
158
159Subsurface is currently built against Qt 4.8.5.
160
1613) Install a MinGW toolchain
162https://docs.google.com/open?id=0B4D8x6CJEmtuczdiQklwMEs4RUU
163
164Qt 4.8.5 comes without a compiler and you will have to download it from
165a separate location. Other compiler may work, but there are no guaranties for
166that. Make sure that the mingw/bin folder is in PATH.
167
1684) Install Libdivecomputer
169Use similar steps to the previous section, without the sudo command.
170
1715) Install CMake (required for building Marble):
172http://www.cmake.org/cmake/resources/software.html
173
174Make sure that the cmake/bin folder is in PATH.
175
1765) Download and build Marble
177http://marble.kde.org/sources.php
178http://techbase.kde.org/Projects/Marble/WindowsCompiling#Compiling_Marble_using_MingW
179
180Make sure you build both the Debug and Release versions.
181
1826) Install pkg-config
183http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
184
185pkg-config depends on DLL files such as libglib-2.0-0.dll and has to be in
186PATH, so it's best that you copy the executable to msys/bin.
187
1887) Install other dependencies
189Subsurface also depends on the following libraries:
190
191* libxml2
192http://www.xmlsoft.org/downloads.html
193* libxslt
194http://xmlsoft.org/XSLT/
195* libusb-1.0
196http://sourceforge.net/apps/trac/libusb-win32/wiki
197* zlib
198http://www.zlib.net/
199* libzip
200http://www.nih.at/libzip/
201
202Once you have the libraries, create .pc files (pkg-config) for them and place
203the files in a folder that is indicated by the PKG_CONFIG_PATH environment
204variable - e.g. PKG_CONFIG_PATH=c:\msys\pkg-config
205
206To build subsurface, use:
207
208$ git clone git://subsurface.hohndel.org/subsurface.git
209$ cd subsurface
210$ qmake
211$ make
212$ make install
213$ make installer
214
215Build options
216-------------
217
218The following options are recognised when passed to qmake:
219
220 -config debug        Create a debug build
221 -config release      Create a release build
222                      The default depends on how Qt was built.
223 V=1                  Disable the "silent" build mode
224 LIBDCDEVEL=1         Search for libdivecomputer in ../libdivecomputer
225 INCLUDEPATH+=xxx     Add xxx to the include paths to the compiler
226                      (pass the actual path, without -I)
227 LIBS+=xxx            Add xxx to the linker flags. -l and -L options are
228                      recognised.
229
230The INCLUDEPATH and LIBS options are useful to tell the buildsystem
231about non-standard installation paths for the dependencies (such as
232Marble). They can be repeated as often as needed, or multiple
233arguments can be passed on the same switch, separated by a space. For
234example:
235
236  qmake LIBS+="-L$HOME/marble/lib -L$HOME/libdivecomputer/lib" \
237        INCLUDEPATH+="$HOME/marble/include $HOME/libdivecomputer/include"
Note: See TracBrowser for help on using the repository browser.