diff options
Diffstat (limited to 'packaging/ubuntu')
-rw-r--r-- | packaging/ubuntu/0001-Make-build-with-Qt4.patch | 90 | ||||
-rw-r--r-- | packaging/ubuntu/debian/copyright | 4 | ||||
-rwxr-xr-x | packaging/ubuntu/debian/rules | 16 | ||||
-rw-r--r-- | packaging/ubuntu/make-package.sh | 100 |
4 files changed, 149 insertions, 61 deletions
diff --git a/packaging/ubuntu/0001-Make-build-with-Qt4.patch b/packaging/ubuntu/0001-Make-build-with-Qt4.patch index 6220f61f3..a1e44fe0c 100644 --- a/packaging/ubuntu/0001-Make-build-with-Qt4.patch +++ b/packaging/ubuntu/0001-Make-build-with-Qt4.patch @@ -1,19 +1,33 @@ -From a5da35bf6fea4424d387ec5d1f94f520834ef77b Mon Sep 17 00:00:00 2001 +From 936f3bab5be5d6c7d8da0a2d2d7e9da42bcd96c1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel <dirk@hohndel.org> -Date: Tue, 17 Feb 2015 13:23:33 -0800 +Date: Thu, 19 Feb 2015 21:51:22 -0800 Subject: [PATCH] Make build with Qt4 This is just a best effort patch - Qt4 is no longer officially supported Signed-off-by: Dirk Hohndel <dirk@hohndel.org> --- + helpers.h | 1 + qt-ui/divelogexportdialog.cpp | 7 ++++++- qt-ui/divelogexportdialog.h | 4 ++++ qt-ui/divelogimportdialog.cpp | 34 ++++++++++++++++++++++++++++++++++ qt-ui/downloadfromdivecomputer.cpp | 12 ++++++++++++ qt-ui/plannerSettings.ui | 4 ++-- - 5 files changed, 58 insertions(+), 3 deletions(-) + qthelper.cpp | 10 ++++++++++ + 7 files changed, 69 insertions(+), 3 deletions(-) +diff --git a/helpers.h b/helpers.h +index 885b73e58235..64fdc9ed5d27 100644 +--- a/helpers.h ++++ b/helpers.h +@@ -8,6 +8,7 @@ + #define HELPERS_H + + #include <QString> ++#include <QPair> + #include "dive.h" + #include "qthelper.h" + diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp index 43c41550f145..8c6d2899f0f0 100644 --- a/qt-ui/divelogexportdialog.cpp @@ -66,10 +80,10 @@ index 14f8f453980f..524416414a8e 100644 void showExplanation(); void exportHtmlInit(const QString &filename); diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp -index bb4701ce36d3..4b9c8f8c0740 100644 +index ce12ef7ec34b..f4e43ef9068f 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp -@@ -376,14 +376,22 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) +@@ -377,14 +377,22 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) seabear = true; firstLine = "Sample time;Sample depth;Sample NDL;Sample TTS;Sample stopdepth;Sample temperature;Sample pressure"; blockSignals(true); @@ -92,7 +106,7 @@ index bb4701ce36d3..4b9c8f8c0740 100644 blockSignals(false); } -@@ -392,9 +400,17 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) +@@ -393,9 +401,17 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) apd=true; firstLine = "Sample time\tSample depth\t\t\t\t\tSample pO₂\t\t\t\t\t\t\t\t\tSample temperature\t\tSample CNS\tSample stopdepth"; blockSignals(true); @@ -110,7 +124,7 @@ index bb4701ce36d3..4b9c8f8c0740 100644 blockSignals(false); } -@@ -413,7 +429,16 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) +@@ -414,7 +430,16 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) separator = ";"; if (ui->CSVSeparator->currentText() != separator) { blockSignals(true); @@ -127,7 +141,7 @@ index bb4701ce36d3..4b9c8f8c0740 100644 blockSignals(false); currColumns = firstLine.split(separator); } -@@ -464,7 +489,16 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) +@@ -465,7 +490,16 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) if (ui->CSVSeparator->currentText() != separator || separator == "Tab") { ui->CSVSeparator->blockSignals(true); @@ -145,10 +159,10 @@ index bb4701ce36d3..4b9c8f8c0740 100644 if (separator == "Tab") separator = "\t"; diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp -index cd3dd90d0cc2..e5ddab840b03 100644 +index c57aa1ef2c00..4e5b27c6b21f 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp -@@ -600,19 +600,31 @@ QVariant DiveImportedModel::data(const QModelIndex &index, int role) const +@@ -602,19 +602,31 @@ QVariant DiveImportedModel::data(const QModelIndex &index, int role) const void DiveImportedModel::changeSelected(QModelIndex clickedIndex) { checkStates[clickedIndex.row()] = !checkStates[clickedIndex.row()]; @@ -181,7 +195,7 @@ index cd3dd90d0cc2..e5ddab840b03 100644 Qt::ItemFlags DiveImportedModel::flags(const QModelIndex &index) const diff --git a/qt-ui/plannerSettings.ui b/qt-ui/plannerSettings.ui -index af03fd1fbfb9..aaf99750e26f 100644 +index 440fb534a6b5..89ffc89e1c38 100644 --- a/qt-ui/plannerSettings.ui +++ b/qt-ui/plannerSettings.ui @@ -338,8 +338,8 @@ @@ -195,6 +209,60 @@ index af03fd1fbfb9..aaf99750e26f 100644 </property> <property name="maxVisibleItems"> <number>6</number> +diff --git a/qthelper.cpp b/qthelper.cpp +index b26bdf467dec..1981571b2007 100644 +--- a/qthelper.cpp ++++ b/qthelper.cpp +@@ -12,6 +12,7 @@ + #include <QDir> + #include <QDebug> + #include <QSettings> ++#if QT_VERSION >= 0x050000 + #include <QStandardPaths> + #include <QJsonDocument> + #include <QJsonArray> +@@ -21,6 +22,9 @@ + #include <QNetworkAccessManager> + #include <QUrlQuery> + #include <QEventLoop> ++#else ++#include <QDesktopServices> ++#endif + + #include <libxslt/documents.h> + +@@ -304,6 +308,7 @@ extern "C" const char *system_default_directory(void) + static char filename[PATH_MAX]; + + if (!*filename) { ++#if QT_VERSION >= 0x050000 + enum QStandardPaths::StandardLocation location; + #if QT_VERSION >= 0x050400 + location = QStandardPaths::AppDataLocation; +@@ -311,6 +316,9 @@ extern "C" const char *system_default_directory(void) + location = QStandardPaths::DataLocation; + #endif + QString name = QStandardPaths::standardLocations(location).first(); ++#else ++ QString name = QDesktopServices::storageLocation(QDesktopServices::DataLocation); ++#endif + QDir dir(name); + dir.mkpath(name); + // Why no "dir.encodeName()"? Crazy Qt +@@ -379,6 +387,7 @@ void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsedOrdered) + + extern "C" void reverseGeoLookup(degrees_t latitude, degrees_t longitude, uint32_t uuid) + { ++#if QT_VERSION >= 0x050000 + QNetworkRequest request; + QNetworkAccessManager *rgl = new QNetworkAccessManager(); + request.setUrl(QString("http://open.mapquestapi.com/nominatim/v1/reverse.php?format=json&accept-language=%1&lat=%2&lon=%3") +@@ -400,4 +409,5 @@ extern "C" void reverseGeoLookup(degrees_t latitude, degrees_t longitude, uint32 + struct dive_site *ds = get_dive_site_by_uuid(uuid); + ds->notes = add_to_string(ds->notes, "countrytag: %s", address.value("country").toString().toUtf8().data()); + } ++#endif + } -- 1.8.0.rc0.18.gf84667d diff --git a/packaging/ubuntu/debian/copyright b/packaging/ubuntu/debian/copyright index 75e69b368..f8f20b50e 100644 --- a/packaging/ubuntu/debian/copyright +++ b/packaging/ubuntu/debian/copyright @@ -7,8 +7,8 @@ Copyright: 2011-2014 Dirk Hohndel, Linus Torvalds, Tomaz Canabrava and others License: GPL-2.0 Files: debian/* -Copyright: 2014 Dirk Hohndel <dirk@hohndel.org> -License: GPL-2.0 +Copyright: 2012 Khalid El Fathi <khalid@elfathi.fr>, 2013-2014 Sylvestre Ledru <sylvestre@debian.org>, 2014-2015 Dirk Hohndel <dirk@hohndel.org> +License: GPL-2.0+ License: GPL-2.0 This package is free software; you can redistribute it and/or modify diff --git a/packaging/ubuntu/debian/rules b/packaging/ubuntu/debian/rules index ef197521c..e1ad26a3d 100755 --- a/packaging/ubuntu/debian/rules +++ b/packaging/ubuntu/debian/rules @@ -3,10 +3,11 @@ # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 - +export DEB_BUILD_OPTIONS+=nocheck +export DEB_CMAKE_INSTALL_PREFIX=/usr %: - dh $@ + dh $@ --buildsystem=cmake --builddirectory=subsurface-build --parallel override_dh_auto_clean: (cd libdivecomputer ; make clean || true) @@ -32,7 +33,16 @@ override_dh_auto_configure: ln -s src/lib/marble lib ; \ mkdir include ; cd include ; for i in `find ../../marble-source -name \*.h` ; do ln -s $$i . ; done ; \ ln -s . marble ) - qmake LIBDCDEVEL=./libdivecomputer LIBGIT2DEVEL=./libgit2 LIBGIT2STATIC=1 LIBMARBLEDEVEL=./marble-build SPECIAL_MARBLE_PREFIX=1 subsurface.pro + (mkdir subsurface-build ; cd subsurface-build ; \ + cmake -DCMAKE_BUILD_TYPE=Release \ + -DPREFER_GIT_FROMSOURCE=1 \ + -DLIBGIT2_INCLUDE_DIR=$$(pwd)/../libgit2/include \ + -DLIBGIT2_LIBRARIES=$$(pwd)/../libgit2/build/libgit2.a \ + -DLIBDIVECOMPUTER_INCLUDE_DIR=$$(pwd)/../libdivecomputer/include \ + -DLIBDIVECOMPUTER_LIBRARIES=$$(pwd)/../libdivecomputer/src/.libs/libdivecomputer.a \ + -DMARBLE_INCLUDE_DIR=$$(pwd)/../marble-build/include \ + -DMARBLE_LIBRARIES=$$(pwd)/../marble-build/lib/libssrfmarblewidget.so \ + $$(pwd)/.. ; ) override_dh_installchangelogs: dh_installchangelogs diff --git a/packaging/ubuntu/make-package.sh b/packaging/ubuntu/make-package.sh index 6063e1b50..15e59a001 100644 --- a/packaging/ubuntu/make-package.sh +++ b/packaging/ubuntu/make-package.sh @@ -1,5 +1,12 @@ #!/bin/bash # start from the directory above the combined subsurface & subsurface/libdivecomputer directory +# +# in order to be able to make changes to the debian/* files without changing the source +# this script assumes that the debian/* files plus a separate debian.changelog are in +# this directory as well - this makes testing builds on launchpad easier +# for most people all it should take is to run +# cp -a packaging/ubuntu/debian . +# if [[ $(pwd | grep "subsurface$") || ! -d subsurface || ! -d subsurface/libdivecomputer || ! -d subsurface/libgit2 ]] ; then echo "Please start this script from the folder ABOVE the subsurface source directory" echo "which includes libdivecomputer and libgit2 as subdirectories)." @@ -15,55 +22,50 @@ LIBDCREVISION=$(cd subsurface/libdivecomputer ; git rev-parse --verify HEAD) # echo "building Subsurface" $VERSION "with libdivecomputer" $LIBDCREVISION # -if [[ -d subsurface_$VERSION ]]; then - rm -rf subsurface_$VERSION.bak.prev - mv subsurface_$VERSION.bak subsurface_$VERSION.bak.prev - mv subsurface_$VERSION subsurface_$VERSION.bak -fi -mkdir subsurface_$VERSION -if [[ "x$GITREVISION" != "x" ]] ; then - rm -f subsurfacedaily-$VERSION - ln -s subsurface_$VERSION subsurfacedaily-$VERSION -else - rm -f subsurfacebeta-$VERSION - ln -s subsurface_$VERSION subsurfacebeta-$VERSION -fi +if [[ ! -d subsurface_$VERSION ]]; then + mkdir subsurface_$VERSION + if [[ "x$GITREVISION" != "x" ]] ; then + rm -f subsurfacedaily-$VERSION + ln -s subsurface_$VERSION subsurfacedaily-$VERSION + else + rm -f subsurfacebeta-$VERSION + ln -s subsurface_$VERSION subsurfacebeta-$VERSION + fi -# -# -echo "copying sources" -# -(cd subsurface ; tar cf - . ) | (cd subsurface_$VERSION ; tar xf - ) -cd subsurface_$VERSION -rm -rf .git libdivecomputer/.git libgit2/.git marble-source/.git -echo $GITVERSION > .gitversion -echo $LIBDCREVISION > libdivecomputer/revision -# dh_make --email dirk@hohndel.org -c gpl2 --createorig --single --yes -p subsurface_$VERSION -# rm debian/*.ex debian/*.EX debian/README.* -# -# -echo "creating source tar file for OBS and Ununtu PPA" -# -if [[ "x$GITREVISION" != "x" ]] ; then - (cd .. ; tar ch subsurfacedaily-$VERSION | xz > home:Subsurface-Divelog/Subsurface-daily/subsurface-$VERSION.orig.tar.xz) & + # + # + echo "copying sources" + # + (cd subsurface ; tar cf - . ) | (cd subsurface_$VERSION ; tar xf - ) + cd subsurface_$VERSION; + rm -rf .git libdivecomputer/.git libgit2/.git marble-source/.git + echo $GITVERSION > .gitversion + echo $LIBDCREVISION > libdivecomputer/revision + # dh_make --email dirk@hohndel.org -c gpl2 --createorig --single --yes -p subsurface_$VERSION + # rm debian/*.ex debian/*.EX debian/README.* + # + # + echo "creating source tar file for OBS and Ununtu PPA" + # + if [[ "x$GITREVISION" != "x" ]] ; then + (cd .. ; tar ch subsurfacedaily-$VERSION | xz > home:Subsurface-Divelog/Subsurface-daily/subsurface-$VERSION.orig.tar.xz) & + else + (cd .. ; tar ch subsurfacebeta-$VERSION | xz > home:Subsurface-Divelog/Subsurface-beta/subsurface-$VERSION.orig.tar.xz) & + fi + tar cf - . | xz > ../subsurface_$VERSION.orig.tar.xz else - (cd .. ; tar ch subsurfacebeta-$VERSION | xz > home:Subsurface-Divelog/Subsurface-beta/subsurface-$VERSION.orig.tar.xz) & + echo "using existing source tree" + cd subsurface_$VERSION fi -tar cf - . | xz > ../subsurface_$VERSION.orig.tar.xz # # echo "preparint the debian directory" # export DEBEMAIL=dirk@hohndel.org +rm -rf debian mkdir -p debian -cp -a packaging/ubuntu/debian . +cp -a ../debian . cp ../debian.changelog debian/changelog -# do something clever with changelog -#mv debian/changelog debian/autocl -#head -1 debian/autocl | sed -e 's/)/~trusty)/' -e 's/unstable/trusty/' > debian/changelog -#cat ../subsurface/packaging/ubuntu/debian/changelog >> debian/changelog -#tail -1 debian/autocl >> debian/changelog -#rm -f debian/autocl rev=0 while [ $rev -le "99" ] @@ -77,22 +79,30 @@ dch -v $VERSION-$rev~trusty -D trusty -M -m "next daily build" mv ~/src/debian.changelog ~/src/debian.changelog.previous cp debian/changelog ~/src/debian.changelog -debuild -S +debuild -S -# and now for utopic (precise can't build Qt5 based packages) +# and now for utopic prev=trusty rel=utopic sed -i "s/${prev}/${rel}/g" debian/changelog debuild -S -# and now for precise +# and now for vivid prev=utopic -rel=precise +rel=vivid sed -i "s/${prev}/${rel}/g" debian/changelog -cp debian/12.04.control debian/control -cp debian/12.04.rules debian/rules debuild -S +# and now for precise (precise can't build Qt5 based packages) +# with the switch to cmake the amount of effort to build Qt4 packages +# on precise just doesn't seem worth it anymore +#prev=vivid +#rel=precise +#sed -i "s/${prev}/${rel}/g" debian/changelog +#cp debian/12.04.control debian/control +#cp debian/12.04.rules debian/rules +#debuild -S + cd .. if [[ "$1x" = "postx" ]] ; then |