@@ -0,0 +1,77 @@
1+{ lib
2+, stdenv
3+, fetchFromGitLab
4+, rustPlatform
5+, substituteAll
6+, desktop-file-utils
7+, meson
8+, ninja
9+, pkg-config
10+, python3
11+, wrapGAppsHook
12+, borgbackup
13+, dbus
14+, gdk-pixbuf
15+, glib
16+, gtk3
17+, libhandy
18+}:
19+
20+stdenv.mkDerivation rec {
21+ pname = "pika-backup";
22+ version = "0.2.1";
23+
24+ src = fetchFromGitLab {
25+ domain = "gitlab.gnome.org";
26+ owner = "World";
27+ repo = "pika-backup";
28+ rev = "v${version}";
29+ sha256 = "0fm6vwpw0pa98v2yn8p3818rrlv9lk3pmgnal1b2kh52im5ll7m8";
30+ };
31+
32+ cargoDeps = rustPlatform.fetchCargoTarball {
33+ inherit src;
34+ name = "${pname}-${version}";
35+ sha256 = "1f5s6a0wjrs2spsicirhbvb5xlz9iflwsaqchij9k02hfcsr308y";
36+ };
37+
38+ patches = [
39+ (substituteAll {
40+ src = ./borg-path.patch;
41+ borg = "${borgbackup}/bin/borg";
42+ })
43+ ];
44+
45+ postPatch = ''
46+ patchShebangs build-aux
47+ '';
48+
49+ nativeBuildInputs = [
50+ desktop-file-utils
51+ meson
52+ ninja
53+ pkg-config
54+ python3
55+ wrapGAppsHook
56+ ] ++ (with rustPlatform; [
57+ cargoSetupHook
58+ rust.cargo
59+ rust.rustc
60+ ]);
61+
62+ buildInputs = [
63+ dbus
64+ gdk-pixbuf
65+ glib
66+ gtk3
67+ libhandy
68+ ];
69+
70+ meta = with lib; {
71+ description = "Simple backups based on borg";
72+ homepage = "https://wiki.gnome.org/Apps/PikaBackup";
73+ changelog = "https://gitlab.gnome.org/World/pika-backup/-/blob/v${version}/CHANGELOG.md";
74+ license = licenses.gpl3Plus;
75+ maintainers = with maintainers; [ dotlambda ];
76+ };
77+}