summaryrefslogtreecommitdiff
path: root/gnu/packages/simulation.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2023-06-15 16:59:23 +0200
committerLudovic Courtès <ludo@gnu.org>2023-06-24 16:19:33 +0200
commit9a86e2e97fd91003ee089dc0fed35d848e84d0f1 (patch)
treecb0a80ba24e88b0597344567a05130572abb31fc /gnu/packages/simulation.scm
parent09a77e31fea3288623062fa4abf1afa41f21b221 (diff)
gnu: fenics: Make sure 'jit.py' can find 'dolfin.pc'.
* gnu/packages/simulation.scm (fenics)[inputs]: Move PYTHON-PKGCONFIG to... [propagated-inputs]: ... here. [arguments]: Add 'set-dolfin-pc-file-name' phase.
Diffstat (limited to 'gnu/packages/simulation.scm')
-rw-r--r--gnu/packages/simulation.scm15
1 files changed, 13 insertions, 2 deletions
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 059be5a2be..9eeb57babe 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -716,12 +716,14 @@ user interface to the FEniCS core components and external libraries.")
("ply" ,python-ply)
("pytest" ,python-pytest)
("python-decorator" ,python-decorator)
- ("python-pkgconfig" ,python-pkgconfig)
,@(package-native-inputs fenics-dolfin)))
(propagated-inputs
`(("dolfin" ,fenics-dolfin)
("petsc4py" ,python-petsc4py)
- ("slepc4py" ,python-slepc4py)))
+ ("slepc4py" ,python-slepc4py)
+
+ ;; 'dolfin/jit/jit.py' parses 'dolfin.pc' at run time.
+ ("python-pkgconfig" ,python-pkgconfig)))
(arguments
`(#:phases
(modify-phases %standard-phases
@@ -729,6 +731,15 @@ user interface to the FEniCS core components and external libraries.")
(lambda _
(substitute* "python/setup.py"
(("pybind11==") "pybind11>="))))
+ (add-after 'unpack 'set-dolfin-pc-file-name
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Instead of cluttering the user's 'PKG_CONFIG_PATH' environment
+ ;; variable, hard-code the 'dolfin.pc' absolute file name.
+ (let ((pc-file (search-input-file inputs
+ "/lib/pkgconfig/dolfin.pc")))
+ (substitute* "python/dolfin/jit/jit.py"
+ (("pkgconfig\\.parse\\(\"dolfin\"\\)")
+ (string-append "pkgconfig.parse(\"" pc-file "\")"))))))
(add-after 'patch-source-shebangs 'set-paths
(lambda _
;; Define paths to store locations.