Initialize contents of dolfin.pc correctly

(rhbz#2118536)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2023-05-28 16:21:54 +02:00
parent a70b88ec67
commit 73799202b0
1 changed files with 13 additions and 0 deletions

View File

@ -29,6 +29,7 @@ ExcludeArch: %{ix86}
BuildRequires: gcc-c++
BuildRequires: gnupg2
BuildRequires: cmake
BuildRequires: pkgconf
BuildRequires: boost-devel
BuildRequires: eigen3-devel
BuildRequires: petsc-devel
@ -66,6 +67,9 @@ FEniCS Problem Solving Environment.}
%package devel
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}%{?isa}
# dolfin headers include headers from other projects
Requires: boost-devel
Requires: eigen3-devel
%description devel
%{summary}.
@ -115,6 +119,15 @@ CFLAGS="%{optflags} -Wno-unused-variable -DH5_USE_110_API" CXXFLAGS="%{optflags}
-Wno-dev
%make_build
# The flags defined in the pkg-config file are used at runtime.
# For some reason, the contents are not injected properly.
# https://fenicsproject.discourse.group/t/cant-define-expression-through-c-returns-fatal-error-ufc-h-no-such-file-or-directory/5472/19
# https://bugzilla.redhat.com/show_bug.cgi?id=2118536
ffc_path="$(python3 -c 'import ffc; print(ffc.get_include_path())')"
eigen_options="$(pkgconf --cflags eigen3)"
sed -r -i "s|Cflags:.*|\\0 -I${ffc_path} ${eigen_options}|" \
dolfin.pc
# "temporary install" so the python build can find the stuff it needs
%make_install