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

75 lines
2.4 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub, fetchpatch, mkDerivation
, qtbase, qtsvg, qtserialport, qtwebengine, qtmultimedia, qttools
, qtconnectivity, qtcharts, libusb-compat-0_1, gsl, blas
, bison, 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 = "Utility;";
};
in mkDerivation rec {
pname = "golden-cheetah";
version = "3.6-DEV2111";
2019-08-20 23:40:25 +00:00
src = fetchFromGitHub {
owner = "GoldenCheetah";
repo = "GoldenCheetah";
rev = "v${version}";
sha256 = "17sk89szvaq31bcv6rgfn1bbw132k7w8zlalfb3ayflavdxbk6sa";
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
];
nativeBuildInputs = [ flex makeWrapper qmake bison ];
2019-08-20 23:40:25 +00:00
patches = [
# allow building with bison 3.7
# PR at https://github.com/GoldenCheetah/GoldenCheetah/pull/3590
(fetchpatch {
url = "https://github.com/GoldenCheetah/GoldenCheetah/commit/e1f42f8b3340eb4695ad73be764332e75b7bce90.patch";
sha256 = "1h0y9vfji5jngqcpzxna5nnawxs77i1lrj44w8a72j0ah0sznivb";
})
];
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
echo 'QMAKE_LRELEASE = ${qttools.dev}/bin/lrelease' >> src/gcconfig.pri
2020-04-28 03:29:39 +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
2016-04-17 09:32:02 +00:00
sed -i -e '21,23d' qwt/qwtconfig.pri # Removed forced installation to /usr/local
'';
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
'';
meta = with lib; {
2016-04-17 09:32:02 +00:00
description = "Performance software for cyclists, runners and triathletes";
2018-09-01 11:49:57 +00:00
platforms = platforms.linux;
maintainers = [ ];
license = licenses.gpl2Plus;
2016-04-17 09:32:02 +00:00
};
}