Documentation: Update INSTALL and Convert it to Markdown.

Update the instructions for the Windows build and convert the file to
markdown.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2024-05-27 22:15:02 +12:00
parent 64d4de4a1b
commit 56f1e7027f
2 changed files with 183 additions and 149 deletions

View file

@ -1,5 +1,4 @@
Building Subsurface from Source # Building Subsurface from Source
===============================
Subsurface uses quite a few open source libraries and frameworks to do its Subsurface uses quite a few open source libraries and frameworks to do its
job. The most important ones include libdivecomputer, Qt, libxml2, libxslt, job. The most important ones include libdivecomputer, Qt, libxml2, libxslt,
@ -13,23 +12,27 @@ Below are instructions for building Subsurface
- iOS (cross-building) - iOS (cross-building)
Getting Subsurface source ## Getting Subsurface source
-------------------------
You can get the sources to the latest development version from our git You can get the sources to the latest development version from our git
repository: repository:
git clone http://github.com/Subsurface/subsurface.git
cd subsurface ```
git submodule init # this will give you our flavor of libdivecomputer git clone http://github.com/Subsurface/subsurface.git
cd subsurface
git submodule init # this will give you our flavor of libdivecomputer
```
You keep it updated by doing: You keep it updated by doing:
git checkout master
git pull -r ```
git submodule update git checkout master
git pull -r
git submodule update
```
Our flavor of libdivecomputer ### Our flavor of libdivecomputer
-----------------------------
Subsurface requires its own flavor of libdivecomputer which is inclduded Subsurface requires its own flavor of libdivecomputer which is inclduded
above as git submodule above as git submodule
@ -37,7 +40,7 @@ above as git submodule
The branches won't have a pretty history and will include ugly merges, The branches won't have a pretty history and will include ugly merges,
but they should always allow a fast forward pull that tracks what we but they should always allow a fast forward pull that tracks what we
believe developers should build against. All our patches are contained believe developers should build against. All our patches are contained
in the "Subsurface-DS9" branch. in the `Subsurface-DS9` branch.
This should allow distros to see which patches we have applied on top of This should allow distros to see which patches we have applied on top of
upstream. They will receive force pushes as we rebase to newer versions of upstream. They will receive force pushes as we rebase to newer versions of
@ -53,8 +56,7 @@ Subsurface or trying to understand what we have done relative to their
respective upstreams. respective upstreams.
Getting Qt5 ### Getting Qt5
-----------
We use Qt5 in order to only maintain one UI across platforms. We use Qt5 in order to only maintain one UI across platforms.
@ -74,36 +76,41 @@ significantly reduced flexibility.
As of this writing, there is thankfully a thirdparty offline installer still As of this writing, there is thankfully a thirdparty offline installer still
available: available:
pip3 install aqtinstall ```
aqt install -O <Qt Location> 5.15.2 mac desktop pip3 install aqtinstall
aqt install -O <Qt Location> 5.15.2 mac desktop
```
(or whatever version / OS you need). This installer is surprisingly fast (or whatever version / OS you need). This installer is surprisingly fast
and seems well maintained - note that we don't use this for Windows as and seems well maintained - note that we don't use this for Windows as
that is completely built from source using MXE. that is completely built from source using MXE.
In order to use this Qt installation, simply add it to your PATH: In order to use this Qt installation, simply add it to your PATH:
```
PATH=<Qt Location>/<version>/<type>/bin:$PATH PATH=<Qt Location>/<version>/<type>/bin:$PATH
```
QtWebKit is needed, if you want to print, but no longer part of Qt5, QtWebKit is needed, if you want to print, but no longer part of Qt5,
so you need to download it and compile. In case you just want to test so you need to download it and compile. In case you just want to test
without print possibility omit this step. without print possibility omit this step.
git clone -b 5.212 https://github.com/qt/qtwebkit ```
mkdir -p qtwebkit/WebKitBuild/Release git clone -b 5.212 https://github.com/qt/qtwebkit
cd qtwebkit/WebKitBuild/Release mkdir -p qtwebkit/WebKitBuild/Release
cmake -DPORT=Qt -DCMAKE_BUILD_TYPE=Release -DQt5_DIR=/<Qt Location>/<version>/<type>/lib/cmake/Qt5 ../.. cd qtwebkit/WebKitBuild/Release
make install cmake -DPORT=Qt -DCMAKE_BUILD_TYPE=Release -DQt5_DIR=/<Qt Location>/<version>/<type>/lib/cmake/Qt5 ../..
make install
```
Other third party library dependencies ### Other third party library dependencies
--------------------------------------
In order for our cloud storage to be fully functional you need In order for our cloud storage to be fully functional you need
libgit2 0.26 or newer. libgit2 0.26 or newer.
cmake build system ### cmake build system
------------------
Our main build system is based on cmake. But qmake is needed Our main build system is based on cmake. But qmake is needed
for the googlemaps plugin and the iOS build. for the googlemaps plugin and the iOS build.
@ -114,109 +121,127 @@ distribution (see build instructions).
Build options for Subsurface ## Build options for Subsurface
----------------------------
The following options are recognised when passed to cmake: The following options are recognised when passed to cmake:
-DCMAKE_BUILD_TYPE=Release create a release build `-DCMAKE_BUILD_TYPE=Release` create a release build
-DCMAKE_BUILD_TYPE=Debug create a debug build `-DCMAKE_BUILD_TYPE=Debug` create a debug build
The Makefile that was created using cmake can be forced into a much more The Makefile that was created using cmake can be forced into a much more
verbose mode by calling verbose mode by calling
make VERBOSE=1 ```
make VERBOSE=1
```
Many more variables are supported, the easiest way to interact with them is Many more variables are supported, the easiest way to interact with them is
to call to call
ccmake . ```
ccmake .
```
in your build directory. in your build directory.
Building the development version of Subsurface under Linux ### Building the development version of Subsurface under Linux
----------------------------------------------------------
On Fedora you need On Fedora you need
```
sudo dnf install autoconf automake bluez-libs-devel cmake gcc-c++ git \ sudo dnf install autoconf automake bluez-libs-devel cmake gcc-c++ git \
libcurl-devel libsqlite3x-devel libssh2-devel libtool libudev-devel \ libcurl-devel libsqlite3x-devel libssh2-devel libtool libudev-devel \
libusbx-devel libxml2-devel libxslt-devel make \ libusbx-devel libxml2-devel libxslt-devel make \
qt5-qtbase-devel qt5-qtconnectivity-devel qt5-qtdeclarative-devel \ qt5-qtbase-devel qt5-qtconnectivity-devel qt5-qtdeclarative-devel \
qt5-qtlocation-devel qt5-qtscript-devel qt5-qtsvg-devel \ qt5-qtlocation-devel qt5-qtscript-devel qt5-qtsvg-devel \
qt5-qttools-devel qt5-qtwebkit-devel redhat-rpm-config \ qt5-qttools-devel qt5-qtwebkit-devel redhat-rpm-config \
bluez-libs-devel libgit2-devel libzip-devel libmtp-devel bluez-libs-devel libgit2-devel libzip-devel libmtp-devel
```
Package names are sadly different on OpenSUSE Package names are sadly different on OpenSUSE
```
sudo zypper install git gcc-c++ make autoconf automake libtool cmake libzip-devel \ sudo zypper install git gcc-c++ make autoconf automake libtool cmake libzip-devel \
libxml2-devel libxslt-devel sqlite3-devel libusb-1_0-devel \ libxml2-devel libxslt-devel sqlite3-devel libusb-1_0-devel \
libqt5-linguist-devel libqt5-qttools-devel libQt5WebKitWidgets-devel \ libqt5-linguist-devel libqt5-qttools-devel libQt5WebKitWidgets-devel \
libqt5-qtbase-devel libQt5WebKit5-devel libqt5-qtsvg-devel \ libqt5-qtbase-devel libQt5WebKit5-devel libqt5-qtsvg-devel \
libqt5-qtscript-devel libqt5-qtdeclarative-devel \ libqt5-qtscript-devel libqt5-qtdeclarative-devel \
libqt5-qtconnectivity-devel libqt5-qtlocation-devel libcurl-devel \ libqt5-qtconnectivity-devel libqt5-qtlocation-devel libcurl-devel \
bluez-devel libgit2-devel libmtp-devel bluez-devel libgit2-devel libmtp-devel
```
On Debian Bookworm this seems to work On Debian Bookworm this seems to work
```
sudo apt install \ sudo apt install \
autoconf automake cmake g++ git libbluetooth-dev libcrypto++-dev \ autoconf automake cmake g++ git libbluetooth-dev libcrypto++-dev \
libcurl4-openssl-dev libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \ libcurl4-openssl-dev libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \
libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libtool \ libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libtool \
libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make pkg-config \ libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make pkg-config \
qml-module-qtlocation qml-module-qtpositioning qml-module-qtquick2 \ qml-module-qtlocation qml-module-qtpositioning qml-module-qtquick2 \
qt5-qmake qtchooser qtconnectivity5-dev qtdeclarative5-dev \ qt5-qmake qtchooser qtconnectivity5-dev qtdeclarative5-dev \
qtdeclarative5-private-dev qtlocation5-dev qtpositioning5-dev \ qtdeclarative5-private-dev qtlocation5-dev qtpositioning5-dev \
qtscript5-dev qttools5-dev qttools5-dev-tools libmtp-dev qtscript5-dev qttools5-dev qttools5-dev-tools libmtp-dev
```
In order to build and run mobile-on-desktop, you also need In order to build and run mobile-on-desktop, you also need
```
sudo apt install \ sudo apt install \
qtquickcontrols2-5-dev qml-module-qtquick-window2 qml-module-qtquick-dialogs \ qtquickcontrols2-5-dev qml-module-qtquick-window2 qml-module-qtquick-dialogs \
qml-module-qtquick-layouts qml-module-qtquick-controls2 qml-module-qtquick-templates2 \ qml-module-qtquick-layouts qml-module-qtquick-controls2 qml-module-qtquick-templates2 \
qml-module-qtgraphicaleffects qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtgraphicaleffects qml-module-qtqml-models2 qml-module-qtquick-controls
```
Package names for Ubuntu 21.04 Package names for Ubuntu 21.04
```
sudo apt install \ sudo apt install \
autoconf automake cmake g++ git libbluetooth-dev libcrypto++-dev \ autoconf automake cmake g++ git libbluetooth-dev libcrypto++-dev \
libcurl4-gnutls-dev libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \ libcurl4-gnutls-dev libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \
libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libtool \ libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libtool \
libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make pkg-config \ libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make pkg-config \
qml-module-qtlocation qml-module-qtpositioning qml-module-qtquick2 \ qml-module-qtlocation qml-module-qtpositioning qml-module-qtquick2 \
qt5-qmake qtchooser qtconnectivity5-dev qtdeclarative5-dev \ qt5-qmake qtchooser qtconnectivity5-dev qtdeclarative5-dev \
qtdeclarative5-private-dev qtlocation5-dev qtpositioning5-dev \ qtdeclarative5-private-dev qtlocation5-dev qtpositioning5-dev \
qtscript5-dev qttools5-dev qttools5-dev-tools libmtp-dev qtscript5-dev qttools5-dev qttools5-dev-tools libmtp-dev
```
In order to build and run mobile-on-desktop, you also need In order to build and run mobile-on-desktop, you also need
```
sudo apt install \ sudo apt install \
qtquickcontrols2-5-dev qml-module-qtquick-window2 qml-module-qtquick-dialogs \ qtquickcontrols2-5-dev qml-module-qtquick-window2 qml-module-qtquick-dialogs \
qml-module-qtquick-layouts qml-module-qtquick-controls2 qml-module-qtquick-templates2 \ qml-module-qtquick-layouts qml-module-qtquick-controls2 qml-module-qtquick-templates2 \
qml-module-qtgraphicaleffects qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtgraphicaleffects qml-module-qtqml-models2 qml-module-qtquick-controls
```
On Raspberry Pi (Raspian Buster and Ubuntu Mate 20.04.1) this seems to work On Raspberry Pi (Raspian Buster and Ubuntu Mate 20.04.1) this seems to work
```
sudo apt install \ sudo apt install \
autoconf automake cmake g++ git libbluetooth-dev libcrypto++-dev \ autoconf automake cmake g++ git libbluetooth-dev libcrypto++-dev \
libcurl4-gnutls-dev libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \ libcurl4-gnutls-dev libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \
libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libtool \ libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libtool \
libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make pkg-config \ libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make pkg-config \
qml-module-qtlocation qml-module-qtpositioning qml-module-qtquick2 \ qml-module-qtlocation qml-module-qtpositioning qml-module-qtquick2 \
qt5-qmake qtchooser qtconnectivity5-dev qtdeclarative5-dev \ qt5-qmake qtchooser qtconnectivity5-dev qtdeclarative5-dev \
qtdeclarative5-private-dev qtlocation5-dev qtpositioning5-dev \ qtdeclarative5-private-dev qtlocation5-dev qtpositioning5-dev \
qtscript5-dev qttools5-dev qttools5-dev-tools libmtp-dev qtscript5-dev qttools5-dev qttools5-dev-tools libmtp-dev
```
In order to build and run mobile-on-desktop, you also need In order to build and run mobile-on-desktop, you also need
```
sudo apt install \ sudo apt install \
qtquickcontrols2-5-dev qml-module-qtquick-window2 qml-module-qtquick-dialogs \ qtquickcontrols2-5-dev qml-module-qtquick-window2 qml-module-qtquick-dialogs \
qml-module-qtquick-layouts qml-module-qtquick-controls2 qml-module-qtquick-templates2 \ qml-module-qtquick-layouts qml-module-qtquick-controls2 qml-module-qtquick-templates2 \
qml-module-qtgraphicaleffects qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtgraphicaleffects qml-module-qtqml-models2 qml-module-qtquick-controls
```
Note that on Ubuntu Mate on the Raspberry Pi, you may need to configure Note that on Ubuntu Mate on the Raspberry Pi, you may need to configure
@ -226,42 +251,46 @@ swap space configured by default. See the dphys-swapfile package.
On Raspberry Pi OS with Desktop (64-bit) Released April 4th, 2022, this seems On Raspberry Pi OS with Desktop (64-bit) Released April 4th, 2022, this seems
to work to work
```
sudo apt install \ sudo apt install \
autoconf automake cmake g++ git libbluetooth-dev libcrypto++-dev \ autoconf automake cmake g++ git libbluetooth-dev libcrypto++-dev \
libcurl4-gnutls-dev libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \ libcurl4-gnutls-dev libgit2-dev libqt5qml5 libqt5quick5 libqt5svg5-dev \
libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libtool \ libqt5webkit5-dev libsqlite3-dev libssh2-1-dev libssl-dev libtool \
libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make pkg-config \ libusb-1.0-0-dev libxml2-dev libxslt1-dev libzip-dev make pkg-config \
qml-module-qtlocation qml-module-qtpositioning qml-module-qtquick2 \ qml-module-qtlocation qml-module-qtpositioning qml-module-qtquick2 \
qt5-qmake qtchooser qtconnectivity5-dev qtdeclarative5-dev \ qt5-qmake qtchooser qtconnectivity5-dev qtdeclarative5-dev \
qtdeclarative5-private-dev qtlocation5-dev qtpositioning5-dev \ qtdeclarative5-private-dev qtlocation5-dev qtpositioning5-dev \
qtscript5-dev qttools5-dev qttools5-dev-tools libmtp-dev qtscript5-dev qttools5-dev qttools5-dev-tools libmtp-dev
```
Note that you'll need to increase the swap space as the default of 100MB Note that you'll need to increase the swap space as the default of 100MB
doesn't seem to be enough. 1024MB worked on a 3B+. doesn't seem to be enough. 1024MB worked on a 3B+.
If maps aren't working, copy the googlemaps plugin If maps aren't working, copy the googlemaps plugin
from <build_dir>/subsurface/googlemaps/build/libqtgeoservices_googlemaps.so from `<build_dir>/subsurface/googlemaps/build/libqtgeoservices_googlemaps.so`
to /usr/lib/aarch64-linux-gnu/qt5/plugins/geoservices. to `/usr/lib/aarch64-linux-gnu/qt5/plugins/geoservices/`.
If Subsurface can't seem to see your dive computer on /dev/ttyUSB0, even after If Subsurface can't seem to see your dive computer on `/dev/ttyUSB0`, even after
adjusting your account's group settings (see note below about usermod), it adjusting your account's group settings (see note below about usermod), it
might be that the FTDI driver doesn't recognize the VendorID/ProductID of your might be that the FTDI driver doesn't recognize the VendorID/ProductID of your
computer. Follow the instructions here: computer. Follow the instructions here:
https://www.ftdichip.com/Support/Documents/TechnicalNotes/TN_101_Customising_FTDI_VID_PID_In_Linux(FT_000081).pdf https://www.ftdichip.com/Support/Documents/TechnicalNotes/TN_101_Customising_FTDI_VID_PID_In_Linux(FT_000081).pdf
If you're unsure of the VID/PID of your device, plug your dive computer in to If you're unsure of the VID/PID of your device, plug your dive computer in to
your host and run `dmesg`. That should show the codes that are needed to your host and run `dmesg`. That should show the codes that are needed to
follow TN_101. follow TN_101.
On PCLinuxOS you appear to need the following packages On PCLinuxOS you appear to need the following packages
su -c "apt-get install -y autoconf automake cmake gcc-c++ git libtool \ ```
lib64bluez-devel lib64qt5bluetooth-devel lib64qt5concurrent-devel \ su -c "apt-get install -y autoconf automake cmake gcc-c++ git libtool \
lib64qt5help-devel lib64qt5location-devel lib64qt5quicktest-devel \ lib64bluez-devel lib64qt5bluetooth-devel lib64qt5concurrent-devel \
lib64qt5quickwidgets-devel lib64qt5script-devel lib64qt5svg-devel \ lib64qt5help-devel lib64qt5location-devel lib64qt5quicktest-devel \
lib64qt5test-devel lib64qt5webkitwidgets-devel lib64qt5xml-devel \ lib64qt5quickwidgets-devel lib64qt5script-devel lib64qt5svg-devel \
lib64ssh2-devel lib64usb1.0-devel lib64zip-devel qttools5 qttranslations5" lib64qt5test-devel lib64qt5webkitwidgets-devel lib64qt5xml-devel \
lib64ssh2-devel lib64usb1.0-devel lib64zip-devel qttools5 qttranslations5"
```
In order to build Subsurface, use the supplied build script. This should In order to build Subsurface, use the supplied build script. This should
work on most systems that have all the prerequisite packages installed. work on most systems that have all the prerequisite packages installed.
@ -269,114 +298,121 @@ work on most systems that have all the prerequisite packages installed.
You should have Subsurface sources checked out in a sane place, something You should have Subsurface sources checked out in a sane place, something
like this: like this:
```
mkdir -p ~/src mkdir -p ~/src
cd ~/src cd ~/src
git clone https://github.com/Subsurface/subsurface.git git clone https://github.com/Subsurface/subsurface.git
./subsurface/scripts/build.sh # <- this step will take quite a while as it ./subsurface/scripts/build.sh # <- this step will take quite a while as it
# compiles a handful of libraries before # compiles a handful of libraries before
# building Subsurface # building Subsurface
```
Now you can run Subsurface like this: Now you can run Subsurface like this:
```
cd ~/src/subsurface/build cd ~/src/subsurface/build
./subsurface ./subsurface
```
Note: on many Linux versions (for example on Kubuntu 15.04) the user must Note: on many Linux versions (for example on Kubuntu 15.04) the user must
belong to the dialout group. belong to the `dialout` group.
You may need to run something like You may need to run something like
sudo usermod -a -G dialout username ```
sudo usermod -a -G dialout $USER
```
with your correct username and log out and log in again for that to take with your correct username and log out and log in again for that to take
effect. effect.
If you get errors like: If you get errors like:
```
./subsurface: error while loading shared libraries: libGrantlee_Templates.so.5: cannot open shared object file: No such file or directory ./subsurface: error while loading shared libraries: libGrantlee_Templates.so.5: cannot open shared object file: No such file or directory
```
You can run the following command: You can run the following command:
```
sudo ldconfig ~/src/install-root/lib sudo ldconfig ~/src/install-root/lib
```
Building Subsurface under MacOSX ### Building Subsurface under MacOSX
--------------------------------
While it is possible to build all required components completely from source, While it is possible to build all required components completely from source,
at this point the preferred way to build Subsurface is to set up the build at this point the preferred way to build Subsurface is to set up the build
infrastructure via Homebrew and then build the dependencies from source. infrastructure via Homebrew and then build the dependencies from source.
0) You need to have XCode installed. The first time (and possibly after updating OSX) 0. You need to have XCode installed. The first time (and possibly after updating OSX)
```
xcode-select --install xcode-select --install
```
1) install Homebrew (see https://brew.sh) and then the required build infrastructure: 1. install Homebrew (see https://brew.sh) and then the required build infrastructure:
```
brew install autoconf automake libtool pkg-config gettext brew install autoconf automake libtool pkg-config gettext
```
2) install Qt 2. install Qt
download the macOS installer from https://download.qt.io/official_releases/online_installers download the macOS installer from https://download.qt.io/official_releases/online_installers
and use it to install the desired Qt version. At this point the latest Qt5 version is still and use it to install the desired Qt version. At this point the latest Qt5 version is still
preferred over Qt6. preferred over Qt6.
If you plan to deploy your build to an Apple Silicon Mac, you may have better results with If you plan to deploy your build to an Apple Silicon Mac, you may have better results with
Bluetooth connections if you install Qt5.15.13. If Qt5.15.13 is not availablevia the Bluetooth connections if you install Qt5.15.13. If Qt5.15.13 is not available via the
installer, you can download from https://download.qt.io/official_releases/qt/5.15/5.15.13 installer, you can download from https://download.qt.io/official_releases/qt/5.15/5.15.13
and build using the usual configure, make, and make install. and build using the usual configure, make, and make install.
3) now build Subsurface 3. now build Subsurface
```
cd ~/src; bash subsurface/scripts/build.sh -build-deps cd ~/src; bash subsurface/scripts/build.sh -build-deps
```
if you are building against Qt6 (still experimental) you can create a universal binary with if you are building against Qt6 (still experimental) you can create a universal binary with
```
cd ~/src; bash subsurface/scripts/build.sh -build-with-qt6 -build-deps -fat-build cd ~/src; bash subsurface/scripts/build.sh -build-with-qt6 -build-deps -fat-build
```
After the above is done, Subsurface.app will be available in the After the above is done, Subsurface.app will be available in the
subsurface/build directory. You can run Subsurface with the command subsurface/build directory. You can run Subsurface with the command
A) open subsurface/build/Subsurface.app A. `open subsurface/build/Subsurface.app`
this will however not show diagnostic output this will however not show diagnostic output
B) subsurface/build/Subsurface.app/Contents/MacOS/Subsurface B. `subsurface/build/Subsurface.app/Contents/MacOS/Subsurface`
the TAB key is your friend :-) the [Tab] key is your friend :-)
Debugging can be done with either Xcode or QtCreator. Debugging can be done with either Xcode or QtCreator.
To install the app for all users, move subsurface/build/Subsurface.app to /Applications. To install the app for all users, move subsurface/build/Subsurface.app to /Applications.
Cross-building Subsurface on MacOSX for iOS ### Cross-building Subsurface on MacOSX for iOS
-------------------------------------------
1) build SubSurface under MacOSX and iOS 0. build SubSurface under MacOSX and iOS
1.1) cd <repo>/..; bash <repo>/scripts/build.sh -build-deps -both 1. `cd <repo>/..; bash <repo>/scripts/build.sh -build-deps -both`
note: this is mainly done to ensure all external dependencies are downloaded and set note: this is mainly done to ensure all external dependencies are downloaded and set
to the correct versions to the correct versions
2) continue as described in subsurface/packaging/ios 2. follow [these instructions](packaging/ios/README.md)
Cross-building Subsurface on Linux for Windows ### Cross-building Subsurface on Linux for Windows
----------------------------------------------
Subsurface builds nicely with MinGW - the official builds are done as Subsurface for Windows builds on linux by using the [MXE (M cross environment)](https://github.com/mxe/mxe). The easiest way to do this is to use a Docker container with a pre-built MXE for Subsurface by following [these instructions](packaging/windows/README.md).
cross builds under Linux (currently on Ubuntu 20.04). A shell script to do
that (plus the .nsi file to create the installer with makensis) are
included in the packaging/windows directory.
Please read through the explanations and instructions in
packaging/windows/README.md, packaging/windows/create-win-installer.sh, and
packaging/windows/mxe-based-build.sh if you want to build the Windows version
on your Linux system.
Building Subsurface on Windows ### Building Subsurface on Windows
------------------------------
This is NOT RECOMMENDED. To the best of our knowledge there is one single This is NOT RECOMMENDED. To the best of our knowledge there is one single
person who regularly does this. The Subsurface team does not provide support person who regularly does this. The Subsurface team does not provide support
@ -386,8 +422,9 @@ The lack of a working package management system for Windows makes it
really painful to build Subsurface natively under Windows, really painful to build Subsurface natively under Windows,
so we don't support that at all. so we don't support that at all.
But if you want to build Subsurface on a Windows system, the docker based [cross-build for Windows](packaging/windows/README.md) works just fine in WSL2 on Windows.
Cross-building Subsurface on Linux for Android
----------------------------------------------
Follow the instructions in packaging/android/README ### Cross-building Subsurface on Linux for Android
Follow [these instructions](packaging/android/README.md).

View file

@ -1,5 +1,4 @@
Tool repo to crosscompile subsurface for iOS # Tool repo to crosscompile subsurface for iOS
--------------------------------------------
Dependencies: Dependencies:
@ -7,20 +6,18 @@ Dependencies:
- XCode with iOS SDK and Qt5.13 or later - XCode with iOS SDK and Qt5.13 or later
- cmake - cmake
Follow the instruction in: Follow [these instructions](/INSTALL.md#cross-building-subsurface-on-macosx-for-ios)
<repo>/INSTALL
and then continue here: and then continue here:
1) cd <repo>/packaging/ios 1. `cd <repo>/packaging/ios`
2) export IOS_BUNDLE_PRODUCT_IDENTIFIER="<your apple id>.subsurface-divelog.subsurface-mobile" 2. `export IOS_BUNDLE_PRODUCT_IDENTIFIER="<your apple id>.subsurface-divelog.subsurface-mobile"`
3) ./build.sh 3. `./build.sh`
note: this builds all dependencies and is only needed first time note: this builds all dependencies and is only needed first time
it currently build for armv7 arm64 and x86_64 (simulator) it currently build for armv7 arm64 and x86_64 (simulator)
1) cd <repo>/.. 1. `cd <repo>/..`
2) Launch QtCreator and open subsurface/packaging/ios/Subsurface-mobile.pro 2. Launch QtCreator and open `subsurface/packaging/ios/Subsurface-mobile.pro`
3) Build Subsurface-mobile in QtCreator - you can build for the simulator and for 3. Build Subsurface-mobile in QtCreator - you can build for the simulator and for
a device and even deploy to a connected device. a device and even deploy to a connected device.
Everything up to here you can do without paying for an Apple Developer account. Everything up to here you can do without paying for an Apple Developer account.
@ -33,17 +30,17 @@ The easiest way to do that appears to be to open the Subsurface-mobile.xcodeproj
in the build directory that QtCreator used in Xcode and to create an archive there. in the build directory that QtCreator used in Xcode and to create an archive there.
WARNING: **WARNING:**
========
The version number used in the Subsurface-mobile app is created in step 3. The version number used in the Subsurface-mobile app is created in step 3.
So whenever you pull the latest git or commit a change, you need to re-run the So whenever you pull the latest git or commit a change, you need to re-run the
build.sh script so that the Info.plist used by QtCreator (well, by Xcode under `build.sh` script so that the `Info.plist` used by QtCreator (well, by Xcode under
the hood) gets updated. Otherwise you will continue to see the old version the hood) gets updated. Otherwise you will continue to see the old version
number, even though the sources have been recompiled which can be very number, even though the sources have been recompiled which can be very
confusing. confusing.
Do a simply version update by running: Do a simply version update by running:
```
build.sh -version build.sh -version
and then rebuilding in Qt Creator (or Xcode) ```
and then rebuilding in Qt Creator (or Xcode).