Package: r-base Version: 4.5.2-1 Severity: important Tags: patch X-Debbugs-Cc: [email protected]
Dear Maintainer,
When building the pkg-config file for libR in src/unix/Makefile.in, the
following stanza,
```
install-pc:
@$(MKINSTALLDIRS) "$(DESTDIR)$(libdir)/pkgconfig"
-@$(SED) -e "s:@rhome:$(rhome):" \
-e "s:@rincludedir:$(rincludedir):" \
-e "s:@rarch:$(R_ARCH):" \
-e 's:@libsprivate:$(STATIC_LIBR_PC):' \
-e 's:@others:$(MAIN_LDFLAGS) $(LDFLAGS):' \
-e 's/@VERSION/$(VERSION)/' $(srcdir)/libR.pc.in \
> "$(DESTDIR)$(libdir)/pkgconfig/libR.pc"
```
combines MAIN_LDFLAGS with LDFLAGS and sticks it into the "Libs" field
of the resulting libR.pc file. That's not what you want: LDFLAGS
contains the user's linker flags at this point, i.e. whatever they have
in their environment variable.
On Ubuntu we started setting --package-metadata and ran into
https://launchpad.net/bugs/2138363. The --package-metadata flag must not
leak into the pkg-config file.
We applied the attached patch to the Ubuntu package to exclude LDFLAGS
from libR.pc. I forwarded the patches upstream and attached the patch
here.
--
Benjamin Drung
Debian & Ubuntu Developer
0001-Exclude-all-LDFLAGS-from-libR.pc.patch
Description: application/mbox

