aboutsummaryrefslogtreecommitdiff
path: root/misc/goldencheetah
diff options
context:
space:
mode:
authorKyle Guinn <elyk03@gmail.com>2021-05-30 20:45:32 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-06-01 21:47:00 +0700
commite73f897568c1f06fb0b93da08498a382cd372d4c (patch)
treeb414f9fbcf86ea7957edc9352d0d9a81a739d909 /misc/goldencheetah
parent52068d3b954ffce93cc753ca719d6abe03ac0f0e (diff)
misc/goldencheetah: Updated for Slackware 15.0
Signed-off-by: Kyle Guinn <elyk03@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'misc/goldencheetah')
-rw-r--r--misc/goldencheetah/README2
-rw-r--r--misc/goldencheetah/goldencheetah.SlackBuild87
-rw-r--r--misc/goldencheetah/goldencheetah.info2
-rw-r--r--misc/goldencheetah/patches/0001-Fix-Qwt-incompatibilities-with-Qt-5.15.0.patch114
-rw-r--r--misc/goldencheetah/patches/0001-SEGV-on-Overview-Chart.patch22
-rw-r--r--misc/goldencheetah/patches/0002-View-on-Strava.patch50
-rw-r--r--misc/goldencheetah/patches/0003-Compatible-with-Strava.patchbin0 -> 4931 bytes
-rw-r--r--misc/goldencheetah/patches/0004-Connect-with-Strava.patchbin0 -> 8081 bytes
-rw-r--r--misc/goldencheetah/patches/0005-3.5-BUILD-INCREMENT.patch29
9 files changed, 286 insertions, 20 deletions
diff --git a/misc/goldencheetah/README b/misc/goldencheetah/README
index a5ae478cd371..e5471277b2b8 100644
--- a/misc/goldencheetah/README
+++ b/misc/goldencheetah/README
@@ -8,3 +8,5 @@ GoldenCheetah is a software package that:
* Provides a rich set of analysis tools, including a critical power graph,
BikeScore calculation, histogram analysis, a best interval finder, and a
pedal force versus pedal velocity chart, to name just a few.
+
+Optional dependencies: R, libkml
diff --git a/misc/goldencheetah/goldencheetah.SlackBuild b/misc/goldencheetah/goldencheetah.SlackBuild
index a3dec7778efa..fe6a3d573ff3 100644
--- a/misc/goldencheetah/goldencheetah.SlackBuild
+++ b/misc/goldencheetah/goldencheetah.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for GoldenCheetah
-# Copyright 2018-2020 Kyle Guinn <elyk03@gmail.com>
+# Copyright 2018-2021 Kyle Guinn <elyk03@gmail.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,7 +25,7 @@
PRGNAM=goldencheetah
SRCNAM=GoldenCheetah
VERSION=${VERSION:-3.5}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -68,11 +68,32 @@ cd $SRCNAM-$VERSION
chown -R root:root .
chmod -R u+w,go-w,a+rX-st .
-# GoldenCheetah statically links its own version of qwt, which doesn't seem to
-# correspond to any released version. The build system uses -L/-l flags to
+# Fixes from release_3.5.0 branch. 0003 and 0004 contain images treated as
+# text since `patch` doesn't decode git binary patches. Comment them out if
+# they won't apply.
+patch -p1 < $CWD/patches/0001-SEGV-on-Overview-Chart.patch
+patch -p1 < $CWD/patches/0002-View-on-Strava.patch
+patch -p1 < $CWD/patches/0003-Compatible-with-Strava.patch
+patch -p1 < $CWD/patches/0004-Connect-with-Strava.patch
+patch -p1 < $CWD/patches/0005-3.5-BUILD-INCREMENT.patch
+
+# GoldenCheetah statically links its own version of qwt, which is likely a fork
+# from around version 6.1.0 or 6.1.1. The build system uses -L/-l flags to
# refer to the static lib, but due to other -L flags and symlinked directories,
# it might find the system qwt instead. Replace the flags with a filename.
-sed -i 's|-L\(\$\${PWD}/../qwt/lib\) -l\(qwtd\?\)|\1/lib\2.a|' src/src.pro
+sed -i 's|-L\(\$\${PWD}/\.\./qwt/lib\) -l\(qwtd\?\)|\1/lib\2.a|' src/src.pro
+
+# Fixes for qwt and Qt5 compatibility.
+patch -p1 < $CWD/patches/0001-Fix-Qwt-incompatibilities-with-Qt-5.15.0.patch
+
+# Use the system levmar if available.
+# Builtin copy is version 2.6 without lapack support.
+# TODO: Replace other builtins (qzip?, qxt, lmfit).
+if [ -f /usr/include/levmar/levmar.h ]; then
+ sed -i 's|\.\./levmar[^ ]* *||g' src/src.pro
+ echo "INCLUDEPATH += /usr/include/levmar" >> src/src.pro
+ echo "LIBS += -llevmar" >> src/src.pro
+fi
# We don't have a '-qt4' suffix on lrelease.
sed -i 's|\(lrelease\)-qt4|\1|' src/src.pro
@@ -82,22 +103,50 @@ cp qwt/qwtconfig.pri.in qwt/qwtconfig.pri
cp src/gcconfig.pri.in src/gcconfig.pri
# Set up the build configuration.
-sed -i 's|^#\(CONFIG += release\)|\1|' src/gcconfig.pri
-sed -i 's|^#\(QMAKE_LEX = flex\)|\1|' src/gcconfig.pri
-sed -i 's|^#\(QMAKE_YACC = bison\)|\1|' src/gcconfig.pri
-sed -i 's|^#\(LIBZ_INCLUDE =\)|\1|' src/gcconfig.pri
-sed -i 's|^#\(LIBZ_LIBS = -lz\)|\1|' src/gcconfig.pri
+sed -i 's|^#\(CONFIG += release\)\>|\1|' src/gcconfig.pri
+sed -i 's|^#\(QMAKE_LEX = flex\)\>|\1|' src/gcconfig.pri
+sed -i 's|^#\(QMAKE_YACC = bison\)\>|\1|' src/gcconfig.pri
+
+# Use -b y to force bison >= 3.7 to copy y.tab.h's contents into y.tab.cpp
+# instead of #including it, since qmake's renaming to $base_yacc.{h,cpp}
+# breaks the #include.
+#echo "QMAKE_YACCFLAGS_MANGLE = -p $base -b y" >> src/gcconfig.pri
+#echo "QMAKE_YACC_HEADER = y.tab.h" >> src/gcconfig.pri
+#echo "QMAKE_YACC_SOURCE = y.tab.cpp" >> src/gcconfig.pri
+# But that breaks parallel builds (multiple build steps produce temporary files
+# with the same y.tab.{h,cpp} names). Make the files available by both names.
+sed -i 's|^#\( QMAKE_MOVE =\).*|\1 ln -sf|' src/gcconfig.pri
# Enable optional dependencies found in stock Slackware.
-# Also enable optional video and webengine from QT5 since QT5 is required.
-# TODO: Enable other optional dependencies (python3, R, libsamplerate, ...)
-sed -i 's|^#\(ICAL_INSTALL =\).*|\1 /usr|' src/gcconfig.pri
-sed -i 's|^#\(LIBUSB_INSTALL =\).*|\1 /usr|' src/gcconfig.pri
-sed -i 's|^#\(CONFIG += link_pkgconfig\)|\1|' src/gcconfig.pri
-sed -i 's|^#\(PKGCONFIG =\)|\1|' src/gcconfig.pri
-sed -i 's|^\(DEFINES += GC_VIDEO_NONE\)|#\1|' src/gcconfig.pri
-sed -i 's|^#\(DEFINES += GC_VIDEO_QT5\)|\1|' src/gcconfig.pri
-sed -i 's|^#\(DEFINES += NOWEBKIT\)|\1|' src/gcconfig.pri
+sed -i 's|^#\(ICAL_INSTALL =\).*|\1 /usr|' src/gcconfig.pri
+sed -i 's|^#\(LIBUSB_INSTALL =\).*|\1 /usr|' src/gcconfig.pri
+sed -i 's|^#\(LIBUSB_USE_V_1 = true\)\>|\1|' src/gcconfig.pri
+sed -i 's|^#\(SAMPLERATE_INSTALL =\).*|\1 /usr|' src/gcconfig.pri
+sed -i 's|^#\(CONFIG += link_pkgconfig\)\>|\1|' src/gcconfig.pri
+sed -i 's|^#\(PKGCONFIG =\).*|\1|' src/gcconfig.pri
+sed -i 's|^#\(LIBZ_INCLUDE =\).*|\1|' src/gcconfig.pri
+sed -i 's|^#\(LIBZ_LIBS = -lz\)\>|\1|' src/gcconfig.pri
+sed -i 's|^#\(HTPATH = \.\./httpserver\)\>|\1|' src/gcconfig.pri
+sed -i 's|^\(DEFINES += GC_VIDEO_NONE\)\>|#\1|' src/gcconfig.pri
+sed -i 's|^#\(DEFINES += GC_VIDEO_QT5\)\>|\1|' src/gcconfig.pri
+sed -i 's|^#\(DEFINES += NOWEBKIT\)\>|\1|' src/gcconfig.pri
+
+# Python support. Regenerate the SIP files.
+echo "DEFINES += GC_WANT_PYTHON" >> src/gcconfig.pri
+echo "PYTHONINCLUDES = $(pkg-config --cflags python3-embed)" >> src/gcconfig.pri
+echo "PYTHONLIBS = $(pkg-config --libs python3-embed)" >> src/gcconfig.pri
+make -C src/Python/SIP -f Makefile.hack clean
+make -C src/Python/SIP -f Makefile.hack
+
+# Optional KML support.
+if pkg-config --exists libkml; then
+ sed -i 's|^#\(KML_INSTALL =\).*|\1 /usr|' src/gcconfig.pri
+fi
+
+# Optional R support.
+if pkg-config --exists libR; then
+ sed -i 's|^#\(DEFINES += GC_WANT_R\)\>|\1|' src/gcconfig.pri
+fi
qmake-qt5 \
-recursive \
diff --git a/misc/goldencheetah/goldencheetah.info b/misc/goldencheetah/goldencheetah.info
index 83fb3ea387ad..14062d371bec 100644
--- a/misc/goldencheetah/goldencheetah.info
+++ b/misc/goldencheetah/goldencheetah.info
@@ -5,6 +5,6 @@ DOWNLOAD="https://github.com/GoldenCheetah/GoldenCheetah/archive/V3.5/GoldenChee
MD5SUM="ed25ef3dfb447b1c4d9cc7387da5d7e7"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES=""
+REQUIRES="levmar"
MAINTAINER="Kyle Guinn"
EMAIL="elyk03@gmail.com"
diff --git a/misc/goldencheetah/patches/0001-Fix-Qwt-incompatibilities-with-Qt-5.15.0.patch b/misc/goldencheetah/patches/0001-Fix-Qwt-incompatibilities-with-Qt-5.15.0.patch
new file mode 100644
index 000000000000..d6cbec6e414f
--- /dev/null
+++ b/misc/goldencheetah/patches/0001-Fix-Qwt-incompatibilities-with-Qt-5.15.0.patch
@@ -0,0 +1,114 @@
+From e1f9005cf5ebafbed6be4b0cae4bee59112ea780 Mon Sep 17 00:00:00 2001
+From: Ale Martinez <amtriathlon@gmail.com>
+Date: Thu, 11 Jun 2020 11:36:54 -0300
+Subject: Fix Qwt incompatibilities with Qt 5.15.0
+
+
+diff --git a/qwt/src/qwt_compass_rose.cpp b/qwt/src/qwt_compass_rose.cpp
+index 21a35f244..d67175940 100644
+--- a/qwt/src/qwt_compass_rose.cpp
++++ b/qwt/src/qwt_compass_rose.cpp
+@@ -11,6 +11,7 @@
+ #include "qwt_point_polar.h"
+ #include "qwt_painter.h"
+ #include <qpainter.h>
++#include <qpainterpath.h>
+
+ static QPointF qwtIntersection(
+ QPointF p11, QPointF p12, QPointF p21, QPointF p22 )
+diff --git a/qwt/src/qwt_dial_needle.cpp b/qwt/src/qwt_dial_needle.cpp
+index 1b53a3d5b..694f7f2bb 100644
+--- a/qwt/src/qwt_dial_needle.cpp
++++ b/qwt/src/qwt_dial_needle.cpp
+@@ -13,6 +13,7 @@
+ #include "qwt_painter.h"
+ #include <qapplication.h>
+ #include <qpainter.h>
++#include <qpainterpath.h>
+
+ #if QT_VERSION < 0x040601
+ #define qFastSin(x) qSin(x)
+diff --git a/qwt/src/qwt_null_paintdevice.cpp b/qwt/src/qwt_null_paintdevice.cpp
+index db1611da2..b9b5dafb6 100644
+--- a/qwt/src/qwt_null_paintdevice.cpp
++++ b/qwt/src/qwt_null_paintdevice.cpp
+@@ -9,6 +9,7 @@
+
+ #include "qwt_null_paintdevice.h"
+ #include <qpaintengine.h>
++#include <qpainterpath.h>
+ #include <qpixmap.h>
+
+ class QwtNullPaintDevice::PrivateData
+diff --git a/qwt/src/qwt_painter.cpp b/qwt/src/qwt_painter.cpp
+index 0bbf258c5..07b217033 100644
+--- a/qwt/src/qwt_painter.cpp
++++ b/qwt/src/qwt_painter.cpp
+@@ -19,6 +19,7 @@
+ #include <qpainter.h>
+ #include <qpalette.h>
+ #include <qpaintdevice.h>
++#include <qpainterpath.h>
+ #include <qpixmap.h>
+ #include <qstyle.h>
+ #include <qtextdocument.h>
+diff --git a/qwt/src/qwt_painter_command.h b/qwt/src/qwt_painter_command.h
+index 2da597a7f..4fafd555c 100644
+--- a/qwt/src/qwt_painter_command.h
++++ b/qwt/src/qwt_painter_command.h
+@@ -15,6 +15,7 @@
+ #include <qpixmap.h>
+ #include <qimage.h>
+ #include <qpolygon.h>
++#include <qpainterpath.h>
+
+ class QPainterPath;
+
+diff --git a/qwt/src/qwt_plot_glcanvas.h b/qwt/src/qwt_plot_glcanvas.h
+index 2ff1cf2e3..89462bba9 100644
+--- a/qwt/src/qwt_plot_glcanvas.h
++++ b/qwt/src/qwt_plot_glcanvas.h
+@@ -13,6 +13,7 @@
+ #include "qwt_global.h"
+ #include <qframe.h>
+ #include <qgl.h>
++#include <qpainterpath.h>
+
+ class QwtPlot;
+
+diff --git a/qwt/src/qwt_plot_panner.cpp b/qwt/src/qwt_plot_panner.cpp
+index 8ed3dbee9..44de4cbef 100644
+--- a/qwt/src/qwt_plot_panner.cpp
++++ b/qwt/src/qwt_plot_panner.cpp
+@@ -15,6 +15,7 @@
+ #include <qbitmap.h>
+ #include <qstyle.h>
+ #include <qstyleoption.h>
++#include <qpainterpath.h>
+
+ static QBitmap qwtBorderMask( const QWidget *canvas, const QSize &size )
+ {
+diff --git a/qwt/src/qwt_plot_renderer.cpp b/qwt/src/qwt_plot_renderer.cpp
+index 3cdcd8c0e..09a5c0a10 100644
+--- a/qwt/src/qwt_plot_renderer.cpp
++++ b/qwt/src/qwt_plot_renderer.cpp
+@@ -19,6 +19,7 @@
+ #include "qwt_math.h"
+ #include <qpainter.h>
+ #include <qpaintengine.h>
++#include <qpainterpath.h>
+ #include <qtransform.h>
+ #include <qprinter.h>
+ #include <qprintdialog.h>
+diff --git a/qwt/src/qwt_widget_overlay.cpp b/qwt/src/qwt_widget_overlay.cpp
+index 07c6272e1..9a458277b 100644
+--- a/qwt/src/qwt_widget_overlay.cpp
++++ b/qwt/src/qwt_widget_overlay.cpp
+@@ -11,6 +11,7 @@
+ #include "qwt_painter.h"
+ #include <qpainter.h>
+ #include <qpaintengine.h>
++#include <qpainterpath.h>
+ #include <qimage.h>
+ #include <qevent.h>
+
diff --git a/misc/goldencheetah/patches/0001-SEGV-on-Overview-Chart.patch b/misc/goldencheetah/patches/0001-SEGV-on-Overview-Chart.patch
new file mode 100644
index 000000000000..da451e86c434
--- /dev/null
+++ b/misc/goldencheetah/patches/0001-SEGV-on-Overview-Chart.patch
@@ -0,0 +1,22 @@
+From 372dd5c14415885c8808c4ad4729cb39ae717db0 Mon Sep 17 00:00:00 2001
+From: Mark Liversedge <liversedge@gmail.com>
+Date: Mon, 13 Jan 2020 20:21:00 +0000
+Subject: SEGV on Overview Chart
+
+.. when no rides available on new user.
+
+Fixes #3295
+
+diff --git a/src/Charts/OverviewWindow.cpp b/src/Charts/OverviewWindow.cpp
+index bfbd31432..7aa0792df 100644
+--- a/src/Charts/OverviewWindow.cpp
++++ b/src/Charts/OverviewWindow.cpp
+@@ -558,6 +558,8 @@ static const QStringList timeInZonesWBAL = QStringList()
+ void
+ Card::setData(RideItem *item)
+ {
++ if (item == NULL || item->ride() == NULL) return;
++
+ // use ride colors in painting?
+ ridecolor = item->color;
+
diff --git a/misc/goldencheetah/patches/0002-View-on-Strava.patch b/misc/goldencheetah/patches/0002-View-on-Strava.patch
new file mode 100644
index 000000000000..454b44865d80
--- /dev/null
+++ b/misc/goldencheetah/patches/0002-View-on-Strava.patch
@@ -0,0 +1,50 @@
+From cc91520e76079555bee24360d42610b7cbc246b3 Mon Sep 17 00:00:00 2001
+From: Mark Liversedge <liversedge@gmail.com>
+Date: Fri, 17 Jan 2020 12:30:29 +0000
+Subject: View on Strava
+
+.. when data is downloaded from strava we now set the metadata
+ tag "StravaID" to the id of the activity on Strava.
+
+.. On RideSummary a link is added at the bottom to view the activity
+ on Strava if the "StravaID" is set.
+
+.. if the user clicks on the link the summary is replaced with the
+ strava page for the ride:
+ e.g. https://www.strava.com/activities/962515512
+
+.. this is part of a couple of updates to comply with the Strava
+ guidelines for consumption of the Strava v3 API, see:
+ https://developers.strava.com/guidelines/
+
+diff --git a/src/Charts/RideSummaryWindow.cpp b/src/Charts/RideSummaryWindow.cpp
+index 1906ef1f3..37de8244d 100644
+--- a/src/Charts/RideSummaryWindow.cpp
++++ b/src/Charts/RideSummaryWindow.cpp
+@@ -1517,6 +1517,12 @@ RideSummaryWindow::htmlSummary()
+ summary += " <li>" + i.next();
+ summary += "</ul>";
+ }
++
++ // add link to view on Strava if was downloaded from there (StravaID will be set)
++ if (ridesummary && rideItem && rideItem->ride() && rideItem->ride()->getTag("StravaID","") != "") {
++ summary += "<a href=\"https://www.strava.com/activities/" + rideItem->ride()->getTag("StravaID","") + "\">View on Strava</a>";
++ }
++
+ summary += "<br></center>";
+
+ return summary;
+diff --git a/src/Cloud/Strava.cpp b/src/Cloud/Strava.cpp
+index 0b339ac98..fe03e9eba 100644
+--- a/src/Cloud/Strava.cpp
++++ b/src/Cloud/Strava.cpp
+@@ -859,6 +859,9 @@ Strava::prepareResponse(QByteArray* data)
+ // 1s samples with start time
+ RideFile *ride = new RideFile(starttime.toUTC(), 1.0f);
+
++ // set strava id in metadata (to show where we got it from - to add View on Strava link in Summary view
++ if (!each["id"].isNull()) ride->setTag("StravaID", QString("%1").arg(each["id"].toVariant().toULongLong()));
++
+ // what sport?
+ if (!each["type"].isNull()) {
+ QString stype = each["type"].toString();
diff --git a/misc/goldencheetah/patches/0003-Compatible-with-Strava.patch b/misc/goldencheetah/patches/0003-Compatible-with-Strava.patch
new file mode 100644
index 000000000000..6b7eadad712f
--- /dev/null
+++ b/misc/goldencheetah/patches/0003-Compatible-with-Strava.patch
Binary files differ
diff --git a/misc/goldencheetah/patches/0004-Connect-with-Strava.patch b/misc/goldencheetah/patches/0004-Connect-with-Strava.patch
new file mode 100644
index 000000000000..a52aa748dcec
--- /dev/null
+++ b/misc/goldencheetah/patches/0004-Connect-with-Strava.patch
Binary files differ
diff --git a/misc/goldencheetah/patches/0005-3.5-BUILD-INCREMENT.patch b/misc/goldencheetah/patches/0005-3.5-BUILD-INCREMENT.patch
new file mode 100644
index 000000000000..eb8565ad1304
--- /dev/null
+++ b/misc/goldencheetah/patches/0005-3.5-BUILD-INCREMENT.patch
@@ -0,0 +1,29 @@
+From 525fcb0a660f99a21250919fd1d8de78fe8cb90d Mon Sep 17 00:00:00 2001
+From: Mark Liversedge <liversedge@gmail.com>
+Date: Fri, 17 Jan 2020 20:15:28 +0000
+Subject: 3.5 BUILD INCREMENT
+
+.. re-issue of 3.5 binaries with Strava API guideline compliance, as
+ part of the 'rate limit' requirements.
+
+diff --git a/src/Core/GcUpgrade.h b/src/Core/GcUpgrade.h
+index b6db40b07..8266c7cb4 100644
+--- a/src/Core/GcUpgrade.h
++++ b/src/Core/GcUpgrade.h
+@@ -98,6 +98,7 @@
+ // 3981 - V3.5 RC2
+ // 3982 - V3.5 RC2X
+ // 3990 - V3.5 RELEASE (January 2020)
++// 3991 - V3.5 RELEASE RE-ISSUE STRAVA RATE LIMIT (January 2020)
+
+
+ #define VERSION3_BUILD 3010 // released
+@@ -114,7 +115,7 @@
+ #define VERSION31_BUILD VERSION31_UPG
+
+ // the next two will with each build/release
+-#define VERSION_LATEST 3990
++#define VERSION_LATEST 3991
+ #define VERSION_STRING "V3.5"
+
+ // default config for this release cycle