diff options
Diffstat (limited to 'libre/hplip/PKGBUILD')
-rw-r--r-- | libre/hplip/PKGBUILD | 175 |
1 files changed, 116 insertions, 59 deletions
diff --git a/libre/hplip/PKGBUILD b/libre/hplip/PKGBUILD index 30e24b6af..c6ea4b5eb 100644 --- a/libre/hplip/PKGBUILD +++ b/libre/hplip/PKGBUILD @@ -1,25 +1,35 @@ -# Maintainer (Arch): Andreas Radke <andyrtr@archlinux.org> -# Maintainer (Arch): Tom Gundersen <teg@jklm.no> -# Contributor (Arch): Rémy Oudompheng <remy@archlinux.org> -# Contributor (Arch): Morgan LEFIEUX <comete@archlinuxfr.org> -# Maintainer (Hyperbola): André Silva <emulatorman@hyperbola.info> -# Contributor (Hyperbola): Márcio Silva <coadde@hyperbola.info> -# Contributor (Hyperbola): Jorge López <jorginho@hyperbola.info> # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe> # Maintainer: David P. <megver83@parabola.nu> +# Maintainer (arch): Andreas Radke <andyrtr@archlinux.org> +# Contributor: Tom Gundersen <teg@jklm.no> +# Contributor: Rémy Oudompheng <remy@archlinux.org> +# Contributor: Morgan LEFIEUX <comete@archlinuxfr.org> +# Contributor: André Silva <emulatorman@hyperbola.info> +# Contributor: Márcio Silva <coadde@hyperbola.info> +# Contributor: Jorge López <jorginho@hyperbola.info> +# Maintainer (arch): Kevin Mihelich <kevin@archlinuxarm.org> +# Contributor: bill-auger <bill-auger@programmer.net> + + +# parabola changes and rationale: +# - remove recommendations and downloads of non-free binaries +# - disable auto-upgrade download and other online features + pkgname=hplip -pkgver=3.20.6 -pkgrel=3 -pkgrel+=.par1 +pkgver=3.23.12 +pkgrel=2 +pkgrel+=.parabola1 epoch=1 pkgdesc="Drivers for HP DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet" -pkgdesc+=", without printers with nonfree drivers support and hplip-plugin binary blobs recommendation (Parabola rebranded)" arch=('x86_64') arch+=('i686' 'armv7h') url="https://hplipopensource.com" -license=('GPL' 'custom') -depends=('python-dbus' 'python-distro' 'ghostscript' 'net-snmp' 'foomatic-db-engine' 'python-gobject' 'libxcrypt') +license=('GPL2' 'GPL3' 'custom:MIT' 'custom:BSD3') # arch license array is incomplete +depends=('python-dbus' 'python-distro' 'ghostscript' 'net-snmp' + 'foomatic-db-engine' 'python-gobject' 'libxcrypt' + 'libjpeg-turbo' 'dbus' 'gcc-libs' 'avahi' 'python' + 'xdg-utils' 'zlib' 'libcups' 'glibc') makedepends=('python-pyqt5' 'sane' 'rpcbind' 'cups' 'libusb') optdepends=('cups: for printing support' 'sane: for scanner support' @@ -30,80 +40,126 @@ optdepends=('cups: for printing support' 'python-pyqt5: for running GUI and hp-toolbox' 'libusb: for advanced usb support' 'wget: for network support') -replaces=(${pkgname}-libre) -conflicts=(${pkgname}-libre) backup=('etc/hp/hplip.conf' 'etc/sane.d/dll.d/hpaio') source=(https://downloads.sourceforge.net/${pkgname}/$pkgname-$pkgver.tar.gz{,.asc} disable_upgrade.patch + 0003-models.dat-Re-add-drivers-missing-from-3.19.1.patch + 0018-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch 0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch 0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch - 0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch - https://launchpadlibrarian.net/480406888/hplip-configure-python.patch + # use the one from Fedora + hplip-configure-python.patch python3.diff - reproducible-gzip.patch - hplip-revert-plugins.patch) -sha512sums=('ccd82112afb5ee73f5d027819ab89ba8f52ec36a4b061d314565f95d288be24e045050c3368332eeae50c0fb170f8cb015fdd8dde4b32a08e3758f0f0f4e8e96' + reproducible-gzip.patch) +source_armv7h=(0001-Remove-ImageProcessor.patch) # x86-only +sha512sums=('7461ffec38be68421e4204021f53d2b1641e7a67c14f205390d45f487a1af90956fd221f7e1561635508103ae944f19e04d6052d3f8928f2c9685fdcdcf515df' 'SKIP' - 'f0cf2774e53070406e89614b748e3c45079be889b83d5854340b92093643f6f8b332d6b6e617884d2bdcbef667a84ee5741b07c5fb080bb04925bb454af448d1' + 'a12aaeece5285ffb86bdbc24871bf512fbc1f29da44ae51ded314378032662074a42b8aca23bebb378bf78ed15bb7f99da59bfb4cd456f3458e7a5ef42a900f8' + 'f79b3f09d022178099f38b9eae1792396e730eb5352a03d088e6610d92b3895f3f65bb92089ce7f5b21d794f9716ceb176d29ca7283e8a48bb04cf6aba305a2f' + '93e29a9ef893636b2b84443e75525c4ed42531d6e68a182dfbb725c3919c77b966b5e7d9381a34d3b5853423995a7b15efb69ce3e500ec72b25b65b2ad6bd64c' '22aeb5b851f78bc6bc62e0bc3da99fecaf42d7604af41e2f3343f8d3666541f7b06b7d1a7d0ddf24f1731ac7b12dfe582375a98e3b94dfa323d6ce954549ca67' '763949a0bc460dcc9faefc86f2a91cf342781bfce696ed0c3826758572dd03ac266bbeb7b6a4f9376ac298d7d3c9c4def42d94921a8e1d1695e39396e36d95ff' - '8710e039626878270b8b7bc1569566274d935c84652d758e25ce8fe01c0f44d911148620bb494489e1238201c01f3ba255c19f7dc5c2ff0d45a5f2a79190286b' - 'c41d5812ab9b5994e06f82acb0299c69edeaed548f5df2a3578c6c6428223e9cf7ec3b746f6e3071b6c858e2b0552417ba4695e1032ea41657bf852eb3ffc3fe' - '5885b223f96706bc09a147b5c141d620846c9058563e986983ca2ab90922cabe891a651d90d5004d45549b3874c40f8a1570a8a79e067d66f1826681111c7e82' - '7bad907228b7c2f3c43128f087a2f8e03778760b7a26179ff441c1f60127e2fca08c94dff76baea2469d3a253a8f46b285d0af0f62a6d8738926caf7a10f670b' - '0dda7afaa96746a45c4720304338aea2315c983edeb8cdde4fbb98ea18421e64209947f87a374c6333ce777ea0e9565e7c5ad4c8f4c987f17d308466d02f475b') -validpgpkeys=('4ABA2F66DBD5A95894910E0673D770CDA59047B9') # HPLIP <hplip@hp.com> + '089c102357ea5fd55d81ae76aaff62713f780fd84500c3b92ecd6b2bb11ccdc3a162978548e9a5f9e98a8354a5be3997e416c52daa18eda4621ed79a29d6fea8' + 'b8a4c860e90a52ec566ca5a9c7f3a5ecb7386ae76e17b2c6c878073e60eeaf0cb63883b740b4725794be9914e1ab8fc91313efb288395f3095f599c07f54cf14' + '379fcbe9dc2986da828a174a0ac4e71a1da43a98408894d5e713e09d7d9cba1e9fac30f9602b81d48d992abe6b65b6402b8a07664efe97400c5d839be33cf15f') +sha512sums_armv7h=('7f402ed13341ac9a01f28ecdb97effcd15f5fa9d123e554d4dd78e9f5ed01bcf7b4fe7400c53ddf5e7068f9ffd858d8fefe060e2fcacea0a0524145d78e315cc') +validpgpkeys=('4ABA2F66DBD5A95894910E0673D770CDA59047B9') # HPLIP (HP Linux Imaging and Printing) <hplip@hp.com> prepare() { cd "$pkgname"-$pkgver - echo "Removing printers not supported with free drivers from the database" - - # based on https://devel.trisquel.info/trisquel/package-helpers/raw/master/helpers/make-hplip - # keep header license - sed '/\[/,99999d' data/models/models.dat > mktemp - - for model in $(grep '\[' data/models/models.dat | sed 's/\[//; s/\]//'); do - sed -n "/\[$model\]/,/^$/p;" data/models/models.dat > mktemp1 - grep '^download=True' -q mktemp1 && continue - grep '^plugin=1' -q mktemp1 && continue - grep '^support-type=0' -q mktemp1 && continue - cat mktemp1 >> mktemp - done - - sed -i 's/plugin=2/plugin=0/g' mktemp - - cp mktemp data/models/models.dat - - rm -v mktemp{,1} - - # remove nonfree software recommendation - https://labs.parabola.nu/issues/893 - sed -i 's/\, requires proprietary plugin//' $(grep -rlI '[,] requires proprietary plugin') - - echo "Preparing source" - # disable insecure update - https://bugs.archlinux.org/task/38083 patch -Np0 -i "${srcdir}"/disable_upgrade.patch - # add missing 'include <cups/ppd.h>' at various places patch -Np1 -i "${srcdir}"/0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch # fix some handling unicode file names FS#58412 patch -Np1 -i "${srcdir}"/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch - # remove binary blob libImageProcessor and all linking - FS#59681 - patch -Np1 -i "${srcdir}"/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch # Workaround patch for missing Python3 transition of the old # (pre-USB-storage) photo memory card support (pcardext) - Debian patch patch -Np1 -i "${srcdir}"/python3.diff - + # fix model support / Debian patch / FS#74942 + patch -Np1 -i "${srcdir}"/0003-models.dat-Re-add-drivers-missing-from-3.19.1.patch # https://bugs.launchpad.net/hplip/+bug/1879445 # broken scanning - https://bugs.archlinux.org/task/66704 patch -Np1 -i ../hplip-configure-python.patch + # allow non-jpeg scanning on all-in-one devices - FS#78135 + patch -Np1 -i ../0018-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch # make gzip creation reproducible by removing the timestamp patch -Np1 -i ../reproducible-gzip.patch - # why do they disable the plugins for almost all printers??? - FS#67119 - patch -Np1 -i ../hplip-revert-plugins.patch + # remove imageprocessor + [[ "${CARCH}" != armv7h ]] || patch -Np1 -i "${srcdir}"/0001-Remove-ImageProcessor.patch + + + ## parabola changes ## + + echo "re-wording non-free recommendations/errors and disabling online features" + + # Removing printers not supported with free drivers from the database + # from: https://gitlab.trisquel.org/trisquel/package-helpers/raw/aramo/helpers/make-hplip + local tmp=printers.tmp + local output=printers.out + local printers='data/models/models.dat' + # Keep header license + sed '/\[/,99999d' $printers > $output + for model in $(grep '\[' $printers | /bin/sed 's/\[//; s/\]//'); do + sed -n "/\[$model\]/,/^$/p;" $printers > $tmp + grep '^download=True' -q $tmp && continue + grep '^plugin=1' -q $tmp && continue + grep '^support-type=0' -q $tmp && continue + cat $tmp >> $output + done + cp $output $printers + # Set plugin-optional entries to not-required + /bin/sed -i 's/plugin=2/plugin=0/g' $printers + rm $tmp $output + + # re-word non-free firmware recommendations and error messages + # and disable online features (phone-home, plugin/firmware downlaoder, etc) + local match_rxs=( # ASSERT: aligns with '$replace_rxs' + ', requires proprietary plugin' + 'Device requires a proprietary binary Plug-in, run hp-plugin' + 'Your HP Device requires to install HP proprietary plugin\\n' + "Device proprietary plug-in is missing. Click 'Next' to continue plug-in installation. In case of plugin download failure, run 'hp-plugin' command from the terminal manually." + "Device requires proprietary plug-in which is missing. Click 'Next' to continue plug-in installation" + "def download(self, pluginPath='',callback = None):" + 'def download_from_network(weburl, outputFile = None, useURLLIB=False):' + 'def download_via_wget(target):' + 'def download_via_curl(target):' + 'def check_network_via_ping(target):' + 'def check_network_connection(url=HTTP_CHECK_TARGET, ping_server=PING_CHECK_TARGET):' + 'def download(mode, passwordObj):' + 'Network connection not detected.' + ) + local replace_rxs=( # ASSERT: aligns with '$match_rxs' + ', (non-free/unsupported)' + 'Device is non-free/unsupported' + '' + 'Device is non-free/unsupported./' + 'Device is non-free/unsupported./' + '&\n return 1' + '&\n return -1, ""' + '&\n return -1' + '&\n return -1' + '&\n return -1' + '&\n return -1' + '&\n return ERROR_NO_NETWORK' + 'Parabola has disabled the networking features of this application.' + ) + local rx_n + for (( rx_n = 0 ; rx_n < ${#match_rxs[@]} ; ++rx_n )) + do sed -i "s|${match_rxs[$rx_n]}|${replace_rxs[$rx_n]}|" $(grep -rlI "${match_rxs[$rx_n]}") + done + + # verify libre patching + local patch_msg='HPLIP upgrade is disabled by Archlinux for security reasons,' + local err_msg="ERROR: 'disable_upgrade.patch' not applied" + grep -A 1 "$patch_msg" upgrade.py | tail -n 1 | grep -q 'clean_exit(1)' || + ! echo "$err_msg" || return 1 + + ## END parabola changes ## + export AUTOMAKE='automake --foreign' autoreconf --force --install @@ -111,13 +167,14 @@ prepare() { build() { cd "$pkgname"-$pkgver - #export CFLAGS+=" $(python3-config --includes)" # Fix build with python 3.8 ./configure --prefix=/usr \ --enable-qt5 \ --disable-qt4 \ --enable-hpcups-install \ --enable-cups-drv-install \ + --disable-imageProcessor-build \ --enable-pp-build #--help + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool make } |