Skip to contentSkip to conversation

gnupg: Read GNUPG_BINDIR from environment variables for nativesdk

PATCH In review Robert Yang 2 participants 3 messages Jan 6, 2020 – Feb 15, 2020

lore
Share & tools
lore
#0 lore raw

v2 cover gnupg: Read GNUPG_BINDIR from environment variables for nativesdk

* V2
- Only enable for native and nativesdk, don't enable for target

* V1
- Initial version

// Robert

The following changes since commit 53cf1241fa4721ba89955146099749d05c5d7171:

musl: Ensure that B is clean before configure task is run (2020-01-06 00:24:16 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/gnupg
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/gnupg

Robert Yang (1):
gnupg: Read GNUPG_BINDIR from environment variables for nativesdk

 meta/recipes-support/gnupg/gnupg_2.2.17.bb | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 gnupg: Read GNUPG_BINDIR from environment variables for nativesdk

There is already a relocate.patch for native which is used for reading GNUPG_BINDIR from environment variables, now also enable it for nativesdk. Otherwise, command like the following one doesn't work for nativesdk:

$ gpg-connect-agent --homedir ../keys/ reloadagent /bye
gpg-connect-agent: no running gpg-agent - starting '/opt/path/to/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/gpg-agent'
gpg-connect-agent: failed to start agent '/opt/path/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/gpg-agent': No such file or directory
---
 meta/recipes-support/gnupg/gnupg_2.2.17.bb | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
meta/recipes-support/gnupg/gnupg_2.2.17.bb +13 -4
index bb8885f..0a939cf 100644
@@ -19,6 +19,8 @@ SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
 SRC_URI_append_class-native = " file://0001-configure.ac-use-a-custom-value-for-the-location-of-.patch \
                                 file://relocate.patch"
 
+SRC_URI_append_class-nativesdk = " file://relocate.patch"
+
 SRC_URI[md5sum] = "1ba2d9b70c377f8e967742064c27a19c"
 SRC_URI[sha256sum] = "afa262868e39b651a2db4c071fba90415154243e83a830ca00516f9a807fd514"
 
@@ -60,10 +62,17 @@ do_install_append() {
 }
 
 do_install_append_class-native() {
-	create_wrapper ${D}${bindir}/gpg2 GNUPG_BINDIR=${STAGING_BINDIR_NATIVE}
-	create_wrapper ${D}${bindir}/gpgconf GNUPG_BINDIR=${STAGING_BINDIR_NATIVE}
-	create_wrapper ${D}${bindir}/gpg-agent GNUPG_BINDIR=${STAGING_BINDIR_NATIVE}
-	create_wrapper ${D}${bindir}/gpg-connect-agent GNUPG_BINDIR=${STAGING_BINDIR_NATIVE}
+	create_wrappers ${STAGING_BINDIR_NATIVE}
+}
+
+do_install_append_class-nativesdk() {
+	create_wrappers ${SDKPATHNATIVE}${bindir_nativesdk}
+}
+
+create_wrappers() {
+	for i in gpg2 gpgconf gpg-agent gpg-connect-agent; do
+		create_wrapper ${D}${bindir}/$i GNUPG_BINDIR=$1
+	done
 }
 
 PACKAGECONFIG ??= "gnutls"
Signature · 1 line
2.7.4
#2 lore raw
Quoted 9 lines · Robert Yang

There is already a relocate.patch for native which is used for reading GNUPG_BINDIR from environment variables, now also enable it for nativesdk. Otherwise, command like the following one doesn't work for nativesdk:

$ gpg-connect-agent --homedir ../keys/ reloadagent /bye
gpg-connect-agent: no running gpg-agent - starting '/opt/path/to/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/gpg-agent'
gpg-connect-agent: failed to start agent '/opt/path/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/gpg-agent': No such file or directory

This seems to have been missed.
Are there any comments?

Robert,
Please rebase and resend

../Randy

Quoted 40 lines
---
  meta/recipes-support/gnupg/gnupg_2.2.17.bb | 17 +++++++++++++----
  1 file changed, 13 insertions(+), 4 deletions(-)
meta/recipes-support/gnupg/gnupg_2.2.17.bb +13 -4
index bb8885f..0a939cf 100644
@@ -19,6 +19,8 @@ SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
  SRC_URI_append_class-native = " file://0001-configure.ac-use-a-custom-value-for-the-location-of-.patch \
                                  file://relocate.patch"
 
+SRC_URI_append_class-nativesdk = " file://relocate.patch"
+
  SRC_URI[md5sum] = "1ba2d9b70c377f8e967742064c27a19c"
  SRC_URI[sha256sum] = "afa262868e39b651a2db4c071fba90415154243e83a830ca00516f9a807fd514"
 
@@ -60,10 +62,17 @@ do_install_append() {
  }
 
  do_install_append_class-native() {
-	create_wrapper ${D}${bindir}/gpg2 GNUPG_BINDIR=${STAGING_BINDIR_NATIVE}
-	create_wrapper ${D}${bindir}/gpgconf GNUPG_BINDIR=${STAGING_BINDIR_NATIVE}
-	create_wrapper ${D}${bindir}/gpg-agent GNUPG_BINDIR=${STAGING_BINDIR_NATIVE}
-	create_wrapper ${D}${bindir}/gpg-connect-agent GNUPG_BINDIR=${STAGING_BINDIR_NATIVE}
+	create_wrappers ${STAGING_BINDIR_NATIVE}
+}
+
+do_install_append_class-nativesdk() {
+	create_wrappers ${SDKPATHNATIVE}${bindir_nativesdk}
+}
+
+create_wrappers() {
+	for i in gpg2 gpgconf gpg-agent gpg-connect-agent; do
+		create_wrapper ${D}${bindir}/$i GNUPG_BINDIR=$1
+	done
  }
 
  PACKAGECONFIG ??= "gnutls"
Signature · 2 lines
# Randy MacLeod
# Wind River Linux