diff --git a/0001-pkgconfig-drop-irrelevant-part-from-Libs-and-Cflags.patch b/0001-pkgconfig-drop-irrelevant-part-from-Libs-and-Cflags.patch new file mode 100644 index 0000000..de85433 --- /dev/null +++ b/0001-pkgconfig-drop-irrelevant-part-from-Libs-and-Cflags.patch @@ -0,0 +1,32 @@ +From 5e7dc695bdbf57b5115f20f5302c8770f05094c6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +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} diff --git a/dolfin.spec b/dolfin.spec index 31538aa..ff935c7 100644 --- a/dolfin.spec +++ b/dolfin.spec @@ -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