1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 nix-update-script,
6 meson,
7 ninja,
8 vala,
9 pkg-config,
10 pantheon,
11 python3,
12 replaceVars,
13 glib,
14 gtk3,
15 dosfstools,
16 e2fsprogs,
17 exfat,
18 hfsprogs,
19 ntfs3g,
20 libgee,
21 wrapGAppsHook3,
22}:
23
24stdenv.mkDerivation rec {
25 pname = "formatter";
26 version = "0.4.0";
27
28 src = fetchFromGitHub {
29 owner = "Djaler";
30 repo = "Formatter";
31 rev = version;
32 sha256 = "sha256-8lZ0jUwHuc3Kntz73Btj6dJvkW2bvShu2KWTSQszbJo=";
33 };
34
35 patches = [
36 (replaceVars ./fix-paths.patch {
37 ext4 = "${e2fsprogs}/bin/mkfs.ext4";
38 exfat = "${exfat}/bin/mkfs.exfat";
39 fat = "${dosfstools}/bin/mkfs.fat";
40 ntfs = "${ntfs3g}/bin/mkfs.ntfs";
41 hfsplus = "${hfsprogs}/bin/mkfs.hfsplus";
42 })
43 ];
44
45 nativeBuildInputs = [
46 meson
47 ninja
48 vala
49 pkg-config
50 python3
51 wrapGAppsHook3
52 ];
53
54 buildInputs = [
55 glib
56 gtk3
57 libgee
58 pantheon.granite
59 ];
60
61 postPatch = ''
62 chmod +x meson/post_install.py
63 patchShebangs meson/post_install.py
64 '';
65
66 passthru = {
67 updateScript = nix-update-script { };
68 };
69
70 meta = with lib; {
71 description = "Simple formatter designed for elementary OS";
72 homepage = "https://github.com/Djaler/Formatter";
73 maintainers = with maintainers; [ xiorcale ];
74 teams = [ teams.pantheon ];
75 platforms = platforms.linux;
76 license = licenses.lgpl2Plus;
77 mainProgram = "com.github.djaler.formatter";
78 };
79}