PKGBUILD 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # Maintainer (Arch): Andreas Radke <andyrtr@archlinux.org>
  2. # Maintainer (Arch): Tom Gundersen <teg@jklm.no>
  3. # Contributor (Arch): Rémy Oudompheng <remy@archlinux.org>
  4. # Contributor (Arch): Morgan LEFIEUX <comete@archlinuxfr.org>
  5. # Maintainer (Hyperbola): André Silva <emulatorman@hyperbola.info>
  6. # Contributor (Hyperbola): Márcio Silva <coadde@hyperbola.info>
  7. # Contributor (Hyperbola): Jorge López <jorginho@hyperbola.info>
  8. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  9. # Maintainer: David P. <megver83@parabola.nu>
  10. pkgname=hplip
  11. pkgver=3.20.6
  12. pkgrel=3
  13. pkgrel+=.par1
  14. epoch=1
  15. pkgdesc="Drivers for HP DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet"
  16. pkgdesc+=", without printers with nonfree drivers support and hplip-plugin binary blobs recommendation (Parabola rebranded)"
  17. arch=('x86_64')
  18. arch+=('i686' 'armv7h')
  19. url="https://hplipopensource.com"
  20. license=('GPL' 'custom')
  21. depends=('python-dbus' 'python-distro' 'ghostscript' 'net-snmp' 'foomatic-db-engine' 'python-gobject' 'libxcrypt')
  22. makedepends=('python-pyqt5' 'sane' 'rpcbind' 'cups' 'libusb')
  23. optdepends=('cups: for printing support'
  24. 'sane: for scanner support'
  25. 'xsane: sane scanner frontend'
  26. 'python-pillow: for commandline scanning support'
  27. 'python-reportlab: for pdf output in hp-scan'
  28. 'rpcbind: for network support'
  29. 'python-pyqt5: for running GUI and hp-toolbox'
  30. 'libusb: for advanced usb support'
  31. 'wget: for network support')
  32. replaces=(${pkgname}-libre)
  33. conflicts=(${pkgname}-libre)
  34. backup=('etc/hp/hplip.conf' 'etc/sane.d/dll.d/hpaio')
  35. source=(https://downloads.sourceforge.net/${pkgname}/$pkgname-$pkgver.tar.gz{,.asc}
  36. disable_upgrade.patch
  37. 0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
  38. 0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
  39. 0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch
  40. https://launchpadlibrarian.net/480406888/hplip-configure-python.patch
  41. python3.diff
  42. reproducible-gzip.patch
  43. hplip-revert-plugins.patch)
  44. sha512sums=('ccd82112afb5ee73f5d027819ab89ba8f52ec36a4b061d314565f95d288be24e045050c3368332eeae50c0fb170f8cb015fdd8dde4b32a08e3758f0f0f4e8e96'
  45. 'SKIP'
  46. 'f0cf2774e53070406e89614b748e3c45079be889b83d5854340b92093643f6f8b332d6b6e617884d2bdcbef667a84ee5741b07c5fb080bb04925bb454af448d1'
  47. '22aeb5b851f78bc6bc62e0bc3da99fecaf42d7604af41e2f3343f8d3666541f7b06b7d1a7d0ddf24f1731ac7b12dfe582375a98e3b94dfa323d6ce954549ca67'
  48. '763949a0bc460dcc9faefc86f2a91cf342781bfce696ed0c3826758572dd03ac266bbeb7b6a4f9376ac298d7d3c9c4def42d94921a8e1d1695e39396e36d95ff'
  49. '8710e039626878270b8b7bc1569566274d935c84652d758e25ce8fe01c0f44d911148620bb494489e1238201c01f3ba255c19f7dc5c2ff0d45a5f2a79190286b'
  50. 'c41d5812ab9b5994e06f82acb0299c69edeaed548f5df2a3578c6c6428223e9cf7ec3b746f6e3071b6c858e2b0552417ba4695e1032ea41657bf852eb3ffc3fe'
  51. '5885b223f96706bc09a147b5c141d620846c9058563e986983ca2ab90922cabe891a651d90d5004d45549b3874c40f8a1570a8a79e067d66f1826681111c7e82'
  52. '7bad907228b7c2f3c43128f087a2f8e03778760b7a26179ff441c1f60127e2fca08c94dff76baea2469d3a253a8f46b285d0af0f62a6d8738926caf7a10f670b'
  53. '0dda7afaa96746a45c4720304338aea2315c983edeb8cdde4fbb98ea18421e64209947f87a374c6333ce777ea0e9565e7c5ad4c8f4c987f17d308466d02f475b')
  54. validpgpkeys=('4ABA2F66DBD5A95894910E0673D770CDA59047B9') # HPLIP <hplip@hp.com>
  55. prepare() {
  56. cd "$pkgname"-$pkgver
  57. echo "Removing printers not supported with free drivers from the database"
  58. # based on https://devel.trisquel.info/trisquel/package-helpers/raw/master/helpers/make-hplip
  59. # keep header license
  60. sed '/\[/,99999d' data/models/models.dat > mktemp
  61. for model in $(grep '\[' data/models/models.dat | sed 's/\[//; s/\]//'); do
  62. sed -n "/\[$model\]/,/^$/p;" data/models/models.dat > mktemp1
  63. grep '^download=True' -q mktemp1 && continue
  64. grep '^plugin=1' -q mktemp1 && continue
  65. grep '^support-type=0' -q mktemp1 && continue
  66. cat mktemp1 >> mktemp
  67. done
  68. sed -i 's/plugin=2/plugin=0/g' mktemp
  69. cp mktemp data/models/models.dat
  70. rm -v mktemp{,1}
  71. # remove nonfree software recommendation - https://labs.parabola.nu/issues/893
  72. sed -i 's/\, requires proprietary plugin//' $(grep -rlI '[,] requires proprietary plugin')
  73. echo "Preparing source"
  74. # disable insecure update - https://bugs.archlinux.org/task/38083
  75. patch -Np0 -i "${srcdir}"/disable_upgrade.patch
  76. # add missing 'include <cups/ppd.h>' at various places
  77. patch -Np1 -i "${srcdir}"/0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
  78. # fix some handling unicode file names FS#58412
  79. patch -Np1 -i "${srcdir}"/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
  80. # remove binary blob libImageProcessor and all linking - FS#59681
  81. patch -Np1 -i "${srcdir}"/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch
  82. # Workaround patch for missing Python3 transition of the old
  83. # (pre-USB-storage) photo memory card support (pcardext) - Debian patch
  84. patch -Np1 -i "${srcdir}"/python3.diff
  85. # https://bugs.launchpad.net/hplip/+bug/1879445
  86. # broken scanning - https://bugs.archlinux.org/task/66704
  87. patch -Np1 -i ../hplip-configure-python.patch
  88. # make gzip creation reproducible by removing the timestamp
  89. patch -Np1 -i ../reproducible-gzip.patch
  90. # why do they disable the plugins for almost all printers??? - FS#67119
  91. patch -Np1 -i ../hplip-revert-plugins.patch
  92. export AUTOMAKE='automake --foreign'
  93. autoreconf --force --install
  94. }
  95. build() {
  96. cd "$pkgname"-$pkgver
  97. #export CFLAGS+=" $(python3-config --includes)" # Fix build with python 3.8
  98. ./configure --prefix=/usr \
  99. --enable-qt5 \
  100. --disable-qt4 \
  101. --enable-hpcups-install \
  102. --enable-cups-drv-install \
  103. --enable-pp-build #--help
  104. make
  105. }
  106. package() {
  107. cd "$pkgname"-$pkgver
  108. make -j1 rulesdir=/usr/lib/udev/rules.d DESTDIR="$pkgdir/" install
  109. # remove config provided by sane and autostart of hp-daemon
  110. rm -rf "$pkgdir"/etc/{sane.d,xdg}
  111. install -dm755 "${pkgdir}"/etc/sane.d/dll.d
  112. echo hpaio > "${pkgdir}"/etc/sane.d/dll.d/hpaio
  113. # remove HAL .fdi file because HAL is no longer used
  114. rm -vrf "$pkgdir"/usr/share/hal
  115. # remove rc script
  116. rm -vrf "$pkgdir"/etc/init.d
  117. # add mixed license file
  118. install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 COPYING
  119. # Compile Python bytecode:
  120. python -m compileall -d /usr/share "$pkgdir/usr/share"
  121. python -O -m compileall -d /usr/share "$pkgdir/usr/share"
  122. }