forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpgme-1.7.0-build-python.patch
115 lines (97 loc) · 3.37 KB
/
gpgme-1.7.0-build-python.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
From e5bccea346379a70fd9cb910c4ead9642227747f Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <[email protected]>
Date: Sat, 24 Sep 2016 01:26:19 +0300
Subject: [PATCH] build: lang: python: cleanups
1. Make setup.py executable when generated.
2. Add prepare target to enable prepare the source tree without building
anything. This is handy to enable standard distutils build outside of
gpgme build system.
3. Treat data.h in similar manner as other VPATH issues, just symlink it
to the srcdir to simplify build, remove the CFLAGS requirement of
distutils.
The above does not alter the behavior of current build but supports the
following sequence:
$ mkdir build
$ cd build
$ ../configure --enable-languages=
$ make
$ cd lang/python
$ make prepare
$ ./setup.py build
$ ./setup.py install
Notice the standard use of distutils which is required for package
manager to control the python selection and build process.
Signed-off-by: Alon Bar-Lev <[email protected]>
---
configure.ac | 2 +-
lang/python/Makefile.am | 16 ++++++++++------
lang/python/gpgme.i | 2 +-
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4a29f2f..efa1f19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -886,9 +886,9 @@ AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([lang/qt/doc/Doxyfile])])
AC_CONFIG_FILES(lang/qt/doc/Makefile)
AC_CONFIG_FILES([lang/python/Makefile
- lang/python/setup.py
lang/python/pyme/version.py
lang/python/tests/Makefile])
+AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
AC_OUTPUT
echo "
diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am
index 2271ce0..9866f53 100644
--- a/lang/python/Makefile.am
+++ b/lang/python/Makefile.am
@@ -46,24 +46,28 @@ COPY_FILES_PYME = \
# For VPATH builds we need to copy some files because Python's
# distutils are not VPATH-aware.
-copystamp: $(COPY_FILES) $(COPY_FILES_PYME)
+copystamp: $(COPY_FILES) $(COPY_FILES_PYME) data.h
if test "$(srcdir)" != "$(builddir)" ; then \
cp -R $(COPY_FILES) . ; \
cp -R $(COPY_FILES_PYME) pyme ; \
fi
touch $@
+data.h:
+ ln -s "$(top_srcdir)/src/data.h"
+
all-local: copystamp
for PYTHON in $(PYTHONS); do \
- CFLAGS="$(CFLAGS) -I$(top_srcdir)" \
- $$PYTHON setup.py build --verbose ; \
+ $$PYTHON setup.py build --verbose ; \
done
dist/pyme3-$(VERSION).tar.gz dist/pyme3-$(VERSION).tar.gz.asc: copystamp
- CFLAGS="$(CFLAGS) -I$(top_srcdir)" \
- $(PYTHON) setup.py sdist --verbose
+ $(PYTHON) setup.py sdist --verbose
gpg2 --detach-sign --armor dist/pyme3-$(VERSION).tar.gz
+.PHONY: prepare
+prepare: copystamp
+
.PHONY: sdist
sdist: dist/pyme3-$(VERSION).tar.gz dist/pyme3-$(VERSION).tar.gz.asc
@@ -72,7 +76,7 @@ upload: dist/pyme3-$(VERSION).tar.gz dist/pyme3-$(VERSION).tar.gz.asc
twine upload $^
CLEANFILES = gpgme.h errors.i gpgme_wrap.c pyme/gpgme.py \
- copystamp
+ data.h copystamp
# Remove the rest.
#
diff --git a/lang/python/gpgme.i b/lang/python/gpgme.i
index 84addae..ac666f4 100644
--- a/lang/python/gpgme.i
+++ b/lang/python/gpgme.i
@@ -183,7 +183,7 @@
representation of struct gpgme_data for an very efficient check if
the buffer has been modified. */
%{
-#include "src/data.h" /* For struct gpgme_data. */
+#include "data.h" /* For struct gpgme_data. */
%}
#endif
--
2.7.3