Skip to content

Commit

Permalink
karlender: 0.9.2 -> 0.10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Bot-wxt1221 committed Nov 6, 2024
1 parent ddcb7a1 commit 226c3d0
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions pkgs/by-name/ka/karlender/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,67 @@
glib,
tzdata,
nix-update-script,
dbus,
cargo-gra,
fetchpatch,
}:

rustPlatform.buildRustPackage rec {
pname = "karlender";
version = "0.9.2";
version = "0.10.4";

src = fetchFromGitLab {
owner = "floers";
repo = pname;
rev = "v${version}";
hash = "sha256-txPMOWwxgs9PH1Scnwr/X4cuMIUa+eoLW3K2aqmqRMQ=";
hash = "sha256-W+s1RCPwy7ZiK514AaQLwV9y+VJ58oMGlrS5cdoFKIg=";
};

cargoHash = "sha256-OyyzzkoYBed2XFCesj3QBodT9e/BaapGl/z0f6+cDZA=";
cargoPatches = [
# https://gitlab.com/floers/calendar-stuff/karlender/-/merge_requests/43
# Remove it when it is merged and released.
(fetchpatch {
url = "https://gitlab.com/floers/calendar-stuff/karlender/-/commit/ce50c68323a834a0ee2cbff88ed285a971dfd91e.patch";
hash = "sha256-0hGgJPwnSNGTO/eiooQkQlBJ4brbaWVKRY6MT1PZApg=";
})
(fetchpatch {
url = "https://gitlab.com/floers/calendar-stuff/karlender/-/commit/98282a07aa92adeadeb5cff4fae2f32b73468357.patch";
hash = "sha256-nfbFdRYGmBzhaNwqwc8qXE9zCScT4Ra9bAth3i0q+qM=";
})
];

cargoHash = "sha256-CeHIx6oUtAcr6tBdqmIDTLuYcesaA6G72L3HwHDLY7Y=";

nativeBuildInputs = [
pkg-config
wrapGAppsHook4
glib
cargo-gra
];

buildInputs = [
gtk4
libadwaita
dbus
];

checkFlags = [
"--skip domain::time::tests::test_get_correct_offset_for_dst" # Need time
];

preBuild = ''
cargo-gra gen
'';

postPatch = ''
substituteInPlace src/domain/time.rs --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
substituteInPlace build.rs --replace "// gra::build" "gra::build"
substituteInPlace src/domain/time.rs --replace-fail "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
'';

postInstall = ''
substituteInPlace target/gra-gen/data/codes.loers.Karlender.desktop \
--replace "Exec=codes.loers.Karlender" "Exec=karlender"
--replace-fail "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>"
--replace-fail "<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/
Expand Down

0 comments on commit 226c3d0

Please sign in to comment.