public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-gfx/sane-frontends/files/, media-gfx/sane-frontends/
@ 2017-08-12 17:55 Amy Liffey
  0 siblings, 0 replies; 2+ messages in thread
From: Amy Liffey @ 2017-08-12 17:55 UTC (permalink / raw
  To: gentoo-commits

commit:     c0fa8b1d326f4fd0b18ad38d49336558b8d47796
Author:     Amy Liffey <amynka <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 12 17:54:41 2017 +0000
Commit:     Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Sat Aug 12 17:55:04 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0fa8b1d

media-gfx/sane-frontends: EAPI 6 bump

Package-Manager: Portage-2.3.6, Repoman-2.3.1

 .../sane-frontends/files/MissingCapsFlag.patch     |  4 +-
 .../sane-frontends/sane-frontends-1.0.14-r1.ebuild | 54 ++++++++++++++++++++++
 2 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/media-gfx/sane-frontends/files/MissingCapsFlag.patch b/media-gfx/sane-frontends/files/MissingCapsFlag.patch
index 4175a87f8e6..226ca085713 100644
--- a/media-gfx/sane-frontends/files/MissingCapsFlag.patch
+++ b/media-gfx/sane-frontends/files/MissingCapsFlag.patch
@@ -1,5 +1,5 @@
---- src/gtkglue.c	2005-04-16 15:12:07.000000000 +0200
-+++ src/gtkglue.c.new	2009-06-24 00:26:46.000000000 +0200
+--- a/src/gtkglue.c	2005-04-16 15:12:07.000000000 +0200
++++ b/src/gtkglue.c	2009-06-24 00:26:46.000000000 +0200
 @@ -1476,8 +1476,7 @@
  	  || opt->type == SANE_TYPE_GROUP || !dialog->element[i].widget)
  	continue;

diff --git a/media-gfx/sane-frontends/sane-frontends-1.0.14-r1.ebuild b/media-gfx/sane-frontends/sane-frontends-1.0.14-r1.ebuild
new file mode 100644
index 00000000000..26cd1d46586
--- /dev/null
+++ b/media-gfx/sane-frontends/sane-frontends-1.0.14-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+DESCRIPTION="Scanner Access Now Easy"
+HOMEPAGE="http://www.sane-project.org"
+SRC_URI="ftp://ftp.sane-project.org/pub/sane/${P}/${P}.tar.gz
+	ftp://ftp.sane-project.org/pub/sane/old-versions/${P}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="gimp"
+
+RDEPEND=""
+DEPEND="media-gfx/sane-backends
+	gimp? ( media-gfx/gimp )"
+
+PATCHES=( "${FILESDIR}/MissingCapsFlag.patch" )
+
+src_configure () {
+	local myconf=""
+	use gimp || myconf="--disable-gimp"
+	use gimp && ! has_version ">=media-gfx/gimp-2" && myconf="--enable-gimp12"
+	econf \
+		--datadir=/usr/share/misc \
+		${myconf}
+	emake
+}
+
+src_install () {
+	local gimpplugindir
+	local gimptool
+	emake DESTDIR="${D}" install
+	if use gimp; then
+		for gimptool in gimptool gimptool-2.0 gimptool-1.2; do
+			if [ -x /usr/bin/${gimptool} ]; then
+				einfo "Setting plugin link for GIMP version	$(/usr/bin/${gimptool} --version)"
+				gimpplugindir=$(/usr/bin/${gimptool} --gimpplugindir)/plug-ins
+				break
+			fi
+		done
+		if [ "/plug-ins" != "${gimpplugindir}" ]; then
+			 dodir ${gimpplugindir}
+			dosym /usr/bin/xscanimage ${gimpplugindir}/xscanimage
+		else
+			ewarn "No idea where to find the gimp plugin directory"
+		fi
+	fi
+	dodoc AUTHORS Changelog NEWS PROBLEMS README
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-gfx/sane-frontends/files/, media-gfx/sane-frontends/
@ 2025-02-12 17:26 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2025-02-12 17:26 UTC (permalink / raw
  To: gentoo-commits

commit:     4d1a76c2d027626a55d2822a3d78c6aeb7f229f0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 12 17:25:41 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 12 17:26:16 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d1a76c2

media-gfx/sane-frontends: avoid BDEPEND on gtk+

Same as 84b9d64c5f3592acf05c6e728afec29b2440b1fd. It is a hack and I
could be convinced to get rid of it, but I sort of get the impression
that users of sane-frontends might appreciate this, so...

Closes: https://bugs.gentoo.org/949670
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-gfx/sane-frontends/files/gtk-2.0.m4          | 189 +++++++++++++++++++++
 .../sane-frontends/sane-frontends-1.0.14-r7.ebuild |   3 +-
 2 files changed, 191 insertions(+), 1 deletion(-)

diff --git a/media-gfx/sane-frontends/files/gtk-2.0.m4 b/media-gfx/sane-frontends/files/gtk-2.0.m4
new file mode 100644
index 000000000000..a89477fabbb7
--- /dev/null
+++ b/media-gfx/sane-frontends/files/gtk-2.0.m4
@@ -0,0 +1,189 @@
+# Configure paths for GTK+
+# Owen Taylor     1997-2001
+
+# Version number used by aclocal, see `info automake Serials`.
+# Increment on every change.
+#serial 1
+
+dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 
+dnl pass to pkg-config
+dnl
+AC_DEFUN([AM_PATH_GTK_2_0],
+[dnl 
+dnl Get the cflags and libraries from pkg-config
+dnl
+AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
+		    , enable_gtktest=yes)
+
+  pkg_config_args=gtk+-2.0
+  for module in . $4
+  do
+      case "$module" in
+         gthread) 
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+      esac
+  done
+
+  no_gtk=""
+
+  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+  PKG_PROG_PKG_CONFIG([0.7])
+
+  min_gtk_version=ifelse([$1], ,2.0.0,$1)
+  AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
+
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+	  echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
+	  enable_gtktest=no
+    fi
+
+    if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
+	  :
+    else
+	  no_gtk=yes
+    fi
+  fi
+
+  if test x"$no_gtk" = x ; then
+    GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
+    GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
+    gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_gtktest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GTK_CFLAGS"
+      LIBS="$GTK_LIBS $LIBS"
+dnl
+dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
+dnl checks the results of pkg-config to some extent)
+dnl
+      rm -f conf.gtktest
+      AC_TRY_RUN([
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  fclose (fopen ("conf.gtktest", "w"));
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_gtk_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_gtk_version");
+     exit(1);
+   }
+
+  if ((gtk_major_version != $gtk_config_major_version) ||
+      (gtk_minor_version != $gtk_config_minor_version) ||
+      (gtk_micro_version != $gtk_config_micro_version))
+    {
+      printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
+             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
+             gtk_major_version, gtk_minor_version, gtk_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    } 
+  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
+	   (gtk_minor_version != GTK_MINOR_VERSION) ||
+           (gtk_micro_version != GTK_MICRO_VERSION))
+    {
+      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
+	     GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     gtk_major_version, gtk_minor_version, gtk_micro_version);
+    }
+  else
+    {
+      if ((gtk_major_version > major) ||
+        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
+               gtk_major_version, gtk_minor_version, gtk_micro_version);
+        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_gtk" = x ; then
+     AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://pkgconfig.sourceforge.net"
+     else
+       if test -f conf.gtktest ; then
+        :
+       else
+          echo "*** Could not run GTK+ test program, checking why..."
+	  ac_save_CFLAGS="$CFLAGS"
+	  ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GTK_CFLAGS"
+          LIBS="$LIBS $GTK_LIBS"
+          AC_TRY_LINK([
+#include <gtk/gtk.h>
+#include <stdio.h>
+],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
+          echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GTK_CFLAGS=""
+     GTK_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GTK_CFLAGS)
+  AC_SUBST(GTK_LIBS)
+  rm -f conf.gtktest
+])

diff --git a/media-gfx/sane-frontends/sane-frontends-1.0.14-r7.ebuild b/media-gfx/sane-frontends/sane-frontends-1.0.14-r7.ebuild
index 3a01f21423be..90e84ef635a9 100644
--- a/media-gfx/sane-frontends/sane-frontends-1.0.14-r7.ebuild
+++ b/media-gfx/sane-frontends/sane-frontends-1.0.14-r7.ebuild
@@ -37,7 +37,8 @@ S="${WORKDIR}"/"${PN}"-upstream-"${PV}"
 src_prepare() {
 	default
 
-	# Needed for C99 patch (acinclude hack to avoid BDEPEND on gimp)
+	# Needed for C99 patch (acinclude hack to avoid BDEPEND on gtk+, gimp)
+	cat "${FILESDIR}"/gtk-2.0.m4 >> acinclude.m4 || die
 	cat "${FILESDIR}"/gimp-2.0.m4 >> acinclude.m4 || die
 	eautoreconf
 }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-12 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12 17:26 [gentoo-commits] repo/gentoo:master commit in: media-gfx/sane-frontends/files/, media-gfx/sane-frontends/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2017-08-12 17:55 Amy Liffey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox