summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-03-26 12:38:33 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2018-03-26 12:54:06 +0200
commit14b3a9f4ddff59bd3959a68b104969f9f5a72ae5 (patch)
treeaf7008d8932d0d6d80ef42fe26405f9e39bc0a00
parent7d267a60207247589233059566706aca98a138b5 (diff)
downloadpygobject-14b3a9f4ddff59bd3959a68b104969f9f5a72ae5.tar.gz
Remove autotools build system
-rwxr-xr-x.gitlab-ci/test-docker.sh29
-rw-r--r--MANIFEST.in12
-rw-r--r--Makefile.am165
-rwxr-xr-xautogen.sh37
-rw-r--r--configure.ac216
-rw-r--r--examples/Makefile.am6
-rw-r--r--gi/Makefile.am176
-rw-r--r--gi/overrides/Makefile.am23
-rw-r--r--gi/repository/Makefile.am16
-rw-r--r--m4/introspection.m496
-rw-r--r--m4/python.m4237
-rw-r--r--pygtkcompat/Makefile.am16
-rwxr-xr-xsetup.py62
-rw-r--r--tests/Makefile.am215
14 files changed, 37 insertions, 1269 deletions
diff --git a/.gitlab-ci/test-docker.sh b/.gitlab-ci/test-docker.sh
index 0b8a5d7b..7cefec8a 100755
--- a/.gitlab-ci/test-docker.sh
+++ b/.gitlab-ci/test-docker.sh
@@ -4,21 +4,20 @@ set -e
python --version
-# ccache setup
-mkdir -p _ccache
-export CCACHE_BASEDIR="$(pwd)"
-export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
PYVER=$(python -c "import sys; sys.stdout.write(''.join(map(str, sys.version_info[:3])))")
PYIMPL=$(python -c "import sys, platform; sys.stdout.write(platform.python_implementation())")
SOURCE_DIR="$(pwd)"
-PY_PREFIX="$(python -c 'import sys; sys.stdout.write(sys.prefix)')"
COV_DIR="${SOURCE_DIR}/coverage"
-export PKG_CONFIG_PATH="${PY_PREFIX}/lib/pkgconfig"
export MALLOC_CHECK_=3
export MALLOC_PERTURB_=$((${RANDOM} % 255 + 1))
export G_SLICE="debug-blocks"
export COVERAGE_FILE="${COV_DIR}/.coverage.${PYVER}"
export CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
+export CCACHE_BASEDIR="$(pwd)"
+export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
+
+mkdir -p "${CCACHE_DIR}"
+mkdir -p "${COV_DIR}"
if [[ "${PYIMPL}" == "PyPy" ]]; then
# https://bitbucket.org/pypy/pypy/issues/2776
@@ -34,22 +33,8 @@ if [[ "${PYIMPL}" == "PyPy" ]]; then
exit 0;
fi;
-mkdir -p "${COV_DIR}"
-rm -Rf /tmp/build
-mkdir /tmp/build
-cd /tmp/build
-
-# BUILD
-"${SOURCE_DIR}"/autogen.sh --with-python=python
-make -j8
-
-# TESTS
-xvfb-run -a make check
-
-# CODE QUALITY CHECKS
-make check.quality
-
-cd "${SOURCE_DIR}"
+# CODE QUALITY
+python -m flake8
# DOCUMENTATION CHECKS
if [[ "${PYENV_VERSION}" == "2.7.14" ]]; then
diff --git a/MANIFEST.in b/MANIFEST.in
index 5f383eb4..fab933a1 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,20 +1,14 @@
include setup.cfg
include pyproject.toml
-include *.am
-include autogen.sh
-include configure.ac
include COPYING
include *.in
-include m4/introspection.m4
-include m4/python.m4
include NEWS
include tools/pygi-convert.sh
include pygobject.doap
include README.rst
include .gitlab-ci.yml
-recursive-include examples *.py *.am *.png *.css *.ui *.gif *.gresource *.jpg *.xml
-recursive-include gi *.am *.h
-recursive-include pygtkcompat *.am
-recursive-include tests *.py *.c *.h *.xml *.supp *.am
+recursive-include examples *.py *.png *.css *.ui *.gif *.gresource *.jpg *.xml
+recursive-include gi *.h
+recursive-include tests *.py *.c *.h *.xml *.supp
recursive-include docs *.rst *.svg LICENSE *.ico *.png *.css *.py *.dia Makefile
recursive-include .gitlab-ci *.sh *.rst *.py Dockerfile*
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 6633494e..00000000
--- a/Makefile.am
+++ /dev/null
@@ -1,165 +0,0 @@
-# Part of the gi subdirectory is handled with non-recursive make to avoid
-# py-compile getting confused between gi/types.py and Python's standard
-# types module.
-SUBDIRS = . examples gi tests pygtkcompat
-
-PLATFORM_VERSION = 3.0
-
-CLEANFILES = \
- `find "$(builddir)" -type f -name "*.pyc" -print`
-
-EXTRA_DIST = \
- autogen.sh \
- pygobject.doap \
- pygobject-$(PLATFORM_VERSION).pc.in \
- PKG-INFO \
- PKG-INFO.in \
- tools/pygi-convert.sh \
- m4/python.m4 \
- m4/introspection.m4 \
- setup.py \
- setup.cfg \
- MANIFEST.in \
- pyproject.toml \
- README.rst \
- docs
-
-MAINTAINERCLEANFILES = \
- $(srcdir)/aclocal.m4 \
- $(srcdir)/autoscan.log \
- $(srcdir)/compile \
- $(srcdir)/config.guess \
- $(srcdir)/config.h.in \
- $(srcdir)/config.sub \
- $(srcdir)/configure.scan \
- $(srcdir)/depcomp \
- $(srcdir)/install-sh \
- $(srcdir)/ltmain.sh \
- $(srcdir)/missing \
- $(srcdir)/mkinstalldirs \
- $(srcdir)/omf.make \
- $(srcdir)/xmldocs.make \
- $(srcdir)/gtk-doc.make \
- $(srcdir)/ChangeLog \
- $(srcdir)/py-compile \
- $(srcdir)/m4/libtool.m4 \
- $(srcdir)/m4/ltoptions.m4 \
- $(srcdir)/m4/ltsugar.m4 \
- $(srcdir)/m4/ltversion.m4 \
- $(srcdir)/m4/lt~obsolete.m4 \
- `find "$(srcdir)" -type f -name Makefile.in -print` \
- `find "$(builddir)" -type f -name "*.pyc" -print`
-
-BUILT_EXTRA_DIST = \
- ChangeLog
-
-nobase_pyexec_PYTHON = \
- gi/__init__.py \
- gi/types.py \
- gi/module.py \
- gi/importer.py \
- gi/pygtkcompat.py \
- gi/docstring.py \
- gi/_constants.py \
- gi/_propertyhelper.py \
- gi/_signalhelper.py \
- gi/_option.py \
- gi/_error.py \
- gi/_ossighelper.py
-
-# if we build in a separate tree, we need to symlink the *.py files from the
-# source tree; Python does not accept the extensions and modules in different
-# paths
-build_pylinks:
- for f in $(nobase_pyexec_PYTHON); do \
- [ -e $(builddir)/$$f ] || \
- $(LN_S) $(abs_srcdir)/$$f $(builddir)/$$f; \
- done
-
-all-local: build_pylinks
-
-check-local: build_pylinks
-
-if WITH_COMMON
-# pkg-config files
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = pygobject-$(PLATFORM_VERSION).pc
-endif
-
-# python
-pyexec_LTLIBRARIES =
-
-EGG_NAME = $(PACKAGE)-$(PACKAGE_VERSION)-py$(PYTHON_VERSION)
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(pyexecdir)
- cp $(top_builddir)/PKG-INFO $(DESTDIR)$(pyexecdir)/$(EGG_NAME).egg-info
-uninstall-local:
- rm -f $(DESTDIR)$(pyexecdir)/$(EGG_NAME).egg-info
-
-release-news:
- printf "%s - %s\n\n" "$(VERSION)" "`LC_TIME=C date -I`" > NEWS.tmp
-
- @echo -e "\n\n\nFor blogging, you can copy&paste this HTML formatted news:"
- @echo "-------------- 8< -------------"
- @last=`head -n1 $(top_srcdir)/NEWS | cut -f1 -d' '`; \
- echo "<ul>"; \
- for commit in `git rev-list $$last..`; do \
- data=`git log --format="format:%s%n%an%n%b" $$commit^..$$commit`; \
- echo "$$data" | perl -e '$$subj = <>; chomp $$subj; $$author = <>; chomp $$author; while (<>) { if (/bugzilla.gnome.org.*id=([0-9]+)/) { $$bug = $$1 }}; print " <li>$$subj ($$author)"; if ($$bug) { print " (<a href=\"https://bugzilla.gnome.org/show_bug.cgi?id=$$bug\">#$$bug</a>)"; }; print "</li>\n"'; \
- echo "$$data" | perl -e '$$subj = <>; chomp $$subj; $$author = <>; chomp $$author; while (<>) { if (/bugzilla.gnome.org.*id=([0-9]+)/) { $$bug = $$1 }}; print "* $$subj ($$author)"; if ($$bug) { print " (#$$bug)"; }; print "\n"' >> NEWS.tmp; \
- done
- @echo "</ul>"
- @echo "-------------- 8< -------------"
-
- @echo >> NEWS.tmp
- @cat $(top_srcdir)/NEWS >> NEWS.tmp
- @mv NEWS.tmp $(top_srcdir)/NEWS
-
-.PHONY: ChangeLog release-news
-
-ChangeLog:
- @echo Creating $@
- @if test -d "$(srcdir)/.git"; then \
- (GIT_DIR=$(top_srcdir)/.git $(top_srcdir)/missing --run git log PYGOBJECT_2_17_0^^.. --stat) | fmt --split-only > $@.tmp \
- && mv -f $@.tmp $@ \
- || ($(RM) $@.tmp; \
- echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
- (test -f $@ || echo git-log is required to generate this file >> $@)); \
- else \
- test -f $@ || \
- (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
- echo A git checkout and git-log is required to generate this file >> $@); \
- fi
-
-
-distclean-local:
- if test $(srcdir) = .; then :; else \
- rm -f $(BUILT_EXTRA_DIST); \
- fi
-
-dist-hook: $(BUILT_EXTRA_DIST)
- files='$(BUILT_EXTRA_DIST)'; \
- for f in $$files; do \
- if test -f $$f; then d=.; else d=$(srcdir); fi; \
- rm -f $(distdir)/$$f && cp $$d/$$f $(distdir) || exit 1; done
- rm -rf "$(distdir)/docs/_build"
-
-check.quality:
- (cd $(abs_top_srcdir) && $(PYTHON) -m flake8);
-
-check.gdb:
- cd tests && $(MAKE) check.gdb
-
-check.nemiver:
- cd tests && $(MAKE) check.nemiver
-
-check.valgrind:
- cd tests && $(MAKE) check.valgrind
-
-check.valgrindlog:
- cd tests && $(MAKE) check.valgrindlog
-
-check.valgrindxml:
- cd tests && $(MAKE) check.valgrindxml
-
-@CODE_COVERAGE_RULES@
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index 56b7d0a7..00000000
--- a/autogen.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-test -n "$srcdir" || srcdir=$(dirname "$0")
-test -n "$srcdir" || srcdir=.
-
-olddir=$(pwd)
-
-cd $srcdir
-
-(test -f configure.ac) || {
- echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***"
- exit 1
-}
-
-# shellcheck disable=SC2016
-PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)
-
-if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
- echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
- echo "*** If you wish to pass any to it, please specify them on the" >&2
- echo "*** '$0' command line." >&2
- echo "" >&2
-fi
-
-aclocal --install || exit 1
-autoreconf --verbose --force --install || exit 1
-
-cd "$olddir"
-if [ "$NOCONFIGURE" = "" ]; then
- $srcdir/configure "$@" || exit 1
-
- if [ "$1" = "--help" ]; then exit 0 else
- echo "Now type 'make' to compile $PKG_NAME" || exit 1
- fi
-else
- echo "Skipping configure process."
-fi
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 9f4c54cd..00000000
--- a/configure.ac
+++ /dev/null
@@ -1,216 +0,0 @@
--*- mode: m4 -*-
-AC_PREREQ([2.68])
-
-# The version of python used is determined by the executable pointed to by the
-# --with-python switch, or if that's not set, by the PYTHON environment
-# variable. For instance if your system installs Python 3 as python3 to
-# configure to compile pygobject under Python 3 you would do this:
-# $ ./configure --with-python=python3
-# or
-# $ PYTHON=python3 ./configure
-#
-# You can also build against a full interpreter path, such as
-# $ ./configure --with-python=~/my-patched-python/python
-
-m4_define(python_min_ver, 2.7)
-m4_define(python3_min_ver, 3.4)
-
-dnl the pygobject version number
-m4_define(pygobject_major_version, 3)
-m4_define(pygobject_minor_version, 29)
-m4_define(pygobject_micro_version, 0)
-m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
-
-dnl versions of packages we require ...
-m4_define(introspection_required_version, 1.46.0)
-m4_define(pycairo_required_version, 1.11.1)
-m4_define(glib_required_version, 2.38.0)
-m4_define(gio_required_version, 2.38.0)
-m4_define(libffi_required_version, 3.0)
-
-AC_INIT([pygobject],[pygobject_version],
- [http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject],
- [pygobject],[https://wiki.gnome.org/Projects/PyGObject/])
-
-m4_ifndef([AX_IS_RELEASE], [AC_MSG_ERROR(['autoconf-archive' missing])])
-
-AX_IS_RELEASE([minor-version])
-AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_SRCDIR([gi/gimodule.c])
-
-AC_DEFINE(PYGOBJECT_MAJOR_VERSION, pygobject_major_version, [pygobject major version])
-AC_SUBST(PYGOBJECT_MAJOR_VERSION, pygobject_major_version)
-AC_DEFINE(PYGOBJECT_MINOR_VERSION, pygobject_minor_version, [pygobject minor version])
-AC_SUBST(PYGOBJECT_MINOR_VERSION, pygobject_minor_version)
-AC_DEFINE(PYGOBJECT_MICRO_VERSION, pygobject_micro_version, [pygobject micro version])
-AC_SUBST(PYGOBJECT_MICRO_VERSION, pygobject_micro_version)
-
-AC_CONFIG_HEADERS(config.h)
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
-AM_INIT_AUTOMAKE([1.13 foreign no-dist-gzip dist-xz])
-
-AC_CANONICAL_BUILD
-AC_CANONICAL_HOST
-AC_MSG_CHECKING([for build time linking with Python (Win32)])
-case "$host" in
- *-*-mingw*|*-*-cygwin*)
- os_win32=yes
- link_python_libs=yes
- OS_EXT=dll
- ;;
- *-*-darwin*)
- os_win32=no
- link_python_libs=no
- OS_EXT=dylib
- ;;
- *)
- os_win32=no
- link_python_libs=no
- OS_EXT=so
- ;;
-esac
-AC_MSG_RESULT([$link_python_libs])
-AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
-
-AC_SUBST(OS_EXT)
-AC_DEFINE_UNQUOTED(OS_EXT, "$OS_EXT", [Define shared library extension])
-
-LT_PREREQ([2.2.6])
-LT_INIT([dlopen win32-dll disable-static])
-
-AC_SEARCH_LIBS([strerror],[cposix])
-AC_PROG_CC
-AM_PROG_CC_C_O
-
-# option to specify python interpreter to use; this just sets $PYTHON, so that
-# we will fallback to reading $PYTHON if --with-python is not given, and
-# python.m4 will get the expected input
-AC_ARG_WITH(python,
- AS_HELP_STRING([--with-python=PATH],[Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
- [PYTHON="$withval"], [])
-if test x"$PYTHON" = xyes; then
- AC_MSG_ERROR([--with-python option requires a path or program argument])
-fi
-if test -n "$PYTHON" && ! which "$PYTHON"; then
- AC_MSG_ERROR([Python interpreter $PYTHON does not exist])
-fi
-
-# check that we have the minimum version of python necessary to build
-JD_PATH_PYTHON(python_min_ver)
-
-# check if we are building for python 3
-AM_PYTHON_CHECK_VERSION([$PYTHON], [3.0],
- build_py3k=true,
- build_py3k=false)
-
-# if building for python 3 make sure we have the minimum version supported
-if test $build_py3k = true ; then
- AC_MSG_CHECKING([for $PYTHON >=] python3_min_ver)
- AM_PYTHON_CHECK_VERSION([$PYTHON], python3_min_ver,
- [AC_MSG_RESULT(yes)],
- [AC_MSG_ERROR(too old)])
-fi
-
-# - 'SO' for PyPy, CPython 2.7-3.2
-# - 'EXT_SUFFIX' for CPython3.3+ (http://bugs.python.org/issue16754)
-# - fallback to '.so'
-PYTHON_SO=`$PYTHON -c "import distutils.sysconfig, sys; get = distutils.sysconfig.get_config_var; sys.stdout.write(get('EXT_SUFFIX') or get('SO') or '.so');"`
-AC_SUBST(PYTHON_SO)
-
-PYG_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found]))
-if test "x$link_python_libs" = "xyes"; then
- PYG_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.]))
-fi
-
-dnl get rid of the -export-dynamic stuff from the configure flags ...
-export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
-
-dnl glib
-AM_PATH_GLIB_2_0(glib_required_version,,[AC_MSG_ERROR(maybe you want the pygobject-2-4 branch?)],gobject $extra_mods)
-if test -n "$export_dynamic"; then
- GLIB_LIBS=`echo $GLIB_LIBS | sed -e "s/$export_dynamic//"`
-fi
-
-PYTHON_VALGRIND_SUPP=`$PYTHON -c "import sys; sys.stdout.write('python' + sys.version.__getitem__(0))"`
-AC_SUBST([PYTHON_VALGRIND_SUPP])
-
-dnl libffi
-PKG_CHECK_MODULES(FFI, libffi >= libffi_required_version)
-
-AC_SUBST(FFI_CFLAGS)
-AC_SUBST(FFI_LIBS)
-
-dnl gio
-PKG_CHECK_MODULES(GIO, gio-2.0 >= gio_required_version)
-
-AC_ARG_ENABLE(cairo,
- AS_HELP_STRING([--enable-cairo],[Enable Cairo bindings using introspection information]),
- enable_cairo=$enableval,
- enable_cairo=yes)
-
-PKG_CHECK_MODULES(GI,
- glib-2.0 >= glib_required_version
- gobject-introspection-1.0 >= introspection_required_version
-)
-
-GOBJECT_INTROSPECTION_CHECK(introspection_required_version)
-
-GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0)
-AC_SUBST(GI_DATADIR)
-
-if test "$enable_cairo" != no; then
- PKG_CHECK_MODULES(CAIRO, cairo cairo-gobject)
-
- if test $build_py3k = true; then
- PKG_CHECK_MODULES(PYCAIRO,
- py3cairo >= pycairo_required_version
- )
- else
- PKG_CHECK_MODULES(PYCAIRO,
- pycairo >= pycairo_required_version
- )
- fi
-fi
-AM_CONDITIONAL(ENABLE_CAIRO, test "$enable_cairo" = "yes")
-
-AC_ARG_WITH(common,
- AS_HELP_STRING([--without-common],
- [For package maintainers: do not install Python version independent files]),
- with_common=$enableval,
- with_common=yes)
-AM_CONDITIONAL(WITH_COMMON, test "$with_common" = "yes")
-
-# Disable -Werror always, see
-# https://mail.gnome.org/archives/desktop-devel-list/2017-April/msg00009.html
-AX_COMPILER_FLAGS(,, [yes])
-# Disable some warnings, either because they get generated by headers of
-# dependencies we don't control or because it was hard to fix them.
-# Feel free and try to get rid of them.
-# For clang only:
-AX_APPEND_COMPILE_FLAGS([-Wno-unknown-warning-option -Wno-incompatible-pointer-types-discards-qualifiers -Wno-cast-align])
-# For gcc + clang:
-AX_APPEND_COMPILE_FLAGS([-Wno-discarded-qualifiers -Wno-redundant-decls -Wno-switch-enum -Wno-undef])
-
-AX_CODE_COVERAGE()
-
-AC_CONFIG_FILES(
- Makefile
- pygobject-3.0.pc
- gi/Makefile
- gi/repository/Makefile
- gi/overrides/Makefile
- examples/Makefile
- tests/Makefile
- pygtkcompat/Makefile
- PKG-INFO)
-AC_OUTPUT
-
-AC_MSG_RESULT([
- pygobject $VERSION
-
- Is release: $ax_is_release
- Using python interpreter: $PYTHON
- cairo support: $enable_cairo
- code coverage support: $enable_code_coverage
-])
-
diff --git a/examples/Makefile.am b/examples/Makefile.am
deleted file mode 100644
index c023cc01..00000000
--- a/examples/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-EXTRA_DIST = \
- properties.py \
- signal.py \
- option.py \
- cairo-demo.py \
- demo
diff --git a/gi/Makefile.am b/gi/Makefile.am
deleted file mode 100644
index 025c7d59..00000000
--- a/gi/Makefile.am
+++ /dev/null
@@ -1,176 +0,0 @@
-PLATFORM_VERSION = 3.0
-
-SUBDIRS = \
- repository \
- overrides
-
-extension_cppflags = \
- $(PYTHON_INCLUDES) \
- -DPY_SSIZE_T_CLEAN
-
-extension_ldflags = \
- -module \
- -avoid-version \
- -shrext $(PYTHON_SO)
-
-if OS_WIN32
-# Windows requires Python modules to be explicitly linked to libpython.
-# Extension modules are shared libaries (.dll), but need to be
-# called .pyd for Python to load it as an extension module.
-extension_libadd = \
- $(PYTHON_LIBS)
-
-extension_ldflags += \
- -no-undefined
-endif
-
-pkgincludedir = $(includedir)/pygobject-$(PLATFORM_VERSION)
-if WITH_COMMON
-pkginclude_HEADERS = pygobject.h
-endif
-
-pygidir = $(pyexecdir)/gi
-
-pygi_LTLIBRARIES = _gi.la
-
-_gi_la_SOURCES = \
- pygboxed.c \
- pygboxed.h \
- pygenum.c \
- pygenum.h \
- pygflags.c \
- pygflags.h \
- pyginterface.c \
- pyginterface.h \
- pygobject.h \
- pygobject-internal.h \
- pygobject-object.c \
- pygobject-object.h \
- pygparamspec.c \
- pygparamspec.h \
- pygpointer.c \
- pygpointer.h \
- pygtype.c \
- pygtype.h \
- pygoptioncontext.c \
- pygoptioncontext.h \
- pygoptiongroup.c \
- pygoptiongroup.h \
- pygspawn.c \
- pygspawn.h \
- pygi-python-compat.c \
- pygi-python-compat.h \
- gimodule.c \
- gimodule.h \
- pygi-repository.c \
- pygi-repository.h \
- pygi-info.c \
- pygi-info.h \
- pygi-foreign.c \
- pygi-foreign.h \
- pygi-foreign-api.h \
- pygi-struct.c \
- pygi-struct.h \
- pygi-source.c \
- pygi-source.h \
- pygi-argument.c \
- pygi-argument.h \
- pygi-resulttuple.c \
- pygi-resulttuple.h \
- pygi-type.c \
- pygi-type.h \
- pygi-boxed.c \
- pygi-boxed.h \
- pygi-closure.c \
- pygi-closure.h \
- pygi-ccallback.c \
- pygi-ccallback.h \
- pygi-util.c \
- pygi-util.h \
- pygi-property.c \
- pygi-property.h \
- pygi-signal-closure.c \
- pygi-signal-closure.h \
- pygi-invoke.c \
- pygi-invoke.h \
- pygi-invoke-state-struct.h \
- pygi-cache.h \
- pygi-cache.c \
- pygi-marshal-cleanup.c \
- pygi-marshal-cleanup.h \
- pygi-basictype.c \
- pygi-basictype.h \
- pygi-list.c \
- pygi-list.h \
- pygi-array.c \
- pygi-array.h \
- pygi-error.c \
- pygi-error.h \
- pygi-object.c \
- pygi-object.h \
- pygi-value.c \
- pygi-value.h \
- pygi-enum-marshal.c \
- pygi-enum-marshal.h \
- pygi-struct-marshal.c \
- pygi-struct-marshal.h \
- pygi-hashtable.c \
- pygi-hashtable.h
-_gi_la_CFLAGS = \
- $(CODE_COVERAGE_CFLAGS) \
- $(WARN_CFLAGS) \
- $(extension_cppflags) \
- $(GLIB_CFLAGS) \
- $(GI_CFLAGS)
-_gi_la_CPPFLAGS = \
- $(CODE_COVERAGE_CPPFLAGS) \
- $(extension_cppflags)
-_gi_la_LIBADD = \
- $(CODE_COVERAGE_LIBS) \
- $(extension_libadd) \
- $(GLIB_LIBS) \
- $(GI_LIBS) \
- $(FFI_LIBS)
-_gi_la_LDFLAGS = \
- $(WARN_LDFLAGS) \
- $(extension_ldflags) \
- -export-symbols-regex "init_gi|PyInit__gi"
-
-if ENABLE_CAIRO
-pygi_LTLIBRARIES += _gi_cairo.la
-endif
-
-_gi_cairo_la_SOURCES = \
- pygi-foreign-cairo.c
-_gi_cairo_la_CFLAGS = \
- $(CODE_COVERAGE_CFLAGS) \
- $(WARN_CFLAGS) \
- $(GI_CFLAGS) \
- $(CAIRO_CFLAGS) \
- $(PYCAIRO_CFLAGS)
-_gi_cairo_la_CPPFLAGS = \
- $(CODE_COVERAGE_CPPFLAGS) \
- $(extension_cppflags)
-_gi_cairo_la_LIBADD = \
- $(CODE_COVERAGE_LIBS) \
- $(extension_libadd) \
- $(GI_LIBS) \
- $(CAIRO_LIBS) \
- $(PYCAIRO_LIBS)
-_gi_cairo_la_LDFLAGS = \
- $(WARN_LDFLAGS) \
- $(extension_ldflags) \
- -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo"
-
-
-# This is to ensure we have a symlink to the .so in the
-# build directory, which the Python interpreter can load
-# directly without having to know how to parse .la files.
-%$(PYTHON_SO): %.la
- $(LN_S) -f .libs/$@ $@
-
-all-local: $(LTLIBRARIES:.la=$(PYTHON_SO))
-
-check-local: $(LTLIBRARIES:.la=$(PYTHON_SO))
-clean-local:
- rm -f $(LTLIBRARIES:.la=$(PYTHON_SO))
diff --git a/gi/overrides/Makefile.am b/gi/overrides/Makefile.am
deleted file mode 100644
index e69c91cc..00000000
--- a/gi/overrides/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-pygioverridesdir = $(pyexecdir)/gi/overrides
-
-pygioverrides_PYTHON = \
- GLib.py \
- Gtk.py \
- Gdk.py \
- GObject.py \
- Gio.py \
- GIMarshallingTests.py \
- Pango.py \
- keysyms.py \
- __init__.py
-
-# if we build in a separate tree, we need to symlink the *.py files from the
-# source tree; Python does not accept the extensions and modules in different
-# paths
-build_pylinks:
- for f in $(pygioverrides_PYTHON); do \
- [ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \
- done
-
-all-local: build_pylinks
-check-local: build_pylinks
diff --git a/gi/repository/Makefile.am b/gi/repository/Makefile.am
deleted file mode 100644
index 1177ad54..00000000
--- a/gi/repository/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-pygirepositorydir = $(pyexecdir)/gi/repository
-
-pygirepository_PYTHON = \
- __init__.py
-
-
-# if we build in a separate tree, we need to symlink the *.py files from the
-# source tree; Python does not accept the extensions and modules in different
-# paths
-build_pylinks:
- for f in $(pygirepository_PYTHON); do \
- [ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \
- done
-
-all-local: build_pylinks
-check-local: build_pylinks
diff --git a/m4/introspection.m4 b/m4/introspection.m4
deleted file mode 100644
index d89c3d90..00000000
--- a/m4/introspection.m4
+++ /dev/null
@@ -1,96 +0,0 @@
-dnl -*- mode: autoconf -*-
-dnl Copyright 2009 Johan Dahlin
-dnl
-dnl This file is free software; the author(s) gives unlimited
-dnl permission to copy and/or distribute it, with or without
-dnl modifications, as long as this notice is preserved.
-dnl
-
-# serial 1
-
-m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
-[
- AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
- AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
- AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
-
- dnl enable/disable introspection
- m4_if([$2], [require],
- [dnl
- enable_introspection=yes
- ],[dnl
- AC_ARG_ENABLE(introspection,
- AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
- [Enable introspection for this build]),,
- [enable_introspection=auto])
- ])dnl
-
- AC_MSG_CHECKING([for gobject-introspection])
-
- dnl presence/version checking
- AS_CASE([$enable_introspection],
- [no], [dnl
- found_introspection="no (disabled, use --enable-introspection to enable)"
- ],dnl
- [yes],[dnl
- PKG_CHECK_EXISTS([gobject-introspection-1.0],,
- AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
- PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
- found_introspection=yes,
- AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
- ],dnl
- [auto],[dnl
- PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
- dnl Canonicalize enable_introspection
- enable_introspection=$found_introspection
- ],dnl
- [dnl
- AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
- ])dnl
-
- AC_MSG_RESULT([$found_introspection])
-
- INTROSPECTION_SCANNER=
- INTROSPECTION_COMPILER=
- INTROSPECTION_GENERATE=
- INTROSPECTION_GIRDIR=
- INTROSPECTION_TYPELIBDIR=
- if test "x$found_introspection" = "xyes"; then
- INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
- INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
- INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
- INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
- INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
- INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
- INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
- INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
- fi
- AC_SUBST(INTROSPECTION_SCANNER)
- AC_SUBST(INTROSPECTION_COMPILER)
- AC_SUBST(INTROSPECTION_GENERATE)
- AC_SUBST(INTROSPECTION_GIRDIR)
- AC_SUBST(INTROSPECTION_TYPELIBDIR)
- AC_SUBST(INTROSPECTION_CFLAGS)
- AC_SUBST(INTROSPECTION_LIBS)
- AC_SUBST(INTROSPECTION_MAKEFILE)
-
- AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
-])
-
-
-dnl Usage:
-dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
-
-AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
-[
- _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
-])
-
-dnl Usage:
-dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
-
-
-AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
-[
- _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
-])
diff --git a/m4/python.m4 b/m4/python.m4
deleted file mode 100644
index 1275d7f9..00000000
--- a/m4/python.m4
+++ /dev/null
@@ -1,237 +0,0 @@
-## this one is commonly used with AM_PATH_PYTHONDIR ...
-dnl PYG_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
-dnl Check if a module containing a given symbol is visible to python.
-AC_DEFUN([PYG_CHECK_PYMOD],
-[AC_REQUIRE([AM_PATH_PYTHON])
-py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
-AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
-AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
-ifelse([$2],[], [prog="
-import sys
-try:
- import $1
-except ImportError:
- sys.exit(1)
-except:
- sys.exit(0)
-sys.exit(0)"], [prog="
-import $1
-$1.$2"])
-if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
- then
- eval "py_cv_mod_$py_mod_var=yes"
- else
- eval "py_cv_mod_$py_mod_var=no"
- fi
-])
-py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
-if test "x$py_val" != xno; then
- AC_MSG_RESULT(yes)
- ifelse([$3], [],, [$3
-])dnl
-else
- AC_MSG_RESULT(no)
- ifelse([$4], [],, [$4
-])dnl
-fi
-])
-
-dnl a macro to check for ability to create python extensions
-dnl PYG_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
-dnl function also defines PYTHON_INCLUDES
-AC_DEFUN([PYG_CHECK_PYTHON_HEADERS],
-[AC_REQUIRE([AM_PATH_PYTHON])
-AC_MSG_CHECKING(for headers required to compile python extensions)
-dnl deduce PYTHON_INCLUDES
-if test "x$PYTHON_INCLUDES" = x; then
- PYTHON_CONFIG=`which $PYTHON`-config
- if test -x "$PYTHON_CONFIG"; then
- PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null`
- else
- PYTHON_INCLUDES=`$PYTHON -c "import distutils.sysconfig, sys; sys.stdout.write(distutils.sysconfig.get_python_inc(True))"`
- PYTHON_INCLUDES="-I$PYTHON_INCLUDES"
- fi
-fi
-AC_SUBST(PYTHON_INCLUDES)
-dnl check if the headers exist:
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
-AC_TRY_CPP([#include <Python.h>],dnl
-[AC_MSG_RESULT(found)
-$1],dnl
-[AC_MSG_RESULT(not found)
-$2])
-CPPFLAGS="$save_CPPFLAGS"
-])
-
-dnl a macro to check for ability to embed python
-dnl PYG_CHECK_PYTHON_LIBS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
-dnl function also defines PYTHON_LIBS
-AC_DEFUN([PYG_CHECK_PYTHON_LIBS],
-[AC_REQUIRE([AM_PATH_PYTHON])
-AC_MSG_CHECKING(for libraries required to embed python)
-dnl deduce PYTHON_LIBS
-py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
-if test "x$PYTHON_LIBS" = x; then
- PYTHON_CONFIG=`which $PYTHON`-config
- if test -x "$PYTHON_CONFIG"; then
- PYTHON_LIBS=`$PYTHON_CONFIG --ldflags 2>/dev/null`
- else
- PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}"
- fi
-fi
-if test "x$PYTHON_LIB_LOC" = x; then
- PYTHON_LIB_LOC="${py_prefix}/lib"
-fi
-AC_SUBST(PYTHON_LIBS)
-AC_SUBST(PYTHON_LIB_LOC)
-dnl check if the headers exist:
-save_LIBS="$LIBS"
-LIBS="$LIBS $PYTHON_LIBS"
-AC_TRY_LINK_FUNC(Py_Initialize, dnl
- [LIBS="$save_LIBS"; AC_MSG_RESULT(yes); $1], dnl
- [LIBS="$save_LIBS"; AC_MSG_RESULT(no); $2])
-
-])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# JD_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# ---------------------------------------------------------------------------
-# Adds support for distributing Python modules and packages. To
-# install modules, copy them to $(pythondir), using the python_PYTHON
-# automake variable. To install a package with the same name as the
-# automake package, install to $(pkgpythondir), or use the
-# pkgpython_PYTHON automake variable.
-#
-# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
-# locations to install python extension modules (shared libraries).
-# Another macro is required to find the appropriate flags to compile
-# extension modules.
-#
-# If your package is configured with a different prefix to python,
-# users will have to add the install directory to the PYTHONPATH
-# environment variable, or create a .pth file (see the python
-# documentation for details).
-#
-# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
-# cause an error if the version of python installed on the system
-# doesn't meet the requirement. MINIMUM-VERSION should consist of
-# numbers and dots only.
-AC_DEFUN([JD_PATH_PYTHON],
- [
- dnl Find a Python interpreter. Python versions prior to 2.0 are not
- dnl supported
- m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
- [python3 python3.3 python3.2 python3.1 python2 python2.7 python])
-
- m4_if([$1],[],[
- dnl No version check is needed.
- # Find any Python interpreter.
- if test -z "$PYTHON"; then
- AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
- fi
- am_display_PYTHON=python
- ], [
- dnl A version check is needed.
- if test -n "$PYTHON"; then
- # If the user set $PYTHON, use it and don't search something else.
- AC_MSG_CHECKING([whether $PYTHON version >= $1])
- AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_ERROR(too old)])
- am_display_PYTHON=$PYTHON
- else
- # Otherwise, try each interpreter until we find one that satisfies
- # VERSION.
- AC_CACHE_CHECK([for a Python interpreter with version >= $1],
- [am_cv_pathless_PYTHON],[
- for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
- test "$am_cv_pathless_PYTHON" = none && break
- AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
- done])
- # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
- if test "$am_cv_pathless_PYTHON" = none; then
- PYTHON=:
- else
- AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
- fi
- am_display_PYTHON=$am_cv_pathless_PYTHON
- fi
- ])
-
- if test "$PYTHON" = :; then
- dnl Run any user-specified action, or abort.
- m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
- else
-
- dnl Query Python for its version number. Getting [:3] seems to be
- dnl the best way to do this; it's what "site.py" does in the standard
- dnl library.
-
- AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
- [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
- AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
-
- dnl Use the values of $prefix and $exec_prefix for the corresponding
- dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
- dnl distinct variables so they can be overridden if need be. However,
- dnl general consensus is that you shouldn't need this ability.
-
- AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
- AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
-
- dnl At times (like when building shared libraries) you may want
- dnl to know which OS platform Python thinks this is.
-
- AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
- [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
- AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
-
-
- dnl Set up 4 directories:
-
- dnl pythondir -- where to install python scripts. This is the
- dnl site-packages directory, not the python standard library
- dnl directory like in previous automake betas. This behavior
- dnl is more consistent with lispdir.m4 for example.
- dnl Query distutils for this directory. distutils does not exist in
- dnl Python 1.5, so we fall back to the hardcoded directory if it
- dnl doesn't work.
- AC_CACHE_CHECK([for $am_display_PYTHON script directory],
- [am_cv_python_pythondir],
- [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX'))" 2>/dev/null ||
- echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`])
- AC_SUBST([pythondir], [$am_cv_python_pythondir])
-
- dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
- dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
- dnl more consistent with the rest of automake.
-
- AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
-
- dnl pyexecdir -- directory for installing python extension modules
- dnl (shared libraries)
- dnl Query distutils for this directory. distutils does not exist in
- dnl Python 1.5, so we fall back to the hardcoded directory if it
- dnl doesn't work.
- AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
- [am_cv_python_pyexecdir],
- [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX'))" 2>/dev/null ||
- echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`])
- AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
-
- dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
-
- AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
-
- dnl Run any user-specified action.
- $2
- fi
-
-])
diff --git a/pygtkcompat/Makefile.am b/pygtkcompat/Makefile.am
deleted file mode 100644
index 914b3e25..00000000
--- a/pygtkcompat/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-pygtkcompatdir = $(pyexecdir)/pygtkcompat
-
-pygtkcompat_PYTHON = \
- __init__.py \
- generictreemodel.py \
- pygtkcompat.py
-
-# if we build in a separate tree, we need to symlink the *.py files from the
-# source tree; Python does not accept the extensions and modules in different
-# paths
-build_pylinks:
- for f in $(pygtkcompat_PYTHON); do \
- [ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \
- done
-
-all-local: build_pylinks
diff --git a/setup.py b/setup.py
index e894bbf6..399a94ce 100755
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,6 @@
import io
import os
-import re
import sys
import errno
import subprocess
@@ -39,6 +38,13 @@ from distutils.sysconfig import get_python_lib, customize_compiler
from distutils import dir_util, log
+PYGOBJECT_VERISON = "3.29.0"
+GLIB_VERSION_REQUIRED = "2.38.0"
+GI_VERSION_REQUIRED = "1.46.0"
+PYCAIRO_VERSION_REQUIRED = "1.11.1"
+LIBFFI_VERSION_REQUIRED = "3.0"
+
+
def get_command_class(name):
# Returns the right class for either distutils or setuptools
return Distribution({}).get_command_class(name)
@@ -48,36 +54,25 @@ def get_pycairo_pkg_config_name():
return "py3cairo" if sys.version_info[0] == 3 else "pycairo"
-def get_version_requirement(conf_dir, pkg_config_name):
+def get_version_requirement(pkg_config_name):
"""Given a pkg-config module name gets the minimum version required"""
- if pkg_config_name in ["cairo", "cairo-gobject"]:
- return "0"
-
- mapping = {
- "gobject-introspection-1.0": "introspection",
- "glib-2.0": "glib",
- "gio-2.0": "gio",
- get_pycairo_pkg_config_name(): "pycairo",
- "libffi": "libffi",
+ versions = {
+ "gobject-introspection-1.0": GI_VERSION_REQUIRED,
+ "glib-2.0": GLIB_VERSION_REQUIRED,
+ "gio-2.0": GLIB_VERSION_REQUIRED,
+ get_pycairo_pkg_config_name(): PYCAIRO_VERSION_REQUIRED,
+ "libffi": LIBFFI_VERSION_REQUIRED,
+ "cairo": "0",
+ "cairo-gobject": "0",
}
- assert pkg_config_name in mapping
- configure_ac = os.path.join(conf_dir, "configure.ac")
- with io.open(configure_ac, "r", encoding="utf-8") as h:
- text = h.read()
- conf_name = mapping[pkg_config_name]
- res = re.findall(
- r"%s_required_version,\s*([\d\.]+)\)" % conf_name, text)
- assert len(res) == 1
- return res[0]
+ return versions[pkg_config_name]
-def parse_versions(conf_dir):
- configure_ac = os.path.join(conf_dir, "configure.ac")
- with io.open(configure_ac, "r", encoding="utf-8") as h:
- version = re.findall(r"pygobject_[^\s]+_version,\s*(\d+)\)", h.read())
- assert len(version) == 3
+def get_versions():
+ version = PYGOBJECT_VERISON.split(".")
+ assert len(version) == 3
versions = {
"PYGOBJECT_MAJOR_VERSION": version[0],
@@ -90,10 +85,10 @@ def parse_versions(conf_dir):
def parse_pkg_info(conf_dir):
"""Returns an email.message.Message instance containing the content
- of the PKG-INFO file. The version info is parsed from configure.ac
+ of the PKG-INFO file.
"""
- versions = parse_versions(conf_dir)
+ versions = get_versions()
pkg_info = os.path.join(conf_dir, "PKG-INFO.in")
with io.open(pkg_info, "r", encoding="utf-8") as h:
@@ -645,9 +640,8 @@ def get_pycairo_include_dir():
Raises if pycairo isn't found or it's too old.
"""
- script_dir = get_script_dir()
pkg_config_name = get_pycairo_pkg_config_name()
- min_version = get_version_requirement(script_dir, pkg_config_name)
+ min_version = get_version_requirement(pkg_config_name)
min_version_info = tuple(int(p) for p in min_version.split("."))
def check_path(include_dir):
@@ -741,8 +735,6 @@ def get_pycairo_include_dir():
def add_ext_pkg_config_dep(ext, compiler_type, name):
- script_dir = get_script_dir()
-
msvc_libraries = {
"glib-2.0": ["glib-2.0"],
"gio-2.0": ["gio-2.0", "gobject-2.0", "glib-2.0"],
@@ -759,7 +751,7 @@ def add_ext_pkg_config_dep(ext, compiler_type, name):
# assume that INCLUDE and LIB contains the right paths
ext.libraries += fallback_libs
else:
- min_version = get_version_requirement(script_dir, name)
+ min_version = get_version_requirement(name)
pkg_config_version_check(name, min_version)
ext.include_dirs += pkg_config_parse("--cflags-only-I", name)
ext.library_dirs += pkg_config_parse("--libs-only-L", name)
@@ -846,8 +838,8 @@ class build_ext(du_build_ext):
def _write_config_h(self):
script_dir = get_script_dir()
target = os.path.join(script_dir, "config.h")
- versions = parse_versions(script_dir)
- content = """
+ versions = get_versions()
+ content = u"""
/* Configuration header created by setup.py - do not edit */
#ifndef _CONFIG_H
#define _CONFIG_H 1
@@ -1050,7 +1042,7 @@ def main():
},
install_requires=[
"pycairo>=%s" % get_version_requirement(
- script_dir, get_pycairo_pkg_config_name()),
+ get_pycairo_pkg_config_name()),
],
data_files=[
('include/pygobject-3.0', ['gi/pygobject.h']),
diff --git a/tests/Makefile.am b/tests/Makefile.am
deleted file mode 100644
index 41d15033..00000000
--- a/tests/Makefile.am
+++ /dev/null
@@ -1,215 +0,0 @@
-CLEANFILES =
-test_ltlibraries = libgimarshallingtests.la
-test_typelibs = GIMarshallingTests-1.0.typelib
-extension_ltlibraries =
-extension_libadd =
-
-common_ldflags = \
- -avoid-version \
- -rpath $(abs_builddir) \
- -shared
-
-if OS_WIN32
-extension_libadd += \
- $(PYTHON_LIBS)
-
-common_ldflags += \
- -no-undefined
-endif
-
-# Note for Python extensions we need to use .so on Mac OSX, not .dylib
-extension_ldflags = \
- $(common_ldflags) \
- -module \
- -shrext $(PYTHON_SO)
-
-extension_cppflags = \
- $(PYTHON_INCLUDES) \
- -DPY_SSIZE_T_CLEAN
-
-nodist_libgimarshallingtests_la_SOURCES = \
- $(GI_DATADIR)/tests/gimarshallingtests.c \
- $(GI_DATADIR)/tests/gimarshallingtests.h
-
-dist_libgimarshallingtests_la_SOURCES = \
- $(srcdir)/gimarshallingtestsextra.c \
- $(srcdir)/gimarshallingtestsextra.h
-
-# We don't control the source so don't pass WARN_CFLAGS etc
-libgimarshallingtests_la_CFLAGS = $(GLIB_CFLAGS)
-libgimarshallingtests_la_LDFLAGS = $(common_ldflags)
-libgimarshallingtests_la_LIBADD = $(GLIB_LIBS)
-
-GIMarshallingTests-1.0.gir: libgimarshallingtests.la Makefile
- $(AM_V_GEN) $(INTROSPECTION_SCANNER) --include=Gio-2.0 \
- --namespace=GIMarshallingTests --nsversion=1.0 --symbol-prefix=gi_marshalling_tests \
- --warn-all --warn-error \
- --library=libgimarshallingtests.la \
- --libtool="$(top_builddir)/libtool" \
- --output $@ \
- $(nodist_libgimarshallingtests_la_SOURCES) \
- $(dist_libgimarshallingtests_la_SOURCES)
-
-GIMarshallingTests-1.0.typelib: GIMarshallingTests-1.0.gir Makefile
- $(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@
-
-# regress.c needs cairo
-test_ltlibraries += libregress.la
-test_typelibs += Regress-1.0.typelib
-nodist_libregress_la_SOURCES = $(GI_DATADIR)/tests/regress.c $(GI_DATADIR)/tests/regress.h
-dist_libregress_la_SOURCES = $(srcdir)/regressextra.c $(srcdir)/regressextra.h
-# We don't control the source so don't pass WARN_CFLAGS etc
-if ENABLE_CAIRO
-libregress_la_CFLAGS = $(GIO_CFLAGS) $(CAIRO_CFLAGS) -I$(GI_DATADIR)/tests
-libregress_la_LIBADD = $(GIO_LIBS) $(CAIRO_LIBS)
-else
-libregress_la_CFLAGS = $(GIO_CFLAGS) -D_GI_DISABLE_CAIRO -I$(GI_DATADIR)/tests
-libregress_la_LIBADD = $(GIO_LIBS) $(CAIRO_LIBS)
-endif
-libregress_la_LDFLAGS = $(common_ldflags)
-
-# g-i doesn't ship these as shared libraries anymore; we build them here
-Regress-1.0.gir: libregress.la Makefile
- $(AM_V_GEN) $(INTROSPECTION_SCANNER) --include=cairo-1.0 --include=Gio-2.0 \
- --namespace=Regress --nsversion=1.0 \
- --warn-all --warn-error \
- --library=libregress.la \
- --libtool="$(top_builddir)/libtool" \
- --output $@ \
- $(nodist_libregress_la_SOURCES) \
- $(dist_libregress_la_SOURCES)
-Regress-1.0.typelib: Regress-1.0.gir Makefile
- $(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@
-
-gschemas.compiled: org.gnome.test.gschema.xml
- glib-compile-schemas --targetdir=. --schema-file=$<
-
-CLEANFILES += Regress-1.0.gir Regress-1.0.typelib GIMarshallingTests-1.0.gir GIMarshallingTests-1.0.typelib gschemas.compiled
-
-extension_ltlibraries += testhelper.la
-
-testhelper_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(WARN_CFLAGS) -I$(top_srcdir)/gi $(extension_cppflags) $(GLIB_CFLAGS)
-testhelper_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(extension_cppflags)
-testhelper_la_LDFLAGS = $(WARN_LDFLAGS) $(extension_ldflags)
-testhelper_la_LIBADD = $(CODE_COVERAGE_LIBS) $(GLIB_LIBS) $(extension_libadd)
-
-testhelper_la_SOURCES = \
- testhelpermodule.c \
- test-floating.c \
- test-thread.c \
- test-unknown.c
-
-check_LTLIBRARIES = $(test_ltlibraries) $(extension_ltlibraries)
-
-target_libraries = \
- $(test_ltlibraries:.la=.$(OS_EXT)) \
- $(extension_ltlibraries:.la=$(PYTHON_SO))
-
-$(target_libraries):
- test -L $@ || $(LN_S) .libs/$@ $@
-
-EXTRA_DIST = \
- helper.py \
- compathelper.py \
- runtests.py \
- test-floating.h \
- test-thread.h \
- test-unknown.h \
- org.gnome.test.gschema.xml \
- test_cairo.py \
- test_error.py \
- test_fields.py \
- test_gio.py \
- test_glib.py \
- test_gobject.py \
- test_gtype.py \
- test_interface.py \
- test_internal_api.py \
- test_iochannel.py \
- test_mainloop.py \
- test_object_marshaling.py \
- test_option.py \
- test_properties.py \
- test_pygtkcompat.py \
- test_signal.py \
- test_source.py \
- test_subprocess.py \
- test_thread.py \
- test_typeclass.py \
- test_everything.py \
- test_gi.py \
- test_gdbus.py \
- test_import_machinery.py \
- test_overrides_glib.py \
- test_overrides_pango.py \
- test_overrides_gdk.py \
- test_overrides_gtk.py \
- test_atoms.py \
- test_generictreemodel.py \
- test_docstring.py \
- test_repository.py \
- test_resulttuple.py \
- test_unknown.py \
- test_ossig.py \
- conftest.py \
- __init__.py \
- gi/overrides/__init__.py \
- gi/overrides/Regress.py \
- $(NULL)
-
-clean-local:
- rm -f $(target_libraries) file.txt~;
- @if [ "$(abs_builddir)" != "$(abs_srcdir)" ]; then \
- rm -f __init__.py; \
- fi;
-
-# Unsetting MSYSTEM prevents msys2 from changing os.path.sep to "/"
-RUN_TESTS_ENV_VARS= \
- MALLOC_PERTURB_=85 \
- MALLOC_CHECK_=3 \
- G_SLICE=debug-blocks \
- MSYSTEM= \
- TESTS_BUILDDIR=$(builddir)
-
-# for non-srcdir builds
-$(abs_builddir)/__init__.py: $(abs_srcdir)/__init__.py
- echo "__path__ = __import__('pkgutil').extend_path(__path__, __name__)" > $@
-
-# pygtkcompat tests need to be run in a separate process as they
-# clobber global name space
-check-local: $(target_libraries) $(test_typelibs) gschemas.compiled $(abs_builddir)/__init__.py
- $(RUN_TESTS_ENV_VARS) $(EXTRA_ENV) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py;
-
-check.gdb:
- EXEC_NAME="gdb --args" $(MAKE) check
-
-check.nemiver:
- EXEC_NAME="nemiver" $(MAKE) check
-
-# Note G_SLICE in these check variations is intended to clobber the default set in RUN_TESTS_ENV_VARS
-check.valgrind:
- EXTRA_ENV="G_SLICE=always-malloc G_DEBUG=gc-friendly PYTHONMALLOC=malloc" \
- EXEC_NAME="valgrind --leak-check=full --show-possibly-lost=no --num-callers=20 \
- --suppressions=$(top_srcdir)/tests/$(PYTHON_VALGRIND_SUPP).supp \
- " \
- $(MAKE) check
-
-check.valgrindlog:
- mkdir -p $(top_builddir)/tmp
- EXTRA_ENV="G_SLICE=always-malloc G_DEBUG=gc-friendly PYTHONMALLOC=malloc" \
- EXEC_NAME="valgrind --leak-check=full --show-possibly-lost=no --num-callers=20 \
- --suppressions=$(top_srcdir)/tests/$(PYTHON_VALGRIND_SUPP).supp \
- --child-silent-after-fork=yes \
- --log-file=$(top_builddir)/tmp/`git rev-parse HEAD | cut -c1-8`-$$TEST_NAMES.log \
- " \
- $(MAKE) check
-
-check.valgrindxml:
- mkdir -p $(top_builddir)/tmp
- EXTRA_ENV="G_SLICE=always-malloc G_DEBUG=gc-friendly PYTHONMALLOC=malloc" \
- EXEC_NAME="valgrind --leak-check=full --show-possibly-lost=no --num-callers=20 \
- --suppressions=$(top_srcdir)/tests/$(PYTHON_VALGRIND_SUPP).supp \
- --child-silent-after-fork=yes \
- --xml=yes --xml-file=$(top_builddir)/tmp/`git rev-parse HEAD | cut -c1-8`-$$TEST_NAMES.xml \
- " \
- $(MAKE) check