From af27f793d1593bcd2803ea93e305eb3e9fdbbc76 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Fri, 27 Sep 2013 08:40:57 +0000 Subject: [PATCH] Much easier to just patch the vala file. --- graphics/simple-scan/Makefile | 38 +++--- .../simple-scan/patches/patch-configure_ac | 4 +- .../patches/patch-src_simple-scan_c | 115 ------------------ .../patches/patch-src_simple-scan_vala | 43 +++++++ 4 files changed, 66 insertions(+), 134 deletions(-) delete mode 100644 graphics/simple-scan/patches/patch-src_simple-scan_c create mode 100644 graphics/simple-scan/patches/patch-src_simple-scan_vala diff --git a/graphics/simple-scan/Makefile b/graphics/simple-scan/Makefile index 501f60d9b51..261c0adbed4 100644 --- a/graphics/simple-scan/Makefile +++ b/graphics/simple-scan/Makefile @@ -1,15 +1,16 @@ -# $OpenBSD: Makefile,v 1.31 2013/09/26 08:50:48 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.32 2013/09/27 08:40:57 ajacoutot Exp $ -COMMENT= simple scanning utility +COMMENT= simple scanning utility -GNOME_PROJECT= simple-scan -GNOME_VERSION= 3.10.0 +GNOME_PROJECT= simple-scan +GNOME_VERSION= 3.10.0 +REVISION= 0 -CATEGORIES= graphics +CATEGORIES= graphics -HOMEPAGE= https://launchpad.net/simple-scan +HOMEPAGE= https://launchpad.net/simple-scan -MAINTAINER= Antoine Jacoutot +MAINTAINER= Antoine Jacoutot # GPLv3 PERMIT_PACKAGE_CDROM= Yes @@ -19,22 +20,25 @@ WANTLIB += fontconfig freetype gdk-3 gdk_pixbuf-2.0 gio-2.0 glib-2.0 WANTLIB += gmodule-2.0 gobject-2.0 gthread-2.0 gtk-3 m pango-1.0 WANTLIB += pangocairo-1.0 pangoft2-1.0 pthread sane sqlite3 z -MASTER_SITES= https://launchpad.net/simple-scan/${GNOME_VERSION:C/^([0-9]+\.[0-9]+).*/\1/}/${GNOME_VERSION}/+download/ +MASTER_SITES= https://launchpad.net/simple-scan/${GNOME_VERSION:C/^([0-9]+\.[0-9]+).*/\1/}/${GNOME_VERSION}/+download/ -MODULES= devel/gettext \ - x11/gnome \ - devel/dconf +MODULES= devel/gettext \ + x11/gnome \ + devel/dconf -LIB_DEPENDS= graphics/sane-backends \ - x11/gtk+3 \ - graphics/colord +LIB_DEPENDS= graphics/sane-backends \ + x11/gtk+3 \ + graphics/colord MODGNOME_DESKTOP_FILE= Yes MODGNOME_TOOLS= yelp -USE_GMAKE= Yes +USE_GMAKE= Yes -AUTOCONF_VERSION=2.69 -CONFIGURE_STYLE=autoconf no-autoheader +AUTOCONF_VERSION= 2.69 +CONFIGURE_STYLE= autoconf no-autoheader + +# patch-src_simple-scan_vala +BUILD_DEPENDS += lang/vala .include diff --git a/graphics/simple-scan/patches/patch-configure_ac b/graphics/simple-scan/patches/patch-configure_ac index 568bbbfc2ea..a505764cd71 100644 --- a/graphics/simple-scan/patches/patch-configure_ac +++ b/graphics/simple-scan/patches/patch-configure_ac @@ -1,6 +1,6 @@ -$OpenBSD: patch-configure_ac,v 1.3 2013/09/26 08:50:48 ajacoutot Exp $ +$OpenBSD: patch-configure_ac,v 1.4 2013/09/27 08:40:57 ajacoutot Exp $ -No gudev under OpenBSD. +No (g)udev under OpenBSD. --- configure.ac.orig Wed Sep 25 07:40:41 2013 +++ configure.ac Thu Sep 26 10:28:39 2013 diff --git a/graphics/simple-scan/patches/patch-src_simple-scan_c b/graphics/simple-scan/patches/patch-src_simple-scan_c deleted file mode 100644 index d9b8f96bca9..00000000000 --- a/graphics/simple-scan/patches/patch-src_simple-scan_c +++ /dev/null @@ -1,115 +0,0 @@ -$OpenBSD: patch-src_simple-scan_c,v 1.7 2013/09/26 08:50:48 ajacoutot Exp $ ---- src/simple-scan.c.orig Thu Sep 26 10:29:05 2013 -+++ src/simple-scan.c Thu Sep 26 10:38:12 2013 -@@ -15,7 +15,9 @@ - #include - #include - #include -+#ifndef __OpenBSD__ - #include -+#endif - #include - #include - #include -@@ -158,7 +160,9 @@ struct _SimpleScanClass { - struct _SimpleScanPrivate { - ScanDevice* default_device; - gboolean have_devices; -+#ifndef __OpenBSD__ - GUdevClient* udev_client; -+#endif - UserInterface* ui; - Scanner* scanner; - Book* book; -@@ -332,8 +336,10 @@ static void simple_scan_scanner_failed_cb (SimpleScan* - static void _simple_scan_scanner_failed_cb_scanner_scan_failed (Scanner* _sender, gint error_code, const gchar* error_string, gpointer self); - static void simple_scan_scanner_scanning_changed_cb (SimpleScan* self, Scanner* scanner); - static void _simple_scan_scanner_scanning_changed_cb_scanner_scanning_changed (Scanner* _sender, gpointer self); -+#ifndef __OpenBSD__ - static void simple_scan_on_uevent (SimpleScan* self, GUdevClient* client, const gchar* action, GUdevDevice* device); - static void _simple_scan_on_uevent_g_udev_client_uevent (GUdevClient* _sender, const gchar* action, GUdevDevice* device, gpointer self); -+#endif - void user_interface_set_scan_devices (UserInterface* self, GList* devices); - void user_interface_set_selected_device (UserInterface* self, const gchar* device); - static void _scan_device_unref0_ (gpointer var); -@@ -521,11 +527,13 @@ static void _simple_scan_scanner_scanning_changed_cb_s - } - - -+#ifndef __OpenBSD__ - static void _simple_scan_on_uevent_g_udev_client_uevent (GUdevClient* _sender, const gchar* action, GUdevDevice* device, gpointer self) { - #line 67 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - simple_scan_on_uevent (self, _sender, action, device); - #line 528 "simple-scan.c" - } -+#endif - - - static void _scan_device_unref0_ (gpointer var) { -@@ -569,8 +577,10 @@ static void simple_scan_real_startup (GApplication* ba - gint _subsystems_size_; - gchar** _tmp18_; - gint _tmp18__length1; -+#ifndef __OpenBSD__ - GUdevClient* _tmp19_; - GUdevClient* _tmp20_; -+#endif - ScanDevice* _tmp21_; - #line 44 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - self = (SimpleScan*) base; -@@ -662,6 +672,7 @@ static void simple_scan_real_startup (GApplication* ba - _tmp18_ = subsystems; - #line 66 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - _tmp18__length1 = subsystems_length1; -+#ifndef __OpenBSD__ - #line 66 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - _tmp19_ = g_udev_client_new (_tmp18_); - #line 66 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" -@@ -672,6 +683,7 @@ static void simple_scan_real_startup (GApplication* ba - _tmp20_ = self->priv->udev_client; - #line 67 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - g_signal_connect_object (_tmp20_, "uevent", (GCallback) _simple_scan_on_uevent_g_udev_client_uevent, self, 0); -+#endif - #line 69 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - _tmp21_ = self->priv->default_device; - #line 69 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" -@@ -752,10 +764,12 @@ static void simple_scan_real_shutdown (GApplication* b - _user_interface_unref0 (self->priv->ui); - #line 90 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - self->priv->ui = NULL; -+#ifndef __OpenBSD__ - #line 91 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - _g_object_unref0 (self->priv->udev_client); - #line 91 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - self->priv->udev_client = NULL; -+#endif - #line 92 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - _tmp0_ = self->priv->scanner; - #line 92 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" -@@ -2596,6 +2610,7 @@ static void simple_scan_log_cb (const gchar* log_domai - } - - -+#ifndef __OpenBSD__ - static void simple_scan_on_uevent (SimpleScan* self, GUdevClient* client, const gchar* action, GUdevDevice* device) { - Scanner* _tmp0_; - #line 453 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" -@@ -2612,6 +2627,7 @@ static void simple_scan_on_uevent (SimpleScan* self, G - scanner_redetect (_tmp0_); - #line 2613 "simple-scan.c" - } -+#endif - - - static glong string_strnlen (gchar* str, glong maxlen) { -@@ -3763,8 +3779,10 @@ static void simple_scan_finalize (GObject* obj) { - self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SIMPLE_SCAN, SimpleScan); - #line 32 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - _scan_device_unref0 (self->priv->default_device); -+#ifndef __OpenBSD__ - #line 34 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - _g_object_unref0 (self->priv->udev_client); -+#endif - #line 35 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" - _user_interface_unref0 (self->priv->ui); - #line 36 "/home/bob/bzr/simple-scan/trunk/src/simple-scan.vala" diff --git a/graphics/simple-scan/patches/patch-src_simple-scan_vala b/graphics/simple-scan/patches/patch-src_simple-scan_vala new file mode 100644 index 00000000000..5cf83148fd5 --- /dev/null +++ b/graphics/simple-scan/patches/patch-src_simple-scan_vala @@ -0,0 +1,43 @@ +$OpenBSD: patch-src_simple-scan_vala,v 1.1 2013/09/27 08:40:58 ajacoutot Exp $ + +No (g)udev under OpenBSD. + +--- src/simple-scan.vala.orig Fri Sep 27 10:33:59 2013 ++++ src/simple-scan.vala Fri Sep 27 10:34:10 2013 +@@ -31,7 +31,6 @@ public class SimpleScan : Gtk.Application + + private ScanDevice? default_device = null; + private bool have_devices = false; +- private GUdev.Client udev_client; + private UserInterface ui; + private Scanner scanner; + private Book book; +@@ -63,8 +62,6 @@ public class SimpleScan : Gtk.Application + scanner.scanning_changed.connect (scanner_scanning_changed_cb); + + string[]? subsystems = { "usb", null }; +- udev_client = new GUdev.Client (subsystems); +- udev_client.uevent.connect (on_uevent); + + if (default_device != null) + { +@@ -88,7 +85,6 @@ public class SimpleScan : Gtk.Application + base.shutdown (); + book = null; + ui = null; +- udev_client = null; + scanner.free (); + } + +@@ -448,11 +444,6 @@ public class SimpleScan : Gtk.Application + log_file.printf ("[%+.2fs] %s %s\n", log_timer.elapsed (), prefix, message); + if (debug_enabled) + stderr.printf ("[%+.2fs] %s %s\n", log_timer.elapsed (), prefix, message); +- } +- +- private void on_uevent (GUdev.Client client, string action, GUdev.Device device) +- { +- scanner.redetect (); + } + + private static void fix_pdf (string filename) throws Error