2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, mkDerivation
|
2019-12-22 20:43:31 +00:00
|
|
|
, qtbase, qtsvg, qtserialport, qtwebengine, qtmultimedia, qttools
|
2020-04-28 03:29:39 +00:00
|
|
|
, qtconnectivity, qtcharts, libusb-compat-0_1
|
2018-09-26 20:18:30 +00:00
|
|
|
, yacc, flex, zlib, qmake, makeDesktopItem, makeWrapper
|
2017-01-21 12:26:30 +00:00
|
|
|
}:
|
2018-09-26 20:18:30 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "goldencheetah";
|
|
|
|
exec = "GoldenCheetah";
|
|
|
|
icon = "goldencheetah";
|
|
|
|
desktopName = "GoldenCheetah";
|
|
|
|
genericName = "GoldenCheetah";
|
|
|
|
comment = "Performance software for cyclists, runners and triathletes";
|
2020-06-25 02:18:37 +00:00
|
|
|
categories = "Utility;";
|
2018-09-26 20:18:30 +00:00
|
|
|
};
|
2019-08-08 11:01:09 +00:00
|
|
|
in mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "golden-cheetah";
|
2020-10-10 14:42:58 +00:00
|
|
|
version = "3.5";
|
2019-08-20 23:40:25 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "GoldenCheetah";
|
|
|
|
repo = "GoldenCheetah";
|
2019-12-22 14:48:37 +00:00
|
|
|
rev = "V${version}";
|
2020-10-10 14:42:58 +00:00
|
|
|
sha256 = "1lyd0b2s3s9c2ppj7l4hf3s4gfzscaaam2pbiaby714bi9nr0ka7";
|
2016-04-17 09:32:02 +00:00
|
|
|
};
|
2019-08-20 23:40:25 +00:00
|
|
|
|
2017-05-17 19:26:11 +00:00
|
|
|
buildInputs = [
|
2019-12-22 20:43:31 +00:00
|
|
|
qtbase qtsvg qtserialport qtwebengine qtmultimedia qttools zlib
|
2020-04-28 03:29:39 +00:00
|
|
|
qtconnectivity qtcharts libusb-compat-0_1
|
2016-04-17 09:32:02 +00:00
|
|
|
];
|
2017-05-17 19:26:11 +00:00
|
|
|
nativeBuildInputs = [ flex makeWrapper qmake yacc ];
|
2019-08-20 23:40:25 +00:00
|
|
|
|
2020-10-10 14:43:12 +00:00
|
|
|
patches = [
|
|
|
|
# allow building with bison 3.7
|
|
|
|
# PR at https://github.com/GoldenCheetah/GoldenCheetah/pull/3590
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/GoldenCheetah/GoldenCheetah/commit/e1f42f8b3340eb4695ad73be764332e75b7bce90.patch";
|
|
|
|
sha256 = "1h0y9vfji5jngqcpzxna5nnawxs77i1lrj44w8a72j0ah0sznivb";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-10-30 02:23:29 +00:00
|
|
|
NIX_LDFLAGS = "-lz";
|
2019-08-08 11:01:09 +00:00
|
|
|
|
|
|
|
qtWrapperArgs = [ "--set LD_LIBRARY_PATH ${zlib.out}/lib" ];
|
|
|
|
|
2016-04-21 00:12:49 +00:00
|
|
|
preConfigure = ''
|
2016-04-17 09:32:02 +00:00
|
|
|
cp src/gcconfig.pri.in src/gcconfig.pri
|
|
|
|
cp qwt/qwtconfig.pri.in qwt/qwtconfig.pri
|
2016-08-31 16:37:05 +00:00
|
|
|
echo 'QMAKE_LRELEASE = ${qttools.dev}/bin/lrelease' >> src/gcconfig.pri
|
2020-04-28 03:29:39 +00:00
|
|
|
echo 'LIBUSB_INSTALL = ${libusb-compat-0_1}' >> src/gcconfig.pri
|
|
|
|
echo 'LIBUSB_INCLUDE = ${libusb-compat-0_1.dev}/include' >> src/gcconfig.pri
|
|
|
|
echo 'LIBUSB_LIBS = -L${libusb-compat-0_1}/lib -lusb' >> src/gcconfig.pri
|
2016-04-17 09:32:02 +00:00
|
|
|
sed -i -e '21,23d' qwt/qwtconfig.pri # Removed forced installation to /usr/local
|
2019-12-22 20:43:31 +00:00
|
|
|
|
|
|
|
# Use qtwebengine instead of qtwebkit
|
|
|
|
substituteInPlace src/gcconfig.pri \
|
|
|
|
--replace "#DEFINES += NOWEBKIT" "DEFINES += NOWEBKIT"
|
2016-04-19 10:13:33 +00:00
|
|
|
'';
|
2019-08-20 23:40:25 +00:00
|
|
|
|
2016-04-17 09:32:02 +00:00
|
|
|
installPhase = ''
|
2017-04-10 18:51:45 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2016-04-17 09:32:02 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp src/GoldenCheetah $out/bin
|
2018-09-26 20:18:30 +00:00
|
|
|
install -Dm644 "${desktopItem}/share/applications/"* -t $out/share/applications/
|
|
|
|
install -Dm644 src/Resources/images/gc.png $out/share/pixmaps/goldencheetah.png
|
2017-04-10 18:51:45 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2016-04-17 09:32:02 +00:00
|
|
|
'';
|
2017-12-05 15:34:39 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-04-17 09:32:02 +00:00
|
|
|
description = "Performance software for cyclists, runners and triathletes";
|
2018-09-01 11:49:57 +00:00
|
|
|
platforms = platforms.linux;
|
2020-12-07 14:26:45 +00:00
|
|
|
maintainers = [ ];
|
2018-09-01 11:49:57 +00:00
|
|
|
license = licenses.gpl3;
|
2016-04-17 09:32:02 +00:00
|
|
|
};
|
|
|
|
}
|