Mail Archives: geda-user/2020/12/20/20:21:31
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 -