Control: tags -1 +patch

The autotools scripts here are very old. See
https://gitlab.com/sane-project/frontends/-/issues/40

I wasn't able to easily run autoreconf without libgimp2.0-dev
installed but we can't have that installed because it is going away.
So I just stopped running autoreconf. That might mean that this code
will fail to build on newer architectures.

Once I skipped running dh_autoreconf, then dh_auto_configure stopped
working because it doesn't recognize --runstatedir= so I manually ran
./configure instead. This is suggested in dh_auto_configure's manpage
and there are a few other Debian packages doing similarly.

I'm attaching the patches to make those changes.

Alternatively, you may want to try packaging a git snapshot which now
uses GTK3 instead of GTK2 and may work with gimp 3. If you do that,
you might also need
https://gitlab.com/sane-project/frontends/-/merge_requests/16

Is anyone even using sane-frontends? It might make more sense to
remove sane-frontends from Debian. People can use apps like
simple-scan or xsane or kylin-scanner instead.

Thank you,
Jeremy Bícha
From ee0f6851dc6229e44755d07638b28ffcf1403d33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jeremy=20B=C3=ADcha?= <jeremy.bi...@canonical.com>
Date: Tue, 10 Dec 2024 16:05:49 -0500
Subject: [PATCH 2/2] Avoid dh_autoreconf and --runstatedir since the autotools
 here is too old

---
 debian/rules | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/debian/rules b/debian/rules
index 9a9f518..b28ff1c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,7 +5,13 @@
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 %:
-	dh  $@
+	dh  $@ --without autoreconf
 
+# This project is too old to understand --runstatedir
+# We could use debhelper compat 10 or just do this manually:
 override_dh_auto_configure:
-	dh_auto_configure -- --disable-gimp
+	./configure --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man \
+	--infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking \
+	--disable-silent-rules --libdir=\${prefix}/lib/$(DEB_BUILD_GNU_TYPE) --disable-maintainer-mode \
+	--disable-dependency-tracking \
+	--disable-gimp
-- 
2.45.2

From 9d8de6f12fd059c6778ecd7d4dc1e3471be2d955 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jeremy=20B=C3=ADcha?= <jeremy.bi...@canonical.com>
Date: Fri, 22 Nov 2024 14:46:04 -0500
Subject: [PATCH 1/2] Build without gimp plugin

Also remove obsolete preinst fix included in Debian 10

Gbp-Dch: Full

Closes: #1088081
---
 debian/control      |  1 -
 debian/rules        |  3 +++
 debian/sane.dirs    |  1 -
 debian/sane.install |  1 -
 debian/sane.links   |  1 -
 debian/sane.preinst | 20 --------------------
 6 files changed, 3 insertions(+), 24 deletions(-)
 delete mode 100644 debian/sane.dirs
 delete mode 100644 debian/sane.links
 delete mode 100644 debian/sane.preinst

diff --git a/debian/control b/debian/control
index 31eb67c..95baf1c 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,6 @@ Standards-Version: 4.6.2.0
 Rules-Requires-Root: no
 Build-Depends:
  debhelper-compat (= 13),
- libgimp2.0-dev,
  libgtk2.0-dev,
  libsane-dev
 Homepage: http://www.sane-project.org
diff --git a/debian/rules b/debian/rules
index e3a8c6e..9a9f518 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,3 +6,6 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 %:
 	dh  $@
+
+override_dh_auto_configure:
+	dh_auto_configure -- --disable-gimp
diff --git a/debian/sane.dirs b/debian/sane.dirs
deleted file mode 100644
index a356f1d..0000000
--- a/debian/sane.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/gimp/2.0/plug-ins
diff --git a/debian/sane.install b/debian/sane.install
index 25e252c..d40d673 100644
--- a/debian/sane.install
+++ b/debian/sane.install
@@ -1,2 +1 @@
 debian/xscanimage-icon-32x32-2.xpm usr/share/sane
-debian/sane/usr/bin/xscanimage usr/lib/gimp/2.0/plug-ins/xscanimage
diff --git a/debian/sane.links b/debian/sane.links
deleted file mode 100644
index 1ad6c2f..0000000
--- a/debian/sane.links
+++ /dev/null
@@ -1 +0,0 @@
-#usr/bin/xscanimage usr/lib/gimp/2.0/plug-ins/xscanimage
diff --git a/debian/sane.preinst b/debian/sane.preinst
deleted file mode 100644
index 9b78cf4..0000000
--- a/debian/sane.preinst
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-set -e
-
-case "$1" in
-    install|upgrade|abort-upgrade)
-#
-# remove obsolete link
-#
-	if [ -L /usr/lib/gimp/2.0/plug-ins/xscanimage ] ; then
-	    rm -f /usr/lib/gimp/2.0/plug-ins/xscanimage
-	fi
-	;;
-    *)
-        echo "preinst called with unknown argument \`$1'" >&2
-        exit 1
-	;;
-esac
-
-
-#DEBHELPER#
-- 
2.45.2

Reply via email to