2013-10-09 01:29:04 +00:00
|
|
|
Building the Qt version under Linux
|
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
On Debian you need libqt4-dev, libmarble-dev, libzip-dev.
|
|
|
|
Unfortunately the marble version in Debian stable (and possibly
|
|
|
|
Ubuntu) appears broken and missing essential header files used in the
|
|
|
|
current git version of Subsurface. We hack around this right now by
|
|
|
|
including this header file but this needs to be revisited before an
|
|
|
|
actual release.
|
|
|
|
|
|
|
|
On Fedora you need qt-devel, marble-devel, libzip-devel,
|
2013-12-09 19:48:16 +00:00
|
|
|
libxml2-devel, libxslt-devel, libsqlite3x-devel, libudev-devel. If you are going
|
|
|
|
to compile libdivecomputer, you need to libusb-devel too.
|
2013-10-09 01:29:04 +00:00
|
|
|
|
|
|
|
On Debian the package names are different; try libxml2-dev,
|
|
|
|
libsqlite3-dev, libxslt1-dev, libzip-dev (and libusb-1.0-0-dev if
|
|
|
|
you're going to compile libdivecomputer).
|
|
|
|
|
|
|
|
To compile libdivecomputer:
|
|
|
|
$ git clone git://git.libdivecomputer.org/libdivecomputer
|
|
|
|
$ cd libdivecomputer
|
|
|
|
$ git checkout release-0.4
|
|
|
|
$ autoreconf --install
|
2013-10-11 17:05:22 +00:00
|
|
|
$ ./configure --disable-shared
|
2013-10-09 01:29:04 +00:00
|
|
|
$ make
|
|
|
|
$ sudo make install
|
|
|
|
|
|
|
|
To compile Subsurface:
|
|
|
|
$ git clone git://subsurface.hohndel.org/subsurface.git
|
|
|
|
$ cd subsurface
|
|
|
|
$ qmake
|
|
|
|
$ make
|
|
|
|
$ sudo make install [optionally, add: prefix=/usr/local]
|
|
|
|
|
2013-12-09 19:48:16 +00:00
|
|
|
Note: on Fedora qmake will appear as qmake-qt4
|
|
|
|
|
2013-10-09 01:29:04 +00:00
|
|
|
Building the Qt version under MacOSX
|
|
|
|
------------------------------------
|
|
|
|
|
|
|
|
1) Install Homebrew
|
|
|
|
|
2013-11-24 00:12:54 +00:00
|
|
|
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
|
2013-10-09 01:29:04 +00:00
|
|
|
|
|
|
|
2) Install needed dependencies
|
|
|
|
|
|
|
|
$ brew install asciidoc libzip qt sqlite cmake libusb pkg-config
|
|
|
|
|
|
|
|
3) Make the brew version of sqlite the default
|
|
|
|
|
|
|
|
$ brew link --force sqlite
|
|
|
|
|
|
|
|
4) Install Marble
|
|
|
|
|
|
|
|
$ mkdir -p ~/src/marble/build
|
|
|
|
$ git clone -b KDE/4.11 git://anongit.kde.org/marble ~/src/marble/sources
|
|
|
|
$ cd ~/src/marble/build
|
2013-10-10 14:53:35 +00:00
|
|
|
$ cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local ../sources
|
2013-11-27 22:11:47 +00:00
|
|
|
- or -
|
|
|
|
$ cmake -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local ../sources
|
2013-10-09 01:29:04 +00:00
|
|
|
$ cd src/lib
|
2013-10-09 19:56:15 +00:00
|
|
|
$ make -j4
|
2013-11-27 21:45:00 +00:00
|
|
|
$ install_name_tool -id /usr/local/lib/`echo libmarblewidget.??.dylib` libmarblewidget.dylib
|
2013-10-09 19:56:15 +00:00
|
|
|
$ cp *dylib /usr/local/lib/
|
2013-10-09 01:29:04 +00:00
|
|
|
$ mkdir -p /usr/local/include/marble
|
2013-11-24 00:12:54 +00:00
|
|
|
$ cd ../../../sources/src/lib
|
2013-10-09 01:29:04 +00:00
|
|
|
$ cp $(find . -name '*.h') /usr/local/include/marble/
|
|
|
|
|
|
|
|
5) Install Libdivecomputer
|
|
|
|
|
|
|
|
$ brew install automake libtool
|
|
|
|
$ cd ~/src
|
2013-10-09 19:56:15 +00:00
|
|
|
$ git clone git://git.libdivecomputer.org/libdivecomputer
|
2013-10-09 01:29:04 +00:00
|
|
|
$ cd libdivecomputer
|
|
|
|
$ git checkout release-0.4
|
|
|
|
$ autoreconf --install
|
2013-10-11 17:05:22 +00:00
|
|
|
$ ./configure --disable-shared
|
2013-10-09 01:29:04 +00:00
|
|
|
$ make
|
2013-10-09 19:56:15 +00:00
|
|
|
$ make install
|
2013-10-09 01:29:04 +00:00
|
|
|
|
|
|
|
6) Compile Subsurface
|
|
|
|
|
|
|
|
$ cd ~/src
|
|
|
|
$ git clone git://subsurface.hohndel.org/subsurface.git
|
|
|
|
$ cd subsurface
|
|
|
|
$ qmake
|
|
|
|
$ make
|
2013-10-09 20:44:44 +00:00
|
|
|
$ make install_mac_bundle
|
2013-10-09 01:29:04 +00:00
|
|
|
|
|
|
|
After the above is done, Subsurface will be installed to
|
|
|
|
/Applications.
|
|
|
|
|
|
|
|
Another option is to create a .dmg for distribution:
|
|
|
|
|
|
|
|
$ qmake
|
|
|
|
$ make
|
|
|
|
$ make mac-create-dmg
|
|
|
|
|
2013-11-28 00:26:39 +00:00
|
|
|
NOTES: macdeployqt assumes that the plugins are located "next" to the
|
|
|
|
frameworks. The frameworks are linked from /usr/local/lib - but the
|
|
|
|
plugins are not in /usr/local/plugins.
|
|
|
|
The easiest workaround is to create a symbolic link from
|
|
|
|
/usr/local/plugins to /usr/local/Cellar/qt/4.8.5/plugins (or whatever
|
|
|
|
version of Qt you have built earlier).
|
|
|
|
|
2013-10-09 01:29:04 +00:00
|
|
|
Cross-building Subsurface on Linux for Windows
|
|
|
|
----------------------------------------------
|
|
|
|
|
|
|
|
Subsurface builds nicely with MinGW - the official builds are done as
|
|
|
|
cross builds under Linux (currently on Fedora 17). A shell script to do
|
|
|
|
that (plus the .nsi file to create the installer with makensis) are
|
|
|
|
included in the packaging/Windows directory.
|
|
|
|
|
|
|
|
The best way to get libdivecomputer to build appears to be
|
|
|
|
|
2013-11-27 22:11:47 +00:00
|
|
|
$ git clone git://git.libdivecomputer.org/libdivecomputer
|
2013-10-09 01:29:04 +00:00
|
|
|
$ cd libdivecomputer
|
|
|
|
$ git checkout release-0.4
|
2013-10-11 17:05:22 +00:00
|
|
|
$ mingw32-configure --disable-shared
|
2013-10-09 01:29:04 +00:00
|
|
|
$ mingw32-make
|
|
|
|
$ sudo mingw32-make install
|
|
|
|
|
2013-11-27 22:11:47 +00:00
|
|
|
To compile Marble, use:
|
|
|
|
|
|
|
|
$ mkdir -p ~/src/marble/build
|
|
|
|
$ git clone -b v4.11.2 git://anongit.kde.org/marble ~/src/marble/sources
|
|
|
|
$ cd ~/src/marble/build
|
|
|
|
$ mingw32-cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=TRUE ../sources
|
|
|
|
- or -
|
|
|
|
$ mingw32-cmake -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE ../sources
|
|
|
|
$ mingw32-make -j4
|
|
|
|
$ mingw32-make install
|
|
|
|
|
2013-10-09 01:29:04 +00:00
|
|
|
To compile Subsurface, use:
|
|
|
|
|
|
|
|
$ git clone git://subsurface.hohndel.org/subsurface.git
|
|
|
|
$ cd subsurface
|
2013-11-28 00:41:16 +00:00
|
|
|
$ packaging/windows/mingw-make.sh
|
|
|
|
$ packaging/windows/mingw-make.sh install
|
|
|
|
$ packaging/windows/mingw-make.sh installer
|
|
|
|
|
|
|
|
The last step assumes that you have a link from packaging/windows/dll to
|
|
|
|
the correct directory in your MinGW installation. On my machine that is
|
|
|
|
/usr/i686-w64-mingw32/sys-root/mingw/bin
|
|
|
|
Similarly, the paths used in packaging/windows/mingw-make.sh may need to
|
|
|
|
be adjusted according to your distributions layout
|
|
|
|
|
2013-10-09 01:29:04 +00:00
|
|
|
|
|
|
|
Building Subsurface on Windows
|
|
|
|
------------------------------
|
|
|
|
|
2013-10-14 10:52:49 +00:00
|
|
|
1) Install msys-git:
|
|
|
|
http://msysgit.github.io
|
|
|
|
|
|
|
|
Tools part of MSYS are required for building Subsurface, while you also
|
|
|
|
need Git to be upstream and contribute to the project.
|
|
|
|
Make sure that the msys/bin (or git/bin) folder is in PATH.
|
|
|
|
|
|
|
|
2) Install Qt
|
|
|
|
http://qt-project.org/downloads
|
|
|
|
|
|
|
|
Subsurface is currently built against Qt 4.8.5.
|
|
|
|
|
|
|
|
3) Install a MinGW toolchain
|
|
|
|
https://docs.google.com/open?id=0B4D8x6CJEmtuczdiQklwMEs4RUU
|
|
|
|
|
|
|
|
Qt 4.8.5 comes without a compiler and you will have to download it from
|
|
|
|
a separate location. Other compiler may work, but there are no guaranties for
|
|
|
|
that. Make sure that the mingw/bin folder is in PATH.
|
|
|
|
|
|
|
|
4) Install Libdivecomputer
|
|
|
|
Use similar steps to the previous section, without the sudo command.
|
|
|
|
|
|
|
|
5) Install CMake (required for building Marble):
|
|
|
|
http://www.cmake.org/cmake/resources/software.html
|
|
|
|
|
|
|
|
Make sure that the cmake/bin folder is in PATH.
|
|
|
|
|
|
|
|
5) Download and build Marble
|
|
|
|
http://marble.kde.org/sources.php
|
|
|
|
http://techbase.kde.org/Projects/Marble/WindowsCompiling#Compiling_Marble_using_MingW
|
|
|
|
|
|
|
|
Make sure you build both the Debug and Release versions.
|
|
|
|
|
|
|
|
6) Install pkg-config
|
|
|
|
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
|
|
|
|
|
|
|
|
pkg-config depends on DLL files such as libglib-2.0-0.dll and has to be in
|
|
|
|
PATH, so it's best that you copy the executable to msys/bin.
|
|
|
|
|
|
|
|
7) Install other dependencies
|
|
|
|
Subsurface also depends on the following libraries:
|
|
|
|
|
|
|
|
* libxml2
|
|
|
|
http://www.xmlsoft.org/downloads.html
|
|
|
|
* libxslt
|
|
|
|
http://xmlsoft.org/XSLT/
|
|
|
|
* libusb-1.0
|
|
|
|
http://sourceforge.net/apps/trac/libusb-win32/wiki
|
|
|
|
* zlib
|
|
|
|
http://www.zlib.net/
|
|
|
|
* libzip
|
|
|
|
http://www.nih.at/libzip/
|
|
|
|
|
|
|
|
Once you have the libraries, create .pc files (pkg-config) for them and place
|
|
|
|
the files in a folder that is indicated by the PKG_CONFIG_PATH environment
|
|
|
|
variable - e.g. PKG_CONFIG_PATH=c:\msys\pkg-config
|
2013-10-09 01:29:04 +00:00
|
|
|
|
|
|
|
To build subsurface, use:
|
|
|
|
|
|
|
|
$ git clone git://subsurface.hohndel.org/subsurface.git
|
|
|
|
$ cd subsurface
|
|
|
|
$ qmake
|
|
|
|
$ make
|
|
|
|
$ make install
|
2013-11-28 00:41:16 +00:00
|
|
|
$ make installer
|
2013-10-09 01:29:04 +00:00
|
|
|
|
|
|
|
Build options
|
|
|
|
-------------
|
|
|
|
|
|
|
|
The following options are recognised when passed to qmake:
|
|
|
|
|
|
|
|
-config debug Create a debug build
|
|
|
|
-config release Create a release build
|
|
|
|
The default depends on how Qt was built.
|
|
|
|
V=1 Disable the "silent" build mode
|
|
|
|
LIBDCDEVEL=1 Search for libdivecomputer in ../libdivecomputer
|
|
|
|
INCLUDEPATH+=xxx Add xxx to the include paths to the compiler
|
|
|
|
(pass the actual path, without -I)
|
|
|
|
LIBS+=xxx Add xxx to the linker flags. -l and -L options are
|
|
|
|
recognised.
|
|
|
|
|
|
|
|
The INCLUDEPATH and LIBS options are useful to tell the buildsystem
|
|
|
|
about non-standard installation paths for the dependencies (such as
|
|
|
|
Marble). They can be repeated as often as needed, or multiple
|
|
|
|
arguments can be passed on the same switch, separated by a space. For
|
|
|
|
example:
|
|
|
|
|
|
|
|
qmake LIBS+="-L$HOME/marble/lib -L$HOME/libdivecomputer/lib" \
|
|
|
|
INCLUDEPATH+="$HOME/marble/include $HOME/libdivecomputer/include"
|