g-ir-scanner fails with python-3.8

Marco Atzeri marco.atzeri@gmail.com
Sun May 23 04:45:54 GMT 2021


On 23.05.2021 06:01, Marco Atzeri wrote:
> On 23.05.2021 05:51, Marco Atzeri wrote:
>> On 23.05.2021 01:44, Lemures Lemniscati via Cygwin-apps wrote:
>>> On Wed, 19 May 2021 22:09:59 +0100, Jon Turney
>>>> On 19/05/2021 20:32, Ken Brown via Cygwin-apps wrote:
> 
>>>
>>> Here are patches...
>>>


assuming I recovered correcttl the file,
they build on my 32bit and pass all tests.

scullywag error is very curious:
------------------------------------------------
   GICOMP 
/cygdrive/c/projects/playground/gobject-introspection-1.54.1-4.i686/src/gobject-introspection-1.54.1/gir/win32-1.0.gir
   GICOMP   gir/cairo-1.0.gir
Traceback (most recent call last):
   File "/usr/lib/python3.8/distutils/unixccompiler.py", line 127, in 
_compile
     self.spawn(compiler_so + cc_args + [src, '-o', obj] +
   File "/usr/lib/python3.8/distutils/ccompiler.py", line 910, in spawn
     spawn(cmd, dry_run=self.dry_run)
   File "/usr/lib/python3.8/distutils/spawn.py", line 36, in spawn
     _spawn_posix(cmd, search_path, dry_run=dry_run)
   File "/usr/lib/python3.8/distutils/spawn.py", line 147, in _spawn_posix
     raise DistutilsExecError(
distutils.errors.DistutilsExecError: command 'gcc' terminated by signal 11
During handling of the above exception, another exception occurred:
-------------------------------------------------

maybe it exceedes the 32bit assigned limits on the machine ?
-------------- next part --------------
At least with 2.7 and 3.2, each argument is output on a separate line;
the results are identical, and the resulting newline messes up the
AC_SUBST.

--- origsrc/gobject-introspection-1.36.0/m4/python.m4	2012-12-18 10:27:16.000000000 -0600
+++ src/gobject-introspection-1.36.0/m4/python.m4	2013-08-04 22:06:23.578220400 -0500
@@ -64,7 +64,7 @@ AC_DEFUN([AM_CHECK_PYTHON_LIBS],
 AC_MSG_CHECKING(for libraries required to link against libpython)
 dnl deduce PYTHON_LIBS
 if test "x$PYTHON_LIBS" = x; then
-	PYTHON_LIBS=`$PYTHON-config --ldflags --libs`
+	PYTHON_LIBS=`$PYTHON-config --libs`
 fi
 AC_SUBST(PYTHON_LIBS)
 dnl check if libpython exist:
-------------- next part --------------
--- origsrc/gobject-introspection-1.36.0/tests/scanner/GetType-1.0-expected.gir	2013-02-26 15:25:11.000000000 -0600
+++ src/gobject-introspection-1.36.0/tests/scanner/GetType-1.0-expected.gir	2013-08-04 21:54:43.219162200 -0500
@@ -11,7 +11,7 @@ and/or use gtk-doc annotations.  -->
   <c:include name="gettype.h"/>
   <namespace name="GetType"
              version="1.0"
-             shared-library="libgettype.so"
+             shared-library="cyggettype.dll"
              c:identifier-prefixes="GetType"
              c:symbol-prefixes="gettype">
     <class name="Object"
--- origsrc/gobject-introspection-1.36.0/tests/scanner/GtkFrob-1.0-expected.gir	2013-08-04 21:54:10.037264300 -0500
+++ src/gobject-introspection-1.36.0/tests/scanner/GtkFrob-1.0-expected.gir	2013-08-04 21:52:26.000000000 -0500
@@ -10,7 +10,7 @@ and/or use gtk-doc annotations.  -->
   <package name="gobject-2.0"/>
   <namespace name="GtkFrob"
              version="1.0"
-             shared-library="libgtkfrob.so"
+             shared-library="cyggtkfrob.dll"
              c:identifier-prefixes="Gtk"
              c:symbol-prefixes="gtk_frob">
     <function name="language_manager_get_default"
--- origsrc/gobject-introspection-1.36.0/tests/scanner/Regress-1.0-expected.gir	2013-08-04 21:54:10.052265200 -0500
+++ src/gobject-introspection-1.36.0/tests/scanner/Regress-1.0-expected.gir	2013-08-04 21:52:26.000000000 -0500
@@ -12,7 +12,7 @@ and/or use gtk-doc annotations.  -->
   <c:include name="regress.h"/>
   <namespace name="Regress"
              version="1.0"
-             shared-library="libregress.so"
+             shared-library="cygregress.dll"
              c:identifier-prefixes="Regress"
              c:symbol-prefixes="regress">
     <alias name="AliasedTestBoxed" c:type="RegressAliasedTestBoxed">
--- origsrc/gobject-introspection-1.36.0/tests/scanner/SLetter-1.0-expected.gir	2013-02-26 15:25:11.000000000 -0600
+++ src/gobject-introspection-1.36.0/tests/scanner/SLetter-1.0-expected.gir	2013-08-04 21:54:52.968719800 -0500
@@ -10,7 +10,7 @@ and/or use gtk-doc annotations.  -->
   <c:include name="sletter.h"/>
   <namespace name="SLetter"
              version="1.0"
-             shared-library="libsletter.so"
+             shared-library="cygsletter.dll"
              c:identifier-prefixes="S"
              c:symbol-prefixes="s">
     <enumeration name="DBusError"
--- origsrc/gobject-introspection-1.46.0/tests/scanner/Typedefs-1.0-expected.gir	2014-02-08 10:22:47.000000000 -0600
+++ src/gobject-introspection-1.46.0/tests/scanner/Typedefs-1.0-expected.gir	2015-11-05 19:18:42.207981400 -0600
@@ -11,7 +11,7 @@ and/or use gtk-doc annotations.  -->
   <c:include name="typedefs.h"/>
   <namespace name="Typedefs"
              version="1.0"
-             shared-library="libtypedefs.so"
+             shared-library="cygtypedefs.dll"
              c:identifier-prefixes="Typedefs"
              c:symbol-prefixes="typedefs">
     <record name="BoxedWithAnonymousTypedef"
--- origsrc/gobject-introspection-1.36.0/tests/scanner/Utility-1.0-expected.gir	2013-08-04 21:54:10.060265600 -0500
+++ src/gobject-introspection-1.36.0/tests/scanner/Utility-1.0-expected.gir	2013-08-04 21:52:26.000000000 -0500
@@ -11,7 +11,7 @@ and/or use gtk-doc annotations.  -->
   <c:include name="utility.h"/>
   <namespace name="Utility"
              version="1.0"
-             shared-library="libutility.so"
+             shared-library="cygutility.dll"
              c:identifier-prefixes="Utility"
              c:symbol-prefixes="utility">
     <alias name="Glyph" c:type="UtilityGlyph">
-------------- next part --------------
--- origsrc/gobject-introspection-1.42.0/tests/scanner/Makefile.am	2015-01-01 20:32:34.542523200 -0600
+++ src/gobject-introspection-1.42.0/tests/scanner/Makefile.am	2015-01-01 20:35:48.056096300 -0600
@@ -148,7 +148,7 @@ Typedefs_1_0_gir_SCANNERFLAGS = --c-incl
 GIRS += Typedefs-1.0.gir
 
 if !OS_WIN32
-EXTRA_PROGRAMS = barapp
+EXTRA_PROGRAMS = barapp$(EXEEXT)
 CLEANFILES += $(EXTRA_PROGRAMS)
 
 barapp_SOURCES = $(srcdir)/barapp.c $(srcdir)/barapp.h
@@ -157,7 +157,7 @@ barapp_LDFLAGS = -export-dynamic
 
 Bar-1.0.gir: barapp
 Bar_1_0_gir_PACKAGES = gobject-2.0
-Bar_1_0_gir_PROGRAM = ./barapp
+Bar_1_0_gir_PROGRAM = ./barapp$(EXEEXT)
 Bar_1_0_gir_CFLAGS = $(GI_SCANNER_CFLAGS)
 Bar_1_0_gir_INCLUDES = GObject-2.0
 Bar_1_0_gir_FILES = $(barapp_SOURCES)
-------------- next part --------------
--- origsrc/gobject-introspection-1.54.1/Makefile-giscanner.am	2016-03-14 06:49:00.000000000 -0400
+++ src/gobject-introspection-1.54.1/Makefile-giscanner.am	2020-08-04 09:49:26.065808000 -0400
@@ -117,7 +117,7 @@ _giscanner_la_LDFLAGS = \
 	-module -avoid-version \
 	-export-symbols-regex "init_giscanner|PyInit__giscanner"
 
-if OS_WIN32
+if PLATFORM_WIN32
 # Windows requires Python extension modules to be explicitly
 # linked to libpython. Extension modules are shared libaries
 # (.dll files), but need to be called .pyd for Python to load
@@ -126,8 +126,12 @@ _giscanner_la_LIBADD += \
 	$(PYTHON_LIBS)
 
 _giscanner_la_LDFLAGS += \
-	-no-undefined \
+	-no-undefined
+endif
+if OS_WIN32
+_giscanner_la_LDFLAGS += \
 	-shrext ".pyd"
 endif
 
+
 _giscanner_la_SOURCES = giscanner/giscannermodule.c
--- origsrc/gobject-introspection-1.54.1/configure.ac	2017-10-02 08:21:36.000000000 -0400
+++ src/gobject-introspection-1.54.1/configure.ac	2020-08-04 09:49:26.073772000 -0400
@@ -29,13 +29,20 @@ AC_SUBST(GI_VERSION)
 # Check for Win32
 AC_CANONICAL_HOST
 case "$host" in
+*-*-cygwin*)
+	platform_win32=yes
+	os_win32=no
+	;;
 *-*-mingw*)
+	platform_win32=yes
 	os_win32=yes
 	;;
 *)
+	platform_win32=no
 	os_win32=no
 	;;
 esac
+AM_CONDITIONAL(PLATFORM_WIN32, [test "x$platform_win32" = "xyes"])
 AM_CONDITIONAL(OS_WIN32, [test "x$os_win32" = "xyes"])
 
 # Checks for programs.
@@ -150,6 +157,9 @@ AS_IF([test x${with_cairo} != xno], [
 AM_CONDITIONAL(HAVE_CAIRO, test x$have_cairo = xyes)
 
 case "$host" in
+  *-*-cygwin*)
+    CAIRO_SHARED_LIBRARY="cygcairo-gobject-2.dll"
+    ;;
   *-*-darwin*)
     CAIRO_SHARED_LIBRARY="libcairo-gobject.2.dylib"
     ;;
@@ -274,7 +284,7 @@ case "$host" in
 	;;
 esac
 AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found]))
-if test "x$os_win32" = "xyes"; then
+if test "x$platform_win32" = "xyes"; then
   AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.]))
 fi
 
--- origsrc/gobject-introspection-1.54.1/girepository/girepository.c	2016-05-08 11:09:09.000000000 -0400
+++ src/gobject-introspection-1.54.1/girepository/girepository.c	2020-08-04 09:49:26.081781100 -0400
@@ -57,7 +57,7 @@ struct _GIRepositoryPrivate
 
 G_DEFINE_TYPE (GIRepository, g_irepository, G_TYPE_OBJECT);
 
-#ifdef G_PLATFORM_WIN32
+#ifdef G_OS_WIN32
 
 #include <windows.h>
 
--- origsrc/gobject-introspection-1.54.1/giscanner/ccompiler.py	2017-05-18 01:42:52.000000000 -0400
+++ src/gobject-introspection-1.54.1/giscanner/ccompiler.py	2020-08-04 09:49:26.089710500 -0400
@@ -118,6 +118,10 @@ class CCompiler(object):
 
         if self.check_is_msvc():
             runtime_path_envvar = ['LIB', 'PATH']
+        elif os.name == 'nt' or sys.platform == 'cygwin':
+            runtime_path_envvar = ['PATH']
+            # Search the current directory first
+            args.append('-L.')
         else:
             runtime_path_envvar = ['LD_LIBRARY_PATH']
             # Search the current directory first
--- origsrc/gobject-introspection-1.54.1/giscanner/shlibs.py	2016-03-14 06:49:01.000000000 -0400
+++ src/gobject-introspection-1.54.1/giscanner/shlibs.py	2020-08-04 10:16:24.364844100 -0400
@@ -61,6 +61,8 @@ def _ldd_library_pattern(library_name):
     pattern = "(?<![A-Za-z0-9_-])(lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
     if platform.system() == 'Darwin':
         pattern = "([^\s]*lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
+    elif platform.platform().startswith('CYGWIN'):
+        pattern = "([^\s]*cyg%s[-.0-9]*\.[^\s\(\)]*)"
     return re.compile(pattern % re.escape(library_name))
 
 
--- origsrc/gobject-introspection-1.54.1/giscanner/utils.py	2017-06-20 17:10:33.000000000 -0400
+++ src/gobject-introspection-1.54.1/giscanner/utils.py	2020-08-04 09:49:26.104703700 -0400
@@ -80,7 +80,7 @@ def to_underscores_noprefix(name):
     return name
 
 
-_libtool_pat = re.compile("dlname='([A-z0-9\.\-\+]+)'\n")
+_libtool_pat = re.compile("dlname='([A-z0-9/\.\-\+]+)'\n")
 
 
 def _extract_dlname_field(la_file):
--- origsrc/gobject-introspection-1.54.1/tests/Makefile.am	2014-09-04 03:24:07.000000000 -0400
+++ src/gobject-introspection-1.54.1/tests/Makefile.am	2020-08-04 09:49:26.110683300 -0400
@@ -20,7 +20,12 @@ tests_DATA =		    \
 EXTRA_LTLIBRARIES = libeverything-1.0.la libgimarshallingtests-1.0.la
 
 libeverything_1_0_la_SOURCES = everything.c
+libeverything_1_0_la_LDFLAGS = -no-undefined
+libeverything_1_0_la_LIBADD = $(GOBJECT_LIBS)
+
 libgimarshallingtests_1_0_la_SOURCES = gimarshallingtests.c
+libgimarshallingtests_1_0_la_LDFLAGS = -no-undefined
+libgimarshallingtests_1_0_la_LIBADD = $(GOBJECT_LIBS)
 
 EXTRA_DIST += \
 	gimarshallingtests.h \
--- origsrc/gobject-introspection-1.54.1/tests/offsets/Makefile.am	2015-07-01 03:23:55.000000000 -0400
+++ src/gobject-introspection-1.54.1/tests/offsets/Makefile.am	2020-08-04 09:49:26.116698000 -0400
@@ -18,7 +18,7 @@ liboffsets_la_SOURCES = \
 	offsets.c
 liboffsets_la_CPPFLAGS = $(GIREPO_CFLAGS) $(GI_HIDDEN_VISIBILITY_CFLAGS) -I$(top_srcdir)/tests
 # dummy rpath to get built dynamically (huh?)
-liboffsets_la_LDFLAGS = -avoid-version -rpath $(libdir)
+liboffsets_la_LDFLAGS = -avoid-version -rpath $(libdir) -no-undefined
 
 Offsets-1.0.gir: liboffsets.la offsets.h
 Offsets_1_0_gir_INCLUDES = GObject-2.0
--- origsrc/gobject-introspection-1.54.1/tests/scanner/Makefile.am	2020-08-04 09:48:05.413104600 -0400
+++ src/gobject-introspection-1.54.1/tests/scanner/Makefile.am	2020-08-04 09:49:26.122659100 -0400
@@ -68,7 +68,7 @@ endif
 libregress_la_LDFLAGS = $(AM_LDFLAGS)
 
 
-if OS_WIN32
+if PLATFORM_WIN32
 AM_LDFLAGS += -no-undefined
 endif
 
@@ -155,7 +155,7 @@ barapp_SOURCES = $(srcdir)/barapp.c $(sr
 barapp_LDADD = $(top_builddir)/libgirepository-1.0.la
 barapp_LDFLAGS = -export-dynamic
 
-Bar-1.0.gir: barapp
+Bar-1.0.gir: barapp$(EXEEXT)
 Bar_1_0_gir_PACKAGES = gobject-2.0
 Bar_1_0_gir_PROGRAM = ./barapp$(EXEEXT)
 Bar_1_0_gir_CFLAGS = $(GI_SCANNER_CFLAGS)
-------------- next part --------------
inherit gnome2 python3

NAME="gobject-introspection"
VERSION=1.54.1
RELEASE=4
CATEGORY="Libs"
SUMMARY="GObject Introspection tools"
DESCRIPTION="The goal of the project is to describe GObject APIs and collect
them in a uniform, machine readable format."
HOMEPAGE="https://gi.readthedocs.io/en/latest/"

PATCH_URI="
	1.42.0-exeext.patch
	1.36.0-tests-expected.patch
	1.36.0-python-libs.patch
	1.54.1-2-cygwin.patch
"

PYTHON3=python3.8
CYGCONF_ARGS="--with-python=${PYTHON3}"

PKG_NAMES="${NAME} libgirepository1.0_1 libgirepository1.0-devel libgirepository1.0-doc"
gobject_introspection_CATEGORY="Devel"
gobject_introspection_SUMMARY="GObject Introspection tools"
gobject_introspection_REQUIRES="libgirepository1.0-devel"
gobject_introspection_CONTENTS="--exclude=gir-1.0 --exclude=gtk-doc
                                usr/bin/g-ir-* usr/lib/${NAME}/ usr/share/"
libgirepository1_0_1_SUMMARY="GObject Introspection library (runtime)"
libgirepository1_0_1_CONTENTS="usr/bin/cyggirepository-1.0-1.dll"
libgirepository1_0_devel_REQUIRES="girepository-GIRepository2.0"
libgirepository1_0_devel_SUMMARY="GObject Introspection library (development)"
libgirepository1_0_devel_CONTENTS="usr/include/ usr/lib/libgirepository-1.0.*
                                   usr/lib/pkgconfig/"
libgirepository1_0_doc_CATEGORY="Doc"
libgirepository1_0_doc_SUMMARY="GObject Introspection library (API docs)"
libgirepository1_0_doc_CONTENTS="usr/share/gtk-doc/"

PKG_NAMES+=" girepository-cairo1.0 girepository-GIRepository2.0
             girepository-GLib2.0 girepository-x11"
girepository_cairo1_0_SUMMARY="GObject Introspection data for libcairo"
girepository_cairo1_0_CONTENTS="usr/*/gir*/cairo-1.0.*"
girepository_GIRepository2_0_SUMMARY="GObject Introspection library (GObject Introspection data)"
girepository_GIRepository2_0_CONTENTS="usr/*/gir*/GIRepository-2.0.*"
girepository_GLib2_0_SUMMARY="GLib GObjectIntrospection data"
girepository_GLib2_0_CONTENTS="--exclude=GIR* --exclude=GL-* usr/*/gir*/G*-2.0.*"
girepository_x11_SUMMARY="GObject Introspection data for X11 libraries"
girepository_x11_CONTENTS="--exclude=cairo-1.0.* --exclude=G*-2.0.* usr/*/gir*/"

DIFF_EXCLUDES="config.py *.pc gi.types"

gobject_introspection_REQUIRES="libgirepository1.0-devel python38-mako"

BUILD_REQUIRES=" \
	flex \
	gnome-common \
	gtk-doc \
	libcairo-devel \
	libffi-devel \
	libglib2.0-devel \
	python38-devel \
	python38-mako \
"


More information about the Cygwin-apps mailing list