Control: tags -1 + patch

On Tue, 22 Nov 2022 at 21:28:48 +0000, Simon McVittie wrote:
> The various curl -dev packages are no longer Multi-Arch: same
...
> I'm currently testing patches that I'm hoping will resolve this and allow
> reverting the recent change that dropped the Multi-Arch: same field.

Please consider the attached.

build-Divide-mit-krb5-gssapi-link-flags-between-LDFLAGS-a.patch could
be sent upstream if you want (it seems to be going in the direction of
what upstream intended, and is coincidentally also useful for resolving
this downstream bug).

Thanks,
    smcv
>From db11b28ac74bc201b2e8429fd6d834afdd343f8a Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@collabora.com>
Date: Tue, 22 Nov 2022 21:21:48 +0000
Subject: [PATCH 1/2] Add patches to make curl-config Multi-Arch co-installable
 again

Signed-off-by: Simon McVittie <s...@collabora.com>
---
 ...LDFLAGS-from-curl-config-static-libs.patch | 42 +++++++++++++++++++
 ...-gssapi-link-flags-between-LDFLAGS-a.patch | 32 ++++++++++++++
 debian/patches/series                         |  2 +
 3 files changed, 76 insertions(+)
 create mode 100644 debian/patches/Remove-curl-s-LDFLAGS-from-curl-config-static-libs.patch
 create mode 100644 debian/patches/build-Divide-mit-krb5-gssapi-link-flags-between-LDFLAGS-a.patch

diff --git a/debian/patches/Remove-curl-s-LDFLAGS-from-curl-config-static-libs.patch b/debian/patches/Remove-curl-s-LDFLAGS-from-curl-config-static-libs.patch
new file mode 100644
index 000000000..721a6b103
--- /dev/null
+++ b/debian/patches/Remove-curl-s-LDFLAGS-from-curl-config-static-libs.patch
@@ -0,0 +1,42 @@
+From: Simon McVittie <s...@collabora.com>
+Date: Tue, 22 Nov 2022 21:20:51 +0000
+Subject: Remove curl's LDFLAGS from curl-config --static-libs
+
+On current Debian bookworm, the LDFLAGS consist of
+-L/usr/lib/${triplet}/mit-krb5 originating from
+`pkg-config --libs-only-L mit-krb5-gssapi` from krb5-multidev, plus
+some linker options that are intended for curl itself rather than for
+dependent packages. None of these are really desirable, and they create
+divergence between architectures that would prevent libcurl-*-dev from
+being Multi-Arch: same.
+
+The -L flag is not really needed, for the same reason that -L@libdir@
+isn't. curl Build-Depends on libkrb5-dev, which doesn't need a special
+-L flag to find libgssapi_krb5, and the various libcurl-*-dev packages
+have Suggests on libkrb5-dev rather than on krb5-multidev for static
+linking.
+
+The other options (currently `-Wl,-z-relro -Wl,-z,now`) are intended
+for libcurl itself, and if dependent packages want those options then
+they should set them from their own packaging.
+
+Bug-Debian: https://bugs.debian.org/1024668
+Forwarded: not-needed
+Signed-off-by: Simon McVittie <s...@collabora.com>
+---
+ curl-config.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/curl-config.in b/curl-config.in
+index 5bf4256..620bff6 100644
+--- a/curl-config.in
++++ b/curl-config.in
+@@ -165,7 +165,7 @@ while test $# -gt 0; do
+ 
+     --static-libs)
+         if test "X@ENABLE_STATIC@" != "Xno" ; then
+-          echo -Wl,-Bstatic -lcurl -Wl,-Bdynamic @LDFLAGS@ @LIBCURL_LIBS@
++          echo -Wl,-Bstatic -lcurl -Wl,-Bdynamic @LIBCURL_LIBS@
+         else
+           echo "curl was built with static libraries disabled" >&2
+           exit 1
diff --git a/debian/patches/build-Divide-mit-krb5-gssapi-link-flags-between-LDFLAGS-a.patch b/debian/patches/build-Divide-mit-krb5-gssapi-link-flags-between-LDFLAGS-a.patch
new file mode 100644
index 000000000..6a16f0589
--- /dev/null
+++ b/debian/patches/build-Divide-mit-krb5-gssapi-link-flags-between-LDFLAGS-a.patch
@@ -0,0 +1,32 @@
+From: Simon McVittie <s...@collabora.com>
+Date: Tue, 22 Nov 2022 20:43:41 +0000
+Subject: build: Divide mit-krb5-gssapi link flags between LDFLAGS and LIBS
+
+From the comments nearby about not having --libs-only-L, it looks as
+though the intention was to apply a split like this to all dependency
+libraries where possible, and the only reason it was not done for
+Kerberos is that krb5-config doesn't have that feature and pkg-config
+was originally not supported here. For example, zlib, libssh and librtmp
+all have their flags from pkg-config split in this way.
+
+Now that pkg-config is supported here, we can do the intended split.
+
+Signed-off-by: Simon McVittie <s...@collabora.com>
+---
+ configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 445b3f9..b5408d2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1853,7 +1853,8 @@ if test x"$want_gss" = xyes; then
+            gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
+            LIBS="$gss_libs $LIBS"
+         elif test "$PKGCONFIG" != "no" ; then
+-           gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
++           LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L mit-krb5-gssapi`"
++           gss_libs=`$PKGCONFIG --libs-only-l mit-krb5-gssapi`
+            LIBS="$gss_libs $LIBS"
+         elif test -f "$KRB5CONFIG"; then
+            dnl krb5-config doesn't have --libs-only-L or similar, put everything
diff --git a/debian/patches/series b/debian/patches/series
index 71e3dee7d..8936f91d0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,7 +2,9 @@
 04_workaround_as_needed_bug.patch
 06_always-disable-valgrind.patch
 08_enable-zsh.patch
+build-Divide-mit-krb5-gssapi-link-flags-between-LDFLAGS-a.patch
 11_omit-directories-from-config.patch
+Remove-curl-s-LDFLAGS-from-curl-config-static-libs.patch
 
 # Upstream backports.
 0001-curl-7.86.0-noproxy.patch
-- 
2.38.1

>From 7d3414eaf4e45d4bf742400980abe85425599299 Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@collabora.com>
Date: Tue, 22 Nov 2022 20:45:50 +0000
Subject: [PATCH 2/2] Revert "Apply multi-arch hints."

Making libcurl-*-dev:amd64 and libcurl-*-dev:i386 is a regression
compared with earlier versions, and doesn't seem to be necessary if we
can eliminate the single divergence between architectures:
curl-config(1) mentions the architecture-specific -L${libdir}/mit-krb5
for krb5-multidev. This is only beneficial for static linking, and
libcurl-*-dev already Suggests libkrb5-dev, which doesn't need a
special -L flag to link libgssapi_krb5 anyway.

This reverts commit a583d1b53d1e7caa51e5a0eb667c45d19889def4.

Closes: #1024668
Signed-off-by: Simon McVittie <s...@collabora.com>
---
 debian/control | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/debian/control b/debian/control
index 75d3d637b..4a5fd8d1d 100644
--- a/debian/control
+++ b/debian/control
@@ -142,6 +142,7 @@ Suggests: libcurl4-doc,
  libssl-dev,
  pkg-config,
  zlib1g-dev
+Multi-Arch: same
 Description: development files and documentation for libcurl (OpenSSL flavour)
  libcurl is an easy-to-use client-side URL transfer library, supporting DICT,
  FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S,
@@ -179,6 +180,7 @@ Suggests: libcurl4-doc,
  libssh2-1-dev,
  pkg-config,
  zlib1g-dev
+Multi-Arch: same
 Description: development files and documentation for libcurl (GnuTLS flavour)
  libcurl is an easy-to-use client-side URL transfer library, supporting DICT,
  FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S,
@@ -216,6 +218,7 @@ Suggests: libcurl4-doc,
  libssh2-1-dev,
  pkg-config,
  zlib1g-dev
+Multi-Arch: same
 Description: development files and documentation for libcurl (NSS flavour)
  libcurl is an easy-to-use client-side URL transfer library, supporting DICT,
  FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S,
-- 
2.38.1

Reply via email to