Commit Graph

27 Commits

Author SHA1 Message Date
Werner Koch
c6cab5a2bd
python: Call ln(1) in a portable way.
* lang/python/Makefile.am: Specify target dir for ln.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-10-14 16:32:59 +02:00
Alon Bar-Lev
453ab9d24c python: Link 'data.h' and 'config.h' into the builddir.
* lang/python/Makefile.am: Link to the files.
* lang/python/gpgme.i: Update path.
* lang/python/setup.py.in: Do not add the top builddir to the include
path.
--
To make it easy to build the subpackage using standard tools without
altering environment or CFLAGS, symlink the required artifacts from
source tree into subpackage directory when preparing sources.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2016-09-30 14:47:26 +02:00
Alon Bar-Lev
68fb8371a1 python: Add 'prepare' target.
* lang/python/Makefile.am: Add 'prepare' target.
--
This enables preparing the package using autoconf then build using
distutils as separate stage.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2016-09-30 14:46:28 +02:00
Justus Winter
3703a47238 python: Include 'config.h'.
* lang/python/Makefile.am: Pass 'top_builddir' to 'setup.py'.
* lang/python/gpgme.i: Include 'config.h'.
* lang/python/helpers.c: Likewise.
* lang/python/helpers.h: Likewise.
* lang/python/setup.py.in: Make sure that 'config.h' can be found.
--
Fixes build on 32 bit platforms with large file support.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-26 16:54:57 +02:00
Werner Koch
936928632b
python: Create install dir.
* lang/python/Makefile.am (install-exec-local): Create dir.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-21 09:18:00 +02:00
Werner Koch
0763357e39
tests: Make "make -j distcheck" work in Python.
* lang/python/Makefile.am (SUBDIRS): Make current dir fist.
* lang/python/tests/Makefile.am (xcheck): Depend on pubring-stamp.
(CLEANFILES): Remove private-keys-v1.d/gpg-sample.stamp.
(check-local): Remove.
(initial.py): Remove dependency.
(./pubring-stamp): Depend on conf files and the
private-keys-v1.d/gpg-sample.stamp file.  Also replace use of
basename.

--

This addresses the problem that two rules might run the private keys
copy rule and due to the files being chmod -w during make discheck the
second process running that rule's cp would get a permission error.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-20 19:58:00 +02:00
Werner Koch
29207bcd3b
tests: Improve portability.
* lang/qt/tests/Makefile.am (clean-local): Avoid non-portable "--"
* lang/python/Makefile.am (copystamp): Use well defined cp -R instead
of cp -r.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-20 19:46:04 +02:00
Justus Winter
24b4162d90 python: Build for both Python2 and Python3.
* NEWS: Update.
* configure.ac: Check for multiple Python versions.
* lang/python/Makefile.am: Build and install for both Python versions.
* lang/python/tests/Makefile.am: Test both versions.
* lang/python/tests/run-tests.py: New test runner.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-14 12:18:15 +02:00
Justus Winter
0bd7d8c197 python: Fix build system integration.
* lang/python/Makefile.am: Be more careful when cleaning the build
directory, we must not delete the generated file 'pyme/version.py'.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-08-02 18:42:26 +02:00
Justus Winter
2f754440f2 python: Rename compiled SWIG module.
Avoid the name pygpgme, as this is the name of another popular Python
binding for GPGME.

This commit renames the compiled Python module produced by SWIG.

* lang/python/Makefile.am: Rename the compiled Python module.
* lang/python/gpgme.i: Likewise.
* lang/python/pyme/core.py: Likewise.
* lang/python/pyme/errors.py: Likewise.
* lang/python/pyme/util.py: Likewise.
* lang/python/pyme/version.py.in: Likewise.
* lang/python/setup.py.in: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-07-28 16:49:50 +02:00
Justus Winter
3d4dc3f021 python: Expose less functions to the Python world.
* lang/python/Makefile.am (EXTRA_DIST, COPY_FILES): Add new file.
* lang/python/gpgme.i: Include new file and add comments.
* lang/python/helpers.c: Include new file.
* lang/python/helpers.h: Move functions we do not need to expose...
* lang/python/private.h: ... here.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-07-28 10:23:32 +02:00
Justus Winter
57b5168552 python: Improve python packaging.
* lang/python/Makefile.am: Sign source releases, and upload them.
* lang/python/setup.py.in: Add categories.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-07-12 18:34:12 +02:00
Justus Winter
ce66289137 python: Fix distcheck.
* lang/python/Makefile.am (EXTRA_DIST): Add missing files.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-07-11 19:42:56 +02:00
Justus Winter
007382ce94 python: Enable out-of-tree build of pyme bindings.
* lang/python/MANIFEST.in: Update manifest template.
* lang/python/Makefile.am: Copy more files, move generation of files
to Python build script, add 'sdist' target to build a Python source
distribution.
* lang/python/gpgme-h-clean.py: Add code to build 'errors.i'.
* lang/python/setup.py.in: Generate files, enable out-of-tree builds.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-07-11 18:09:54 +02:00
Justus Winter
52efcf1ee9 python: Fix distcheck.
* lang/python/INSTALL: Drop obsolete file.
* lang/python/Makefile.am (EXTRA_DIST): Add missing files.
(CLEANFILES): Remove generated files.
(clean-local): Fix permissions of copied files.
* lang/python/tests/Makefile.am (TESTS): Use our own setup and
teardown scripts.
(EXTRA_DIST): Add missing files.
* lang/python/tests/final.py: New file.
* lang/python/tests/initial.py: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-07-07 14:10:36 +02:00
Justus Winter
856bcfe293 python: Avoid creating SWIG proxy classes.
* lang/python/Makefile.am (gpgme_wrap.c): Use '-builtin' to make SWIG
generate builtin types for c types.
* lang/python/gpgme.i (pygpgme_wrap_gpgme_data_t): Adapt slightly.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-16 14:19:17 +02:00
Justus Winter
616929b6ed python: Wrap objects implementing the buffer protocol.
* lang/python/Makefile.am: Add the toplevel source directory to CFLAGS
when compiling the bindings so that we can use private header files.
* lang/python/gpgme.i (gpgme_data_t): Rework the object wrapping.  Do
not create a Python wrapper object, merely a gpgme_data_t object, and
keep references to buffer objects, if any.  If necessary, update the
buffer after the function call.
(pygpgme_wrap_gpgme_data_t): New function.
* lang/python/helpers.c (object_to_gpgme_data_t): Rework object
wrapping.  Also wrap objects implementing the buffer protocol.
* lang/python/helpers.h (object_to_gpgme_data_t): Update prototype.
(pygpgme_wrap_gpgme_data_t): New prototype.
* lang/python/tests/t-idiomatic.py: Demonstrate this.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-16 14:19:17 +02:00
Justus Winter
5492853d7b python: Improve the documentation.
* lang/python/Makefile.am: Copy the README file.
* lang/python/README: Rename, convert to org, and update.
* lang/python/pyme/__init__.py: Move license out of the docstring,
update docstring.
* lang/python/pyme/core.py: Add and update docstrings.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-16 14:07:41 +02:00
Justus Winter
7eef399d89 python: Get version information from the build system.
* configure.ac: Generate 'setup.py' and 'version.py'.
* lang/python/Makefile.am: Use generated setup script.
* lang/python/pyme/version.py: Turn it into a template, and get
version information from the build system.  Also drop some variables.
* lang/python/setup.py: Likewise.  This way we can avoid importing the
version module, which is frowned upon and actually caused a problem.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-16 14:07:41 +02:00
Justus Winter
3bacce03e6 python: Fix license.
Other parts of the build system are also LGPLed.

* lang/python/Makefile.am: Fix license.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-16 14:07:41 +02:00
Justus Winter
8426304b67 python: Fix stripping deprecated functionality.
* lang/python/Makefile.am (gpgme.h): Add script as input.
* lang/python/gpgme-h-clean.py (deprec_func): Also match struct
members.
(line_break): Fix matching on struct members.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-08 17:12:00 +02:00
Justus Winter
73c47535b6 python: Improve build system integration, fix warnings.
* lang/python/Makefile.am: Pass CFLAGS to python build system.
* lang/python/helpers.c (pyPassphraseCb): Use correct type for length.
(pygpgme_data_new_from_cbs): Drop unused variable.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-01 14:18:45 +02:00
Tobias Mueller
8ad17f402f python: use GPG_ERROR_CONFIG variable
instead of calling gpg-error-config.
This is useful when configuring with --with-gpgerror-prefix
because then GPG_ERROR_CONFIG contains the correct
/path/to/bin/gpg-error-config whereas calling gpg-error-config
directly would look in the user's PATH (and not in the prefix
where gpg-error-config was installed).

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-31 16:35:59 +02:00
Justus Winter
7bc9cc717e python: Make all GnuPG errors available.
* lang/python/Makefile.am (errors.i): Generate file.
* lang/python/gpgme.i: Include generated file.
* lang/python/pyme/errors.py: Pull in all errors and error sources.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-24 18:00:16 +02:00
Justus Winter
2c3a5d93e7 python: Various fixes.
* configure.ac: Fix SWIG detection, bump required Python version.
* lang/python/Makefile.am: Portability fix.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-18 15:37:38 +02:00
Justus Winter
e64bffe030 python: Add a test suite.
* configure.ac: Add new Makefile.
* lang/python/Makefile.am: Add subdirectory.
* lang/python/tests/Makefile.am: New file.
* lang/python/tests/t-wrapper.py: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 15:37:00 +02:00
Justus Winter
a29babd07c python: Integrate into the build system.
* configure.ac: Make Python bindings configurable, add new Makefile.
* lang/python/Makefile.am: New file.
* lang/python/setup.py: Integrate into the build system.
* m4/ax_pkg_swig.m4: New file from the autoconf archive.
* m4/m4_ax_swig_python.m4: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-11 13:33:05 +02:00