gobject-introspection: Update to 1.58.0; add new python-markdown dependency (#4348)

This commit is contained in:
Christoph Reiter
2018-09-03 06:24:32 +02:00
committed by Алексей
parent 0c5196423f
commit 788d4fa7e9
12 changed files with 168 additions and 210 deletions

View File

@@ -1,74 +0,0 @@
From 142020d1728dec78a0ffb97b636f459d3184a796 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 30 Dec 2015 17:28:58 +0000
Subject: [PATCH] Revert "Windows port: Work arount MSYS weirdness where it
changes --libtool= command line arguments."
A very old version of MSYS performed normalization during path conversion
so "/bin/sh ../../libtool" became "c:/opt/msys/1.0/bin/libtool" ("sh .."
was considered a single folder), it doesn't do this any more; nor does
MSYS2.
Also, the old comment was incorrect. It claimed:
"This continues to reuse the LIBTOOL variable from automake if it's set,
but works around some MSYS weirdness: When running g-ir-scanner, MSYS
changes a command-line argument --libtool="/bin/sh ../../libtool" into
--libtool=c:/opt/msys/1.0/bin/libtool. So just use sh.exe without path
because we already "know" where the libtool configure produced is."
.. yet the actual code was changed to:
_gir_libtool = $(if $(findstring MINGW,$(shell uname -s)),--libtool="$(top_builddir)/libtool",$(if $(LIBTOOL),--libtool="$(LIBTOOL)"))
.. so in fact, if $(uname -s) contained "MINGW", then --libtool ignored
the LIBTOOL variable from automake and used $(top_builddir)/libtool
instead, at the very least, removing all trace of $(SHELL) from it.
Now that $(SHELL) has been re-introduced into libtool, it must not
doubly appear in resolve_windows_libs in ccompiler.py, as otherwise
sh.exe will try to execute sh.exe and that clearly will not work.
I've left some MSYS-specific hacks in dumper.py, some of which could
probaly be removed safely now (execution through a temporary shell
script), but I've opted to leave it as is for now.
This reverts commit 33bbdce144d275b693752f0bc2c2f292deda854e.
---
Makefile.introspection | 8 ++------
giscanner/ccompiler.py | 1 -
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/Makefile.introspection b/Makefile.introspection
index cd7bd1b..c28d734 100644
--- a/Makefile.introspection
+++ b/Makefile.introspection
@@ -63,12 +63,8 @@ _gir_packages = $(foreach pkg,$($(_gir_name)_PACKAGES),--pkg=$(pkg))
_gir_includes = $(foreach include,$($(_gir_name)_INCLUDES),--include=$(include))
_gir_export_packages = $(foreach pkg,$($(_gir_name)_EXPORT_PACKAGES),--pkg-export=$(pkg))
-# Reuse the LIBTOOL variable from automake if it's set, but
-# work around MSYS weirdness: When running g-ir-scanner, MSYS changes
-# a command-line argument --libtool="/bin/sh ../../libtool" into
-# --libtool=c:/opt/msys/1.0/bin/libtool. So just use sh.exe without path
-# because we already "know" where the libtool configure produced is.
-_gir_libtool = $(if $(findstring MINGW,$(shell uname -s)),--libtool="$(top_builddir)/libtool",$(if $(LIBTOOL),--libtool="$(LIBTOOL)"))
+# Reuse the LIBTOOL variable from automake if it's set
+_gir_libtool = $(if $(LIBTOOL),--libtool="$(LIBTOOL)")
# Macros for AM_SILENT_RULES prettiness
_gir_verbosity = $(if $(AM_DEFAULT_VERBOSITY),$(AM_DEFAULT_VERBOSITY),1)
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index 9b27f0e..f9b0b27 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -282,8 +282,6 @@ class CCompiler(object):
else:
libtool = utils.get_libtool_command(options)
if libtool:
- if os.name == 'nt':
- args.append(utils.which(os.environ.get('SHELL', 'sh.exe')))
args.extend(libtool)
args.append('--mode=execute')
args.extend([os.environ.get('DLLTOOL', 'dlltool.exe'), '--identify'])
--
2.6.3

View File

@@ -6,8 +6,8 @@ index 27cd5ce..e3a71d3 100644
offsets.c
liboffsets_la_CPPFLAGS = $(GIREPO_CFLAGS)
# dummy rpath to get built dynamically (huh?)
-liboffsets_la_LDFLAGS = -avoid-version -rpath $(libdir)
+liboffsets_la_LDFLAGS = -avoid-version -no-undefined -rpath $(libdir)
-liboffsets_la_LDFLAGS = $(WARN_LDFLAGS) -avoid-version -rpath $(libdir)
+liboffsets_la_LDFLAGS = $(WARN_LDFLAGS) -avoid-version -no-undefined -rpath $(libdir)
Offsets-1.0.gir: liboffsets.la offsets.h
Offsets_1_0_gir_INCLUDES = GObject-2.0

View File

@@ -412,9 +412,9 @@ https://bugzilla.gnome.org/show_bug.cgi?id=620566
+# Simple rule to compile a typelib.
+%.typelib: %.gir
+ $(call introspection-compiler,$<,$@)
--- a/configure.ac
+++ a/configure.ac
@@ -31,12 +31,18 @@ AC_CANONICAL_HOST
--- gobject-introspection-1.58.0/configure.ac.orig 2018-08-31 18:32:24.000000000 +0200
+++ gobject-introspection-1.58.0/configure.ac 2018-08-31 20:58:54.731260300 +0200
@@ -31,12 +31,18 @@
case "$host" in
*-*-mingw*)
os_win32=yes
@@ -433,14 +433,14 @@ https://bugzilla.gnome.org/show_bug.cgi?id=620566
# Checks for programs.
AC_PROG_CC
@@ -358,6 +364,7 @@ tests/warn/Makefile
docs/Makefile
@@ -379,6 +385,7 @@
docs/reference/Makefile
docs/reference/version.xml
giscanner/_version.py
+Makefile.introspection
gobject-introspection-1.0.pc
gobject-introspection-no-export-1.0.pc
config.h.win32
gobject-introspection-no-export-1.0.pc])
AC_OUTPUT
--- a/giscanner/scannermain.py
+++ a/giscanner/scannermain.py
@@ -470,8 +470,9 @@ def write_output(data, options):
@@ -456,10 +456,10 @@ https://bugzilla.gnome.org/show_bug.cgi?id=620566
passthrough_gir(options.passthrough_gir, sys.stdout)
--- a/giscanner/utils.py
+++ a/giscanner/utils.py
@@ -22,6 +22,7 @@ import re
import os
import subprocess
@@ -29,6 +29,7 @@
import platform
import shutil
import time
+import shlex

View File

@@ -1,27 +0,0 @@
diff -rU2 gobject-introspection-1.50.0.orig/giscanner/dumper.py gobject-introspection-1.50.0/giscanner/dumper.py
--- gobject-introspection-1.50.0.orig/giscanner/dumper.py 2016-07-29 06:32:43.000000000 +0100
+++ gobject-introspection-1.50.0/giscanner/dumper.py 2016-10-30 22:48:11.873424500 +0000
@@ -168,5 +168,5 @@
except CompilerError as e:
if not utils.have_debug_flag('save-temps'):
- shutil.rmtree(tmpdir)
+ shutil.rmtree(tmpdir, True)
raise SystemExit('compilation of temporary binary failed:' + str(e))
@@ -175,5 +175,5 @@
except LinkerError as e:
if not utils.have_debug_flag('save-temps'):
- shutil.rmtree(tmpdir)
+ shutil.rmtree(tmpdir, True)
raise SystemExit('linking of temporary binary failed: ' + str(e))
diff -rU2 gobject-introspection-1.50.0.orig/giscanner/gdumpparser.py gobject-introspection-1.50.0/giscanner/gdumpparser.py
--- gobject-introspection-1.50.0.orig/giscanner/gdumpparser.py 2016-07-29 06:32:43.000000000 +0100
+++ gobject-introspection-1.50.0/giscanner/gdumpparser.py 2016-10-30 22:45:58.043346300 +0000
@@ -182,5 +182,5 @@
finally:
if not utils.have_debug_flag('save-temps'):
- shutil.rmtree(self._binary.tmpdir)
+ shutil.rmtree(self._binary.tmpdir, True)
# Parser

View File

@@ -1,11 +0,0 @@
--- gobject-introspection-1.39.3/m4/python.m4.orig 2014-02-17 13:49:28.485000000 +0400
+++ gobject-introspection-1.39.3/m4/python.m4 2014-02-17 13:49:34.101000000 +0400
@@ -64,7 +64,7 @@
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 --ldflags`
fi
AC_SUBST(PYTHON_LIBS)
dnl check if libpython exist:

View File

@@ -5,8 +5,8 @@ _realname=gobject-introspection
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-runtime")
pkgver=1.56.1
pkgrel=2
pkgver=1.58.0
pkgrel=1
arch=('any')
url="https://live.gnome.org/GObjectIntrospection"
license=("LGPL")
@@ -16,46 +16,34 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-pkg-config"
"${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-mako"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools")
# Building this in debug invokes pdb when things go wrong.
# options=('!strip' 'debug')
"${MINGW_PACKAGE_PREFIX}-python3-markdown"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"autoconf-archive")
source=(https://download.gnome.org/sources/gobject-introspection/${pkgver%.*}/${_realname}-${pkgver}.tar.xz
0001-Revert-Windows-port-Work-arount-MSYS-weirdness-where.patch
0021-tests-no-undefined.patch
0022-change-pkg-config-invocations.mingw.patch
0024-Support-passing-arguments-to-g-ir-scanner-through-a-.all.patch
0025-more-tolerant-rmtreeing.patch
0026-giscanner-assertions-and-waits.patch
0027-wait-for-xml-parse-too.patch
0055-fix-python-detection.patch
py3-fixes.patch
pyscript2exe.py)
sha256sums=('5b2875ccff99ff7baab63a34b67f8c920def240e178ff50add809e267d9ea24b'
'f84df99e1ce5a3a0b640ef172de068958eb0b3d0be43a454dd86e6ccb8cfc386'
'663bb39764058b1de1591765f9f465dd69eeae16fcf56b82a3692560849dacae'
sha256sums=('27c1590a32749de0a5481ce897772547043e94bccba4bc0a7edb3d8513e401ec'
'79ec6c7f845d65eacafdcb8380441b85ab17afd5ef6cf7d374f2370431135fd5'
'bb5f48047613216a6c3c652e0ef65c099475ffdddbea4a835b5a51279d7755ac'
'fd461c3458aa174126b287c659ba3ce7c9a5402c844562022293790988783d30'
'f7fa69b6af7571371b1e162cacac05fc2a2877d057dd61649948d973b74a9e8d'
'548242ff213afacb0c8192bfbc82ef80fc4d4d5832bbd7130a32c44f0bde1bf8'
'19ca830262339c4ac9f21bfb8d669ee8e126a949a4237d55656e00c5ae81c451'
'3f38bdd0dd43d9cf626cbca7c2abd22a7ed0213e6756252c6d467d470d9c5948'
'f61d099aa7cd37c437f01d98bb95c57c66f07c78028675ae19fac87f943d189d'
'c91a0604e4cbc483099da94ab61a7dc32cb7337f03c5561ac5950c12e6f3d9af'
'f68b24932b3365c4098c04eeaeaf87275ceec29694b3f0597c431bbcf4f913a3')
prepare() {
cd ${srcdir}/${_realname}-${pkgver}
patch -p1 -i "${srcdir}"/0001-Revert-Windows-port-Work-arount-MSYS-weirdness-where.patch
patch -p1 -i "${srcdir}"/0021-tests-no-undefined.patch
patch -p1 -i "${srcdir}"/0022-change-pkg-config-invocations.mingw.patch
# Source for this patch is:
# https://bazaar.launchpad.net/~lrn1986/stupidbuild/trunk/view/head:/src/mingw/gobject-introspection-1.0-1.44.0-2/patches/0024-Support-passing-arguments-to-g-ir-scanner-through-a-.all.patch
patch -p1 -i "${srcdir}"/0024-Support-passing-arguments-to-g-ir-scanner-through-a-.all.patch
patch -p1 -i "${srcdir}"/0025-more-tolerant-rmtreeing.patch
patch -p1 -i "${srcdir}"/0026-giscanner-assertions-and-waits.patch
patch -p1 -i "${srcdir}"/0027-wait-for-xml-parse-too.patch
patch -p1 -i "${srcdir}"/0055-fix-python-detection.patch
patch -p1 -i "${srcdir}"/py3-fixes.patch
autoreconf -fi
}
@@ -69,7 +57,8 @@ build() {
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--disable-silent-rules
--disable-silent-rules \
--enable-doctool
make
}
@@ -86,27 +75,6 @@ package_gobject-introspection() {
make -j1 DESTDIR="${pkgdir}" install
make -j1 DESTDIR="${pkgdir}" uninstall-libLTLIBRARIES uninstall-typelibsDATA
# I've spent too long debugging gobject-introspection and it's too painful each
# time. Therefore, I've taken the decision to copy the .pyd also as a _d.pyd
# in-case I happen to be investigating it with a debug version of Python which
# only loads _d.pyd extensions.
# You will still have to rebuild this package after having built and installed
# the debug mingw-w64-python2 of course .. still one less thing to forget to
# remember.
# There will be a way to communicate the nature of the Python through to Autoconf
# and that would be better, but this will have to do for now.
# (see:
# @OS_WIN32_TRUE@ -shrext ".pyd"
# in gobject-introspection/Makefile.in)
# Disabled since the Python 3 switch
#~ PYDS=$(find "${pkgdir}" -name "*.pyd")
#~ for PYD in "${PYDS}"; do
#~ pushd $(dirname "${PYD}")
#~ cp $(basename "${PYD}") $(basename "${PYD}" .pyd)_d.pyd
#~ popd
#~ done
for name in g-ir-scanner g-ir-doc-tool g-ir-annotation-tool; do
${MINGW_PREFIX}/bin/python3 \
"${srcdir}/pyscript2exe.py" "${pkgdir}${MINGW_PREFIX}/bin/${name}"
@@ -121,7 +89,6 @@ package_gobject-introspection-runtime() {
make -j1 DESTDIR="${pkgdir}" install-libLTLIBRARIES install-typelibsDATA
}
# Wrappers
package_mingw-w64-i686-gobject-introspection()
{
package_gobject-introspection

View File

@@ -1,43 +0,0 @@
--- gobject-introspection-1.54.1/giscanner/dumper.py.orig 2017-05-04 10:51:33.000000000 +0200
+++ gobject-introspection-1.54.1/giscanner/dumper.py 2018-01-28 15:38:39.836403900 +0100
@@ -25,6 +25,7 @@
from __future__ import unicode_literals
import os
+import io
import sys
import shlex
import subprocess
@@ -281,7 +282,8 @@
# Create a temporary script file that
# runs the command we want
tf, tf_name = tempfile.mkstemp()
- with os.fdopen(tf, 'wb') as f:
+ os.close(tf)
+ with io.open(tf_name, 'w', encoding='utf-8') as f:
shellcontents = ' '.join([x.replace('\\', '/') for x in args])
fcontents = '#!/bin/sh\nunset PWD\n{}\n'.format(shellcontents)
f.write(fcontents)
--- gobject-introspection-1.54.1/configure.ac.orig 2017-10-02 14:21:36.000000000 +0200
+++ gobject-introspection-1.54.1/configure.ac 2018-01-28 15:57:38.294520000 +0100
@@ -278,6 +284,9 @@
AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.]))
fi
+PYTHON_SO=`$PYTHON -c "import sysconfig, sys; get = sysconfig.get_config_var; sys.stdout.write(get('EXT_SUFFIX') or get('SO') or '.so');"`
+AC_SUBST(PYTHON_SO)
+
dnl Not enabled by default until 3.6 cycle when we can propose mako as
dnl an external dependency
AC_ARG_ENABLE(doctool,[ --disable-doctool disable g-ir-doc-tool ],,enable_doctool=auto)
--- gobject-introspection-1.54.1/Makefile-giscanner.am.orig 2018-01-28 15:59:36.423276600 +0100
+++ gobject-introspection-1.54.1/Makefile-giscanner.am 2018-01-28 16:00:05.110917400 +0100
@@ -127,7 +127,7 @@
_giscanner_la_LDFLAGS += \
-no-undefined \
- -shrext ".pyd"
+ -shrext $(PYTHON_SO)
endif
_giscanner_la_SOURCES = giscanner/giscannermodule.c

View File

@@ -0,0 +1,90 @@
# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>
_realname=markdown
_pyname=Markdown
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=2.6.11
pkgrel=1
pkgdesc="Python implementation of John Gruber's Markdown (mingw-w64)"
url='https://pypi.python.org/pypi/Markdown'
license=('BSD')
arch=('any')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools")
source=("https://pypi.io/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
sha256sums=('a856869c7ff079ad84a3e19cd87a64998350c2b94e9e08e44270faef33400f81')
prepare() {
cd ${srcdir}
cp -r ${_realname}-${pkgver} python2-build-${CARCH}
cp -r ${_realname}-${pkgver} python3-build-${CARCH}
}
build() {
cd "${srcdir}"
for pver in {2,3}; do
msg "Python ${pver} build for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
${MINGW_PREFIX}/bin/python${pver} setup.py build
done
}
package_python3-markdown() {
depends=("${MINGW_PACKAGE_PREFIX}-python3")
cd ${srcdir}/python3-build-${CARCH}
${MINGW_PREFIX}/bin/python3 setup.py build
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}"
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
sed -e "s|$(cygpath -wm ${MINGW_PREFIX})|${MINGW_PREFIX}|g" -i "${_f}"
done
install -D -m644 LICENSE.md "${pkgdir}${MINGW_PREFIX}"/share/licenses/python3-${_realname}/LICENSE.md
}
package_python2-markdown() {
depends=("${MINGW_PACKAGE_PREFIX}-python2")
cd ${srcdir}/python2-build-${CARCH}
${MINGW_PREFIX}/bin/python2 setup.py build
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}"
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
sed -e "s|$(cygpath -wm ${MINGW_PREFIX})|${MINGW_PREFIX}|g" -i "${_f}"
done
for f in markdown_py; do
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe
if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest
sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest
fi
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py
done
install -D -m644 LICENSE.md "${pkgdir}${MINGW_PREFIX}"/share/licenses/python2-${_realname}/LICENSE.md
}
package_mingw-w64-i686-python2-markdown() {
install=python2-${_realname}-${CARCH}.install
package_python2-markdown
}
package_mingw-w64-i686-python3-markdown() {
install=python3-${_realname}-${CARCH}.install
package_python3-markdown
}
package_mingw-w64-x86_64-python2-markdown() {
install=python2-${_realname}-${CARCH}.install
package_python2-markdown
}
package_mingw-w64-x86_64-python3-markdown() {
install=python3-${_realname}-${CARCH}.install
package_python3-markdown
}

View File

@@ -0,0 +1,14 @@
post_install() {
cd mingw32
local _prefix=$(pwd -W)
cd -
local _it
for _it in markdown_py2; do
sed -e "s|/mingw32|${_prefix}|g" \
-i mingw32/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}

View File

@@ -0,0 +1,14 @@
post_install() {
cd mingw64
local _prefix=$(pwd -W)
cd -
local _it
for _it in markdown_py2; do
sed -e "s|/mingw64|${_prefix}|g" \
-i mingw64/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}

View File

@@ -0,0 +1,14 @@
post_install() {
cd mingw32
local _prefix=$(pwd -W)
cd -
local _it
for _it in markdown_py; do
sed -e "s|/mingw32|${_prefix}|g" \
-i mingw32/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}

View File

@@ -0,0 +1,14 @@
post_install() {
cd mingw64
local _prefix=$(pwd -W)
cd -
local _it
for _it in markdown_py; do
sed -e "s|/mingw64|${_prefix}|g" \
-i mingw64/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}