summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a02dcd22f3948ce88565b46d0673a610a4ba0599 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Maintainer: Ayushmaan Padhi
# Contributor: Sergey Kolesov <cucullus at mail dot ru>
# Contributor: Chris Severance <aur.severach aATt spamgourmet dott com>
# Contributor: Joan Figueras <ffigue at gmail dot com>
# Contributor: megadriver <megadriver at gmx dot com>

pkgname='hplip-minimal'
pkgver=3.24.4
pkgrel=6
pkgdesc='Lite build of HPLIP with proprietary binary plugin'
arch=('x86_64')
url='https://developers.hp.com/hp-linux-imaging-and-printing/'
license=('GPL-2.0-only' 'MIT' 'BSD-3-Clause' 'GPL-3.0-only' 'LicenseRef-HPLIP')
depends=(libjpeg-turbo libcups net-snmp rpcbind sane)
makedepends=(python libusb cups rpcbind sane)
conflicts=('hplip' 'hplip-lite' 'hplip-plugin')
provides=('hplip')
backup=('etc/hp/hplip.conf' 'etc/sane.d/dll.d/hpaio')
optdepends=('cups: for printing support'
            'python-pillow: for commandline scanning support'
            'python-reportlab: for pdf output in hp-scan')
source=(https://downloads.sourceforge.net/hplip/hplip-$pkgver.tar.gz{,.asc}
        https://developers.hp.com/sites/default/files/hplip-${pkgver}-plugin.run{,.asc}
        0003-models.dat-Re-add-drivers-missing-from-3.19.1.patch
        0017-Workaround-patch-for-missing-Python3-transition-of-t.patch
        0018-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch
        0024-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
        0026-Fix-handling-of-unicode-filenames-in-sixext.py.patch
        0073-Fix-upstream-CFLAGS-override.patch
        hplip-hpaio-gcc14.patch
        hplip-pserror-gcc14.patch)
sha256sums=('5d7643831893a5e2addf9d42d581a5dbfe5aaf023626886b8762c5645da0f1fb'
            'SKIP'
            '1f3c6bdd25661a8a2e18153655d6f06f028c1d9c308d69c8ecfd7767a2d0c5aa'
            'SKIP'
            '29c4c882deda828257420aeb7b388d5b7dd6400daa2e23cbfbc8dde8367ad5a3'
            '8572c8300a2a6b2a0f4d721076d48562ffee9be2ae8d6e7ffa02fb8d7814cf42'
            'b4df02f4614a4b2e373390102d90cd28972c371da903c3d45cc188494e8ea0ba'
            '17f63f4d55ae071922b49585cc9a933ecb997348a9daeb6a30f8ddba49969fce'
            '98e15d2fa7618bf18c0386d18810669dea5b5d38b684c071ab33ea585e7ec95c'
            'e362ae5c577434168d0f04c74c59998d2d047bc374957dfda6d2c44be1ca4c1c'
            '10eca7bc2249a20365d97cc6cf3f15d5104ef74a5faa1c534a7f6994a15771fe'
            'b3f865424f288c7e3e44c46816fcd87f10ac6be7caa2a8698a82b9a5981cd1d7')
validpgpkeys=('4ABA2F66DBD5A95894910E0673D770CDA59047B9') # HPLIP (HP Linux Imaging and Printing) <hplip@hp.com>
options=(!makeflags)

prepare() {
 sh "hplip-$pkgver-plugin.run" --target "$srcdir/hplip-$pkgver-plugin" --noexec
 
 cd "hplip-$pkgver"

 patch -Np1 -i ../0003-models.dat-Re-add-drivers-missing-from-3.19.1.patch
 patch -Np1 -i ../0017-Workaround-patch-for-missing-Python3-transition-of-t.patch
 patch -Np1 -i ../0018-Allow-non-JPEG-scanning-on-the-HP-DeskJet-3520-All-i.patch
 patch -Np1 -i ../0024-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
 patch -Np1 -i ../0026-Fix-handling-of-unicode-filenames-in-sixext.py.patch
 patch -Np1 -i ../0073-Fix-upstream-CFLAGS-override.patch
 patch -Np1 -i ../hplip-hpaio-gcc14.patch
 patch -Np1 -i ../hplip-pserror-gcc14.patch
}

build() {
 cd "hplip-$pkgver"
 ./configure -q --prefix=/usr \
        --enable-lite-build \
        --disable-imageProcessor-build \
        --disable-gui-build \
        --disable-fax-build \
        --disable-doc-build
  make
}

package() {
 cd "hplip-$pkgver"
 make DESTDIR="$pkgdir/" install
 libtool --finish /usr/lib
 install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 COPYING
 cd ..
 cd "hplip-$pkgver-plugin"
 install -Dt "$pkgdir/usr/share/hplip" -m644 plugin.spec
 install -Dt "$pkgdir/usr/share/hplip/data/firmware" -m644 hp_laserjet_*.fw.gz
 install -Dt "$pkgdir/usr/share/hplip/prnt/plugins" -m644 hbpl1-x86_64.so
 install -Dt "$pkgdir/usr/share/hplip/prnt/plugins" -m644 lj-x86_64.so
 install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 license.txt

 cat << EOF > hplip.state
[plugin]
installed = 1
eula = 1
version = $pkgver
EOF
 install -Dm644 -t "$pkgdir/var/lib/hp" hplip.state

 find "$pkgdir/usr/share/hplip" -type f -name "*.so" | while read -r f; do
   lib_dir="${f%/*}"
   lib_name="${f##*/}"
   ln -vsf "$lib_name" "$lib_dir/${lib_name%%-*}.so"
 done
}