From: W.C.A. Wijngaards Date: Wed, 29 Jul 2026 09:14:22 +0000 (+0200) Subject: * Fix: python rdf2str for added RDF types, and fix python version X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fldns.git * Fix: python rdf2str for added RDF types, and fix python version check in configure for swig check, and fix to not pass deprecated option to swig with new swig version. --- diff --git a/Changelog b/Changelog index 270f8e5e..363dd9e0 100644 --- a/Changelog +++ b/Changelog @@ -11,6 +11,9 @@ * Fix to parse SVCB and HTTPS svcparam ech=0. * Fix #314: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility + * Fix: python rdf2str for added RDF types, and fix python version + check in configure for swig check, and fix to not pass deprecated + option to swig with new swig version. 1.9.2 2026-06-10 * Fix to set VERSION_INFO to create .so.3 instead of .so.11 which will diff --git a/configure.ac b/configure.ac index eaf605e0..a7082ce0 100644 --- a/configure.ac +++ b/configure.ac @@ -252,21 +252,15 @@ if test x_$withval != x_no; then ldns_have_python=yes fi - # pass additional Python 3 option to SWIG - if test `$PYTHON -c "import sys; \ - ver = sys.version.split()[[0]]; \ - print(ver >= '3')"` = "True"; then - AC_SUBST(SWIGPY3, ["-py3 -DPY3"]) - fi - # check for SWIG if test x_$ldns_have_python != x_no; then sinclude(ax_pkg_swig.m4) # check for >=SWIG-2.0.4 if Python 3.2 used if test `$PYTHON -c "import sys; \ - ver = sys.version.split()[[0]]; \ - print(ver >= '3.2')"` = "True"; then + ver = sys.version.split()[[0]].split('.'); \ + print(int(ver[[0]]) > 3 or (int(ver[[0]])==3 and int(ver[[1]])>=2))"` \ + = "True"; then AX_PKG_SWIG(2.0.4, [], [AC_MSG_ERROR([SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater.])]) else AX_PKG_SWIG @@ -280,6 +274,21 @@ if test x_$withval != x_no; then AC_SUBST(swig, "$SWIG") ldns_with_pyldns=yes fi + # pass additional Python 3 option to SWIG + if test `$PYTHON -c "import sys; \ + ver = sys.version.split()[[0]].split('.')[[0]]; \ + print(int(ver) >= 3)"` = "True" \ + -a -n "$available_swig_vernum" ; then + # have options when swig is older than 4.1.1 + check_major=4 + check_minor=1 + check_patch=1 + required_swig_vernum=`expr $check_major \* 10000 \ + \+ $check_minor \* 100 \+ $check_patch` + if test "$available_swig_vernum" -lt "$required_swig_vernum"; then + AC_SUBST(SWIGPY3, ["-py3 -DPY3"]) + fi + fi else AC_MSG_RESULT([*** don't have Python, skipping SWIG, no pyldns ***]) # ' fi diff --git a/contrib/python/ldns_rdf.i b/contrib/python/ldns_rdf.i index ed1f0d00..f0c16989 100644 --- a/contrib/python/ldns_rdf.i +++ b/contrib/python/ldns_rdf.i @@ -252,6 +252,7 @@ case LDNS_RDF_TYPE_INT8: return "INT8"; case LDNS_RDF_TYPE_INT16: return "INT16"; case LDNS_RDF_TYPE_INT32: return "INT32"; + case LDNS_RDF_TYPE_INT64: return "INT64"; case LDNS_RDF_TYPE_A: return "A"; case LDNS_RDF_TYPE_AAAA: return "AAAA"; case LDNS_RDF_TYPE_STR: return "STR"; @@ -282,10 +283,12 @@ case LDNS_RDF_TYPE_ILNP64: return "ILNP64"; case LDNS_RDF_TYPE_EUI48: return "EUI48"; case LDNS_RDF_TYPE_EUI64: return "EUI64"; + case LDNS_RDF_TYPE_UNQUOTED: return "UNQUOTED"; case LDNS_RDF_TYPE_TAG: return "TAG"; case LDNS_RDF_TYPE_LONG_STR: return "LONG_STR"; case LDNS_RDF_TYPE_AMTRELAY: return "AMTRELAY"; case LDNS_RDF_TYPE_SVCPARAMS: return "SVCPARAMS"; + case LDNS_RDF_TYPE_IPN: return "IPN"; case LDNS_RDF_TYPE_CERTIFICATE_USAGE: return "CERTIFICATE_USAGE"; case LDNS_RDF_TYPE_SELECTOR: return "SELECTOR";