| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  | Building Subsurface from Source | 
					
						
							|  |  |  | =============================== | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  | Subsurface uses a few open source libraries and frameworks to do its | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | job. The most important ones include libdivecomputer, Qt, Marble | 
					
						
							|  |  |  | (more precisely libmarblewidget), libxml2, libxslt, libsqlite3, libzip, | 
					
						
							|  |  |  | and libgit2. | 
					
						
							| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | Below are instructions for building Subsurface under some popular | 
					
						
							|  |  |  | Linux distributions, for building Subsurface using Homebrew on a Mac, | 
					
						
							|  |  |  | and for cross-building Subsurface for Windows. The lack of a working | 
					
						
							|  |  |  | package management system for Windows makes it really painful to build | 
					
						
							|  |  |  | Subsurface natively under Windows, we have some hints how to do so | 
					
						
							|  |  |  | here as well. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | As of Subsurface 4.3 all of the prebuilt binaries that we provide (right | 
					
						
							|  |  |  | now Windows64, Windows32, Mac, Ubuntu and LinuxMint) are built using our | 
					
						
							|  |  |  | own custom "flavors" of libdivecomputer and libmarblewidget. You can get | 
					
						
							|  |  |  | these from | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | git://git.subsurface-divelog.org/marble (in the Subsurface-4.3 branch) | 
					
						
							|  |  |  | git://git.subsurface-divelog.org/libdc (in the Subsurface-4.3 branch) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Both of these repositories also have a Subsurface-testing branch. That | 
					
						
							|  |  |  | branch is explicitly marked as NOT STABLE and will receive force pushes. | 
					
						
							|  |  |  | The rationale for this is that we have no intention of forking either of | 
					
						
							|  |  |  | these two projects. We simply are adding a few patches on top of their | 
					
						
							|  |  |  | latest versions and so those testing branches get frequently rebased. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Also, all of the prebuilt binaries (with the exception of the Windows32 | 
					
						
							|  |  |  | build) are now Qt5 based and Qt5 is considered the stable and supported | 
					
						
							|  |  |  | framework to use for building Subsurface. | 
					
						
							| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | Build options for Subsurface | 
					
						
							|  |  |  | ---------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-15 08:15:45 -08:00
										 |  |  | The following options are recognized when passed to qmake: | 
					
						
							| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |  -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 | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  |  LIBMARBLEDEVEL=path  Search for marble library and includes in path | 
					
						
							| 
									
										
										
										
											2014-12-15 12:11:14 -08:00
										 |  |  |  SPECIAL_MARBLE_PREFIX=1 Use libssrfmarblewidget as library name | 
					
						
							|  |  |  |                       This is needed when building with our marble branch | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  |  LIBGIT2DEVEL=path    Search for libgit2 library and includes in path | 
					
						
							| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  |  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 | 
					
						
							| 
									
										
										
										
											2013-12-15 08:15:45 -08:00
										 |  |  | 		      recognized. | 
					
						
							| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 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" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Building Subsurface 4 under Linux | 
					
						
							|  |  |  | --------------------------------- | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | On Fedora you need | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | sudo yum install git gcc-c++ make autoconf automake libtool cmake \ | 
					
						
							|  |  |  | 	libzip-devel libxml2-devel libxslt-devel libsqlite3x-devel \ | 
					
						
							|  |  |  | 	libgit2-devel libudev-devel libusbx-devel \ | 
					
						
							|  |  |  | 	qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtscript-devel \ | 
					
						
							|  |  |  | 	qt5-qtwebkit-devel qt5-qtsvg-devel qt5-qttools-devel | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-15 14:53:04 -08:00
										 |  |  | Package names are sadly different on OpenSUSE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | sudo zypper install git gcc-c++ make autoconf automake libtool cmake libzip-devel \ | 
					
						
							|  |  |  | 	libxml2-devel libxslt-devel sqlite3-devel libgit2-devel libusb-1_0-devel \ | 
					
						
							|  |  |  | 	libqt5-linguist-devel libqt5-qttools-devel libQt5WebKitWidgets-devel \ | 
					
						
							|  |  |  | 	libqt5-qtbase-devel libQt5WebKit5-devel libqt5-qtsvg-devel \ | 
					
						
							|  |  |  | 	libqt5-qtscript-devel libqt5-qtdeclarative-devel | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | On Debian Jessie this seems to work | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | sudo apt-get install git g++ make autoconf libtool cmake pkg-config \ | 
					
						
							|  |  |  | 	libxml2-dev libxslt1-dev libzip-dev libsqlite3-dev \ | 
					
						
							|  |  |  | 	libusb-1.0-0-dev libgit2-dev \ | 
					
						
							|  |  |  | 	qt5-default qtchooser qttools5-dev-tools libqt5svg5-dev libqt5webkit5-dev \ | 
					
						
							|  |  |  | 	libqt5qml5 libqt5quick5 libqt5declarative5 qtscript5-dev | 
					
						
							| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | On Debian style distributions you can install the required development | 
					
						
							| 
									
										
										
										
											2013-12-13 01:38:54 +02:00
										 |  |  | packages by running (once Qt version of subsurface is available in your | 
					
						
							|  |  |  | distribution) | 
					
						
							| 
									
										
										
										
											2013-12-13 01:38:53 +02:00
										 |  |  | $ sudo apt-get build-dep subsurface | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | but on many of them this will give you the build dependencies for the | 
					
						
							|  |  |  | official package (which is often way out of date). So be careful that this | 
					
						
							|  |  |  | doesn't get you a Qt4 based environment | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | First you need to compile our version of libdivecomputer: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ mkdir ~/src # unless you have this already | 
					
						
							|  |  |  | $ cd ~/src | 
					
						
							|  |  |  | $ git clone -b Subsurface-4.3 git://subsurface-divelog.org/libdc libdivecomputer | 
					
						
							|  |  |  |        # or -b Subsurface-testing to get the testing version - careful, | 
					
						
							|  |  |  |        #                          careful - this gets rebased and may be broken | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | $ cd libdivecomputer | 
					
						
							|  |  |  | $ autoreconf --install | 
					
						
							| 
									
										
										
										
											2013-10-11 10:05:22 -07:00
										 |  |  | $ ./configure --disable-shared | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | $ make | 
					
						
							|  |  |  | $ sudo make install | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | Then you compile our custom branch of libmarblewidget | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ cd ~/src | 
					
						
							|  |  |  | $ git clone -b Subsurface-4.3 git://subsurface-divelog.org/marble marble-source | 
					
						
							|  |  |  |        # or -b Subsurface-testing to get the testing version - careful, | 
					
						
							|  |  |  |        #                          careful - this gets rebased and may be broken | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ mkdir marble-build | 
					
						
							|  |  |  | $ cd marble-build | 
					
						
							|  |  |  | $ cmake -DQTONLY=ON -DQT5BUILD=ON \ | 
					
						
							|  |  |  | 	-DBUILD_MARBLE_APPS=OFF -DBUILD_MARBLE_EXAMPLES=OFF \ | 
					
						
							|  |  |  | 	-DBUILD_MARBLE_TESTS=OFF -DBUILD_MARBLE_TOOLS=OFF \ | 
					
						
							|  |  |  | 	-DBUILD_TESTING=OFF -DWITH_DESIGNER_PLUGIN=OFF \ | 
					
						
							|  |  |  | 	-DBUILD_WITH_DBUS=OFF ../marble-source | 
					
						
							|  |  |  | $ make # <- this step will take quite a while... if you have more cores | 
					
						
							|  |  |  |        #    try make -j8 or something like that | 
					
						
							|  |  |  | $ sudo make install | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Finally you can compile Subsurface: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ cd ~/src | 
					
						
							| 
									
										
										
										
											2014-11-18 13:12:40 +00:00
										 |  |  | $ git clone git://subsurface-divelog.org/subsurface.git | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | $ cd subsurface | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | $ cd git checkout v4.3   # this get's you the last release | 
					
						
							|  |  |  |                          # skip this step to build the latest development | 
					
						
							|  |  |  | 			 # version | 
					
						
							| 
									
										
										
										
											2014-12-16 20:05:27 -08:00
										 |  |  | $ qmake SPECIAL_MARBLE_PREFIX=1 | 
					
						
							| 
									
										
										
										
											2014-12-16 11:56:39 -08:00
										 |  |  | # on Fedora/OpenSUSE you need qmake-qt5 | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | $ make | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | $ sudo make install    # [optionally, add: prefix=/usr/local] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | At least on Fedora and OpenSUSE you need to make sure that /usr/local/lib | 
					
						
							|  |  |  | is searched for shared libraries (this is where the steps above installed | 
					
						
							|  |  |  | libdivecomputer and libmarblewidget in order not to conflict with system | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | pacakges). So you need to do the following: | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | $ sudo echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf | 
					
						
							|  |  |  | $ sudo ldconfig | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Now you should be able to start the Subsurface binary you just created | 
					
						
							|  |  |  | with | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ ./subsurface | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-09 20:48:16 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-14 13:11:37 -08:00
										 |  |  | Building Subsurface under MacOSX (using Homebrew) | 
					
						
							|  |  |  | ------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-01 13:55:20 +01:00
										 |  |  | 0) You need to have XCode installed. The first time (and possibly after updating OSX) | 
					
						
							|  |  |  | you need to run | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ xcode-select --install | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 1)  Install Homebrew | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-23 16:12:54 -08:00
										 |  |  | $ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)" | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 2) Install needed dependencies | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-25 23:44:59 +01:00
										 |  |  | $ brew install asciidoc libzip sqlite cmake libusb pkg-config | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 3) Make the brew version of sqlite the default | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ brew link --force sqlite | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-25 23:44:59 +01:00
										 |  |  | 4) Download Qt from http://www.qt.io/download-open-source/ | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-25 23:44:59 +01:00
										 |  |  | In the installer, chose an install folder (e.g., /home/username/Qt5), in | 
					
						
							|  |  |  | "Select components" select the most recent version and be sure you also | 
					
						
							|  |  |  | install the "Source Components". | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Build it (takes a long time) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ cd ~/Qt5/5.4/Src/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ ./configure -prefix /usr/local -opensource | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ make -j4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ make install | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 5) Install custom subsurface Marble | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ cd ~/src | 
					
						
							|  |  |  | $ git clone -b Subsurface-4.3 git://subsurface-divelog.org/marble marble-source | 
					
						
							|  |  |  | $ cd marble-source | 
					
						
							|  |  |  | $ mkdir marble-build | 
					
						
							|  |  |  | $ cd marble-build | 
					
						
							|  |  |  | $ cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=TRUE -DWITH_PHONON=OFF \ | 
					
						
							|  |  |  | 	-DQT5BUILD=ON -DCMAKE_INSTALL_PREFIX=/usr/local ../../marble-source | 
					
						
							|  |  |  | $ cd src/lib/marble | 
					
						
							| 
									
										
										
										
											2013-10-09 12:56:15 -07:00
										 |  |  | $ make -j4 | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 5) Install Libdivecomputer | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ brew install automake libtool | 
					
						
							|  |  |  | $ cd ~/src | 
					
						
							| 
									
										
										
										
											2014-12-25 23:44:59 +01:00
										 |  |  | $ git clone -b Subsurface-4.3 git://subsurface-divelog.org/libdc libdivecomputer | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | $ cd libdivecomputer | 
					
						
							|  |  |  | $ autoreconf --install | 
					
						
							| 
									
										
										
										
											2013-10-11 10:05:22 -07:00
										 |  |  | $ ./configure --disable-shared | 
					
						
							| 
									
										
										
										
											2014-12-25 23:44:59 +01:00
										 |  |  | $ make -j4 | 
					
						
							| 
									
										
										
										
											2013-10-09 12:56:15 -07:00
										 |  |  | $ make install | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-25 23:44:59 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 6) Compile Subsurface | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ cd ~/src | 
					
						
							| 
									
										
										
										
											2014-11-18 13:12:40 +00:00
										 |  |  | $ git clone git://subsurface-divelog.org/subsurface.git | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | $ cd subsurface | 
					
						
							| 
									
										
										
										
											2014-12-25 23:44:59 +01:00
										 |  |  | $ qmake SPECIAL_MARBLE_PREFIX=1 INCLUDEPATH+=/usr/local/include \ | 
					
						
							|  |  |  | 	LIBS+=-L/usr/local/lib \ | 
					
						
							|  |  |  | 	LIBS+='-L/usr/local/Cellar/libzip/0.11.2/lib -lzip -lz' \ | 
					
						
							|  |  |  | 	INCLUDEPATH+=/usr/local/Cellar/libzip/0.11.2/include V=1 \ | 
					
						
							|  |  |  | 	LIBMARBLEDEVEL=../marble-source/marble-build/ | 
					
						
							|  |  |  | $ make -j4 | 
					
						
							| 
									
										
										
										
											2013-10-09 13:44:44 -07:00
										 |  |  | $ make install_mac_bundle | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-25 23:44:59 +01:00
										 |  |  | After the above is done, Subsurface will be installed to /Applications. | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | Another option is to create a .dmg for distribution: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ qmake | 
					
						
							|  |  |  | $ make | 
					
						
							|  |  |  | $ make mac-create-dmg | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-26 17:21:13 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | Cross-building Subsurface on Linux for Windows | 
					
						
							|  |  |  | ---------------------------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Subsurface builds nicely with MinGW - the official builds are done as | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | cross builds under Linux (currently on Fedora 20). A shell script to do | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | that (plus the .nsi file to create the installer with makensis) are | 
					
						
							| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  | included in the packaging/windows directory. | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | Everywhere below the mingw64- prefix is used for the cross tools. If you | 
					
						
							|  |  |  | really need a 32bit binary you need to use mingw32- as prefix and you may | 
					
						
							|  |  |  | also run into issues creating an installable binary with Qt5 (i.e., you | 
					
						
							|  |  |  | may have to go back to Qt4). | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | The best way to get libdivecomputer to build appears to be | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-12 17:10:49 +01:00
										 |  |  | $ mkdir -p ~/src | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | $ cd ~/src | 
					
						
							|  |  |  | $ git clone -b Subsurface-4.3 git://subsurface-divelog.org/libdc libdivecomputer | 
					
						
							|  |  |  |        # or -b Subsurface-testing to get the testing version - careful, | 
					
						
							|  |  |  |        #                          careful - this gets rebased and may be broken | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ cd libdivecomputer | 
					
						
							|  |  |  | $ autoreconf --install | 
					
						
							|  |  |  | $ mingw64-configure --disable-shared | 
					
						
							|  |  |  | $ mingw64-make | 
					
						
							|  |  |  | $ sudo mingw64-make install | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-27 14:11:47 -08:00
										 |  |  | To compile Marble, use: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | $ cd ~/src | 
					
						
							|  |  |  | $ git clone -b Subsurface-4.3 git://subsurface-divelog.org/marble marble-source | 
					
						
							|  |  |  |        # or -b Subsurface-testing to get the testing version - careful, | 
					
						
							|  |  |  |        #                          careful - this gets rebased and may be broken | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ mkdir marble-build | 
					
						
							|  |  |  | $ cd marble-build | 
					
						
							|  |  |  | $ mingg64-cmake -DQTONLY=ON -DQT5BUILD=ON \ | 
					
						
							|  |  |  | 	-DBUILD_MARBLE_APPS=OFF -DBUILD_MARBLE_EXAMPLES=OFF \ | 
					
						
							|  |  |  | 	-DBUILD_MARBLE_TESTS=OFF -DBUILD_MARBLE_TOOLS=OFF \ | 
					
						
							|  |  |  | 	-DBUILD_TESTING=OFF -DWITH_DESIGNER_PLUGIN=OFF \ | 
					
						
							|  |  |  | 	-DBUILD_WITH_DBUS=OFF ../marble-source | 
					
						
							|  |  |  | $ mingw64-make # <- this step will take quite a while... if you have more cores | 
					
						
							|  |  |  |                #    try ming64-make -j8 or something like that | 
					
						
							|  |  |  | $ sudo mingw64-make install | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-27 14:11:47 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-03-07 16:33:00 -08:00
										 |  |  | To compile libgit2, use: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $ mkdir -p ~/src/libgit2/build | 
					
						
							|  |  |  | $ git clone git://github.com/libgit2/libgit2 ~/src/libgit2 | 
					
						
							|  |  |  | $ cd ~/src/libgit2/build | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | $ mingw64-cmake .. | 
					
						
							|  |  |  | $ mingw64-make | 
					
						
							|  |  |  | $ sudo mingw64-make install | 
					
						
							| 
									
										
										
										
											2014-03-07 16:33:00 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | To compile Subsurface, use: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | $ cd ~/src | 
					
						
							|  |  |  | $ git clone git://subsurface-divelog.org/subsurface.git | 
					
						
							|  |  |  | $ cd subsurface | 
					
						
							|  |  |  | $ cd git checkout v4.3   # this get's you the last release | 
					
						
							|  |  |  |                          # skip this step to build the latest development | 
					
						
							|  |  |  | 			 # version | 
					
						
							| 
									
										
										
										
											2014-12-16 20:05:27 -08:00
										 |  |  | $ packagin/windows/mingw-make.sh Qt5 SPECIAL_MARBLE_PREFIX=1 | 
					
						
							| 
									
										
										
										
											2013-11-27 16:41:16 -08:00
										 |  |  | $ 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 | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | /usr/i686-w64-mingw64/sys-root/mingw/bin | 
					
						
							| 
									
										
										
										
											2013-11-27 16:41:16 -08:00
										 |  |  | Similarly, the paths used in packaging/windows/mingw-make.sh may need to | 
					
						
							|  |  |  | be adjusted according to your distributions layout | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | Also, at least one version of Qt DLLs shipping with Fedora was | 
					
						
							|  |  |  | self-inconsistent at caused random crashes at startup. Unless you have | 
					
						
							|  |  |  | good reasons to build your own binaries, on Windows you may be better off | 
					
						
							|  |  |  | with the pre-compiled binaries we provide. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | Building Subsurface on Windows | 
					
						
							|  |  |  | ------------------------------ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-15 18:19:21 -08:00
										 |  |  | This is NOT RECOMMENDED. To the best of our knowledge there is one single | 
					
						
							|  |  |  | person who regularly does this (and he provided these instructions). The | 
					
						
							|  |  |  | Subsurface team does not provide support for Windows binary build from | 
					
						
							|  |  |  | sources... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-14 13:52:49 +03: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-08 18:29:04 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | To build subsurface, use: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-18 13:12:40 +00:00
										 |  |  | $ git clone git://subsurface-divelog.org/subsurface.git | 
					
						
							| 
									
										
										
										
											2013-10-08 18:29:04 -07:00
										 |  |  | $ cd subsurface | 
					
						
							|  |  |  | $ qmake | 
					
						
							|  |  |  | $ make | 
					
						
							|  |  |  | $ make install | 
					
						
							| 
									
										
										
										
											2013-11-27 16:41:16 -08:00
										 |  |  | $ make installer |