* [PATCH] Fix gpgme when building for the target
@ 2017-03-07 16:00 Mark Hatle
2017-03-07 16:00 ` [PATCH] gpgme: Fix issue " Mark Hatle
0 siblings, 1 reply; 5+ messages in thread
From: Mark Hatle @ 2017-03-07 16:00 UTC (permalink / raw)
To: openembedded-core
Fix gpgme when building for the target. There were multiple problems when
cross compiling gpgme for the target:
* PKG_CONFIG (pkg-config) was not being set
* Auto selecting python would pick up the host version and fail
* calling gpg-error-config would fail
Mark Hatle (1):
gpgme: Fix issue building for the target
.../gpgme/gpgme/python-lang-config.patch | 50 ++++++++++++++++++++++
meta/recipes-support/gpgme/gpgme_1.8.0.bb | 28 +++++++++++-
2 files changed, 77 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-support/gpgme/gpgme/python-lang-config.patch
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] gpgme: Fix issue building for the target
2017-03-07 16:00 [PATCH] Fix gpgme when building for the target Mark Hatle
@ 2017-03-07 16:00 ` Mark Hatle
2017-03-07 16:08 ` Burton, Ross
2017-03-07 17:00 ` Leonardo Sandoval
0 siblings, 2 replies; 5+ messages in thread
From: Mark Hatle @ 2017-03-07 16:00 UTC (permalink / raw)
To: openembedded-core
gpgme failed when configuring since you can only configure for one python
system at a time (via the inherits). So we need to have a PACKAGECONFIG
that defines which one [or neither] you want to use.
The prior pkgconfig patch introduced the usage of the variable PKG_CONFIG,
which is not defined anywhere. Define this.
When building the python module, we can not call gpg-error-config, so we
need to find an alternative way of finding the information the setup.py.in
requires. (In this case, it's easy to just use the environment
STAGING_INCDIR.)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
.../gpgme/gpgme/python-lang-config.patch | 50 ++++++++++++++++++++++
meta/recipes-support/gpgme/gpgme_1.8.0.bb | 28 +++++++++++-
2 files changed, 77 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-support/gpgme/gpgme/python-lang-config.patch
diff --git a/meta/recipes-support/gpgme/gpgme/python-lang-config.patch b/meta/recipes-support/gpgme/gpgme/python-lang-config.patch
new file mode 100644
index 0000000..a289c62
--- /dev/null
+++ b/meta/recipes-support/gpgme/gpgme/python-lang-config.patch
@@ -0,0 +1,50 @@
+gpgme/lang/python: gpg-error-config should not be used.
+
+gpg-error-config was modified by OE to always return an error. So we want
+to find an alternative way to retrieve whatever it is we need. It turns
+out that the system is just trying to find the path to the gpg-error.h, which
+we can pull in from the STAGING_INC environment.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: gpgme-1.8.0/lang/python/setup.py.in
+===================================================================
+--- gpgme-1.8.0.orig/lang/python/setup.py.in
++++ gpgme-1.8.0/lang/python/setup.py.in
+@@ -24,7 +24,6 @@ import glob
+ import subprocess
+
+ # Out-of-tree build of the gpg bindings.
+-gpg_error_config = ["gpg-error-config"]
+ gpgme_config_flags = ["--thread=pthread"]
+ gpgme_config = ["gpgme-config"] + gpgme_config_flags
+ gpgme_h = ""
+@@ -52,13 +51,6 @@ else:
+ devnull = open(os.devnull, "w")
+
+ try:
+- subprocess.check_call(gpg_error_config + ['--version'],
+- stdout=devnull)
+-except:
+- sys.exit("Could not find gpg-error-config. " +
+- "Please install the libgpg-error development package.")
+-
+-try:
+ subprocess.check_call(gpgme_config + ['--version'],
+ stdout=devnull)
+ except:
+@@ -81,12 +73,9 @@ if not (major > 1 or (major == 1 and min
+ if not gpgme_h:
+ gpgme_h = os.path.join(getconfig("prefix")[0], "include", "gpgme.h")
+
+-gpg_error_prefix = getconfig("prefix", config=gpg_error_config)[0]
+-gpg_error_h = os.path.join(gpg_error_prefix, "include", "gpg-error.h")
++gpg_error_h = os.path.join(os.getenv('STAGING_INCDIR'), "gpg-error.h")
+ if not os.path.exists(gpg_error_h):
+- gpg_error_h = \
+- glob.glob(os.path.join(gpg_error_prefix, "include",
+- "*", "gpg-error.h"))[0]
++ sys.exit("gpg_error_h not found: %s" % gpg_error_h)
+
+ print("Building python gpg module using {} and {}.".format(gpgme_h, gpg_error_h))
+
diff --git a/meta/recipes-support/gpgme/gpgme_1.8.0.bb b/meta/recipes-support/gpgme/gpgme_1.8.0.bb
index 3e74b6f..7d249b3 100644
--- a/meta/recipes-support/gpgme/gpgme_1.8.0.bb
+++ b/meta/recipes-support/gpgme/gpgme_1.8.0.bb
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
SRC_URI = "${GNUPG_MIRROR}/gpgme/${BP}.tar.bz2 \
file://pkgconfig.patch \
+ file://python-lang-config.patch \
"
SRC_URI[md5sum] = "722a4153904b9b5dc15485a22d29263b"
@@ -22,12 +23,37 @@ RDEPENDS_${PN}-cpp += "libstdc++"
BINCONFIG = "${bindir}/gpgme-config"
-inherit autotools texinfo binconfig-disabled pkgconfig
+# Note select python2 or python3, but you can't select both at the same time
+PACKAGECONFIG ??= "python3"
+PACKAGECONFIG[python2] = ",,python,"
+PACKAGECONFIG[python3] = ",,python3,"
+
+# Default in configure.ac: "cl cpp python qt"
+# Supported: "cl cpp python python2 python3 qt"
+# python says 'search and find python2 or python3'
+
+LANGUAGES ?= "cpp"
+LANGUAGES .= "${@bb.utils.contains('PACKAGECONFIG', 'python2', ' python2', '', d)}"
+LANGUAGES .= "${@bb.utils.contains('PACKAGECONFIG', 'python3', ' python3', '', d)}"
+
+PYTHON_INHERIT = "${@bb.utils.contains('PACKAGECONFIG', 'python2', 'pythonnative', '', d)}"
+PYTHON_INHERIT .= "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native', '', d)}"
+
+EXTRA_OECONF += '--enable-languages="${LANGUAGES}"'
+
+inherit autotools texinfo binconfig-disabled pkgconfig ${PYTHON_INHERIT}
+
+export PKG_CONFIG='pkg-config'
BBCLASSEXTEND = "native"
PACKAGES =+ "${PN}-cpp"
+PACKAGES =. "${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python2-gpg ', '', d)}"
+PACKAGES =. "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-gpg ', '', d)}"
+
FILES_${PN}-cpp = "${libdir}/libgpgmepp.so.*"
+FILES_python2-gpg = "${PYTHON_SITEPACKAGES_DIR}/*"
+FILES_python3-gpg = "${PYTHON_SITEPACKAGES_DIR}/*"
FILES_${PN}-dev += "${datadir}/common-lisp/source/gpgme/* \
${libdir}/cmake/* \
"
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gpgme: Fix issue building for the target
2017-03-07 16:00 ` [PATCH] gpgme: Fix issue " Mark Hatle
@ 2017-03-07 16:08 ` Burton, Ross
2017-03-07 16:39 ` Mark Hatle
2017-03-07 17:00 ` Leonardo Sandoval
1 sibling, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2017-03-07 16:08 UTC (permalink / raw)
To: Mark Hatle; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 854 bytes --]
On 7 March 2017 at 16:00, Mark Hatle <mark.hatle@windriver.com> wrote:
> gpgme failed when configuring since you can only configure for one python
> system at a time (via the inherits). So we need to have a PACKAGECONFIG
> that defines which one [or neither] you want to use.
>
> The prior pkgconfig patch introduced the usage of the variable PKG_CONFIG,
> which is not defined anywhere. Define this.
>
> When building the python module, we can not call gpg-error-config, so we
> need to find an alternative way of finding the information the setup.py.in
> requires. (In this case, it's easy to just use the environment
> STAGING_INCDIR.)
| checking for swig... no
| checking for swig2.0... no
| configure: error:
| ***
| *** You need SWIG to build the Python bindings.
It must be finding a swig binary on your host.
Ross
[-- Attachment #2: Type: text/html, Size: 1600 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gpgme: Fix issue building for the target
2017-03-07 16:08 ` Burton, Ross
@ 2017-03-07 16:39 ` Mark Hatle
0 siblings, 0 replies; 5+ messages in thread
From: Mark Hatle @ 2017-03-07 16:39 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
On 3/7/17 10:08 AM, Burton, Ross wrote:
>
> On 7 March 2017 at 16:00, Mark Hatle <mark.hatle@windriver.com
> <mailto:mark.hatle@windriver.com>> wrote:
>
> gpgme failed when configuring since you can only configure for one python
> system at a time (via the inherits). So we need to have a PACKAGECONFIG
> that defines which one [or neither] you want to use.
>
> The prior pkgconfig patch introduced the usage of the variable PKG_CONFIG,
> which is not defined anywhere. Define this.
>
> When building the python module, we can not call gpg-error-config, so we
> need to find an alternative way of finding the information the setup.py.in
> <http://setup.py.in>
> requires. (In this case, it's easy to just use the environment
> STAGING_INCDIR.)
>
>
> | checking for swig... no
> | checking for swig2.0... no
> | configure: error:
> | ***
> | *** You need SWIG to build the Python bindings.
>
> It must be finding a swig binary on your host.
Thanks, I'll rework it.
--Mark
> Ross
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gpgme: Fix issue building for the target
2017-03-07 16:00 ` [PATCH] gpgme: Fix issue " Mark Hatle
2017-03-07 16:08 ` Burton, Ross
@ 2017-03-07 17:00 ` Leonardo Sandoval
1 sibling, 0 replies; 5+ messages in thread
From: Leonardo Sandoval @ 2017-03-07 17:00 UTC (permalink / raw)
To: Mark Hatle; +Cc: openembedded-core
Mark, pachtest complained with this series. (manually copying and
pasting stuff from the latter tool, posted in patchwork)
On Tue, 2017-03-07 at 10:00 -0600, Mark Hatle wrote:
> gpgme failed when configuring since you can only configure for one python
> system at a time (via the inherits). So we need to have a PACKAGECONFIG
> that defines which one [or neither] you want to use.
>
> The prior pkgconfig patch introduced the usage of the variable PKG_CONFIG,
> which is not defined anywhere. Define this.
>
> When building the python module, we can not call gpg-error-config, so we
> need to find an alternative way of finding the information the setup.py.in
> requires. (In this case, it's easy to just use the environment
> STAGING_INCDIR.)
>
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
> ---
> .../gpgme/gpgme/python-lang-config.patch | 50 ++++++++++++++++++++++
> meta/recipes-support/gpgme/gpgme_1.8.0.bb | 28 +++++++++++-
> 2 files changed, 77 insertions(+), 1 deletion(-)
> create mode 100644 meta/recipes-support/gpgme/gpgme/python-lang-config.patch
>
> diff --git a/meta/recipes-support/gpgme/gpgme/python-lang-config.patch b/meta/recipes-support/gpgme/gpgme/python-lang-config.patch
* Issue Added patch file is missing Upstream-Status in the
header [test_upstream_status_presence]
Suggested fix Add Upstream-Status: <status> to the header of
meta/recipes-support/gpgme/gpgme/python-lang-config.patch (possible
values: Pending, Submitted, Accepted, Backport, Denied, Inappropriate)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-03-07 16:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-07 16:00 [PATCH] Fix gpgme when building for the target Mark Hatle
2017-03-07 16:00 ` [PATCH] gpgme: Fix issue " Mark Hatle
2017-03-07 16:08 ` Burton, Ross
2017-03-07 16:39 ` Mark Hatle
2017-03-07 17:00 ` Leonardo Sandoval
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox