source: subsurface/INSTALL @ a9b7b41

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

Minor tweaks to INSTALL file

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

  • Property mode set to 100644
File size: 8.4 KB
Line 
1Building Subsurface from Source
2===============================
3
4Subsurface uses a few open source libraries and frameworks to do its
5job. The most important ones include libdivecomputer, Qt4, Marble
6(more precisely libmarble; this is what causes the need for Qt4 as
7Marble as of the time of this writing hasn't been ported to Qt5, yet),
8libxml2, libxslt, libsqlite3, and libzip.
9
10Below are instructions for building Subsurface under some popular
11Linux distributions, for building Subsurface using Homebrew on a Mac,
12and for cross-building Subsurface for Windows. The lack of a working
13package management system for Windows makes it really painful to build
14Subsurface natively under Windows, we have some hints how to do so
15here as well.
16
17
18Build options for Subsurface
19----------------------------
20
21The following options are recognized when passed to qmake:
22
23 -config debug        Create a debug build
24 -config release      Create a release build
25                      The default depends on how Qt was built.
26 V=1                  Disable the "silent" build mode
27 LIBDCDEVEL=1         Search for libdivecomputer in ../libdivecomputer
28 INCLUDEPATH+=xxx     Add xxx to the include paths to the compiler
29                      (pass the actual path, without -I)
30 LIBS+=xxx            Add xxx to the linker flags. -l and -L options are
31                      recognized.
32
33The INCLUDEPATH and LIBS options are useful to tell the buildsystem
34about non-standard installation paths for the dependencies (such as
35Marble). They can be repeated as often as needed, or multiple
36arguments can be passed on the same switch, separated by a space. For
37example:
38
39  qmake LIBS+="-L$HOME/marble/lib -L$HOME/libdivecomputer/lib" \
40        INCLUDEPATH+="$HOME/marble/include $HOME/libdivecomputer/include"
41
42
43Building Subsurface 4 under Linux
44---------------------------------
45
46On Fedora you need qt-devel, marble-devel, libzip-devel,
47libxml2-devel, libxslt-devel, libsqlite3x-devel, libudev-devel. If you are going
48to compile libdivecomputer, you need libusb-devel, too.
49
50On Debian style distributions you can install the required development
51packages by running (once Qt version of subsurface is available in your
52distribution)
53$ sudo apt-get build-dep subsurface
54
55If you want to install the required packages individually instead you
56need libqt4-dev, qt4-qmake, libxml2-dev, libxslt1-dev, zlib1g-dev,
57libzip-dev, libmarble-dev, libsqlite3-dev, libqtwebkit-dev
58(and libusb-1.0-0-dev if you're going to compile libdivecomputer).
59
60Unfortunately the marble version in Debian stable (and possibly
61Ubuntu) appears to be missing essential header files used in
62Subsurface. We hack around this right now by including this header
63file but that of course causes potential version conflicts.
64
65To compile libdivecomputer:
66$ git clone git://git.libdivecomputer.org/libdivecomputer
67$ cd libdivecomputer
68$ git checkout release-0.4
69$ autoreconf --install
70$ ./configure --disable-shared
71$ make
72$ sudo make install
73
74To compile Subsurface:
75$ git clone git://subsurface.hohndel.org/subsurface.git
76$ cd subsurface
77$ qmake # qmake-qt4 on some flavors of Linux
78$ make
79$ sudo make install     [optionally, add: prefix=/usr/local]
80
81Note: on Fedora qmake will appear as qmake-qt4
82
83Building the Qt version under MacOSX
84------------------------------------
85
861)  Install Homebrew
87
88$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
89
902) Install needed dependencies
91
92$ brew install asciidoc libzip qt sqlite cmake libusb pkg-config
93
943) Make the brew version of sqlite the default
95
96$ brew link --force sqlite
97
984) Install Marble
99
100$ mkdir -p ~/src/marble/build
101$ git clone -b 4.11.2 git://anongit.kde.org/marble ~/src/marble/sources
102$ cd ~/src/marble/build
103$ cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local ../sources
104 - or -
105$ cmake -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local ../sources
106$ cd src/lib
107$ make -j4
108$ install_name_tool -id /usr/local/lib/`echo libmarblewidget.??.dylib` libmarblewidget.dylib
109$ cp *dylib /usr/local/lib/
110$ mkdir -p /usr/local/include/marble
111$ cd ../../../sources/src/lib
112$ cp $(find . -name '*.h') /usr/local/include/marble/
113
1145) Install Libdivecomputer
115
116$ brew install automake libtool
117$ cd ~/src
118$ git clone git://git.libdivecomputer.org/libdivecomputer
119$ cd libdivecomputer
120$ git checkout release-0.4
121$ autoreconf --install
122$ ./configure --disable-shared
123$ make
124$ make install
125
1266) Compile Subsurface
127
128$ cd ~/src
129$ git clone git://subsurface.hohndel.org/subsurface.git
130$ cd subsurface
131$ qmake
132$ make
133$ make install_mac_bundle
134
135After the above is done, Subsurface will be installed to
136/Applications.
137
138Another option is to create a .dmg for distribution:
139
140$ qmake
141$ make
142$ make mac-create-dmg
143
144NOTES: macdeployqt assumes that the plugins are located "next" to the
145frameworks. The frameworks are linked from /usr/local/lib - but the
146plugins are not in /usr/local/plugins.
147The easiest workaround is to create a symbolic link from
148/usr/local/plugins to /usr/local/Cellar/qt/4.8.5/plugins (or whatever
149version of Qt you have built earlier).
150
151Cross-building Subsurface on Linux for Windows
152----------------------------------------------
153
154Subsurface builds nicely with MinGW - the official builds are done as
155cross builds under Linux (currently on Fedora 19). A shell script to do
156that (plus the .nsi file to create the installer with makensis) are
157included in the packaging/windows directory.
158
159The best way to get libdivecomputer to build appears to be
160
161$ mkdir -p ~/src
162$ git clone git://git.libdivecomputer.org/libdivecomputer ~/src/libdivecomputer
163$ cd ~/src/libdivecomputer
164$ git checkout release-0.4
165$ mingw32-configure --disable-shared
166$ mingw32-make
167$ sudo mingw32-make install
168
169To compile Marble, use:
170
171$ mkdir -p ~/src/marble/build
172$ git clone -b v4.11.2 git://anongit.kde.org/marble ~/src/marble/sources
173$ cd ~/src/marble/build
174$ mingw32-cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=TRUE ../sources
175 - or -
176$ mingw32-cmake -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE ../sources
177$ mingw32-make -j4
178$ mingw32-make install
179
180To compile Subsurface, use:
181
182$ mkdir -p ~/src/subsurface
183$ git clone git://subsurface.hohndel.org/subsurface.git ~/src/subsurface
184$ cd ~/src/subsurface
185$ packaging/windows/mingw-make.sh
186$ packaging/windows/mingw-make.sh install
187$ packaging/windows/mingw-make.sh installer
188
189The last step assumes that you have a link from packaging/windows/dll to
190the correct directory in your MinGW installation. On my machine that is
191/usr/i686-w64-mingw32/sys-root/mingw/bin
192Similarly, the paths used in packaging/windows/mingw-make.sh may need to
193be adjusted according to your distributions layout
194
195
196Building Subsurface on Windows
197------------------------------
198
1991) Install msys-git:
200http://msysgit.github.io
201
202Tools part of MSYS are required for building Subsurface, while you also
203need Git to be upstream and contribute to the project.
204Make sure that the msys/bin (or git/bin) folder is in PATH.
205
2062) Install Qt
207http://qt-project.org/downloads
208
209Subsurface is currently built against Qt 4.8.5.
210
2113) Install a MinGW toolchain
212https://docs.google.com/open?id=0B4D8x6CJEmtuczdiQklwMEs4RUU
213
214Qt 4.8.5 comes without a compiler and you will have to download it from
215a separate location. Other compiler may work, but there are no guaranties for
216that. Make sure that the mingw/bin folder is in PATH.
217
2184) Install Libdivecomputer
219Use similar steps to the previous section, without the sudo command.
220
2215) Install CMake (required for building Marble):
222http://www.cmake.org/cmake/resources/software.html
223
224Make sure that the cmake/bin folder is in PATH.
225
2265) Download and build Marble
227http://marble.kde.org/sources.php
228http://techbase.kde.org/Projects/Marble/WindowsCompiling#Compiling_Marble_using_MingW
229
230Make sure you build both the Debug and Release versions.
231
2326) Install pkg-config
233http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
234
235pkg-config depends on DLL files such as libglib-2.0-0.dll and has to be in
236PATH, so it's best that you copy the executable to msys/bin.
237
2387) Install other dependencies
239Subsurface also depends on the following libraries:
240
241* libxml2
242http://www.xmlsoft.org/downloads.html
243* libxslt
244http://xmlsoft.org/XSLT/
245* libusb-1.0
246http://sourceforge.net/apps/trac/libusb-win32/wiki
247* zlib
248http://www.zlib.net/
249* libzip
250http://www.nih.at/libzip/
251
252Once you have the libraries, create .pc files (pkg-config) for them and place
253the files in a folder that is indicated by the PKG_CONFIG_PATH environment
254variable - e.g. PKG_CONFIG_PATH=c:\msys\pkg-config
255
256To build subsurface, use:
257
258$ git clone git://subsurface.hohndel.org/subsurface.git
259$ cd subsurface
260$ qmake
261$ make
262$ make install
263$ make installer
Note: See TracBrowser for help on using the repository browser.