about summary refs log tree commit diff
path: root/pkgs/misc/drivers/hplip/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/misc/drivers/hplip/default.nix')
-rw-r--r--pkgs/misc/drivers/hplip/default.nix29
1 files changed, 14 insertions, 15 deletions
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index ad98f3fa768f7..fa3c2aad09fde 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -1,6 +1,6 @@
 { lib, stdenv, fetchurl, substituteAll
-, pkg-config, autoreconfHook
-, cups, zlib, libjpeg, libusb1, python3Packages, sane-backends
+, pkg-config, autoreconfHook, gobject-introspection, wrapGAppsHook3
+, cups, zlib, libjpeg, libusb1, python311Packages, sane-backends
 , dbus, file, ghostscript, usbutils
 , net-snmp, openssl, perl, nettools, avahi
 , bash, util-linux
@@ -14,16 +14,16 @@
 let
 
   pname = "hplip";
-  version = "3.23.8";
+  version = "3.24.4";
 
   src = fetchurl {
     url = "mirror://sourceforge/hplip/${pname}-${version}.tar.gz";
-    hash = "sha256-98wF9ijAz9dQ5UrkFDHB390p6XaC8YtcW6XLLFtLG0Y=";
+    hash = "sha256-XXZDgxiTpeKt351C1YGl2/5arwI2Johrh2LFZF2g8fs=";
   };
 
   plugin = fetchurl {
     url = "https://developers.hp.com/sites/default/files/${pname}-${version}-plugin.run";
-    hash = "sha256-frsgye3f0M3HE2trKRlfFvMnDEwe+z74IumCdVPrcSY=";
+    hash = "sha256-Hzxr3SVmGoouGBU2VdbwbwKMHZwwjWnI7P13Z6LQxao=";
   };
 
   hplipState = substituteAll {
@@ -49,7 +49,7 @@ in
 assert withPlugin -> builtins.elem hplipArch pluginArches
   || throw "HPLIP plugin not supported on ${stdenv.hostPlatform.system}";
 
-python3Packages.buildPythonApplication {
+python311Packages.buildPythonApplication {
   inherit pname version src;
   format = "other";
 
@@ -74,15 +74,16 @@ python3Packages.buildPythonApplication {
     pkg-config
     removeReferencesTo
     autoreconfHook
+    gobject-introspection
+    wrapGAppsHook3
   ] ++ lib.optional withQt5 qt5.wrapQtAppsHook;
 
-  pythonPath = with python3Packages; [
+  pythonPath = with python311Packages; [
     dbus
     pillow
     pygobject3
     reportlab
     usbutils
-    sip4
     dbus-python
     distro
   ] ++ lib.optionals withQt5 [
@@ -105,9 +106,6 @@ python3Packages.buildPythonApplication {
       url = "https://web.archive.org/web/20230226174550/https://sources.debian.org/data/main/h/hplip/3.22.10+dfsg0-1/debian/patches/0028-Remove-ImageProcessor-binary-installs.patch";
       sha256 = "sha256:18njrq5wrf3fi4lnpd1jqmaqr7ph5d7jxm7f15b1wwrbxir1rmml";
     })
-
-    # Revert changes that break compilation under -Werror=format-security
-    ./revert-snprintf-change.patch
   ];
 
   postPatch = ''
@@ -239,7 +237,8 @@ python3Packages.buildPythonApplication {
   # 1. Calling patchPythonProgram on the original script in $out/share/hplip
   # 2. Making our own wrapper pointing directly to the original script.
   dontWrapPythonPrograms = true;
-  # We also avoid double wrapping in case we add qt5 support
+  # We also avoid double (or triple in case qt5 support is added) wrapping
+  dontWrapGApps = true;
   dontWrapQtApps = true;
   preFixup = ''
     buildPythonPath "$out $pythonPath"
@@ -253,7 +252,7 @@ python3Packages.buildPythonApplication {
       ${if withQt5 then "makeQtWrapper" else "makeWrapper"} "$py" "$bin" \
           --prefix PATH ':' "$program_PATH" \
           --set PYTHONNOUSERSITE "true" \
-          $makeWrapperArgs
+          $makeWrapperArgs "''${gappsWrapperArgs[@]}"
     done
   '';
 
@@ -272,7 +271,7 @@ python3Packages.buildPythonApplication {
 
   # There are some binaries there, which reference gcc-unwrapped otherwise.
   stripDebugList = [
-    "share/hplip" "lib/cups/backend" "lib/cups/filter" python3Packages.python.sitePackages "lib/sane"
+    "share/hplip" "lib/cups/backend" "lib/cups/filter" python311Packages.python.sitePackages "lib/sane"
   ];
 
   meta = with lib; {
@@ -283,6 +282,6 @@ python3Packages.buildPythonApplication {
       then licenses.unfree
       else with licenses; [ mit bsd2 gpl2Plus ];
     platforms = [ "i686-linux" "x86_64-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" ];
-    maintainers = with maintainers; [ ttuegel arthsmn ];
+    maintainers = with maintainers; [ ttuegel ];
   };
 }