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

70 lines
2.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, mkDerivation
, qtbase, qtsvg, qtserialport, qtwebengine, qtmultimedia, qttools
2020-04-28 04:29:39 +01:00
, qtconnectivity, qtcharts, libusb-compat-0_1
, yacc, flex, zlib, qmake, makeDesktopItem, makeWrapper
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 = "Application;Utility;";
};
in mkDerivation rec {
pname = "golden-cheetah";
version = "3.5-RC2X";
2019-08-21 00:40:25 +01:00
src = fetchFromGitHub {
owner = "GoldenCheetah";
repo = "GoldenCheetah";
rev = "V${version}";
sha256 = "1d85700gjbcw2badwz225rjdr954ai89900vp8sal04sk79wbr6g";
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 = [
qtbase qtsvg qtserialport qtwebengine qtmultimedia qttools zlib
2020-04-28 04:29:39 +01:00
qtconnectivity qtcharts libusb-compat-0_1
2016-04-17 10:32:02 +01:00
];
2017-05-17 20:26:11 +01:00
nativeBuildInputs = [ flex makeWrapper qmake yacc ];
2019-08-21 00:40:25 +01:00
2019-10-30 02:23:29 +00:00
NIX_LDFLAGS = "-lz";
qtWrapperArgs = [ "--set LD_LIBRARY_PATH ${zlib.out}/lib" ];
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
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
# Use qtwebengine instead of qtwebkit
substituteInPlace src/gcconfig.pri \
--replace "#DEFINES += NOWEBKIT" "DEFINES += NOWEBKIT"
'';
2019-08-21 00:40:25 +01:00
2016-04-17 10:32:02 +01:00
installPhase = ''
runHook preInstall
2016-04-17 10:32:02 +01: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 10:32:02 +01:00
'';
2018-09-01 12:49:57 +01:00
meta = with stdenv.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;
maintainers = [ maintainers.ocharles ];
license = licenses.gpl3;
2016-04-17 10:32:02 +01:00
};
}