Skip to content

Commit fa9a43a

Browse files
golden-cheetah: update to qt6, add darwin (NixOS#376565)
2 parents 77efc48 + c961b3c commit fa9a43a

File tree

3 files changed

+54
-46
lines changed

3 files changed

+54
-46
lines changed

pkgs/applications/misc/golden-cheetah/0001-Fix-building-with-bison-3.7.patch renamed to pkgs/by-name/go/golden-cheetah/0001-Fix-building-with-bison-3.7.patch

File renamed without changes.
Lines changed: 54 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
{
22
lib,
3+
stdenv,
34
fetchFromGitHub,
45
nix-update-script,
5-
mkDerivation,
6-
qtbase,
7-
qtsvg,
8-
qtserialport,
9-
qtwebengine,
10-
qtmultimedia,
11-
qttools,
12-
qtconnectivity,
13-
qtcharts,
6+
qt6,
147
libusb-compat-0_1,
158
gsl,
169
blas,
1710
bison,
1811
flex,
1912
zlib,
20-
qmake,
2113
makeDesktopItem,
22-
wrapQtAppsHook,
2314
}:
2415

2516
let
@@ -33,37 +24,45 @@ let
3324
categories = [ "Utility" ];
3425
};
3526
in
36-
mkDerivation rec {
27+
stdenv.mkDerivation (finalAttrs: {
3728
pname = "golden-cheetah";
3829
version = "3.7-DEV2408";
3930

4031
src = fetchFromGitHub {
4132
owner = "GoldenCheetah";
4233
repo = "GoldenCheetah";
43-
tag = "v${version}";
34+
tag = "v${finalAttrs.version}";
4435
hash = "sha256-6JAdnYaKULJsc/zdcTMbCkbOCbiVtnJivEazDKL721c=";
4536
};
4637

47-
buildInputs = [
48-
qtbase
49-
qtsvg
50-
qtserialport
51-
qtwebengine
52-
qtmultimedia
53-
qttools
54-
zlib
55-
qtconnectivity
56-
qtcharts
57-
libusb-compat-0_1
58-
gsl
59-
blas
60-
];
61-
nativeBuildInputs = [
62-
flex
63-
wrapQtAppsHook
64-
qmake
65-
bison
66-
];
38+
buildInputs =
39+
with qt6;
40+
[
41+
qt5compat
42+
qtbase
43+
qtcharts
44+
qtconnectivity
45+
qtmultimedia
46+
qtserialport
47+
qtsvg
48+
qttools
49+
qtwebengine
50+
]
51+
++ [
52+
blas
53+
gsl
54+
libusb-compat-0_1
55+
zlib
56+
];
57+
nativeBuildInputs =
58+
[
59+
bison
60+
flex
61+
]
62+
++ (with qt6; [
63+
qmake
64+
wrapQtAppsHook
65+
]);
6766

6867
patches = [
6968
# allow building with bison 3.7
@@ -84,30 +83,41 @@ mkDerivation rec {
8483
preConfigure = ''
8584
cp src/gcconfig.pri.in src/gcconfig.pri
8685
cp qwt/qwtconfig.pri.in qwt/qwtconfig.pri
87-
sed -i 's,^#QMAKE_LRELEASE.*,QMAKE_LRELEASE = ${qttools.dev}/bin/lrelease,' src/gcconfig.pri
86+
sed -i 's,^#QMAKE_LRELEASE.*,QMAKE_LRELEASE = ${qt6.qttools.dev}/bin/lrelease,' src/gcconfig.pri
8887
sed -i 's,^#LIBUSB_INSTALL.*,LIBUSB_INSTALL = ${libusb-compat-0_1},' src/gcconfig.pri
8988
sed -i 's,^#LIBUSB_INCLUDE.*,LIBUSB_INCLUDE = ${libusb-compat-0_1.dev}/include,' src/gcconfig.pri
9089
sed -i 's,^#LIBUSB_LIBS.*,LIBUSB_LIBS = -L${libusb-compat-0_1}/lib -lusb,' src/gcconfig.pri
9190
'';
9291

93-
installPhase = ''
94-
runHook preInstall
92+
installPhase =
93+
if stdenv.isLinux then
94+
''
95+
runHook preInstall
9596
96-
mkdir -p $out/bin
97-
cp src/GoldenCheetah $out/bin
98-
install -Dm644 "${desktopItem}/share/applications/"* -t $out/share/applications/
99-
install -Dm644 src/Resources/images/gc.png $out/share/pixmaps/goldencheetah.png
97+
mkdir -p $out/bin
98+
cp src/GoldenCheetah $out/bin
99+
install -Dm644 "${desktopItem}/share/applications/"* -t $out/share/applications/
100+
install -Dm644 src/Resources/images/gc.png $out/share/pixmaps/goldencheetah.png
100101
101-
runHook postInstall
102-
'';
102+
runHook postInstall
103+
''
104+
else if stdenv.isDarwin then
105+
''
106+
runHook preInstall
107+
mkdir -p $out/Applications
108+
cp -r src/GoldenCheetah.app $out/Applications
109+
runHook postInstall
110+
''
111+
else
112+
abort "unsupported platform";
103113

104114
passthru.updateScript = nix-update-script { };
105115

106116
meta = {
107117
description = "Performance software for cyclists, runners and triathletes. Built from source and without API tokens";
108118
mainProgram = "GoldenCheetah";
109-
platforms = lib.platforms.linux;
119+
platforms = with lib.platforms; darwin ++ linux;
110120
maintainers = with lib.maintainers; [ adamcstephens ];
111121
license = lib.licenses.gpl2Plus;
112122
};
113-
}
123+
})

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18184,8 +18184,6 @@ with pkgs;
1818418184

1818518185
discordo = callPackage ../applications/networking/discordo/default.nix { };
1818618186

18187-
golden-cheetah = libsForQt5.callPackage ../applications/misc/golden-cheetah { };
18188-
1818918187
tomb = callPackage ../by-name/to/tomb/package.nix {
1819018188
pinentry = pinentry-curses;
1819118189
};

0 commit comments

Comments
 (0)