summary refs log tree commit diff
path: root/pkgs/desktops/gnome/apps/ghex/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/desktops/gnome/apps/ghex/default.nix')
-rw-r--r--pkgs/desktops/gnome/apps/ghex/default.nix44
1 files changed, 36 insertions, 8 deletions
diff --git a/pkgs/desktops/gnome/apps/ghex/default.nix b/pkgs/desktops/gnome/apps/ghex/default.nix
index d12c8f61017..1ec3c9dfdf2 100644
--- a/pkgs/desktops/gnome/apps/ghex/default.nix
+++ b/pkgs/desktops/gnome/apps/ghex/default.nix
@@ -1,7 +1,9 @@
 { stdenv
 , lib
 , fetchurl
+, fetchpatch
 , pkg-config
+, gi-docgen
 , meson
 , ninja
 , python3
@@ -11,23 +13,38 @@
 , gettext
 , itstool
 , libxml2
-, gtk3
+, gtk4
 , glib
 , atk
+, gobject-introspection
 , wrapGAppsHook
 }:
 
 stdenv.mkDerivation rec {
   pname = "ghex";
-  version = "3.41.1";
+  version = "4.beta.1";
 
-  outputs = [ "out" "dev" ];
+  outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/ghex/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "i3nPAJ6uXEfK0KtT4hmcOm+y86thh381m+1SR3DuYfc=";
+    url = "mirror://gnome/sources/ghex/${version}/${pname}-${version}.tar.xz";
+    sha256 = "sBS/9cY++uHLGCbLeex8ZW697JJn3dK+HaM6tHBdwJ4=";
   };
 
+  patches = [
+    # Fix build with -Werror=format-security
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/ghex/-/commit/3d35359f3a12b6abb4a3d8a12a0f39b7221be408.patch";
+      sha256 = "4z9nUd+/eBOUGwl3MErse+FKLzGqtWKwkIzej57CnYk=";
+    })
+    # Build devhelp index.
+    # https://gitlab.gnome.org/GNOME/ghex/-/merge_requests/25
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/ghex/-/commit/b26a7b1135ea2fe956a9bc0669b3b6ed818716c3.patch";
+      sha256 = "nYjjxds9GNWkW/RhXEe5zJzPF4TnLMsCELEqYR4dXTk=";
+    })
+  ];
+
   nativeBuildInputs = [
     desktop-file-utils
     gettext
@@ -35,12 +52,14 @@ stdenv.mkDerivation rec {
     meson
     ninja
     pkg-config
+    gi-docgen
     python3
+    gobject-introspection
     wrapGAppsHook
   ];
 
   buildInputs = [
-    gtk3
+    gtk4
     atk
     glib
   ];
@@ -50,9 +69,18 @@ stdenv.mkDerivation rec {
     desktop-file-utils
   ];
 
+  mesonFlags = [
+    "-Dgtk_doc=true"
+  ];
+
   postPatch = ''
-     chmod +x meson_post_install.py
-     patchShebangs meson_post_install.py
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+  '';
+
+  postFixup = ''
+    # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
+    moveToOutput "share/doc" "$devdoc"
   '';
 
   passthru = {