1{
2 fetchFromGitHub,
3 stdenv,
4 lib,
5 cups,
6 hamlib,
7 pkg-config,
8 qt6,
9 qt6Packages,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "qlog";
14 version = "0.44.1";
15
16 src = fetchFromGitHub {
17 owner = "foldynl";
18 repo = "QLog";
19 tag = "v${version}";
20 hash = "sha256-oSnWgv+c4XpvGzG+b+CteCy0oKRpx5qt5TQOzSGNg1I=";
21 fetchSubmodules = true;
22 };
23
24 env.NIX_LDFLAGS = "-lhamlib";
25
26 buildInputs = [
27 hamlib
28 qt6.qtbase
29 qt6.qtcharts
30 qt6.qtserialport
31 qt6.qtwebchannel
32 qt6.qtwebengine
33 qt6Packages.qtkeychain
34 ]
35 ++ lib.optionals stdenv.hostPlatform.isDarwin [
36 cups
37 ];
38
39 nativeBuildInputs = [
40 pkg-config
41 qt6.qmake
42 qt6.wrapQtAppsHook
43 ];
44
45 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
46 mkdir -p $out/{Applications,bin}
47 mv $out/{qlog.app,Applications}
48 ln -s $out/Applications/qlog.app/Contents/MacOS/qlog $out/bin/qlog
49 '';
50
51 meta = {
52 description = "Amateur radio logbook software";
53 mainProgram = "qlog";
54 license = with lib.licenses; [ gpl3Only ];
55 homepage = "https://github.com/foldynl/QLog";
56 maintainers = with lib.maintainers; [
57 oliver-koss
58 ];
59 platforms = with lib.platforms; unix;
60 };
61}