[git] GPGME - branch, master, updated. gpgme-1.6.0-255-g4c8265d

by Justus Winter cvs at cvs.gnupg.org
Tue Aug 2 18:49:42 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  4c8265d32ddff5960a464b8d4e8d7d2258495b2e (commit)
       via  0bd7d8c1977183abc414e11aafa26a4f834ca2a5 (commit)
      from  135185b7ef2225aa5e8c54a6cf1265d3e6cbbe48 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4c8265d32ddff5960a464b8d4e8d7d2258495b2e
Author: Justus Winter <justus at g10code.com>
Date:   Tue Aug 2 18:45:10 2016 +0200

    python: Add a flag identifying in-tree builds.
    
    * lang/python/helpers.c (pyme_in_tree_build): New variable.
    * lang/python/helpers.h (pyme_in_tree_build): New declaration.
    * lang/python/pyme/version.py.in (in_tree_build): New variable.
    * lang/python/setup.py.in: Rework macro handling, set 'IN_TREE_BUILD'
    as appropriate.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/lang/python/helpers.c b/lang/python/helpers.c
index 0406f9f..0b4a773 100644
--- a/lang/python/helpers.c
+++ b/lang/python/helpers.c
@@ -28,6 +28,15 @@
 #include "helpers.h"
 #include "private.h"
 
+/* Flag specifying whether this is an in-tree build.  */
+int pyme_in_tree_build =
+#if IN_TREE_BUILD
+  1
+#else
+  0
+#endif
+  ;
+
 static PyObject *GPGMEError = NULL;
 
 void _pyme_exception_init(void) {
diff --git a/lang/python/helpers.h b/lang/python/helpers.h
index 16a9b9f..9200f93 100644
--- a/lang/python/helpers.h
+++ b/lang/python/helpers.h
@@ -26,6 +26,9 @@
 #define write(fd, str, sz) {DWORD written; WriteFile((HANDLE) fd, str, sz, &written, 0);}
 #endif
 
+/* Flag specifying whether this is an in-tree build.  */
+extern int pyme_in_tree_build;
+
 PyObject *pyme_raise_callback_exception(PyObject *self);
 
 PyObject *pyme_set_passphrase_cb(PyObject *self, PyObject *cb);
diff --git a/lang/python/pyme/version.py.in b/lang/python/pyme/version.py.in
index a40e02d..e4a5a27 100644
--- a/lang/python/pyme/version.py.in
+++ b/lang/python/pyme/version.py.in
@@ -21,6 +21,7 @@ from . import gpgme
 productname = 'pyme'
 versionstr = "@VERSION@"
 gpgme_versionstr = gpgme.GPGME_VERSION
+in_tree_build = bool(gpgme.cvar.pyme_in_tree_build)
 
 versionlist = versionstr.split(".")
 major = versionlist[0]
diff --git a/lang/python/setup.py.in b/lang/python/setup.py.in
index 45b56a3..a524c95 100755
--- a/lang/python/setup.py.in
+++ b/lang/python/setup.py.in
@@ -28,7 +28,9 @@ gpg_error_config = "gpg-error-config"
 gpgme_config = "gpgme-config"
 gpgme_h = ""
 library_dirs = []
+in_tree = False
 extra_swig_opts = []
+extra_macros = dict()
 
 if os.path.exists("../../src/gpgme-config"):
     # In-tree build.
@@ -36,7 +38,10 @@ if os.path.exists("../../src/gpgme-config"):
     gpgme_config = "../../src/gpgme-config"
     gpgme_h = "../../src/gpgme.h"
     library_dirs = ["../../src/.libs"] # XXX uses libtool internals
-    extra_swig_opts = ["-DHAVE_DATA_H=1"]
+    extra_macros.update(
+        HAVE_DATA_H=1,
+        IN_TREE_BUILD=1,
+    )
 
 try:
     subprocess.check_call([gpg_error_config, '--version'],
@@ -87,6 +92,11 @@ include_dirs = [os.getcwd()]
 define_macros = []
 libs = getconfig('libs')
 
+# Define extra_macros for both the SWIG and C code
+for k, v in extra_macros.items():
+    extra_swig_opts.append("-D{0}={1}".format(k, v))
+    define_macros.append((k, str(v)))
+
 for item in getconfig('cflags'):
     if item.startswith("-I"):
         include_dirs.append(item[2:])

commit 0bd7d8c1977183abc414e11aafa26a4f834ca2a5
Author: Justus Winter <justus at g10code.com>
Date:   Tue Aug 2 18:42:26 2016 +0200

    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 at g10code.com>

diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am
index f0df800..8e18dab 100644
--- a/lang/python/Makefile.am
+++ b/lang/python/Makefile.am
@@ -32,14 +32,25 @@ COPY_FILES = \
 	$(srcdir)/README \
 	$(srcdir)/MANIFEST.in \
 	$(srcdir)/gpgme-h-clean.py \
-	$(srcdir)/pyme \
 	$(srcdir)/examples \
 	$(srcdir)/helpers.c $(srcdir)/helpers.h $(srcdir)/private.h
 
+COPY_FILES_PYME = \
+	$(srcdir)/pyme/callbacks.py \
+	$(srcdir)/pyme/constants \
+	$(srcdir)/pyme/core.py \
+	$(srcdir)/pyme/errors.py \
+	$(srcdir)/pyme/__init__.py \
+	$(srcdir)/pyme/results.py \
+	$(srcdir)/pyme/util.py
+
 # For VPATH builds we need to copy some files because Python's
 # distutils are not VPATH-aware.
-copystamp: $(COPY_FILES)
-	if test "$(srcdir)" != "$(builddir)" ; then cp -r $^ . ; fi
+copystamp: $(COPY_FILES) $(COPY_FILES_PYME)
+	if test "$(srcdir)" != "$(builddir)" ; then \
+	  cp -r $(COPY_FILES) . ; \
+	  cp -r $(COPY_FILES_PYME) pyme ; \
+	fi
 	touch $@
 
 all-local: copystamp
@@ -70,6 +81,9 @@ clean-local:
 	if test "$(srcdir)" != "$(builddir)" ; then \
 	  find . -type d ! -perm -200 -exec chmod u+w {} ';' ; \
 	  for F in $(COPY_FILES); do rm -rf -- `basename $$F` ; done ; \
+	  for F in $(COPY_FILES_PYME); do \
+	      rm -rf -- pyme/`basename $$F` ; \
+	  done ; \
 	fi
 
 install-exec-local:

-----------------------------------------------------------------------

Summary of changes:
 lang/python/Makefile.am        | 20 +++++++++++++++++---
 lang/python/helpers.c          |  9 +++++++++
 lang/python/helpers.h          |  3 +++
 lang/python/pyme/version.py.in |  1 +
 lang/python/setup.py.in        | 12 +++++++++++-
 5 files changed, 41 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list