2021-01-25 08:26:54 +00:00
|
|
|
{ lib, fetchFromGitHub, fetchpatch, mkDerivation
|
2019-12-22 20:43:31 +00:00
|
|
|
, qtbase, qtsvg, qtserialport, qtwebengine, qtmultimedia, qttools
|
2021-05-01 09:45:17 +01:00
|
|
|
, qtconnectivity, qtcharts, libusb-compat-0_1, gsl, blas
|
2021-03-14 17:50:12 +00:00
|
|
|
, bison, flex, zlib, qmake, makeDesktopItem, makeWrapper
|
2017-01-21 12:26:30 +00:00
|
|
|
}:
|
2018-09-26 21:18:30 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "goldencheetah";
|
|
|
|
exec = "GoldenCheetah";
|
|
|
|
icon = "goldencheetah";
|
|
|
|
desktopName = "GoldenCheetah";
|
|
|
|
genericName = "GoldenCheetah";
|
|
|
|
comment = "Performance software for cyclists, runners and triathletes";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Utility" ];
|
2018-09-26 21:18:30 +01:00
|
|
|
};
|
2019-08-08 12:01:09 +01:00
|
|
|
in mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "golden-cheetah";
|
2021-12-12 19:32:29 +00:00
|
|
|
version = "3.6-DEV2111";
|
2019-08-21 00:40:25 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "GoldenCheetah";
|
|
|
|
repo = "GoldenCheetah";
|
2021-05-01 09:45:17 +01:00
|
|
|
rev = "v${version}";
|
2021-12-12 19:32:29 +00:00
|
|
|
sha256 = "17sk89szvaq31bcv6rgfn1bbw132k7w8zlalfb3ayflavdxbk6sa";
|
2016-04-17 10:32:02 +01:00
|
|
|
};
|
2019-08-21 00:40:25 +01:00
|
|
|
|
2017-05-17 20:26:11 +01:00
|
|
|
buildInputs = [
|
2022-01-04 16:47:54 +00:00
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtserialport
|
|
|
|
qtwebengine
|
|
|
|
qtmultimedia
|
|
|
|
qttools
|
|
|
|
zlib
|
|
|
|
qtconnectivity
|
|
|
|
qtcharts
|
|
|
|
libusb-compat-0_1
|
|
|
|
gsl
|
|
|
|
blas
|
2016-04-17 10:32:02 +01:00
|
|
|
];
|
2021-03-14 17:50:12 +00:00
|
|
|
nativeBuildInputs = [ flex makeWrapper qmake bison ];
|
2019-08-21 00:40:25 +01:00
|
|
|
|
2020-10-10 15:43:12 +01:00
|
|
|
patches = [
|
|
|
|
# allow building with bison 3.7
|
2022-01-04 16:47:54 +00:00
|
|
|
# Included in https://github.com/GoldenCheetah/GoldenCheetah/pull/3590,
|
|
|
|
# which is periodically rebased but pre 3.6 release, as it'll break other CI systems
|
|
|
|
./0001-Fix-building-with-bison-3.7.patch
|
2020-10-10 15:43:12 +01:00
|
|
|
];
|
|
|
|
|
2021-05-01 09:45:17 +01:00
|
|
|
NIX_LDFLAGS = "-lz -lgsl -lblas";
|
2019-08-08 12:01:09 +01:00
|
|
|
|
2021-05-01 09:45:17 +01:00
|
|
|
qtWrapperArgs = [ "--prefix" "LD_LIBRARY_PATH" ":" "${zlib.out}/lib" ];
|
2019-08-08 12:01:09 +01:00
|
|
|
|
2016-04-21 01:12:49 +01:00
|
|
|
preConfigure = ''
|
2016-04-17 10:32:02 +01:00
|
|
|
cp src/gcconfig.pri.in src/gcconfig.pri
|
|
|
|
cp qwt/qwtconfig.pri.in qwt/qwtconfig.pri
|
2016-08-31 17:37:05 +01:00
|
|
|
echo 'QMAKE_LRELEASE = ${qttools.dev}/bin/lrelease' >> src/gcconfig.pri
|
2020-04-28 04:29:39 +01: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 10:32:02 +01:00
|
|
|
sed -i -e '21,23d' qwt/qwtconfig.pri # Removed forced installation to /usr/local
|
2016-04-19 11:13:33 +01:00
|
|
|
'';
|
2019-08-21 00:40:25 +01:00
|
|
|
|
2016-04-17 10:32:02 +01:00
|
|
|
installPhase = ''
|
2017-04-10 19:51:45 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
2016-04-17 10:32:02 +01:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp src/GoldenCheetah $out/bin
|
2018-09-26 21:18:30 +01: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 19:51:45 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2016-04-17 10:32:02 +01:00
|
|
|
'';
|
2017-12-05 15:34:39 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-04-17 10:32:02 +01:00
|
|
|
description = "Performance software for cyclists, runners and triathletes";
|
2018-09-01 12:49:57 +01:00
|
|
|
platforms = platforms.linux;
|
2020-12-07 14:26:45 +00:00
|
|
|
maintainers = [ ];
|
2021-05-01 09:45:17 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2016-04-17 10:32:02 +01:00
|
|
|
};
|
|
|
|
}
|