Merge pull request #64722 from Yarny0/hplip
hplip: update version to 3.19.6, fix `hpcups` segfault, enable udev rule file
This commit is contained in:
commit
e740b88c00
@ -142,8 +142,6 @@ pythonPackages.buildPythonApplication {
|
|||||||
|
|
||||||
mkdir -p $out/etc/sane.d/dll.d
|
mkdir -p $out/etc/sane.d/dll.d
|
||||||
mv $out/etc/sane.d/dll.conf $out/etc/sane.d/dll.d/hpaio.conf
|
mv $out/etc/sane.d/dll.conf $out/etc/sane.d/dll.d/hpaio.conf
|
||||||
|
|
||||||
rm $out/etc/udev/rules.d/56-hpmud.rules
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# The installed executables are just symlinks into $out/share/hplip,
|
# The installed executables are just symlinks into $out/share/hplip,
|
||||||
@ -171,12 +169,12 @@ pythonPackages.buildPythonApplication {
|
|||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
|
substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
|
||||||
'' + stdenv.lib.optionalString (!withPlugin) ''
|
# Patch udev rules:
|
||||||
# A udev rule to notify users that they need the binary plugin.
|
# with plugin, they upload firmware to printers,
|
||||||
# Needs a lot of patching but might save someone a bit of confusion:
|
# without plugin, they complain about the missing plugin.
|
||||||
substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \
|
substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \
|
||||||
--replace {,${bash}}/bin/sh \
|
--replace {,${bash}}/bin/sh \
|
||||||
--replace {/usr,${coreutils}}/bin/nohup \
|
--replace /usr/bin/nohup "" \
|
||||||
--replace {,${utillinux}/bin/}logger \
|
--replace {,${utillinux}/bin/}logger \
|
||||||
--replace {/usr,$out}/bin
|
--replace {/usr,$out}/bin
|
||||||
'';
|
'';
|
||||||
@ -184,6 +182,7 @@ pythonPackages.buildPythonApplication {
|
|||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Print, scan and fax HP drivers for Linux";
|
description = "Print, scan and fax HP drivers for Linux";
|
||||||
homepage = http://hplipopensource.com/;
|
homepage = http://hplipopensource.com/;
|
||||||
|
downloadPage = https://sourceforge.net/projects/hplip/files/hplip/;
|
||||||
license = if withPlugin
|
license = if withPlugin
|
||||||
then licenses.unfree
|
then licenses.unfree
|
||||||
else with licenses; [ mit bsd2 gpl2Plus ];
|
else with licenses; [ mit bsd2 gpl2Plus ];
|
||||||
|
@ -174,8 +174,6 @@ pythonPackages.buildPythonApplication {
|
|||||||
|
|
||||||
mkdir -p $out/var/lib/hp
|
mkdir -p $out/var/lib/hp
|
||||||
cp ${hplipState} $out/var/lib/hp/hplip.state
|
cp ${hplipState} $out/var/lib/hp/hplip.state
|
||||||
|
|
||||||
rm $out/etc/udev/rules.d/56-hpmud.rules
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# The installed executables are just symlinks into $out/share/hplip,
|
# The installed executables are just symlinks into $out/share/hplip,
|
||||||
@ -203,12 +201,12 @@ pythonPackages.buildPythonApplication {
|
|||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
|
substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
|
||||||
'' + stdenv.lib.optionalString (!withPlugin) ''
|
# Patch udev rules:
|
||||||
# A udev rule to notify users that they need the binary plugin.
|
# with plugin, they upload firmware to printers,
|
||||||
# Needs a lot of patching but might save someone a bit of confusion:
|
# without plugin, they complain about the missing plugin.
|
||||||
substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \
|
substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \
|
||||||
--replace {,${bash}}/bin/sh \
|
--replace {,${bash}}/bin/sh \
|
||||||
--replace {/usr,${coreutils}}/bin/nohup \
|
--replace /usr/bin/nohup "" \
|
||||||
--replace {,${utillinux}/bin/}logger \
|
--replace {,${utillinux}/bin/}logger \
|
||||||
--replace {/usr,$out}/bin
|
--replace {/usr,$out}/bin
|
||||||
'';
|
'';
|
||||||
@ -216,6 +214,7 @@ pythonPackages.buildPythonApplication {
|
|||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Print, scan and fax HP drivers for Linux";
|
description = "Print, scan and fax HP drivers for Linux";
|
||||||
homepage = https://developers.hp.com/hp-linux-imaging-and-printing;
|
homepage = https://developers.hp.com/hp-linux-imaging-and-printing;
|
||||||
|
downloadPage = https://sourceforge.net/projects/hplip/files/hplip/;
|
||||||
license = if withPlugin
|
license = if withPlugin
|
||||||
then licenses.unfree
|
then licenses.unfree
|
||||||
else with licenses; [ mit bsd2 gpl2Plus ];
|
else with licenses; [ mit bsd2 gpl2Plus ];
|
||||||
|
@ -12,16 +12,16 @@
|
|||||||
let
|
let
|
||||||
|
|
||||||
name = "hplip-${version}";
|
name = "hplip-${version}";
|
||||||
version = "3.19.1";
|
version = "3.19.6";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://sourceforge/hplip/${name}.tar.gz";
|
url = "mirror://sourceforge/hplip/${name}.tar.gz";
|
||||||
sha256 = "1kl1q4753xx1w76dhp92wgrhn5k1yx1ib35pyi0vi3mw0njbhrzm";
|
sha256 = "0vfnc6pg7wzs68qn5mlk3cyl969d8n55bydgydq2wzfikvpfvnpw";
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin = fetchurl {
|
plugin = fetchurl {
|
||||||
url = "https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/${name}-plugin.run";
|
url = "https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/${name}-plugin.run";
|
||||||
sha256 = "1fwjypy1ycyi7rr1vk1yxhbdhx51n7fxhvjb36mzw8qz71dif2i3";
|
sha256 = "1b5gys04kh41gg7r7rzlpdbc2f4jirl2ik22cd935mm85k7abfwq";
|
||||||
};
|
};
|
||||||
|
|
||||||
hplipState = substituteAll {
|
hplipState = substituteAll {
|
||||||
@ -82,6 +82,13 @@ pythonPackages.buildPythonApplication {
|
|||||||
|
|
||||||
makeWrapperArgs = [ "--prefix" "PATH" ":" "${nettools}/bin" ];
|
makeWrapperArgs = [ "--prefix" "PATH" ":" "${nettools}/bin" ];
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
# remove ImageProcessor usage, it causes segfaults, see
|
||||||
|
# https://bugs.launchpad.net/hplip/+bug/1788706
|
||||||
|
# https://bugs.launchpad.net/hplip/+bug/1787289
|
||||||
|
./image-processor.patch
|
||||||
|
];
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
# HPLIP hardcodes absolute paths everywhere. Nuke from orbit.
|
# HPLIP hardcodes absolute paths everywhere. Nuke from orbit.
|
||||||
find . -type f -exec sed -i \
|
find . -type f -exec sed -i \
|
||||||
@ -174,8 +181,6 @@ pythonPackages.buildPythonApplication {
|
|||||||
|
|
||||||
mkdir -p $out/var/lib/hp
|
mkdir -p $out/var/lib/hp
|
||||||
cp ${hplipState} $out/var/lib/hp/hplip.state
|
cp ${hplipState} $out/var/lib/hp/hplip.state
|
||||||
|
|
||||||
rm $out/etc/udev/rules.d/56-hpmud.rules
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# The installed executables are just symlinks into $out/share/hplip,
|
# The installed executables are just symlinks into $out/share/hplip,
|
||||||
@ -203,12 +208,12 @@ pythonPackages.buildPythonApplication {
|
|||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
|
substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
|
||||||
'' + stdenv.lib.optionalString (!withPlugin) ''
|
# Patch udev rules:
|
||||||
# A udev rule to notify users that they need the binary plugin.
|
# with plugin, they upload firmware to printers,
|
||||||
# Needs a lot of patching but might save someone a bit of confusion:
|
# without plugin, they complain about the missing plugin.
|
||||||
substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \
|
substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \
|
||||||
--replace {,${bash}}/bin/sh \
|
--replace {,${bash}}/bin/sh \
|
||||||
--replace {/usr,${coreutils}}/bin/nohup \
|
--replace /usr/bin/nohup "" \
|
||||||
--replace {,${utillinux}/bin/}logger \
|
--replace {,${utillinux}/bin/}logger \
|
||||||
--replace {/usr,$out}/bin
|
--replace {/usr,$out}/bin
|
||||||
'';
|
'';
|
||||||
@ -216,6 +221,7 @@ pythonPackages.buildPythonApplication {
|
|||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Print, scan and fax HP drivers for Linux";
|
description = "Print, scan and fax HP drivers for Linux";
|
||||||
homepage = https://developers.hp.com/hp-linux-imaging-and-printing;
|
homepage = https://developers.hp.com/hp-linux-imaging-and-printing;
|
||||||
|
downloadPage = https://sourceforge.net/projects/hplip/files/hplip/;
|
||||||
license = if withPlugin
|
license = if withPlugin
|
||||||
then licenses.unfree
|
then licenses.unfree
|
||||||
else with licenses; [ mit bsd2 gpl2Plus ];
|
else with licenses; [ mit bsd2 gpl2Plus ];
|
||||||
|
62
pkgs/misc/drivers/hplip/image-processor.patch
Normal file
62
pkgs/misc/drivers/hplip/image-processor.patch
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
diff --git i/prnt/hpcups/HPCupsFilter.cpp w/prnt/hpcups/HPCupsFilter.cpp
|
||||||
|
index 5b282d8..153ee3a 100644
|
||||||
|
--- i/prnt/hpcups/HPCupsFilter.cpp
|
||||||
|
+++ w/prnt/hpcups/HPCupsFilter.cpp
|
||||||
|
@@ -31,7 +31,6 @@
|
||||||
|
\*****************************************************************************/
|
||||||
|
|
||||||
|
#include "HPCupsFilter.h"
|
||||||
|
-#include "ImageProcessor.h"
|
||||||
|
|
||||||
|
#include <signal.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
@@ -637,16 +636,10 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
|
||||||
|
|
||||||
|
|
||||||
|
sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
|
||||||
|
- image_processor_t* imageProcessor = imageProcessorCreate();
|
||||||
|
|
||||||
|
while (cupsRasterReadHeader2(cups_raster, &cups_header))
|
||||||
|
{
|
||||||
|
|
||||||
|
- IMAGE_PROCESSOR_ERROR result = imageProcessorStartPage(imageProcessor, &cups_header);
|
||||||
|
- if (result != IPE_SUCCESS){
|
||||||
|
- dbglog("DEBUG: imageProcessorStartPage failed result = %d\n", result);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
current_page_number++;
|
||||||
|
|
||||||
|
if (current_page_number == 1) {
|
||||||
|
@@ -745,11 +738,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
|
||||||
|
color_raster = rgbRaster;
|
||||||
|
black_raster = kRaster;
|
||||||
|
|
||||||
|
- result = imageProcessorProcessLine(imageProcessor, m_pPrinterBuffer, cups_header.cupsBytesPerLine);
|
||||||
|
- if (result != IPE_SUCCESS){
|
||||||
|
- dbglog("DEBUG: imageProcessorProcessLine failed result = %d\n", result);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
|
||||||
|
if ((y == 0) && !is_ljmono) {
|
||||||
|
//For ljmono, make sure that first line is not a blankRaster line.Otherwise printer
|
||||||
|
@@ -780,11 +768,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
|
||||||
|
}
|
||||||
|
} // for() loop end
|
||||||
|
|
||||||
|
- result = imageProcessorEndPage(imageProcessor);
|
||||||
|
- if (result != IPE_SUCCESS){
|
||||||
|
- dbglog("DEBUG: imageProcessorEndPage failed result = %d\n", result);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
|
||||||
|
m_Job.NewPage();
|
||||||
|
if (err != NO_ERROR) {
|
||||||
|
@@ -800,8 +783,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
|
||||||
|
rgbRaster = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
- imageProcessorDestroy(imageProcessor);
|
||||||
|
-
|
||||||
|
unlink(hpPreProcessedRasterFile);
|
||||||
|
return ret_status;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user