nixpkgs/pkgs/applications/misc/golden-cheetah/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

85 lines
2.5 KiB
Nix
Raw Normal View History

2023-08-08 00:50:07 +00:00
{ lib, fetchFromGitHub, nix-update-script, mkDerivation
, qtbase, qtsvg, qtserialport, qtwebengine, qtmultimedia, qttools
, qtconnectivity, qtcharts, libusb-compat-0_1, gsl, blas
2023-01-29 19:18:48 +00:00
, bison, flex, zlib, qmake, makeDesktopItem, wrapQtAppsHook
2017-01-21 12:26:30 +00:00
}:
let
desktopItem = makeDesktopItem {
name = "goldencheetah";
exec = "GoldenCheetah";
icon = "goldencheetah";
desktopName = "GoldenCheetah";
genericName = "GoldenCheetah";
comment = "Performance software for cyclists, runners and triathletes";
categories = [ "Utility" ];
};
in mkDerivation rec {
pname = "golden-cheetah";
2024-04-16 19:08:40 +00:00
version = "3.7-DEV2404";
2019-08-20 23:40:25 +00:00
src = fetchFromGitHub {
owner = "GoldenCheetah";
repo = "GoldenCheetah";
2023-01-29 19:18:48 +00:00
rev = "refs/tags/v${version}";
2024-04-16 19:08:40 +00:00
hash = "sha256-u2igcnOulgJGZT46/Z3vSsce9mr3VsxkD3mTeQPvUOg=";
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 = [
qtbase
qtsvg
qtserialport
qtwebengine
qtmultimedia
qttools
zlib
qtconnectivity
qtcharts
libusb-compat-0_1
gsl
blas
2016-04-17 09:32:02 +00:00
];
2023-01-29 19:18:48 +00:00
nativeBuildInputs = [ flex wrapQtAppsHook qmake bison ];
2019-08-20 23:40:25 +00:00
patches = [
# allow building with bison 3.7
# 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
];
NIX_LDFLAGS = "-lz -lgsl -lblas";
qtWrapperArgs = [ "--prefix" "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
2023-01-29 19:18:48 +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
'';
2019-08-20 23:40:25 +00:00
2016-04-17 09:32:02 +00:00
installPhase = ''
runHook preInstall
2016-04-17 09:32:02 +00:00
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
2016-04-17 09:32:02 +00:00
'';
2023-08-08 00:50:07 +00:00
passthru.updateScript = nix-update-script { };
meta = {
description = "Performance software for cyclists, runners and triathletes. Built from source and without API tokens";
mainProgram = "GoldenCheetah";
2023-08-08 00:50:07 +00:00
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ adamcstephens ];
license = lib.licenses.gpl2Plus;
2016-04-17 09:32:02 +00:00
};
}