summaryrefslogtreecommitdiff
path: root/net-print
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-06-04 00:07:50 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-06-04 00:07:50 +0100
commitdafa6f367240d1f5329ca89fb6f78985dbdc025b (patch)
tree96ba5ff3cc1d06604d928ca1b58ed15a4f8733dc /net-print
parenta3bb28551df94028000fb72308a9e9baa01458b0 (diff)
gentoo auto-resync : 04:06:2024 - 00:07:50
Diffstat (limited to 'net-print')
-rw-r--r--net-print/Manifest.gzbin6415 -> 6421 bytes
-rw-r--r--net-print/cups-filters/Manifest2
-rw-r--r--net-print/cups-filters/cups-filters-2.0.0-r1.ebuild2
-rw-r--r--net-print/hplip/Manifest4
-rw-r--r--net-print/hplip/files/hplip-3.23.12-py3.12.patch47
-rw-r--r--net-print/hplip/hplip-3.23.12-r2.ebuild297
-rw-r--r--net-print/hplip/hplip-3.23.12-r3.ebuild296
7 files changed, 646 insertions, 2 deletions
diff --git a/net-print/Manifest.gz b/net-print/Manifest.gz
index 3408e81053ea..a91a77be7189 100644
--- a/net-print/Manifest.gz
+++ b/net-print/Manifest.gz
Binary files differ
diff --git a/net-print/cups-filters/Manifest b/net-print/cups-filters/Manifest
index 97e0ec3db94e..aa8693d3e944 100644
--- a/net-print/cups-filters/Manifest
+++ b/net-print/cups-filters/Manifest
@@ -4,6 +4,6 @@ AUX cups-filters-1.28.17-c++17.patch 1066 BLAKE2B 149001a37c5799210a7cbc6c79ab1b
DIST cups-filters-1.28.17.tar.xz 1516052 BLAKE2B 87258391901d55d9e59b06d54603d014e54d224a373529bd70fcd38cded9dc96c88ca73bcea63d7633c065caea3f9e3274cd450aec5f1bd90130d9a88c0d3421 SHA512 320544a48206165581adafb28dbef58f39c66bebd3641be3d180a692605349d9e6af6d464044db9f7bda17a67f4a079370d8cc880cd7873d684b2209882deb35
DIST cups-filters-2.0.0.tar.xz 447648 BLAKE2B be5e2aab4eb921aa67bfcc93aa5f95a9f1fe1a269ed73d18273a0e9a3e816187e9e32750ba6521c3ab083c3c7b7a60bb1fa679e16d4a5917f911a4ba8d4b7207 SHA512 fc8ba3bbf92d5ede295884023d1c42422c4c250dbbf21c948f160a04ded3259784df4bd17eea64492f9417f866e566be1a9fcde47d29655cd4204ef4cc7af134
EBUILD cups-filters-1.28.17-r2.ebuild 3679 BLAKE2B 6f49716b9a904f063cf4356d856a87af14ce1d8536ff87aa92fe025f2df53d863373b8268524143500a17993b6dc98ede742c85a8ea931d279402e4dc70d5c36 SHA512 0e5d1a2d6c63ae020cab8f598d9b06e72712b95af8f3daf0b8a6eccbce311d89596e57ebcfa19dc9fcbc55c20714f22792ae84d29d1decdc07d20f1e7a03d1a3
-EBUILD cups-filters-2.0.0-r1.ebuild 1572 BLAKE2B 554eeca88be668f81a632527fe7b7913d48bdb5b0958a4b5541b9495b5a301f2c62a143eb01d3e7ae701fcaa542e293783be626ed57d09dfdb9f6dada1f43485 SHA512 5151eb4505f7c6d014c013a048620cfe1aa67a304bb66971aced03a267d11c0649f598815197313d0abf18c526146b282011afed6750e356268a99162f1cad88
+EBUILD cups-filters-2.0.0-r1.ebuild 1568 BLAKE2B 57aa8ff14c15b187067baed4990327503b5c697f33f11fcbf9c1e68cdbe7d559240e2418f451ffc9d4c9b001ab005e231b9284253f763398bf1cec6537560282 SHA512 7e7a26d8c691ead223da6276b9e45d7cf8028b24c5b96534ffb6069c85a0ea8dae94e776c5d19a0b2d591a8774ee3f625060e66401097bc6ce9c8dfae55ec9d0
EBUILD cups-filters-2.0.0.ebuild 1422 BLAKE2B c85fcc33008f41ad75c2b8c25e5ed6671d18a3e6049afe410becf97c0f2821f8984fb78dbe301552b2972534af92cf6de1dddf381d3a241d5cd8f1edc6e5c8d8 SHA512 e997a777141dd75987c9f5b6a405076bb791d8e581471668a6a7719cc739d38388866bde5299f728174047fe4ee00c32e371b3094ed829f8599e73b2650a347f
MISC metadata.xml 585 BLAKE2B c3ae887bff09343b882156b9020c185a9bd0d7bfabee240c71d714b8811761ef23176e4ee71f731022103a3da2255e1683b7ac4aca0f677afd994de5bedc96ca SHA512 313722d8912f26c1a7754a837b1d64dd122ac005cd9bb644ae65cac7b7a442845b25befa7891669abbf43011e9958988a6ad084dfa6ed393decbd198e852b196
diff --git a/net-print/cups-filters/cups-filters-2.0.0-r1.ebuild b/net-print/cups-filters/cups-filters-2.0.0-r1.ebuild
index 462a52f62558..efe14dde6359 100644
--- a/net-print/cups-filters/cups-filters-2.0.0-r1.ebuild
+++ b/net-print/cups-filters/cups-filters-2.0.0-r1.ebuild
@@ -9,7 +9,7 @@ SRC_URI="https://github.com/OpenPrinting/cups-filters/releases/download/${PV}/${
LICENSE="Apache-2.0"
SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ppc ~ppc64 ~riscv sparc x86"
IUSE="+foomatic"
RDEPEND="
diff --git a/net-print/hplip/Manifest b/net-print/hplip/Manifest
index a1ea84cd2057..6ec9832014e3 100644
--- a/net-print/hplip/Manifest
+++ b/net-print/hplip/Manifest
@@ -1,4 +1,8 @@
+AUX hplip-3.23.12-py3.12.patch 1431 BLAKE2B b4919efa8e26a8f546fe7bd2fa9da49a10c704e5e56043accdee7d5371e8e1cc188444f8812ebdd3a5916db19cbd8f2f6160c3b79ea51479d867821a460e6eb1 SHA512 e8fadb55daf2a38a29c376506a14f517a270865482a4ae64cc0e2057dd5498d1c72727d543f68b9b2b88c96a3c64809089253cbe76ca91bbce99414a18de1172
DIST hplip-3.23.12-patches-1.tar.xz 21132 BLAKE2B 83cee13ef988618cf6537b3954649c733b3de99f4d1c2ffefe9aeaba8f21e61a92dfa2e4cdb87af3d4b56df244e7de1b1d6bf73d878aa8ccabe60c537e05916f SHA512 89a0139660b013c11ba1dfa6adf1840b8ccc5b49bc31580481967c85e75ca79aba537bc4b65834ee464013b7aa0544267235d14dc877cb5276cb6e89c6a3fafa
+DIST hplip-3.23.12-patches-2.tar.xz 22484 BLAKE2B 919be82d0639bc30fdbe6a5651ec08c8b6951fc31284e52f09ea2aed254bb34024c7f757ec3eccec6c0fd5d261a625c2e77d6aa33d298287f26313811280e3b7 SHA512 bc9746fb748819ca06a0a3d5b2a66ab15ef499ed01177fd936f754d743a282253897db7f813ba8165e8336a9a3540c2f9b99e10908930b3842ef7452957afc13
DIST hplip-3.23.12.tar.gz 30162044 BLAKE2B 752a5b75855677e4f8b5b8738181d40c426268be4e393e5df7565c78efca68389e86d92f21002a733c0b2d5d62913bef3986e4bedd36a9f35f205c11e6027e7a SHA512 7461ffec38be68421e4204021f53d2b1641e7a67c14f205390d45f487a1af90956fd221f7e1561635508103ae944f19e04d6052d3f8928f2c9685fdcdcf515df
EBUILD hplip-3.23.12-r1.ebuild 8535 BLAKE2B 5a5a723b5fc8461b683119b6be9d573d0670941498b3c979193cba7c12d3fa40d1296822293004700c7f8ebf4e2ea3b2d566f6c0d9d2344618a3af76ba5f7c17 SHA512 10c05f98b99667c8987c4b06f96e63a8981b31b5df38a849f952aa834b1ba077a8e2d9c1178b8448c8d35f07a72a3d285ecdb60855c60212ead57db10b3cf280
+EBUILD hplip-3.23.12-r2.ebuild 8584 BLAKE2B 45a144e4c53ea5bbec3987c32b9d8f8a14942ad948c0e454df86144721d5869c6e1fa9f5a100e63282f2d2f003e05ef41727409953e563b2cda5a133f69d364e SHA512 1db5d907ad67a5fc0a87b752e054af1670252a8b1fd967976d6fdfb9115a84c12bcdaaeca7356052b77b43b455aeeec6bb790832bf0830aee89bfc0da16849cb
+EBUILD hplip-3.23.12-r3.ebuild 8544 BLAKE2B 79f69ae244355a341daed0ce4d6cd7d298b4c889053738a453048a2756b9cf84dfb6c91f6c3827a6325f3f449b8ce4c41e98e61b6ae3d6f8d6ee1ecedcc31bb0 SHA512 8e3746ad6b864eaa4fdd072c1c9cac79a74f1af7533fd3915e50b6c4859d7fb660fe1d69c667d1be509e6ce2eeda984cdb9c2fa12e7ebf2162aae93ad97ca24e
MISC metadata.xml 1849 BLAKE2B 381cc0d0fe08d072487850a5f5ac6e264cb4ee5db8722b6f83ad9d4e6e78948a7768e80ea2a8a2313bdca1029b59a02d8c3ca309d9438d5e4d63585f7a6b2a83 SHA512 0f5f42b561099e943d99dc5e50cfd42577582b31590c0cd98f276e5acc364fb31f4a48cf91b33e923d24daa77b7b3a6bc54a0c24d9ebff9e3ec82c957a5671e3
diff --git a/net-print/hplip/files/hplip-3.23.12-py3.12.patch b/net-print/hplip/files/hplip-3.23.12-py3.12.patch
new file mode 100644
index 000000000000..8a298e35dc3c
--- /dev/null
+++ b/net-print/hplip/files/hplip-3.23.12-py3.12.patch
@@ -0,0 +1,47 @@
+https://bugs.gentoo.org/932150#c8
+
+Fix deprecated use of configparser.readfp()
+--- a/base/g.py
++++ b/base/g.py
+@@ -128,7 +128,7 @@
+ try:
+ fp = open(self.filename, "r")
+ try:
+- self.conf.readfp(fp)
++ self.conf.read_file(fp)
+ except configparser.MissingSectionHeaderError:
+ print("")
+ log.error("Found No Section in %s. Please set the http proxy for root and try again." % self.filename)
+--- a/ui/devmgr4.py
++++ b/ui/devmgr4.py
+@@ -1227,7 +1227,7 @@
+
+ hplip_conf = ConfigParser.ConfigParser()
+ fp = open("/etc/hp/hplip.conf", "r")
+- hplip_conf.readfp(fp)
++ hplip_conf.read_file(fp)
+ fp.close()
+
+ try:
+--- a/ui4/devmgr5.py
++++ b/ui4/devmgr5.py
+@@ -1024,7 +1024,7 @@
+
+ hplip_conf = configparser.ConfigParser()
+ fp = open("/etc/hp/hplip.conf", "r")
+- hplip_conf.readfp(fp)
++ hplip_conf.read_file(fp)
+ fp.close()
+
+ try:
+--- a/ui5/devmgr5.py
++++ b/ui5/devmgr5.py
+@@ -1074,7 +1074,7 @@
+
+ hplip_conf = configparser.ConfigParser()
+ fp = open("/etc/hp/hplip.conf", "r")
+- hplip_conf.readfp(fp)
++ hplip_conf.read_file(fp)
+ fp.close()
+
+ try:
diff --git a/net-print/hplip/hplip-3.23.12-r2.ebuild b/net-print/hplip/hplip-3.23.12-r2.ebuild
new file mode 100644
index 000000000000..c831b78ad173
--- /dev/null
+++ b/net-print/hplip/hplip-3.23.12-r2.ebuild
@@ -0,0 +1,297 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_REQ_USE="threads(+),xml(+)"
+
+inherit autotools flag-o-matic linux-info python-single-r1 readme.gentoo-r1 udev
+
+DESCRIPTION="HP Linux Imaging and Printing - Print, scan, fax drivers and service tools"
+HOMEPAGE="https://developers.hp.com/hp-linux-imaging-and-printing"
+SRC_URI="https://downloads.sourceforge.net/project/${PN}/${PN}/${PV}/${P}.tar.gz
+ https://dev.gentoo.org/~billie/distfiles/${PN}-3.23.12-patches-1.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
+
+IUSE="doc fax +hpcups hpijs kde libnotify libusb0 minimal parport policykit qt5 scanner +snmp static-ppds X"
+
+COMMON_DEPEND="
+ net-print/cups
+ media-libs/libjpeg-turbo:0
+ hpijs? ( net-print/cups-filters[foomatic] )
+ !libusb0? ( virtual/libusb:1 )
+ libusb0? ( virtual/libusb:0 )
+ ${PYTHON_DEPS}
+ !minimal? (
+ sys-apps/dbus
+ scanner? (
+ media-gfx/sane-backends
+ )
+ snmp? (
+ dev-libs/openssl:0=
+ net-analyzer/net-snmp:=[${PYTHON_SINGLE_USEDEP}]
+ net-dns/avahi[dbus,python,${PYTHON_SINGLE_USEDEP}]
+ )
+ )
+"
+BDEPEND="
+ virtual/pkgconfig
+"
+DEPEND="
+ ${COMMON_DEPEND}
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ app-text/ghostscript-gpl
+ !minimal? (
+ $(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]' 'python3*')
+ kernel_linux? ( virtual/udev )
+ $(python_gen_cond_dep '
+ >=dev-python/dbus-python-1.2.0-r1[${PYTHON_USEDEP}]
+ dev-python/distro[${PYTHON_USEDEP}]
+ fax? ( dev-python/reportlab[${PYTHON_USEDEP}] )
+ qt5? (
+ >=dev-python/PyQt5-5.5.1[dbus,gui,widgets,${PYTHON_USEDEP}]
+ libnotify? ( dev-python/notify2[${PYTHON_USEDEP}] )
+ )
+ scanner? (
+ >=dev-python/reportlab-3.2[${PYTHON_USEDEP}]
+ >=dev-python/pillow-3.1.1[${PYTHON_USEDEP}]
+ X? (
+ || (
+ kde? ( kde-misc/skanlite )
+ media-gfx/xsane
+ media-gfx/sane-frontends
+ )
+ )
+ )
+ ')
+ )
+ policykit? ( sys-auth/polkit )
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+PATCHES=(
+ "${WORKDIR}/patches"
+ "${FILESDIR}/hplip-3.23.12-py3.12.patch"
+)
+
+CONFIG_CHECK="~PARPORT ~PPDEV"
+ERROR_PARPORT="Please make sure kernel parallel port support is enabled (PARPORT and PPDEV)."
+
+#DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+For more information on setting up your printer please take
+a look at the hplip section of the gentoo printing guide:
+https://wiki.gentoo.org/wiki/Printing
+"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+
+ use scanner && ! use X && ewarn "You need USE=X for the scanner GUI."
+
+ use parport && linux-info_pkg_setup
+
+ if use minimal ; then
+ ewarn "Installing driver portions only, make sure you know what you are doing."
+ ewarn "Depending on the USE flags set for hpcups or hpijs the appropiate driver"
+ ewarn "is installed. If both USE flags are set hpijs overrides hpcups."
+ ewarn "This also disables fax, network, scanner and gui support!"
+ fi
+
+ if ! use hpcups && ! use hpijs ; then
+ ewarn "Installing neither hpcups (USE=-hpcups) nor hpijs (USE=-hpijs) driver,"
+ ewarn "which is probably not what you want."
+ ewarn "You will almost certainly not be able to print."
+ fi
+}
+
+src_prepare() {
+ default
+
+ python_fix_shebang .
+
+ # Make desktop files follow the specification
+ # Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=443680
+ # Upstream bug: https://bugs.launchpad.net/hplip/+bug/1080324
+ sed -i -e '/^Categories=/s/Application;//' \
+ -e '/^Encoding=.*/d' hplip.desktop.in || die
+ sed -i -e '/^Categories=/s/Application;//' \
+ -e '/^Version=.*/d' \
+ -e '/^Comment=.*/d' hplip-systray.desktop.in || die
+
+ # Fix for Gentoo bug https://bugs.gentoo.org/show_bug.cgi?id=345725
+ # Upstream bug: https://bugs.launchpad.net/hplip/+bug/880847,
+ # https://bugs.launchpad.net/hplip/+bug/500086
+ local udevdir=$(get_udevdir)
+ sed -i -e "s|/etc/udev|${udevdir}|g" \
+ $(find . -type f -exec grep -l /etc/udev {} +) || die
+
+ # Force recognition of Gentoo distro by hp-check
+ sed -i \
+ -e "s:file('/etc/issue', 'r').read():'Gentoo':" \
+ installer/core_install.py || die
+
+ eautoreconf
+}
+
+src_configure() {
+ # -Werror=lto-type-mismatch
+ # https://bugs.gentoo.org/861851
+ # https://bugs.launchpad.net/hplip/+bug/2055371
+ filter-lto
+
+ local drv_build minimal_build
+
+ if use hpcups ; then
+ drv_build="$(use_enable hpcups hpcups-install)"
+ if use static-ppds ; then
+ drv_build="${drv_build} --enable-cups-ppd-install"
+ drv_build="${drv_build} --disable-cups-drv-install"
+ else
+ drv_build="${drv_build} --enable-cups-drv-install"
+ drv_build="${drv_build} --disable-cups-ppd-install"
+ fi
+ else
+ drv_build="--disable-hpcups-install"
+ drv_build="${drv_build} --disable-cups-drv-install"
+ drv_build="${drv_build} --disable-cups-ppd-install"
+ fi
+
+ if use hpijs ; then
+ drv_build="${drv_build} $(use_enable hpijs hpijs-install)"
+ if use static-ppds ; then
+ drv_build="${drv_build} --enable-foomatic-ppd-install"
+ drv_build="${drv_build} --disable-foomatic-drv-install"
+ else
+ drv_build="${drv_build} --enable-foomatic-drv-install"
+ drv_build="${drv_build} --disable-foomatic-ppd-install"
+ fi
+ else
+ drv_build="${drv_build} --disable-hpijs-install"
+ drv_build="${drv_build} --disable-foomatic-drv-install"
+ drv_build="${drv_build} --disable-foomatic-ppd-install"
+ fi
+
+ if use minimal ; then
+ if use hpijs ; then
+ minimal_build="--enable-hpijs-only-build"
+ else
+ minimal_build="--disable-hpijs-only-build"
+ fi
+ if use hpcups ; then
+ minimal_build="${minimal_build} --enable-hpcups-only-build"
+ else
+ minimal_build="${minimal_build} --disable-hpcups-only-build"
+ fi
+ minimal_build="${minimal_build} --disable-dbus-build"
+ minimal_build="${minimal_build} --disable-fax-build"
+ minimal_build="${minimal_build} --disable-network-build"
+ minimal_build="${minimal_build} --disable-scan-build"
+ minimal_build="${minimal_build} --disable-gui-build"
+ else
+ minimal_build="${minimal_build} --enable-dbus-build"
+ if use fax ; then
+ minimal_build="${minimal_build} --enable-fax-build"
+ else
+ minimal_build="${minimal_build} --disable-fax-build"
+ fi
+ if use snmp ; then
+ minimal_build="${minimal_build} --enable-network-build"
+ else
+ minimal_build="${minimal_build} --disable-network-build"
+ fi
+ if use scanner ; then
+ minimal_build="${minimal_build} --enable-scan-build"
+ else
+ minimal_build="${minimal_build} --disable-scan-build"
+ fi
+ if use qt5 ; then
+ minimal_build="${minimal_build} --enable-qt5"
+ minimal_build="${minimal_build} --enable-gui-build"
+ else
+ minimal_build="${minimal_build} --disable-gui-build"
+ minimal_build="${minimal_build} --disable-qt5"
+ fi
+ fi
+
+ # disable class driver for now
+ econf \
+ --disable-class-driver \
+ --disable-cups11-build \
+ --disable-foomatic-rip-hplip-install \
+ --disable-imageProcessor-build \
+ --disable-lite-build \
+ --disable-shadow-build \
+ --disable-qt3 \
+ --disable-qt4 \
+ --disable-udev_sysfs_rules \
+ --with-cupsbackenddir=$(cups-config --serverbin)/backend \
+ --with-cupsfilterdir=$(cups-config --serverbin)/filter \
+ --with-docdir=/usr/share/doc/${PF} \
+ --with-htmldir=/usr/share/doc/${PF}/html \
+ --enable-hpps-install \
+ ${drv_build} \
+ ${minimal_build} \
+ $(use_enable doc doc-build) \
+ $(use_enable libusb0 libusb01_build) \
+ $(use_enable parport pp-build) \
+ $(use_enable policykit)
+
+ # hpijs ppds are created at configure time but are not installed (3.17.11)
+
+ # Use system foomatic-rip for hpijs driver instead of foomatic-rip-hplip
+ # The hpcups driver does not use foomatic-rip
+ #local i
+ #for i in ppd/hpijs/*.ppd.gz ; do
+ # rm -f ${i}.temp || die
+ # gunzip -c ${i} | sed 's/foomatic-rip-hplip/foomatic-rip/g' | \
+ # gzip > ${i}.temp || die
+ # mv ${i}.temp ${i} || die
+ #done
+}
+
+src_install() {
+ # Disable parallel install
+ # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=578018
+ emake -j1 DESTDIR="${D}" install
+ einstalldocs
+ # default
+
+ # Installed by sane-backends
+ # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=201023
+ rm -f "${ED}"/etc/sane.d/dll.conf || die
+
+ # Remove desktop and autostart files
+ # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=638770
+ use qt5 || {
+ rm -Rf "${ED}"/usr/share/applications "${ED}"/etc/xdg
+ }
+
+ rm -f "${ED}"/usr/share/doc/${PF}/{copyright,README_LIBJPG,COPYING} || die
+ rmdir --ignore-fail-on-non-empty "${ED}"/usr/share/doc/${PF}/ || die
+
+ # Remove hal fdi files
+ rm -rf "${ED}"/usr/share/hal || die
+
+ find "${D}" -name '*.la' -delete || die
+
+ python_optimize "${ED}"/usr/share/hplip
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ udev_reload
+ readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/net-print/hplip/hplip-3.23.12-r3.ebuild b/net-print/hplip/hplip-3.23.12-r3.ebuild
new file mode 100644
index 000000000000..835770a5fc96
--- /dev/null
+++ b/net-print/hplip/hplip-3.23.12-r3.ebuild
@@ -0,0 +1,296 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10,11,12} )
+PYTHON_REQ_USE="threads(+),xml(+)"
+
+inherit autotools flag-o-matic linux-info python-single-r1 readme.gentoo-r1 udev
+
+DESCRIPTION="HP Linux Imaging and Printing - Print, scan, fax drivers and service tools"
+HOMEPAGE="https://developers.hp.com/hp-linux-imaging-and-printing"
+SRC_URI="https://downloads.sourceforge.net/project/${PN}/${PN}/${PV}/${P}.tar.gz
+ https://dev.gentoo.org/~billie/distfiles/${PN}-3.23.12-patches-2.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
+
+IUSE="doc fax +hpcups hpijs kde libnotify libusb0 minimal parport policykit qt5 scanner +snmp static-ppds X"
+
+COMMON_DEPEND="
+ net-print/cups
+ media-libs/libjpeg-turbo:0
+ hpijs? ( net-print/cups-filters[foomatic] )
+ !libusb0? ( virtual/libusb:1 )
+ libusb0? ( virtual/libusb:0 )
+ ${PYTHON_DEPS}
+ !minimal? (
+ sys-apps/dbus
+ scanner? (
+ media-gfx/sane-backends
+ )
+ snmp? (
+ dev-libs/openssl:0=
+ net-analyzer/net-snmp:=[${PYTHON_SINGLE_USEDEP}]
+ net-dns/avahi[dbus,python,${PYTHON_SINGLE_USEDEP}]
+ )
+ )
+"
+BDEPEND="
+ virtual/pkgconfig
+"
+DEPEND="
+ ${COMMON_DEPEND}
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ app-text/ghostscript-gpl
+ !minimal? (
+ $(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]' 'python3*')
+ kernel_linux? ( virtual/udev )
+ $(python_gen_cond_dep '
+ >=dev-python/dbus-python-1.2.0-r1[${PYTHON_USEDEP}]
+ dev-python/distro[${PYTHON_USEDEP}]
+ fax? ( dev-python/reportlab[${PYTHON_USEDEP}] )
+ qt5? (
+ >=dev-python/PyQt5-5.5.1[dbus,gui,widgets,${PYTHON_USEDEP}]
+ libnotify? ( dev-python/notify2[${PYTHON_USEDEP}] )
+ )
+ scanner? (
+ >=dev-python/reportlab-3.2[${PYTHON_USEDEP}]
+ >=dev-python/pillow-3.1.1[${PYTHON_USEDEP}]
+ X? (
+ || (
+ kde? ( kde-misc/skanlite )
+ media-gfx/xsane
+ media-gfx/sane-frontends
+ )
+ )
+ )
+ ')
+ )
+ policykit? ( sys-auth/polkit )
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+PATCHES=(
+ "${WORKDIR}/patches"
+)
+
+CONFIG_CHECK="~PARPORT ~PPDEV"
+ERROR_PARPORT="Please make sure kernel parallel port support is enabled (PARPORT and PPDEV)."
+
+#DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+For more information on setting up your printer please take
+a look at the hplip section of the gentoo printing guide:
+https://wiki.gentoo.org/wiki/Printing
+"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+
+ use scanner && ! use X && ewarn "You need USE=X for the scanner GUI."
+
+ use parport && linux-info_pkg_setup
+
+ if use minimal ; then
+ ewarn "Installing driver portions only, make sure you know what you are doing."
+ ewarn "Depending on the USE flags set for hpcups or hpijs the appropiate driver"
+ ewarn "is installed. If both USE flags are set hpijs overrides hpcups."
+ ewarn "This also disables fax, network, scanner and gui support!"
+ fi
+
+ if ! use hpcups && ! use hpijs ; then
+ ewarn "Installing neither hpcups (USE=-hpcups) nor hpijs (USE=-hpijs) driver,"
+ ewarn "which is probably not what you want."
+ ewarn "You will almost certainly not be able to print."
+ fi
+}
+
+src_prepare() {
+ default
+
+ python_fix_shebang .
+
+ # Make desktop files follow the specification
+ # Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=443680
+ # Upstream bug: https://bugs.launchpad.net/hplip/+bug/1080324
+ sed -i -e '/^Categories=/s/Application;//' \
+ -e '/^Encoding=.*/d' hplip.desktop.in || die
+ sed -i -e '/^Categories=/s/Application;//' \
+ -e '/^Version=.*/d' \
+ -e '/^Comment=.*/d' hplip-systray.desktop.in || die
+
+ # Fix for Gentoo bug https://bugs.gentoo.org/show_bug.cgi?id=345725
+ # Upstream bug: https://bugs.launchpad.net/hplip/+bug/880847,
+ # https://bugs.launchpad.net/hplip/+bug/500086
+ local udevdir=$(get_udevdir)
+ sed -i -e "s|/etc/udev|${udevdir}|g" \
+ $(find . -type f -exec grep -l /etc/udev {} +) || die
+
+ # Force recognition of Gentoo distro by hp-check
+ sed -i \
+ -e "s:file('/etc/issue', 'r').read():'Gentoo':" \
+ installer/core_install.py || die
+
+ eautoreconf
+}
+
+src_configure() {
+ # -Werror=lto-type-mismatch
+ # https://bugs.gentoo.org/861851
+ # https://bugs.launchpad.net/hplip/+bug/2055371
+ filter-lto
+
+ local drv_build minimal_build
+
+ if use hpcups ; then
+ drv_build="$(use_enable hpcups hpcups-install)"
+ if use static-ppds ; then
+ drv_build="${drv_build} --enable-cups-ppd-install"
+ drv_build="${drv_build} --disable-cups-drv-install"
+ else
+ drv_build="${drv_build} --enable-cups-drv-install"
+ drv_build="${drv_build} --disable-cups-ppd-install"
+ fi
+ else
+ drv_build="--disable-hpcups-install"
+ drv_build="${drv_build} --disable-cups-drv-install"
+ drv_build="${drv_build} --disable-cups-ppd-install"
+ fi
+
+ if use hpijs ; then
+ drv_build="${drv_build} $(use_enable hpijs hpijs-install)"
+ if use static-ppds ; then
+ drv_build="${drv_build} --enable-foomatic-ppd-install"
+ drv_build="${drv_build} --disable-foomatic-drv-install"
+ else
+ drv_build="${drv_build} --enable-foomatic-drv-install"
+ drv_build="${drv_build} --disable-foomatic-ppd-install"
+ fi
+ else
+ drv_build="${drv_build} --disable-hpijs-install"
+ drv_build="${drv_build} --disable-foomatic-drv-install"
+ drv_build="${drv_build} --disable-foomatic-ppd-install"
+ fi
+
+ if use minimal ; then
+ if use hpijs ; then
+ minimal_build="--enable-hpijs-only-build"
+ else
+ minimal_build="--disable-hpijs-only-build"
+ fi
+ if use hpcups ; then
+ minimal_build="${minimal_build} --enable-hpcups-only-build"
+ else
+ minimal_build="${minimal_build} --disable-hpcups-only-build"
+ fi
+ minimal_build="${minimal_build} --disable-dbus-build"
+ minimal_build="${minimal_build} --disable-fax-build"
+ minimal_build="${minimal_build} --disable-network-build"
+ minimal_build="${minimal_build} --disable-scan-build"
+ minimal_build="${minimal_build} --disable-gui-build"
+ else
+ minimal_build="${minimal_build} --enable-dbus-build"
+ if use fax ; then
+ minimal_build="${minimal_build} --enable-fax-build"
+ else
+ minimal_build="${minimal_build} --disable-fax-build"
+ fi
+ if use snmp ; then
+ minimal_build="${minimal_build} --enable-network-build"
+ else
+ minimal_build="${minimal_build} --disable-network-build"
+ fi
+ if use scanner ; then
+ minimal_build="${minimal_build} --enable-scan-build"
+ else
+ minimal_build="${minimal_build} --disable-scan-build"
+ fi
+ if use qt5 ; then
+ minimal_build="${minimal_build} --enable-qt5"
+ minimal_build="${minimal_build} --enable-gui-build"
+ else
+ minimal_build="${minimal_build} --disable-gui-build"
+ minimal_build="${minimal_build} --disable-qt5"
+ fi
+ fi
+
+ # disable class driver for now
+ econf \
+ --disable-class-driver \
+ --disable-cups11-build \
+ --disable-foomatic-rip-hplip-install \
+ --disable-imageProcessor-build \
+ --disable-lite-build \
+ --disable-shadow-build \
+ --disable-qt3 \
+ --disable-qt4 \
+ --disable-udev_sysfs_rules \
+ --with-cupsbackenddir=$(cups-config --serverbin)/backend \
+ --with-cupsfilterdir=$(cups-config --serverbin)/filter \
+ --with-docdir=/usr/share/doc/${PF} \
+ --with-htmldir=/usr/share/doc/${PF}/html \
+ --enable-hpps-install \
+ ${drv_build} \
+ ${minimal_build} \
+ $(use_enable doc doc-build) \
+ $(use_enable libusb0 libusb01_build) \
+ $(use_enable parport pp-build) \
+ $(use_enable policykit)
+
+ # hpijs ppds are created at configure time but are not installed (3.17.11)
+
+ # Use system foomatic-rip for hpijs driver instead of foomatic-rip-hplip
+ # The hpcups driver does not use foomatic-rip
+ #local i
+ #for i in ppd/hpijs/*.ppd.gz ; do
+ # rm -f ${i}.temp || die
+ # gunzip -c ${i} | sed 's/foomatic-rip-hplip/foomatic-rip/g' | \
+ # gzip > ${i}.temp || die
+ # mv ${i}.temp ${i} || die
+ #done
+}
+
+src_install() {
+ # Disable parallel install
+ # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=578018
+ emake -j1 DESTDIR="${D}" install
+ einstalldocs
+ # default
+
+ # Installed by sane-backends
+ # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=201023
+ rm -f "${ED}"/etc/sane.d/dll.conf || die
+
+ # Remove desktop and autostart files
+ # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=638770
+ use qt5 || {
+ rm -Rf "${ED}"/usr/share/applications "${ED}"/etc/xdg
+ }
+
+ rm -f "${ED}"/usr/share/doc/${PF}/{copyright,README_LIBJPG,COPYING} || die
+ rmdir --ignore-fail-on-non-empty "${ED}"/usr/share/doc/${PF}/ || die
+
+ # Remove hal fdi files
+ rm -rf "${ED}"/usr/share/hal || die
+
+ find "${D}" -name '*.la' -delete || die
+
+ python_optimize "${ED}"/usr/share/hplip
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ udev_reload
+ readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+ udev_reload
+}