1 # Maintainer: Andreas Radke <andyrtr@archlinux.org>
2 # Contributor: Tom Gundersen <teg@jklm.no>
3 # Contributor : Rémy Oudompheng <remy@archlinux.org>
4 # Contributor: Morgan LEFIEUX <comete@archlinuxfr.org>
10 pkgdesc="Drivers for HP DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet"
12 url="https://hplipopensource.com"
13 license=('GPL2' 'custom')
14 depends=('python-dbus' 'python-distro' 'ghostscript' 'net-snmp' 'foomatic-db-engine' 'python-gobject' 'libxcrypt')
15 makedepends=('python-pyqt5' 'sane' 'rpcbind' 'cups' 'libusb')
16 optdepends=('cups: for printing support'
17 'sane: for scanner support'
18 'xsane: sane scanner frontend'
19 'python-pillow: for commandline scanning support'
20 'python-reportlab: for pdf output in hp-scan'
21 'rpcbind: for network support'
22 'python-pyqt5: for running GUI and hp-toolbox'
23 'libusb: for advanced usb support'
24 'wget: for network support')
25 # 'hplip-plugin: binary blobs for specific devices (AUR) or run hp-setup to download the plugin'
26 backup=('etc/hp/hplip.conf' 'etc/sane.d/dll.d/hpaio')
27 source=(https://downloads.sourceforge.net/${pkgname}/$pkgname-$pkgver.tar.gz{,.asc}
29 0003-models.dat-Re-add-drivers-missing-from-3.19.1.patch
30 0018-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch
31 0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
32 0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
33 0025_fix-Werror-format-security.patch
34 # use the one from Fedora
35 hplip-configure-python.patch
37 reproducible-gzip.patch)
38 sha512sums=('b3c061d59ec4c4b8c2cb5a90a66a706439a75362d19bc7a14b6a8656812334f6de4358cfa8d5ef37e597eaaabf914f9a00f69c5b68e61bc1aac6e71521eee8a8'
40 'a12aaeece5285ffb86bdbc24871bf512fbc1f29da44ae51ded314378032662074a42b8aca23bebb378bf78ed15bb7f99da59bfb4cd456f3458e7a5ef42a900f8'
41 'f79b3f09d022178099f38b9eae1792396e730eb5352a03d088e6610d92b3895f3f65bb92089ce7f5b21d794f9716ceb176d29ca7283e8a48bb04cf6aba305a2f'
42 '93e29a9ef893636b2b84443e75525c4ed42531d6e68a182dfbb725c3919c77b966b5e7d9381a34d3b5853423995a7b15efb69ce3e500ec72b25b65b2ad6bd64c'
43 '22aeb5b851f78bc6bc62e0bc3da99fecaf42d7604af41e2f3343f8d3666541f7b06b7d1a7d0ddf24f1731ac7b12dfe582375a98e3b94dfa323d6ce954549ca67'
44 '763949a0bc460dcc9faefc86f2a91cf342781bfce696ed0c3826758572dd03ac266bbeb7b6a4f9376ac298d7d3c9c4def42d94921a8e1d1695e39396e36d95ff'
45 'b7e67bccb2516f4d98e4c5ea55f7d2299d95bfdc341dbc0149af1423169bedcd8bcfdb125c92f373e9e7be57ea284fef80a8343035fb42572b9cb927929cd257'
46 '089c102357ea5fd55d81ae76aaff62713f780fd84500c3b92ecd6b2bb11ccdc3a162978548e9a5f9e98a8354a5be3997e416c52daa18eda4621ed79a29d6fea8'
47 'b8a4c860e90a52ec566ca5a9c7f3a5ecb7386ae76e17b2c6c878073e60eeaf0cb63883b740b4725794be9914e1ab8fc91313efb288395f3095f599c07f54cf14'
48 '379fcbe9dc2986da828a174a0ac4e71a1da43a98408894d5e713e09d7d9cba1e9fac30f9602b81d48d992abe6b65b6402b8a07664efe97400c5d839be33cf15f')
49 validpgpkeys=('4ABA2F66DBD5A95894910E0673D770CDA59047B9') # HPLIP (HP Linux Imaging and Printing) <hplip@hp.com>
54 # disable insecure update - https://bugs.archlinux.org/task/38083
55 patch -Np0 -i "${srcdir}"/disable_upgrade.patch
56 # add missing 'include <cups/ppd.h>' at various places
57 patch -Np1 -i "${srcdir}"/0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
58 # fix some handling unicode file names FS#58412
59 patch -Np1 -i "${srcdir}"/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
60 # Workaround patch for missing Python3 transition of the old
61 # (pre-USB-storage) photo memory card support (pcardext) - Debian patch
62 patch -Np1 -i "${srcdir}"/python3.diff
63 # fix model support / Debian patch / FS#74942
64 patch -Np1 -i "${srcdir}"/0003-models.dat-Re-add-drivers-missing-from-3.19.1.patch
65 # fix -Werror=format-security build error with gcc 12
66 patch -Np1 -i "${srcdir}"/0025_fix-Werror-format-security.patch
67 # https://bugs.launchpad.net/hplip/+bug/1879445
68 # broken scanning - https://bugs.archlinux.org/task/66704
69 patch -Np1 -i ../hplip-configure-python.patch
70 # allow non-jpeg scanning on all-in-one devices - FS#78135
71 patch -Np1 -i ../0018-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch
73 # make gzip creation reproducible by removing the timestamp
74 patch -Np1 -i ../reproducible-gzip.patch
76 export AUTOMAKE='automake --foreign'
77 autoreconf --force --install
82 ./configure --prefix=/usr \
85 --enable-hpcups-install \
86 --enable-cups-drv-install \
87 --disable-imageProcessor-build \
88 --enable-pp-build #--help
89 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
95 make -j1 rulesdir=/usr/lib/udev/rules.d DESTDIR="$pkgdir/" install
97 # remove config provided by sane and autostart of hp-daemon
98 rm -rf "$pkgdir"/etc/{sane.d,xdg}
99 install -dm755 "${pkgdir}"/etc/sane.d/dll.d
100 echo hpaio > "${pkgdir}"/etc/sane.d/dll.d/hpaio
102 # remove HAL .fdi file because HAL is no longer used
103 rm -vrf "$pkgdir"/usr/share/hal
106 rm -vrf "$pkgdir"/etc/init.d
108 # add mixed license file
109 install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 COPYING
111 # Compile Python bytecode:
112 python -m compileall -d /usr/share "$pkgdir/usr/share"
113 python -O -m compileall -d /usr/share "$pkgdir/usr/share"