2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-06-05 15:53:02 +00:00
|
|
|
, qt6
|
2024-01-02 11:29:13 +00:00
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation (self: {
|
|
|
|
pname = "cloudlogoffline";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "1.1.5";
|
|
|
|
rev = self.version;
|
|
|
|
hash = "sha256-CF56yk7hsM4M43le+CLy93oLyZ9kaqaRTFWtjJuF6Vo=";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit (self) rev hash;
|
|
|
|
owner = "myzinsky";
|
|
|
|
repo = "cloudLogOffline";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-06-05 15:53:02 +00:00
|
|
|
qt6.qmake
|
|
|
|
qt6.wrapQtAppsHook
|
2024-01-02 11:29:13 +00:00
|
|
|
]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
|
2024-01-02 11:29:13 +00:00
|
|
|
copyDesktopItems
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2024-06-05 15:53:02 +00:00
|
|
|
qt6.qtbase
|
|
|
|
qt6.qtlocation
|
|
|
|
qt6.qtpositioning
|
|
|
|
qt6.qtsvg
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = let
|
2024-09-26 11:04:55 +00:00
|
|
|
targetDir = if stdenv.hostPlatform.isDarwin then "Applications" else "bin";
|
2024-01-02 11:29:13 +00:00
|
|
|
in ''
|
|
|
|
substituteInPlace CloudLogOffline.pro \
|
|
|
|
--replace 'target.path = /opt/$''${TARGET}/bin' "target.path = $out/${targetDir}"
|
|
|
|
'';
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
|
2024-01-02 11:29:13 +00:00
|
|
|
install -d $out/share/pixmaps
|
|
|
|
install -m644 images/logo_circle.svg $out/share/pixmaps/cloudlogoffline.svg
|
2024-09-26 11:04:55 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2024-06-05 15:53:02 +00:00
|
|
|
# FIXME: For some reason, the Info.plist isn't copied correctly to
|
|
|
|
# the application bundle when building normally, instead creating an
|
|
|
|
# empty file. This doesn't happen when building in a dev shell with
|
|
|
|
# genericBuild.
|
|
|
|
# So, just copy the file manually.
|
|
|
|
plistPath="$out/Applications/CloudLogOffline.app/Contents/Info.plist"
|
|
|
|
[[ -s "$plistPath" ]] && { echo "expected Info.plist to be empty; workaround no longer needed?"; exit 1; }
|
|
|
|
install -m644 macos/Info.plist $out/Applications/CloudLogOffline.app/Contents/Info.plist
|
2024-01-02 11:29:13 +00:00
|
|
|
'';
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
desktopItems = lib.optionals (!stdenv.hostPlatform.isDarwin) [
|
2024-01-02 11:29:13 +00:00
|
|
|
(makeDesktopItem {
|
|
|
|
name = "cloudlogoffline";
|
|
|
|
desktopName = "CloudLogOffline";
|
|
|
|
exec = "CloudLogOffline";
|
|
|
|
icon = "cloudlogoffline";
|
|
|
|
comment = self.meta.description;
|
|
|
|
genericName = "Ham radio contact logbook";
|
|
|
|
categories = [ "Network" "Utility" "HamRadio" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Offline frontend for Cloudlog";
|
|
|
|
homepage = "https://github.com/myzinsky/cloudLogOffline";
|
|
|
|
license = [ lib.licenses.lgpl3 ];
|
|
|
|
mainProgram = "CloudLogOffline";
|
|
|
|
maintainers = [ lib.maintainers.dblsaiko ];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
};
|
|
|
|
})
|