Remove private flags from Libs and Cflags

https://bugzilla.redhat.com/show_bug.cgi?id=2043092#c36
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-01-30 09:46:32 +01:00
parent 6b611c77d7
commit b0d7edf0e9
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From 5e7dc695bdbf57b5115f20f5302c8770f05094c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sun, 30 Jan 2022 09:39:40 +0100
Subject: [PATCH] pkgconfig: drop irrelevant part from Libs and Cflags
Link flags that were used for dolfin itself, for example -flto or
other similar items are not useful here: those lines should just
specify the flag that injects this library into those programs, and
any special preprocessor flags, no more. In particular flags like -DHAS_HDF5
will either be irrelevant for projects using the library or might even
confuse their build systems. Those flags should stay "private" to dolfin.
The immediate problem this was causing is
https://bugzilla.redhat.com/show_bug.cgi?id=2043092#c36
where a linker flag inserting a section with additional information about the
build is "leaked" into projects using the dolfin library.
---
cmake/templates/dolfin.pc.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmake/templates/dolfin.pc.in b/cmake/templates/dolfin.pc.in
index 3faf2c35bb..945918723f 100644
--- a/cmake/templates/dolfin.pc.in
+++ b/cmake/templates/dolfin.pc.in
@@ -13,5 +13,5 @@ Description: Dynamic Object-oriented Library for FINite element computation
Version: @DOLFIN_VERSION@
Requires: @PKG_REQUIRES@
Conflicts:
-Libs: @PKG_LINKFLAGS@ -L${libdir} -ldolfin
-Cflags: @PKG_CXXFLAGS@ -DDOLFIN_VERSION=\"@DOLFIN_VERSION@\" ${definitions} -I${includedir} @PKG_INCLUDES@
+Libs: -L${libdir} -ldolfin
+Cflags: -DDOLFIN_VERSION=\"@DOLFIN_VERSION@\" -I${includedir}

View File

@ -11,6 +11,8 @@ Source0: https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-%{v
Source1: https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-%{version}.tar.gz.asc
Source2: 3083BE4C722232E28AD0828CBED06106DD22BAB3.gpg
Patch: 0001-pkgconfig-drop-irrelevant-part-from-Libs-and-Cflags.patch
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
%global blaslib flexiblas
%global cmake_blas_flags -DBLA_VENDOR=FlexiBLAS
@ -82,7 +84,7 @@ BuildArch: noarch
%prep
%{?gpgverify:%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'}
%autosetup -n dolfin-%{version}
%autosetup -p1
# Let's just specify an exact version of a dependency, yay!
sed -i -r 's|pybind11==|pybind11>=|' python/setup.py