diff mbox series

[2/3] package/libgcrypt: add upstream patch to add pkg-config file

Message ID 20190704104321.2598-3-joerg.krause@embedded.rocks
State Superseded
Headers show
Series package/mpd: bump to version 0.21.7 | expand

Commit Message

Jörg Krause July 4, 2019, 10:43 a.m. UTC
libgrypt provides a config file `libgcrypt-config`. After the version
bump to 1.8.4 upstream added a pkg-config file as well [1].

Using the pkg-config file is preferred over using the package provided
config file. For example, the Meson build system requires that for every
special config file an entry is added to the `[binary]` section in the
cross-compilation.conf file, otherwise it will use the config file found
in `PATH`. This is bad when cross-compiling as `PATH` will include
pathes to the host and therefore Meson will wrongly use the host config
file.

To simplify using libgcrypt for packages using the meson infrastructure
lets add the pkg-config file.

[1] https://github.com/gpg/libgcrypt/commit/97194b422bc89a6137f4e218d4cdee118c63e96e

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
---
 ...-libgcrypt.pc-generated-by-configure.patch | 102 ++++++++++++++++++
 package/libgcrypt/libgcrypt.mk                |   1 +
 2 files changed, 103 insertions(+)
 create mode 100644 package/libgcrypt/0002-build-Provide-libgcrypt.pc-generated-by-configure.patch

Comments

Arnout Vandecappelle July 4, 2019, 5:16 p.m. UTC | #1
[snip]
> +From ef6f53ae7f9938a672f96c0c43707bc808c78221 Mon Sep 17 00:00:00 2001
> +From: NIIBE Yutaka <gniibe@fsij.org>
> +Date: Wed, 24 Oct 2018 14:57:53 +0900
> +Subject: [PATCH] build: Provide libgcrypt.pc, generated by configure.
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +* configure.ac: Generate src/libgcrypt.pc.
> +* src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New.
> +(EXTRA_DIST): Add libgcrypt.pc.in.
> +* src/libgcrypt-config.in: Use @PACKAGE_VERSION@.
> +* src/libgcrypt.pc.in: New.
> +
> +Fetched from: 97194b422bc89a6137f4e218d4cdee118c63e96e
> +
> +Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
> +
> +build: Fix libgcrypt.pc.
> +
> +* src/libgcrypt.pc.in: Fix typo.
> +
> +Fetched from: 0e071372fc0e6fed4a449955ed0789803ba5e709

 These are two upstream patches. We prefer to have them as individual patches,
not squashed.

 Regards,
 Arnout

> +
> +Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
> +Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>

[snip]
diff mbox series

Patch

diff --git a/package/libgcrypt/0002-build-Provide-libgcrypt.pc-generated-by-configure.patch b/package/libgcrypt/0002-build-Provide-libgcrypt.pc-generated-by-configure.patch
new file mode 100644
index 0000000000..4f4d86c975
--- /dev/null
+++ b/package/libgcrypt/0002-build-Provide-libgcrypt.pc-generated-by-configure.patch
@@ -0,0 +1,102 @@ 
+From ef6f53ae7f9938a672f96c0c43707bc808c78221 Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <gniibe@fsij.org>
+Date: Wed, 24 Oct 2018 14:57:53 +0900
+Subject: [PATCH] build: Provide libgcrypt.pc, generated by configure.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+* configure.ac: Generate src/libgcrypt.pc.
+* src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New.
+(EXTRA_DIST): Add libgcrypt.pc.in.
+* src/libgcrypt-config.in: Use @PACKAGE_VERSION@.
+* src/libgcrypt.pc.in: New.
+
+Fetched from: 97194b422bc89a6137f4e218d4cdee118c63e96e
+
+Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
+
+build: Fix libgcrypt.pc.
+
+* src/libgcrypt.pc.in: Fix typo.
+
+Fetched from: 0e071372fc0e6fed4a449955ed0789803ba5e709
+
+Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
+Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
+---
+ configure.ac            |  1 +
+ src/Makefile.am         |  5 ++++-
+ src/libgcrypt-config.in |  2 +-
+ src/libgcrypt.pc.in     | 17 +++++++++++++++++
+ 4 files changed, 23 insertions(+), 2 deletions(-)
+ create mode 100644 src/libgcrypt.pc.in
+
+diff --git a/configure.ac b/configure.ac
+index ce11162d..4e788714 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2613,6 +2613,7 @@ doc/Makefile
+ src/Makefile
+ src/gcrypt.h
+ src/libgcrypt-config
++src/libgcrypt.pc
+ src/versioninfo.rc
+ tests/Makefile
+ ])
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 3cc4a552..82d6e8a0 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -20,8 +20,11 @@
+ 
+ ## Process this file with automake to produce Makefile.in
+ 
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = libgcrypt.pc
++
+ EXTRA_DIST = libgcrypt-config.in libgcrypt.m4 libgcrypt.vers \
+-             gcrypt.h.in libgcrypt.def
++             gcrypt.h.in libgcrypt.def libgcrypt.pc.in
+ 
+ bin_SCRIPTS = libgcrypt-config
+ m4datadir = $(datadir)/aclocal
+diff --git a/src/libgcrypt-config.in b/src/libgcrypt-config.in
+index c052638c..f7a13afe 100644
+--- a/src/libgcrypt-config.in
++++ b/src/libgcrypt-config.in
+@@ -14,7 +14,7 @@
+ # General.
+ prefix="@prefix@"
+ exec_prefix="@exec_prefix@"
+-version="@VERSION@"
++version="@PACKAGE_VERSION@"
+ includedir="@includedir@"
+ libdir="@libdir@"
+ gpg_error_libs="@GPG_ERROR_LIBS@"
+diff --git a/src/libgcrypt.pc.in b/src/libgcrypt.pc.in
+new file mode 100644
+index 00000000..ec68fa2d
+--- /dev/null
++++ b/src/libgcrypt.pc.in
+@@ -0,0 +1,17 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++includedir=@includedir@
++libdir=@libdir@
++host=@LIBGCRYPT_CONFIG_HOST@
++api_version=@LIBGCRYPT_CONFIG_API_VERSION@
++symmetric_ciphers="@LIBGCRYPT_CIPHERS@"
++asymmetric_ciphers="@LIBGCRYPT_PUBKEY_CIPHERS@"
++digests="@LIBGCRYPT_DIGESTS@"
++
++Name: libgcrypt
++Description: General purpose cryptographic library
++Requires: gpg-error
++Version: @PACKAGE_VERSION@
++Cflags: @LIBGCRYPT_CONFIG_CFLAGS@
++Libs: @LIBGCRYPT_CONFIG_LIBS@
++URL: https://www.gnupg.org/software/libgcrypt/index.html
+-- 
+2.22.0
+
diff --git a/package/libgcrypt/libgcrypt.mk b/package/libgcrypt/libgcrypt.mk
index 5aa44481ae..2799a6fba2 100644
--- a/package/libgcrypt/libgcrypt.mk
+++ b/package/libgcrypt/libgcrypt.mk
@@ -14,6 +14,7 @@  LIBGCRYPT_DEPENDENCIES = libgpg-error
 LIBGCRYPT_CONFIG_SCRIPTS = libgcrypt-config
 
 # Patching acinclude.m4 in 0001
+# Patching configure.ac and Makefile.am in 0002
 LIBGCRYPT_AUTORECONF = YES
 LIBGCRYPT_CONF_OPTS = \
 	--with-gpg-error-prefix=$(STAGING_DIR)/usr