2023-10-09 19:29:22 +00:00
|
|
|
{ lib, fetchFromGitHub, nix-update-script, mkDerivation
|
2020-04-24 23:36:52 +00:00
|
|
|
, qtbase, qtsvg, qtserialport, qtwebengine, qtmultimedia, qttools
|
2021-07-14 22:03:04 +00:00
|
|
|
, qtconnectivity, qtcharts, libusb-compat-0_1, gsl, blas
|
2023-02-02 18:25:31 +00:00
|
|
|
, bison, flex, zlib, qmake, makeDesktopItem, wrapQtAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "goldencheetah";
|
|
|
|
exec = "GoldenCheetah";
|
|
|
|
icon = "goldencheetah";
|
|
|
|
desktopName = "GoldenCheetah";
|
|
|
|
genericName = "GoldenCheetah";
|
|
|
|
comment = "Performance software for cyclists, runners and triathletes";
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Utility" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
in mkDerivation rec {
|
|
|
|
pname = "golden-cheetah";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "3.7-DEV2404";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "GoldenCheetah";
|
|
|
|
repo = "GoldenCheetah";
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-u2igcnOulgJGZT46/Z3vSsce9mr3VsxkD3mTeQPvUOg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
2022-01-13 20:06:32 +00:00
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtserialport
|
|
|
|
qtwebengine
|
|
|
|
qtmultimedia
|
|
|
|
qttools
|
|
|
|
zlib
|
|
|
|
qtconnectivity
|
|
|
|
qtcharts
|
|
|
|
libusb-compat-0_1
|
|
|
|
gsl
|
|
|
|
blas
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeBuildInputs = [ flex wrapQtAppsHook qmake bison ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
patches = [
|
|
|
|
# allow building with bison 3.7
|
2022-01-13 20:06:32 +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-16 20:44:37 +00:00
|
|
|
];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
NIX_LDFLAGS = "-lz -lgsl -lblas";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
qtWrapperArgs = [ "--prefix" "LD_LIBRARY_PATH" ":" "${zlib.out}/lib" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cp src/gcconfig.pri.in src/gcconfig.pri
|
|
|
|
cp qwt/qwtconfig.pri.in qwt/qwtconfig.pri
|
2023-02-02 18:25:31 +00:00
|
|
|
sed -i 's,^#QMAKE_LRELEASE.*,QMAKE_LRELEASE = ${qttools.dev}/bin/lrelease,' src/gcconfig.pri
|
|
|
|
sed -i 's,^#LIBUSB_INSTALL.*,LIBUSB_INSTALL = ${libusb-compat-0_1},' src/gcconfig.pri
|
|
|
|
sed -i 's,^#LIBUSB_INCLUDE.*,LIBUSB_INCLUDE = ${libusb-compat-0_1.dev}/include,' src/gcconfig.pri
|
|
|
|
sed -i 's,^#LIBUSB_LIBS.*,LIBUSB_LIBS = -L${libusb-compat-0_1}/lib -lusb,' src/gcconfig.pri
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp src/GoldenCheetah $out/bin
|
|
|
|
install -Dm644 "${desktopItem}/share/applications/"* -t $out/share/applications/
|
|
|
|
install -Dm644 src/Resources/images/gc.png $out/share/pixmaps/goldencheetah.png
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
|
|
|
meta = {
|
2023-04-12 12:48:02 +00:00
|
|
|
description = "Performance software for cyclists, runners and triathletes. Built from source and without API tokens";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "GoldenCheetah";
|
2023-10-09 19:29:22 +00:00
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ adamcstephens ];
|
|
|
|
license = lib.licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|