Skip to content

Commit af0422b

Browse files
authored
cargo-gra: init at 0.6.0; karlender: 0.9.2 -> 0.10.4, refactor (#353793)
2 parents 196e4c2 + 9a47d38 commit af0422b

File tree

3 files changed

+73
-22
lines changed

3 files changed

+73
-22
lines changed

pkgs/by-name/ca/cargo-gra/package.nix

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
rustPlatform,
3+
fetchCrate,
4+
lib,
5+
}:
6+
7+
rustPlatform.buildRustPackage rec {
8+
pname = "cargo-gra";
9+
version = "0.6.0";
10+
11+
src = fetchCrate {
12+
inherit pname version;
13+
hash = "sha256-cli7qaIVYvoZpDml/QAxm2vjvh/g28zlDSpU9IIUBfw=";
14+
};
15+
16+
cargoHash = "sha256-xsaavcpDaiDDbL3Dl+7NLcfB5U6vuYsVPoIuA/KXCvI=";
17+
18+
meta = {
19+
license = lib.licenses.gpl3Plus;
20+
homepage = "https://gitlab.com/floers/gtk-stuff/cargo-gra/";
21+
maintainers = with lib.maintainers; [ bot-wxt1221 ];
22+
platforms = lib.platforms.unix;
23+
description = "gtk-rust-app cli for building flatpak apps with ease";
24+
};
25+
}
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,71 @@
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,
1015
}:
1116

1217
rustPlatform.buildRustPackage rec {
1318
pname = "karlender";
14-
version = "0.9.2";
19+
version = "0.10.4";
1520

1621
src = fetchFromGitLab {
1722
owner = "floers";
1823
repo = pname;
1924
rev = "v${version}";
20-
hash = "sha256-txPMOWwxgs9PH1Scnwr/X4cuMIUa+eoLW3K2aqmqRMQ=";
25+
hash = "sha256-W+s1RCPwy7ZiK514AaQLwV9y+VJ58oMGlrS5cdoFKIg=";
2126
};
2227

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=";
2438

2539
nativeBuildInputs = [
2640
pkg-config
2741
wrapGAppsHook4
2842
glib
43+
cargo-gra
2944
];
3045

3146
buildInputs = [
3247
gtk4
3348
libadwaita
49+
dbus
50+
];
51+
52+
checkFlags = [
53+
"--skip domain::time::tests::test_get_correct_offset_for_dst" # Need time
3454
];
3555

56+
preBuild = ''
57+
cargo-gra gen
58+
'';
59+
3660
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"
3962
'';
4063

4164
postInstall = ''
4265
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"
4467
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>"
4669
install -Dm444 target/gra-gen/codes.loers.Karlender.gschema.xml -t $out/share/gsettings-schemas/$name/glib-2.0/schemas/
4770
glib-compile-schemas $out/share/gsettings-schemas/$name/glib-2.0/schemas/
4871
install -Dm444 target/gra-gen/data/codes.loers.Karlender.svg -t $out/share/icons/hicolor/scalable/apps/
@@ -52,12 +75,17 @@ rustPlatform.buildRustPackage rec {
5275
install -Dm444 target/gra-gen/data/codes.loers.Karlender.appdata.xml -t $out/share/metainfo/
5376
'';
5477

55-
meta = with lib; {
78+
passthru.updateScript = nix-update-script { };
79+
80+
meta = {
5681
description = "Mobile-friendly GTK calendar application";
5782
mainProgram = "karlender";
5883
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;
6290
};
6391
}

pkgs/top-level/all-packages.nix

-2
Original file line numberDiff line numberDiff line change
@@ -28742,8 +28742,6 @@ with pkgs;
2874228742
avahi = avahi.override { withLibdnssdCompat = true; };
2874328743
};
2874428744

28745-
karlender = callPackage ../applications/office/karlender { };
28746-
2874728745
keepassxc = libsForQt5.callPackage ../applications/misc/keepassxc {
2874828746
inherit (darwin.apple_sdk_11_0.frameworks) LocalAuthentication;
2874928747
stdenv = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;

0 commit comments

Comments
 (0)