nixpkgs/pkgs/applications/office/karlender/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
2.1 KiB
Nix
Raw Normal View History

2022-10-13 18:42:43 +02:00
{ lib
, rustPlatform
, fetchFromGitLab
, pkg-config
, gtk4
, libadwaita
, wrapGAppsHook4
, glib
, tzdata
}:
rustPlatform.buildRustPackage rec {
pname = "karlender";
2023-05-19 06:30:14 +02:00
version = "0.9.2";
2022-10-13 18:42:43 +02:00
src = fetchFromGitLab {
2022-11-02 00:54:54 +01:00
owner = "floers";
repo = pname;
2022-10-13 18:42:43 +02:00
rev = "v${version}";
2023-05-19 06:30:14 +02:00
hash = "sha256-txPMOWwxgs9PH1Scnwr/X4cuMIUa+eoLW3K2aqmqRMQ=";
2022-10-13 18:42:43 +02:00
};
2023-05-19 06:30:14 +02:00
cargoHash = "sha256-OyyzzkoYBed2XFCesj3QBodT9e/BaapGl/z0f6+cDZA=";
2022-10-13 18:42:43 +02:00
nativeBuildInputs = [
pkg-config
wrapGAppsHook4
glib
];
2022-11-02 00:54:54 +01:00
2022-10-13 18:42:43 +02:00
buildInputs = [
gtk4
libadwaita
];
postPatch = ''
substituteInPlace src/domain/time.rs --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
2023-01-18 12:07:16 +01:00
substituteInPlace build.rs --replace "// gra::build" "gra::build"
2022-10-13 18:42:43 +02:00
'';
postInstall = ''
substituteInPlace target/gra-gen/data/codes.loers.Karlender.desktop \
--replace "Exec=codes.loers.Karlender" "Exec=karlender"
substituteInPlace target/gra-gen/data/codes.loers.Karlender.appdata.xml \
--replace "<binary>codes.loers.Karlender</binary>" "<binary>karlender</binary>"
install -Dm444 target/gra-gen/codes.loers.Karlender.gschema.xml -t $out/share/gsettings-schemas/$name/glib-2.0/schemas/
glib-compile-schemas $out/share/gsettings-schemas/$name/glib-2.0/schemas/
install -Dm444 target/gra-gen/data/codes.loers.Karlender.svg -t $out/share/icons/hicolor/scalable/apps/
install -Dm444 target/gra-gen/data/codes.loers.Karlender.64.png -T $out/share/icons/hicolor/64x64/apps/codes.loers.Karlender.png
install -Dm444 target/gra-gen/data/codes.loers.Karlender.128.png -T $out/share/icons/hicolor/128x128/apps/codes.loers.Karlender.png
install -Dm444 target/gra-gen/data/codes.loers.Karlender.desktop -t $out/share/applications/
install -Dm444 target/gra-gen/data/codes.loers.Karlender.appdata.xml -t $out/share/metainfo/
'';
meta = with lib; {
description = "Mobile-friendly GTK calendar application";
mainProgram = "karlender";
2022-11-02 00:54:54 +01:00
homepage = "https://gitlab.com/floers/karlender";
2022-10-13 18:42:43 +02:00
license = licenses.gpl3Plus;
maintainers = with maintainers; [ chuangzhu ];
platforms = platforms.linux;
};
}