delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2020/12/20/20:21:31

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Mon, 21 Dec 2020 02:02:20 +0100 (CET)
From: Roland Lutz <rlutz AT hedmen DOT org>
To: "Girvin Herr (gherrl AT fastmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
Subject: Re: [geda-user] Problem with Guile 2.2.4 dependency for gEDA
1.10.1.
In-Reply-To: <1277282c-52c2-6ab9-5e7b-ce4fdeb95b84@fastmail.com>
Message-ID: <alpine.DEB.2.21.2012210158220.5679@nimbus>
References: <f5ab1b6f-dbf3-4be3-a43f-eb74b32b7a51 AT fastmail DOT com> <alpine DOT DEB DOT 2 DOT 21 DOT 2012190043450 DOT 7556 AT nimbus> <alpine DOT DEB DOT 2 DOT 21 DOT 2012191400380 DOT 24569 AT nimbus> <20201219180603 DOT 22277 DOT qmail AT stuge DOT se> <a3f3b383-ebf2-fc8a-6405-e1d69c2a6838 AT epilitimus DOT com>
<20201219205836 DOT 23919 DOT qmail AT stuge DOT se> <ccee0a93-a553-f351-901b-1f986a8eba2e AT epilitimus DOT com> <alpine DOT DEB DOT 2 DOT 21 DOT 2012201503460 DOT 17210 AT nimbus> <1277282c-52c2-6ab9-5e7b-ce4fdeb95b84 AT fastmail DOT com>
User-Agent: Alpine 2.21 (DEB 202 2017-01-01)
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, 20 Dec 2020, Girvin Herr (gherrl AT fastmail DOT com) [via 
geda-user AT delorie DOT com] wrote:
> I am having problems with the html patch from your URL above.

This isn't really intended for applying from the HTML version, it's more 
of a concentient way to view Git commits from the web.  In order to create 
a plain text patch, use:

   git clone git://git.geda-project.org/geda-gaf
   git format-patch 1.10.1-20201216..stable-1.10

Here's the patch, but beware of whitespace and/or line break errors:



diff --git a/configure.ac b/configure.ac
index d03ba1b58..1e66194b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,7 +81,7 @@ AX_DESKTOP_I18N

  PKG_PROG_PKG_CONFIG

-AX_CHECK_GUILE([2.2.4])
+AX_CHECK_GUILE([2.0.10])

  PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.58.3], ,
    AC_MSG_ERROR([GLib 2.58.3 or later is required.]))
diff --git a/m4/geda-guile.m4 b/m4/geda-guile.m4
index ea3f2433d..bbdf67b7b 100644
--- a/m4/geda-guile.m4
+++ b/m4/geda-guile.m4
@@ -34,9 +34,20 @@ AC_DEFUN([AX_CHECK_GUILE],
    GUILE_MIN_MINOR=`echo ${GUILE_MIN_VER} | sed -e 's;[[^\.]]*\.;;' -e 's;\..*;;g'`
    GUILE_MIN_TEENY=`echo ${GUILE_MIN_VER} | sed -e 's;.*\.;;'`

+  _found_pkg_config_guile=yes
    PKG_CHECK_MODULES(GUILE, [guile-2.2 >= $GUILE_MIN_VER],
-                           [GUILE_PKG_NAME=guile-2.2],
-                           [AC_MSG_ERROR([you need Guile 2.2 (at least version ${GUILE_MIN_VER})])])
+                           [GUILE_PKG_NAME=guile-2.2], [_found_pkg_config_guile=no])
+
+  if test "${_found_pkg_config_guile}" = "no" ; then
+   PKG_CHECK_MODULES(GUILE, [guile-2.0 >= $GUILE_MIN_VER],
+                            [_found_pkg_config_guile=yes
+                             GUILE_PKG_NAME=guile-2.0],
+                            [_found_pkg_config_guile=no])
+  fi
+
+  if test "${_found_pkg_config_guile}" = "no" ; then
+    AC_MSG_ERROR([you need Guile 2.x (at least version ${GUILE_MIN_VER})])
+  fi

    AC_SUBST([GUILE_PKG_NAME])

diff --git a/xorn/configure.ac b/xorn/configure.ac
index 084438996..9818eacbc 100644
--- a/xorn/configure.ac
+++ b/xorn/configure.ac
@@ -34,7 +34,9 @@ AM_PATH_PYTHON([2.7])
  PKG_CHECK_MODULES([PYTHON], [python-2.7 >= 2.7],, [
    PKG_CHECK_MODULES([PYTHON], [python2 >= 2.7])
  ])
-PKG_CHECK_MODULES([GUILE], [guile-2.2 >= 2.2.4])
+PKG_CHECK_MODULES([GUILE], [guile-2.2],, [
+  PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.10])
+])

  AM_GNU_GETTEXT([external])
  AM_GNU_GETTEXT_VERSION([0.19.8])
diff --git a/xorn/src/cpython/guile/module.h b/xorn/src/cpython/guile/module.h
index 249c0709f..b2f9ae599 100644
--- a/xorn/src/cpython/guile/module.h
+++ b/xorn/src/cpython/guile/module.h
@@ -29,6 +29,9 @@ extern PyTypeObject ProcedureType;
  extern PyObject *guile_error;
  extern SCM gsubr_alist;

+SCM scm_procedure_or_name(SCM proc);
+SCM scm_frame_procedure_or_name(SCM frame);
+
  SCM py2scm(PyObject *value);
  PyObject *scm2py(SCM value);

diff --git a/xorn/src/cpython/guile/proc.c b/xorn/src/cpython/guile/proc.c
index f29f3a2d2..97f0d6cde 100644
--- a/xorn/src/cpython/guile/proc.c
+++ b/xorn/src/cpython/guile/proc.c
@@ -17,6 +17,25 @@
  #include "module.h"


+SCM scm_procedure_or_name(SCM proc)
+{
+#if SCM_MINOR_VERSION < 2
+	return proc;
+#else
+	return scm_procedure_name(proc);
+#endif
+}
+
+SCM scm_frame_procedure_or_name(SCM frame)
+{
+#if SCM_MINOR_VERSION < 2
+	return scm_frame_procedure(frame);
+#else
+	return scm_frame_procedure_name(frame);
+#endif
+}
+
+
  struct call_data {
  	SCM proc;
  	PyObject *args;
diff --git a/xorn/src/cpython/guile/py2scm.c b/xorn/src/cpython/guile/py2scm.c
index 3a2ce619a..49caec914 100644
--- a/xorn/src/cpython/guile/py2scm.c
+++ b/xorn/src/cpython/guile/py2scm.c
@@ -64,7 +64,7 @@ static SCM call_callable(SCM scm_args)
  {
  	SCM stack = scm_make_stack(SCM_BOOL_T, SCM_EOL);
  	SCM frame = scm_stack_ref(stack, scm_from_int(0));
-	SCM name = scm_frame_procedure_name(frame);
+	SCM name = scm_frame_procedure_or_name(frame);
  	PyObject *callable = scm_to_pointer(scm_assq_ref(gsubr_alist, name));

  	scm_dynwind_begin(0);
@@ -151,7 +151,7 @@ SCM py2scm(PyObject *value)
  		SCM gsubr = scm_c_make_gsubr(name, 0, 0, 1, &call_callable);
  		Py_INCREF(value);
  		SCM ptr = scm_from_pointer(value, (void (*)(void *))Py_DecRef);
-		gsubr_alist = scm_acons(scm_procedure_name(gsubr), ptr,
+		gsubr_alist = scm_acons(scm_procedure_or_name(gsubr), ptr,
  					gsubr_alist);
  		return gsubr;
  	}
diff --git a/xorn/src/cpython/guile/scm2py.c b/xorn/src/cpython/guile/scm2py.c
index baf72f045..3fd235214 100644
--- a/xorn/src/cpython/guile/scm2py.c
+++ b/xorn/src/cpython/guile/scm2py.c
@@ -64,7 +64,8 @@ PyObject *scm2py(SCM value)
  		return result;
  	}
  	if (scm_to_bool(scm_procedure_p(value))) {
-		SCM ptr = scm_assq_ref(gsubr_alist, scm_procedure_name(value));
+		SCM ptr = scm_assq_ref(gsubr_alist,
+				       scm_procedure_or_name(value));
  		if (!scm_is_false(ptr)) {
  			PyObject *result = scm_to_pointer(ptr);
  			Py_INCREF(result);
-- 
2.20.1

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019