1
- { lib
2
- , rustPlatform
3
- , fetchFromGitLab
4
- , pkg-config
5
- , gtk4
6
- , libadwaita
7
- , wrapGAppsHook4
8
- , glib
9
- , tzdata
1
+ {
2
+ lib ,
3
+ rustPlatform ,
4
+ fetchFromGitLab ,
5
+ pkg-config ,
6
+ gtk4 ,
7
+ libadwaita ,
8
+ wrapGAppsHook4 ,
9
+ glib ,
10
+ tzdata ,
11
+ nix-update-script ,
12
+ dbus ,
13
+ cargo-gra ,
14
+ fetchpatch ,
10
15
} :
11
16
12
17
rustPlatform . buildRustPackage rec {
13
18
pname = "karlender" ;
14
- version = "0.9.2 " ;
19
+ version = "0.10.4 " ;
15
20
16
21
src = fetchFromGitLab {
17
22
owner = "floers" ;
18
23
repo = pname ;
19
24
rev = "v${ version } " ;
20
- hash = "sha256-txPMOWwxgs9PH1Scnwr/X4cuMIUa+eoLW3K2aqmqRMQ =" ;
25
+ hash = "sha256-W+s1RCPwy7ZiK514AaQLwV9y+VJ58oMGlrS5cdoFKIg =" ;
21
26
} ;
22
27
23
- cargoHash = "sha256-OyyzzkoYBed2XFCesj3QBodT9e/BaapGl/z0f6+cDZA=" ;
28
+ cargoPatches = [
29
+ # https://gitlab.com/floers/calendar-stuff/karlender/-/merge_requests/43
30
+ # Remove it when it is merged and released.
31
+ ( fetchpatch {
32
+ url = "https://gitlab.com/floers/calendar-stuff/karlender/-/commit/ce50c68323a834a0ee2cbff88ed285a971dfd91e.patch" ;
33
+ hash = "sha256-0hGgJPwnSNGTO/eiooQkQlBJ4brbaWVKRY6MT1PZApg=" ;
34
+ } )
35
+ ] ;
36
+
37
+ cargoHash = "sha256-CeHIx6oUtAcr6tBdqmIDTLuYcesaA6G72L3HwHDLY7Y=" ;
24
38
25
39
nativeBuildInputs = [
26
40
pkg-config
27
41
wrapGAppsHook4
28
42
glib
43
+ cargo-gra
29
44
] ;
30
45
31
46
buildInputs = [
32
47
gtk4
33
48
libadwaita
49
+ dbus
50
+ ] ;
51
+
52
+ checkFlags = [
53
+ "--skip domain::time::tests::test_get_correct_offset_for_dst" # Need time
34
54
] ;
35
55
56
+ preBuild = ''
57
+ cargo-gra gen
58
+ '' ;
59
+
36
60
postPatch = ''
37
- substituteInPlace src/domain/time.rs --replace "/usr/share/zoneinfo" "${ tzdata } /share/zoneinfo"
38
- substituteInPlace build.rs --replace "// gra::build" "gra::build"
61
+ substituteInPlace src/domain/time.rs --replace-fail "/usr/share/zoneinfo" "${ tzdata } /share/zoneinfo"
39
62
'' ;
40
63
41
64
postInstall = ''
42
65
substituteInPlace target/gra-gen/data/codes.loers.Karlender.desktop \
43
- --replace "Exec=codes.loers.Karlender" "Exec=karlender"
66
+ --replace-fail "Exec=codes.loers.Karlender" "Exec=karlender"
44
67
substituteInPlace target/gra-gen/data/codes.loers.Karlender.appdata.xml \
45
- --replace "<binary>codes.loers.Karlender</binary>" "<binary>karlender</binary>"
68
+ --replace-fail "<binary>codes.loers.Karlender</binary>" "<binary>karlender</binary>"
46
69
install -Dm444 target/gra-gen/codes.loers.Karlender.gschema.xml -t $out/share/gsettings-schemas/$name/glib-2.0/schemas/
47
70
glib-compile-schemas $out/share/gsettings-schemas/$name/glib-2.0/schemas/
48
71
install -Dm444 target/gra-gen/data/codes.loers.Karlender.svg -t $out/share/icons/hicolor/scalable/apps/
@@ -52,12 +75,17 @@ rustPlatform.buildRustPackage rec {
52
75
install -Dm444 target/gra-gen/data/codes.loers.Karlender.appdata.xml -t $out/share/metainfo/
53
76
'' ;
54
77
55
- meta = with lib ; {
78
+ passthru . updateScript = nix-update-script { } ;
79
+
80
+ meta = {
56
81
description = "Mobile-friendly GTK calendar application" ;
57
82
mainProgram = "karlender" ;
58
83
homepage = "https://gitlab.com/floers/karlender" ;
59
- license = licenses . gpl3Plus ;
60
- maintainers = with maintainers ; [ chuangzhu ] ;
61
- platforms = platforms . linux ;
84
+ license = lib . licenses . gpl3Plus ;
85
+ maintainers = with lib . maintainers ; [
86
+ chuangzhu
87
+ bot-wxt1221
88
+ ] ;
89
+ platforms = lib . platforms . linux ;
62
90
} ;
63
91
}
0 commit comments