biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / office / karlender / default.nix
blobdb3e5c6876d9c4003ecbfe874b88b7f8edb2e011
1 { lib
2 , rustPlatform
3 , fetchFromGitLab
4 , pkg-config
5 , gtk4
6 , libadwaita
7 , wrapGAppsHook4
8 , glib
9 , tzdata
12 rustPlatform.buildRustPackage rec {
13   pname = "karlender";
14   version = "0.9.2";
16   src = fetchFromGitLab {
17     owner = "floers";
18     repo = pname;
19     rev = "v${version}";
20     hash = "sha256-txPMOWwxgs9PH1Scnwr/X4cuMIUa+eoLW3K2aqmqRMQ=";
21   };
23   cargoHash = "sha256-OyyzzkoYBed2XFCesj3QBodT9e/BaapGl/z0f6+cDZA=";
25   nativeBuildInputs = [
26     pkg-config
27     wrapGAppsHook4
28     glib
29   ];
31   buildInputs = [
32     gtk4
33     libadwaita
34   ];
36   postPatch = ''
37     substituteInPlace src/domain/time.rs --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
38     substituteInPlace build.rs --replace "// gra::build" "gra::build"
39   '';
41   postInstall = ''
42     substituteInPlace target/gra-gen/data/codes.loers.Karlender.desktop \
43       --replace "Exec=codes.loers.Karlender" "Exec=karlender"
44     substituteInPlace target/gra-gen/data/codes.loers.Karlender.appdata.xml \
45       --replace "<binary>codes.loers.Karlender</binary>" "<binary>karlender</binary>"
46     install -Dm444 target/gra-gen/codes.loers.Karlender.gschema.xml -t $out/share/gsettings-schemas/$name/glib-2.0/schemas/
47     glib-compile-schemas $out/share/gsettings-schemas/$name/glib-2.0/schemas/
48     install -Dm444 target/gra-gen/data/codes.loers.Karlender.svg -t $out/share/icons/hicolor/scalable/apps/
49     install -Dm444 target/gra-gen/data/codes.loers.Karlender.64.png -T $out/share/icons/hicolor/64x64/apps/codes.loers.Karlender.png
50     install -Dm444 target/gra-gen/data/codes.loers.Karlender.128.png -T $out/share/icons/hicolor/128x128/apps/codes.loers.Karlender.png
51     install -Dm444 target/gra-gen/data/codes.loers.Karlender.desktop -t $out/share/applications/
52     install -Dm444 target/gra-gen/data/codes.loers.Karlender.appdata.xml -t $out/share/metainfo/
53   '';
55   meta = with lib; {
56     description = "Mobile-friendly GTK calendar application";
57     mainProgram = "karlender";
58     homepage = "https://gitlab.com/floers/karlender";
59     license = licenses.gpl3Plus;
60     maintainers = with maintainers; [ chuangzhu ];
61     platforms = platforms.linux;
62   };