2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchFromGitHub, fetchpatch, 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
|
2021-04-05 15:23:46 +00:00
|
|
|
, bison, flex, zlib, qmake, makeDesktopItem, makeWrapper
|
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";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "3.6-DEV2111";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "GoldenCheetah";
|
|
|
|
repo = "GoldenCheetah";
|
2021-07-14 22:03:04 +00:00
|
|
|
rev = "v${version}";
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "17sk89szvaq31bcv6rgfn1bbw132k7w8zlalfb3ayflavdxbk6sa";
|
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
|
|
|
];
|
2021-04-05 15:23:46 +00:00
|
|
|
nativeBuildInputs = [ flex makeWrapper 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
|
|
|
|
echo 'QMAKE_LRELEASE = ${qttools.dev}/bin/lrelease' >> src/gcconfig.pri
|
2020-05-03 17:38:23 +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
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i -e '21,23d' qwt/qwtconfig.pri # Removed forced installation to /usr/local
|
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Performance software for cyclists, runners and triathletes";
|
|
|
|
platforms = platforms.linux;
|
2020-12-09 12:39:15 +00:00
|
|
|
maintainers = [ ];
|
2021-07-14 22:03:04 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|