pantum-universal-driver 1.1.186-5
seededverified· maintained by osguot· LicenseRef-Pantum
Universal printer and scanner driver for Pantum devices
75e5e90b30f0→
00226482aa5c
·
6 files changed.SRCINFO
modified +1135 -1615diff --git a/.SRCINFO b/.SRCINFO
index d48f202..4063e82 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
pkgbase = pantum-universal-driver
pkgdesc = Universal printer and scanner driver for Pantum devices
pkgver = 1.1.186
- pkgrel = 4
+ pkgrel = 5
url = https://global.pantum.com/support/
+ install = pantum-universal-driver.install
arch = x86_64
license = LicenseRef-Pantum
depends = cups
@@ -15,27 +16,17 @@ pkgbase = pantum-universal-driver
depends = zlib
depends = libgcc
depends = libstdc++
+ depends = glibc
+ depends = avahi
+ depends = systemd
+ depends = usbutils
+ optdepends = ipp-usb: IPP-over-USB support using the Pantum-compatible fork
provides = pantum-driver=1.1.186
conflicts = pantum-driver
noextract = pantum-universal-driver-1.1.186.zip
options = !strip
- backup = etc/sane.d/pantum6500.conf
- backup = etc/sane.d/pantum_bm2400.conf
- backup = etc/sane.d/pantum_bm4200.conf
- backup = etc/sane.d/pantum_bm5200.conf
- backup = etc/sane.d/pantum_bm5230.conf
- backup = etc/sane.d/pantum_mfp.conf
- backup = etc/sane.d/dll.d/pantum6500
- backup = etc/sane.d/dll.d/pantum_bm2400
- backup = etc/sane.d/dll.d/pantum_bm4200
- backup = etc/sane.d/dll.d/pantum_bm5200
- backup = etc/sane.d/dll.d/pantum_bm5230
- backup = etc/sane.d/dll.d/pantum_mfp
+ options = !debug
source = pantum-universal-driver-1.1.186.zip::https://drivers.pantum.in/userfiles/files/download/%E9%A9%B1%E5%8A%A8%E6%96%87%E4%BB%B6/4020/%E6%AC%A7%E6%B4%B2%E5%AD%90%E7%AB%99%E9%80%82%E9%85%8D%E8%8D%B7%E5%85%B0%E8%AF%AD20260520/Pantum%20Linux%20Driver%20V1_1_186.zip
- source = pantum-ipp-usb.conf
- source = fix-pantum-ppd.awk
sha256sums = ce28c1f42e3c6a642cd49af3d6827b63ad4f0484b2151f0594470a1746828a45
- sha256sums = b24a64ae11b9e3b5eb1e5da608b38592b8131644be48e2e8d75d9491750aa6f5
- sha256sums = 262d88bd34188a401fae2599ed8ac255236cec3b7d86fd22618fcf0f46a11f4e
pkgname = pantum-universal-driver
PKGBUILD
modified +6986 -9959diff --git a/PKGBUILD b/PKGBUILD
index 570e58a..1be4d12 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -81,7 +81,7 @@
pkgname=pantum-universal-driver
pkgver=1.1.186
-pkgrel=4
+pkgrel=5
pkgdesc="Universal printer and scanner driver for Pantum devices"
arch=('x86_64')
url="https://global.pantum.com/support/"
@@ -97,10 +97,16 @@ depends=(
'zlib'
'libgcc'
'libstdc++'
+ 'glibc'
+ 'avahi'
+ 'systemd'
+ 'usbutils'
)
+optdepends=('ipp-usb: IPP-over-USB support using the Pantum-compatible fork')
provides=("pantum-driver=${pkgver}")
conflicts=('pantum-driver')
-options=('!strip')
+options=('!strip' '!debug')
+install=pantum-universal-driver.install
# Auxiliary variables
_zipver="${pkgver//./_}"
@@ -110,31 +116,8 @@ _foldername="Pantum Linux Driver V${pkgver}"
_download_url='https://drivers.pantum.in/userfiles/files/download'
_download_path='%E9%A9%B1%E5%8A%A8%E6%96%87%E4%BB%B6/4020/%E6%AC%A7%E6%B4%B2%E5%AD%90%E7%AB%99%E9%80%82%E9%85%8D%E8%8D%B7%E5%85%B0%E8%AF%AD20260520'
-backup=(
- 'etc/sane.d/pantum6500.conf'
- 'etc/sane.d/pantum_bm2400.conf'
- 'etc/sane.d/pantum_bm4200.conf'
- 'etc/sane.d/pantum_bm5200.conf'
- 'etc/sane.d/pantum_bm5230.conf'
- 'etc/sane.d/pantum_mfp.conf'
- 'etc/sane.d/dll.d/pantum6500'
- 'etc/sane.d/dll.d/pantum_bm2400'
- 'etc/sane.d/dll.d/pantum_bm4200'
- 'etc/sane.d/dll.d/pantum_bm5200'
- 'etc/sane.d/dll.d/pantum_bm5230'
- 'etc/sane.d/dll.d/pantum_mfp'
-)
-
-source=(
- "${pkgname}-${pkgver}.zip::${_download_url}/${_download_path}/Pantum%20Linux%20Driver%20V${_zipver}.zip"
- 'pantum-ipp-usb.conf'
- 'fix-pantum-ppd.awk'
-)
-sha256sums=(
- 'ce28c1f42e3c6a642cd49af3d6827b63ad4f0484b2151f0594470a1746828a45'
- 'b24a64ae11b9e3b5eb1e5da608b38592b8131644be48e2e8d75d9491750aa6f5'
- '262d88bd34188a401fae2599ed8ac255236cec3b7d86fd22618fcf0f46a11f4e'
-)
+source=("${pkgname}-${pkgver}.zip::${_download_url}/${_download_path}/Pantum%20Linux%20Driver%20V${_zipver}.zip")
+sha256sums=('ce28c1f42e3c6a642cd49af3d6827b63ad4f0484b2151f0594470a1746828a45')
noextract=("${pkgname}-${pkgver}.zip")
prepare() {
@@ -150,84 +133,21 @@ package() {
bsdtar -xOf "${_debname}" data.tar.xz | \
bsdtar --no-same-owner -xpf - -C "$pkgdir"
- # Debian ships duplicate SANE files in /usr/local, which packages must not own.
- rm -rf "$pkgdir/usr/local"
-
- # Use Arch's native SANE library directory.
+ # Keep both vendor SANE trees intact. Arch's SANE loader only searches
+ # /usr/lib/sane, so expose the Debian multiarch tree there with symlinks.
install -d "$pkgdir/usr/lib/sane"
- mv "$pkgdir/usr/lib/x86_64-linux-gnu/sane/"* "$pkgdir/usr/lib/sane/"
- rmdir "$pkgdir/usr/lib/x86_64-linux-gnu/sane" \
- "$pkgdir/usr/lib/x86_64-linux-gnu"
-
- # Vendor udev rules belong in /usr, not in the administrator-owned /etc.
- install -d "$pkgdir/usr/lib/udev/rules.d"
- mv "$pkgdir/etc/udev/rules.d/"*.rules "$pkgdir/usr/lib/udev/rules.d/"
- rmdir "$pkgdir/etc/udev/rules.d" "$pkgdir/etc/udev"
-
- # Do not make USB devices world-writable. Members of lp retain access, and
- # libsane_matched lets Arch's 70-uaccess.rules grant an ACL to active users.
- sed -i \
- -e 's/MODE="0666", OWNER="root", GROUP="lp"/GROUP="lp", MODE="0664"/g' \
- -e '/^LABEL="mud_rules_end"$/d' \
- "$pkgdir/usr/lib/udev/rules.d/"*.rules
-
- # The bundled ipp-usb fork conflicts with Arch's supported ipp-usb package.
- rm -rf "$pkgdir/opt/pantum/ippfilter" "$pkgdir/opt/pantum/{lib}"
- install -Dm644 "$srcdir/pantum-ipp-usb.conf" \
- "$pkgdir/usr/share/ipp-usb/quirks/pantum.conf"
+ local backend
+ for backend in "$pkgdir/usr/lib/x86_64-linux-gnu/sane/"*; do
+ ln -s "../x86_64-linux-gnu/sane/${backend##*/}" \
+ "$pkgdir/usr/lib/sane/${backend##*/}"
+ done
# V1.1.186 PPDs still reference these filters, omitted from the vendor DEB.
ln -s rastertoPantum "$pkgdir/usr/lib/cups/filter/BM2400"
ln -s rastertoPantum "$pkgdir/usr/lib/cups/filter/BP2400"
- # Normalize invalid JCL UI blocks and let Pantum's PDF filters consume
- # standard PDF directly, avoiding a failing bannertopdf/pdftopdf chain.
- local ppd ppd_count=0 original_valid
- while IFS= read -r -d '' ppd; do
- ppd_count=$((ppd_count + 1))
- original_valid=false
- if cupstestppd -q -I filters -W none "$ppd"; then
- original_valid=true
- fi
-
- awk -f "$srcdir/fix-pantum-ppd.awk" "$ppd" > "$ppd.fixed"
-
- if $original_valid &&
- ! cupstestppd -q -I filters -W none "$ppd.fixed"; then
- printf 'PPD normalization broke a valid file: %s\n' \
- "${ppd#$pkgdir/}" >&2
- return 1
- fi
-
- awk -f "$srcdir/fix-pantum-ppd.awk" "$ppd.fixed" \
- > "$ppd.checked"
- if ! cmp -s "$ppd.fixed" "$ppd.checked"; then
- printf 'PPD normalization is not idempotent: %s\n' \
- "${ppd#$pkgdir/}" >&2
- return 1
- fi
-
- rm "$ppd.checked"
- mv "$ppd.fixed" "$ppd"
- done < <(find "$pkgdir/usr/share/cups/model/Pantum" -type f \
- -name '*.ppd' -print0)
-
- if ((ppd_count == 0)); then
- printf '%s\n' 'No Pantum PPD files found in the vendor package' >&2
- return 1
- fi
-
- if grep -R -E '^\*cupsFilter:.*application/vnd\.cups-pdf.*(ptps|phase2filter)' \
- "$pkgdir/usr/share/cups/model/Pantum" >/dev/null; then
- printf '%s\n' 'Unnormalized Pantum PDF filter declarations remain' >&2
- return 1
- fi
-
install -Dm644 EULA "$pkgdir/usr/share/licenses/$pkgname/EULA"
install -Dm644 PRIVACY "$pkgdir/usr/share/licenses/$pkgname/PRIVACY"
install -Dm644 "$pkgdir/usr/share/doc/pantum/copyright" \
"$pkgdir/usr/share/licenses/$pkgname/copyright"
- install -Dm644 "$pkgdir/usr/share/doc/pantum/changelog.gz" \
- "$pkgdir/usr/share/doc/$pkgname/changelog.gz"
- rm -rf "$pkgdir/usr/share/doc/pantum"
}
REUSE.toml
removed +0 -266diff --git a/REUSE.toml b/REUSE.toml
deleted file mode 100644
index 6a08ff4..0000000
--- a/REUSE.toml
+++ /dev/null
@@ -1,13 +0,0 @@
-version = 1
-
-[[annotations]]
-path = [
- ".SRCINFO",
- ".gitignore",
- "PKGBUILD",
- "fix-pantum-ppd.awk",
- "pantum-ipp-usb.conf",
-]
-precedence = "aggregate"
-SPDX-FileCopyrightText = "2026 Ivan Burmin <osguot@vivaldi.net>"
-SPDX-License-Identifier = "0BSD"
fix-pantum-ppd.awk
removed +0 -800diff --git a/fix-pantum-ppd.awk b/fix-pantum-ppd.awk
deleted file mode 100644
index d220156..0000000
--- a/fix-pantum-ppd.awk
+++ /dev/null
@@ -1,47 +0,0 @@
-function flush_ui_block() {
- if (!in_ui_block)
- return
-
- if (has_jcl_setup) {
- sub(/^\*OpenUI /, "*JCLOpenUI ", ui_block)
- sub(/\n\*CloseUI:/, "\n*JCLCloseUI:", ui_block)
- }
-
- printf "%s", ui_block
- ui_block = ""
- in_ui_block = 0
- has_jcl_setup = 0
-}
-
-/^\*cupsFilter:/ &&
-/application\/vnd\.cups-pdf/ &&
-/(ptps|phase2filter)"[[:space:]]*$/ {
- sub(/application\/vnd\.cups-pdf/, "application/pdf")
- print
- next
-}
-
-/^\*OpenUI / {
- flush_ui_block()
- in_ui_block = 1
- ui_block = $0 ORS
- next
-}
-
-in_ui_block {
- ui_block = ui_block $0 ORS
-
- if ($0 ~ /^\*OrderDependency:.*[[:space:]]JCLSetup[[:space:]]/)
- has_jcl_setup = 1
-
- if ($0 ~ /^\*CloseUI:/)
- flush_ui_block()
-
- next
-}
-
-{ print }
-
-END {
- flush_ui_block()
-}
pantum-ipp-usb.conf
removed +0 -103diff --git a/pantum-ipp-usb.conf b/pantum-ipp-usb.conf
deleted file mode 100644
index a86ee23..0000000
--- a/pantum-ipp-usb.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-# The proprietary Pantum driver needs direct access to Pantum USB devices.
-[232b:*]
- blacklist = true
pantum-universal-driver.install
added +3089 -0diff --git a/pantum-universal-driver.install b/pantum-universal-driver.install
new file mode 100644
index 0000000..e73be9b
--- /dev/null
+++ b/pantum-universal-driver.install
@@ -0,0 +1,102 @@
+_pantum_rules_dir=/etc/udev/rules.d
+_pantum_systemd_dir=/usr/lib/systemd/system
+_pantum_ipp_dir=/opt/pantum/ippfilter
+_pantum_bin_dir=/opt/pantum/bin
+
+_pantum_has_ippusbxd() {
+ [[ -f /usr/lib/udev/rules.d/55-ippusbxd.rules &&
+ -f /usr/lib/systemd/system/ippusbxd@.service ]] &&
+ command -v ippusbxd >/dev/null 2>&1
+}
+
+_pantum_has_ipp_usb() {
+ [[ -f /usr/lib/udev/rules.d/71-ipp-usb.rules &&
+ -f /usr/lib/systemd/system/ipp-usb.service &&
+ -x /usr/bin/ipp-usb ]]
+}
+
+_pantum_reload_udev() {
+ udevadm control --reload-rules 2>/dev/null || true
+ udevadm trigger --subsystem-match=usb 2>/dev/null || true
+}
+
+_pantum_install_ipp_overrides() {
+ if _pantum_has_ippusbxd; then
+ if systemctl is-active --quiet pt-ipp-usb.service; then
+ systemctl stop pt-ipp-usb.service || true
+ fi
+ rm -f "$_pantum_rules_dir/71-ipp-usb.rules" \
+ "$_pantum_systemd_dir/pt-ipp-usb.service" \
+ "$_pantum_bin_dir/ipp-usb"
+ install -Dm644 "$_pantum_ipp_dir/55-ippusbxd.rules" \
+ "$_pantum_rules_dir/55-ippusbxd.rules"
+
+ local bus_device service
+ while read -r bus_device; do
+ service="ippusbxd@${bus_device}.service"
+ if systemctl is-active --quiet "$service"; then
+ systemctl stop "$service" || true
+ fi
+ done < <(lsusb -d 232b: | awk -F '[ :]' '{print $2 ":" $4}')
+ elif _pantum_has_ipp_usb; then
+ rm -f "$_pantum_rules_dir/55-ippusbxd.rules"
+ install -Dm644 "$_pantum_ipp_dir/71-ipp-usb.rules" \
+ "$_pantum_rules_dir/71-ipp-usb.rules"
+ install -Dm644 "$_pantum_ipp_dir/pt-ipp-usb.service" \
+ "$_pantum_systemd_dir/pt-ipp-usb.service"
+ install -Dm755 "$_pantum_ipp_dir/ipp-usb" \
+ "$_pantum_bin_dir/ipp-usb"
+ systemctl daemon-reload || true
+
+ if systemctl is-active --quiet ipp-usb.service; then
+ systemctl stop ipp-usb.service || true
+ systemctl start pt-ipp-usb.service || true
+ fi
+ else
+ _pantum_remove_ipp_overrides
+ return
+ fi
+
+ _pantum_reload_udev
+}
+
+_pantum_remove_ipp_overrides() {
+ local restart_ipp_usb=false
+ if systemctl is-active --quiet pt-ipp-usb.service; then
+ restart_ipp_usb=true
+ systemctl stop pt-ipp-usb.service || true
+ fi
+
+ rm -f "$_pantum_rules_dir/55-ippusbxd.rules" \
+ "$_pantum_rules_dir/71-ipp-usb.rules" \
+ "$_pantum_systemd_dir/pt-ipp-usb.service" \
+ "$_pantum_bin_dir/ipp-usb"
+ systemctl daemon-reload || true
+
+ if [[ $restart_ipp_usb == true ]] && _pantum_has_ipp_usb; then
+ systemctl start ipp-usb.service || true
+ fi
+
+ _pantum_reload_udev
+}
+
+post_install() {
+ _pantum_install_ipp_overrides
+ printf 'Pantum %s installed\n' "$1"
+}
+
+post_upgrade() {
+ _pantum_install_ipp_overrides
+ printf 'Pantum upgraded to %s\n' "$1"
+}
+
+pre_upgrade() {
+ rm -f /etc/ld.so.conf.d/pantum.conf
+ ldconfig
+}
+
+pre_remove() {
+ rm -f /etc/ld.so.conf.d/pantum.conf
+ ldconfig
+ _pantum_remove_ipp_overrides
+}