canon-cups-ufr2: fix color printing issues

This commit resolves https://github.com/NixOS/nixpkgs/issues/310013 by
adding the required `libjpeg` and `libgcrypt` libraries. It sets
`dontPatchELF = true` to prevent `patchelf --shrink-rpath` from removing
these libraries from the `RPATH`. This is necessary because the driver
binaries use `dlopen` to load the libraries at runtime instead of
specifying them in `DT_NEEDED`, which causes `dlopen` to be unable to
find them when `patchelf --shrink-rpath` is called.
This commit is contained in:
Daniel S. Smetana 2024-08-20 20:57:50 +09:00
parent c6668dffc8
commit 3ce3d5b240

View File

@ -8,6 +8,8 @@
, makeWrapper
, cups
, jbigkit
, libjpeg
, libgcrypt
, glib
, gtk3
, gdk-pixbuf
@ -41,13 +43,16 @@ let
hash = "sha256-JQAe/avYG+9TAsH26UGai6u8/upRXwZrGBc/hd4jZe8=";
};
buildInputs = [ cups zlib jbigkit glib gtk3 libxml2 gdk-pixbuf pango cairo atk ];
buildInputs = [ cups zlib jbigkit libjpeg libgcrypt glib gtk3 libxml2 gdk-pixbuf pango cairo atk ];
in
stdenv.mkDerivation rec {
pname = "canon-cups-ufr2";
inherit version;
src = src_canon;
# we can't let patchelf remove unnecessary RPATHs because the driver uses dlopen to load libjpeg and libgcrypt
dontPatchELF = true;
postUnpack = ''
(
cd $sourceRoot