archrelease: copy trunk to extra-x86_64
[arch-packages.git] / hplip / trunk / PKGBUILD
blob005a2f92c35b06d5955e4cc112c2ea4d8429aa2a
1 # Maintainer: Andreas Radke <andyrtr@archlinux.org>
2 # Maintainer: 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.21.10
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         0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
30         0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
31         # use the one from Fedora
32         hplip-configure-python.patch
33         python3.diff
34         reproducible-gzip.patch)
35 sha512sums=('e9b49b7bfc3fa38ea83b357af01cfbc59bf238ad7add49c8e4cb281fbc87facfe6fed9e8428bb926f75fb22ff8e980d620ac102694ae0c8271ce0c4f1ab8b7ed'
36             'SKIP'
37             'ee0bd240568a7dbb4dc6ef64dba28ea84c4bedf7d688d054960c686666f8f0bc4562961c40845107ef0c936e60d3e676bffb2a1ba708039690bb0520cda3a525'
38             '22aeb5b851f78bc6bc62e0bc3da99fecaf42d7604af41e2f3343f8d3666541f7b06b7d1a7d0ddf24f1731ac7b12dfe582375a98e3b94dfa323d6ce954549ca67'
39             '763949a0bc460dcc9faefc86f2a91cf342781bfce696ed0c3826758572dd03ac266bbeb7b6a4f9376ac298d7d3c9c4def42d94921a8e1d1695e39396e36d95ff'
40             '089c102357ea5fd55d81ae76aaff62713f780fd84500c3b92ecd6b2bb11ccdc3a162978548e9a5f9e98a8354a5be3997e416c52daa18eda4621ed79a29d6fea8'
41             '5885b223f96706bc09a147b5c141d620846c9058563e986983ca2ab90922cabe891a651d90d5004d45549b3874c40f8a1570a8a79e067d66f1826681111c7e82'
42             '7bad907228b7c2f3c43128f087a2f8e03778760b7a26179ff441c1f60127e2fca08c94dff76baea2469d3a253a8f46b285d0af0f62a6d8738926caf7a10f670b')
43 validpgpkeys=('4ABA2F66DBD5A95894910E0673D770CDA59047B9') # HPLIP (HP Linux Imaging and Printing) <hplip@hp.com>
45 prepare() {
46  cd "$pkgname"-$pkgver
48  # disable insecure update - https://bugs.archlinux.org/task/38083
49  patch -Np0 -i "${srcdir}"/disable_upgrade.patch
50  # add missing 'include <cups/ppd.h>' at various places
51  patch -Np1 -i "${srcdir}"/0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
52  # fix some handling unicode file names FS#58412
53  patch -Np1 -i "${srcdir}"/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
54  # Workaround patch for missing Python3 transition of the old
55  # (pre-USB-storage) photo memory card support (pcardext) - Debian patch
56  patch -Np1 -i "${srcdir}"/python3.diff
58  # https://bugs.launchpad.net/hplip/+bug/1879445
59  # broken scanning - https://bugs.archlinux.org/task/66704
60  patch -Np1 -i ../hplip-configure-python.patch
62  # make gzip creation reproducible by removing the timestamp
63  patch -Np1 -i ../reproducible-gzip.patch
65  export AUTOMAKE='automake --foreign'
66  autoreconf --force --install
69 build() {
70  cd "$pkgname"-$pkgver
71  ./configure --prefix=/usr \
72              --enable-qt5 \
73              --disable-qt4 \
74              --enable-hpcups-install \
75              --enable-cups-drv-install \
76              --disable-imageProcessor-build \
77              --enable-pp-build #--help
78  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
79  make
82 package() {
83  cd "$pkgname"-$pkgver
84  make -j1 rulesdir=/usr/lib/udev/rules.d DESTDIR="$pkgdir/" install
86  # remove config provided by sane and autostart of hp-daemon
87  rm -rf "$pkgdir"/etc/{sane.d,xdg}
88  install -dm755 "${pkgdir}"/etc/sane.d/dll.d
89  echo hpaio > "${pkgdir}"/etc/sane.d/dll.d/hpaio
91  # remove HAL .fdi file because HAL is no longer used
92  rm -vrf "$pkgdir"/usr/share/hal
94  # remove rc script
95  rm -vrf "$pkgdir"/etc/init.d
97  # add mixed license file
98  install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 COPYING
100  # Compile Python bytecode:
101  python -m compileall -d /usr/share "$pkgdir/usr/share"
102  python -O -m compileall -d /usr/share "$pkgdir/usr/share"