archrelease: copy trunk to staging-x86_64
[arch-packages.git] / hplip / repos / extra-x86_64 / PKGBUILD
blob762d37bb47d2bf5c72b7e87d9535ead6e8c3647b
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>
6 pkgname=hplip
7 pkgver=3.23.3
8 pkgrel=2
9 epoch=1
10 pkgdesc="Drivers for HP DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet"
11 arch=('x86_64')
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}
28         disable_upgrade.patch
29         0003-models.dat-Re-add-drivers-missing-from-3.19.1.patch
30         0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
31         0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
32         0025_fix-Werror-format-security.patch
33         # use the one from Fedora
34         hplip-configure-python.patch
35         python3.diff
36         reproducible-gzip.patch)
37 sha512sums=('b3c061d59ec4c4b8c2cb5a90a66a706439a75362d19bc7a14b6a8656812334f6de4358cfa8d5ef37e597eaaabf914f9a00f69c5b68e61bc1aac6e71521eee8a8'
38             'SKIP'
39             'a12aaeece5285ffb86bdbc24871bf512fbc1f29da44ae51ded314378032662074a42b8aca23bebb378bf78ed15bb7f99da59bfb4cd456f3458e7a5ef42a900f8'
40             'f79b3f09d022178099f38b9eae1792396e730eb5352a03d088e6610d92b3895f3f65bb92089ce7f5b21d794f9716ceb176d29ca7283e8a48bb04cf6aba305a2f'
41             '22aeb5b851f78bc6bc62e0bc3da99fecaf42d7604af41e2f3343f8d3666541f7b06b7d1a7d0ddf24f1731ac7b12dfe582375a98e3b94dfa323d6ce954549ca67'
42             '763949a0bc460dcc9faefc86f2a91cf342781bfce696ed0c3826758572dd03ac266bbeb7b6a4f9376ac298d7d3c9c4def42d94921a8e1d1695e39396e36d95ff'
43             'b7e67bccb2516f4d98e4c5ea55f7d2299d95bfdc341dbc0149af1423169bedcd8bcfdb125c92f373e9e7be57ea284fef80a8343035fb42572b9cb927929cd257'
44             '089c102357ea5fd55d81ae76aaff62713f780fd84500c3b92ecd6b2bb11ccdc3a162978548e9a5f9e98a8354a5be3997e416c52daa18eda4621ed79a29d6fea8'
45             'b8a4c860e90a52ec566ca5a9c7f3a5ecb7386ae76e17b2c6c878073e60eeaf0cb63883b740b4725794be9914e1ab8fc91313efb288395f3095f599c07f54cf14'
46             '379fcbe9dc2986da828a174a0ac4e71a1da43a98408894d5e713e09d7d9cba1e9fac30f9602b81d48d992abe6b65b6402b8a07664efe97400c5d839be33cf15f')
47 validpgpkeys=('4ABA2F66DBD5A95894910E0673D770CDA59047B9') # HPLIP (HP Linux Imaging and Printing) <hplip@hp.com>
49 prepare() {
50  cd "$pkgname"-$pkgver
52  # disable insecure update - https://bugs.archlinux.org/task/38083
53  patch -Np0 -i "${srcdir}"/disable_upgrade.patch
54  # add missing 'include <cups/ppd.h>' at various places
55  patch -Np1 -i "${srcdir}"/0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
56  # fix some handling unicode file names FS#58412
57  patch -Np1 -i "${srcdir}"/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
58  # Workaround patch for missing Python3 transition of the old
59  # (pre-USB-storage) photo memory card support (pcardext) - Debian patch
60  patch -Np1 -i "${srcdir}"/python3.diff
61  # fix model support / Debian patch / FS#74942
62  patch -Np1 -i "${srcdir}"/0003-models.dat-Re-add-drivers-missing-from-3.19.1.patch
63  # fix -Werror=format-security build error with gcc 12
64  patch -Np1 -i "${srcdir}"/0025_fix-Werror-format-security.patch
65  # https://bugs.launchpad.net/hplip/+bug/1879445
66  # broken scanning - https://bugs.archlinux.org/task/66704
67  patch -Np1 -i ../hplip-configure-python.patch
69  # make gzip creation reproducible by removing the timestamp
70  patch -Np1 -i ../reproducible-gzip.patch
72  export AUTOMAKE='automake --foreign'
73  autoreconf --force --install
76 build() {
77  cd "$pkgname"-$pkgver
78  ./configure --prefix=/usr \
79              --enable-qt5 \
80              --disable-qt4 \
81              --enable-hpcups-install \
82              --enable-cups-drv-install \
83              --disable-imageProcessor-build \
84              --enable-pp-build #--help
85  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
86  make
89 package() {
90  cd "$pkgname"-$pkgver
91  make -j1 rulesdir=/usr/lib/udev/rules.d DESTDIR="$pkgdir/" install
93  # remove config provided by sane and autostart of hp-daemon
94  rm -rf "$pkgdir"/etc/{sane.d,xdg}
95  install -dm755 "${pkgdir}"/etc/sane.d/dll.d
96  echo hpaio > "${pkgdir}"/etc/sane.d/dll.d/hpaio
98  # remove HAL .fdi file because HAL is no longer used
99  rm -vrf "$pkgdir"/usr/share/hal
101  # remove rc script
102  rm -vrf "$pkgdir"/etc/init.d
104  # add mixed license file
105  install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 COPYING
107  # Compile Python bytecode:
108  python -m compileall -d /usr/share "$pkgdir/usr/share"
109  python -O -m compileall -d /usr/share "$pkgdir/usr/share"