1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, installShellFiles
, cmake
, pkg-config
, makeWrapper
, bzip2
, fontconfig
, freetype
, libGL
, libX11
, libXcursor
, libXrandr
, libXi
, libxkbcommon
, vulkan-loader
, wayland
, gnome
, libsForQt5
}:
rustPlatform.buildRustPackage rec {
pname = "ludusavi";
version = "0.23.0";
src = fetchFromGitHub {
owner = "mtkennerly";
repo = "ludusavi";
rev = "v${version}";
hash = "sha256-3Z/v3+3mrmPV2Rb/5tM+h6UN+MEIF/aK07B93Zn38AA=";
};
cargoHash = "sha256-bAap8eSXAPLrs5MEX1Pp6gKdp0iLxci4aX+2+ve6Wk0=";
nativeBuildInputs = [
cmake
installShellFiles
pkg-config
makeWrapper
];
buildInputs = [
fontconfig
freetype
libX11
libXcursor
libXrandr
libXi
];
postInstall = ''
install -Dm644 assets/com.github.mtkennerly.ludusavi.metainfo.xml -t \
"$out/share/metainfo/"
install -Dm644 assets/icon.png \
"$out/share/icons/hicolor/64x64/apps/ludusavi.png"
install -Dm644 assets/icon.svg \
"$out/share/icons/hicolor/scalable/apps/ludusavi.svg"
install -Dm644 "assets/ludusavi.desktop" -t "$out/share/applications/"
install -Dm644 assets/MaterialIcons-Regular.ttf -t "$out/share/fonts/TTF/"
install -Dm644 LICENSE -t "$out/share/licenses/ludusavi/"
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd ludusavi \
--bash <($out/bin/ludusavi complete bash) \
--fish <($out/bin/ludusavi complete fish) \
--zsh <($out/bin/ludusavi complete zsh)
'';
postFixup =
let
libPath = lib.makeLibraryPath [
libGL
bzip2
fontconfig
freetype
libX11
libXcursor
libXrandr
libXi
libxkbcommon
vulkan-loader
wayland
];
in
''
patchelf --set-rpath "${libPath}" "$out/bin/ludusavi"
wrapProgram $out/bin/ludusavi --prefix PATH : ${lib.makeBinPath [ gnome.zenity libsForQt5.kdialog ]}
'';
meta = with lib; {
description = "Backup tool for PC game saves";
homepage = "https://github.com/mtkennerly/ludusavi";
changelog = "https://github.com/mtkennerly/ludusavi/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ pasqui23 ];
mainProgram = "ludusavi";
};
}
|