1{
2 stdenv,
3 lib,
4 fetchurl,
5 pkg-config,
6 gi-docgen,
7 meson,
8 ninja,
9 gnome,
10 desktop-file-utils,
11 gettext,
12 itstool,
13 gtk4,
14 libadwaita,
15 glib,
16 atk,
17 gobject-introspection,
18 vala,
19 wrapGAppsHook4,
20}:
21
22stdenv.mkDerivation (finalAttrs: {
23 pname = "ghex";
24 version = "48.beta2";
25
26 outputs = [
27 "out"
28 "dev"
29 "devdoc"
30 ];
31
32 src = fetchurl {
33 url = "mirror://gnome/sources/ghex/${lib.versions.major finalAttrs.version}/ghex-${finalAttrs.version}.tar.xz";
34 hash = "sha256-4vIgRVGNgWtG0wluCp075lTdggMBVGX8ck/okWrY70E=";
35 };
36
37 nativeBuildInputs = [
38 desktop-file-utils
39 gettext
40 itstool
41 meson
42 ninja
43 pkg-config
44 gi-docgen
45 gobject-introspection
46 vala
47 wrapGAppsHook4
48 ];
49
50 buildInputs = [
51 gtk4
52 libadwaita
53 atk
54 glib
55 ];
56
57 mesonFlags = [
58 "-Dgtk_doc=true"
59 "-Dvapi=true"
60 ]
61 ++ lib.optionals stdenv.hostPlatform.isDarwin [
62 # mremap does not exist on darwin
63 "-Dmmap-buffer-backend=false"
64 ];
65
66 postFixup = ''
67 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
68 moveToOutput "share/doc" "$devdoc"
69 '';
70
71 passthru = {
72 updateScript = gnome.updateScript {
73 packageName = "ghex";
74 };
75 };
76
77 meta = with lib; {
78 homepage = "https://gitlab.gnome.org/GNOME/ghex";
79 changelog = "https://gitlab.gnome.org/GNOME/ghex/-/blob/${finalAttrs.version}/NEWS?ref_type=tags";
80 description = "Hex editor for GNOME desktop environment";
81 mainProgram = "ghex";
82 platforms = platforms.linux;
83 license = licenses.gpl2Plus;
84 teams = [ teams.gnome ];
85 };
86})