36 dijitso = pythonPackages.buildPythonPackage {
40 url = "https://bitbucket.org/fenics-project/dijitso/downloads/dijitso-${version}.tar.gz";
41 sha256 = "1ncgbr0bn5cvv16f13g722a0ipw6p9y6p4iasxjziwsp8kn5x97a";
43 propagatedBuildInputs = [
47 nativeCheckInputs = [ pytest ];
57 description = "Distributed just-in-time shared library building";
58 homepage = "https://fenicsproject.org/";
59 platforms = lib.platforms.all;
60 license = lib.licenses.lgpl3;
64 fiat = pythonPackages.buildPythonPackage {
68 url = "https://bitbucket.org/fenics-project/fiat/downloads/fiat-${version}.tar.gz";
69 sha256 = "1sbi0fbr7w9g9ajr565g3njxrc3qydqjy3334vmz5xg0rd3106il";
71 propagatedBuildInputs = [
76 nativeCheckInputs = [ pytest ];
79 # Workaround pytest 4.6.3 issue.
80 # See: https://bitbucket.org/fenics-project/fiat/pull-requests/59
81 rm test/unit/test_quadrature.py
82 rm test/unit/test_reference_element.py
83 rm test/unit/test_fiat.py
85 # Fix `np.float` deprecation in Numpy 1.20
86 grep -lr 'np.float(' test/ | while read -r fn; do
87 substituteInPlace "$fn" \
88 --replace "np.float(" "np.float64("
97 description = "Automatic generation of finite element basis functions";
98 homepage = "https://fenicsproject.org/";
99 platforms = lib.platforms.all;
100 license = lib.licenses.lgpl3;
104 ufl = pythonPackages.buildPythonPackage {
108 url = "https://bitbucket.org/fenics-project/ufl/downloads/ufl-${version}.tar.gz";
109 sha256 = "04daxwg4y9c51sdgvwgmlc82nn0fjw7i2vzs15ckdc7dlazmcfi1";
111 propagatedBuildInputs = [
115 nativeCheckInputs = [ pytest ];
122 description = "Domain-specific language for finite element variational forms";
123 homepage = "https://fenicsproject.org/";
124 platforms = lib.platforms.all;
125 license = lib.licenses.lgpl3;
129 ffc = pythonPackages.buildPythonPackage {
133 url = "https://bitbucket.org/fenics-project/ffc/downloads/ffc-${version}.tar.gz";
134 sha256 = "1zdg6pziss4va74pd7jjl8sc3ya2gmhpypccmyd8p7c66ji23y2g";
136 nativeBuildInputs = [ pybind11 ];
137 propagatedBuildInputs = [
146 nativeCheckInputs = [ pytest ];
149 rm test/unit/ufc/finite_element/test_evaluate.py
157 description = "Compiler for finite element variational forms";
158 homepage = "https://fenicsproject.org/";
159 platforms = lib.platforms.all;
160 license = lib.licenses.lgpl3;
163 dolfin = stdenv.mkDerivation {
167 url = "https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-${version}.tar.gz";
168 sha256 = "0kbyi4x5f6j4zpasch0swh0ch81w2h92rqm1nfp3ydi4a93vky33";
172 name = "fix-double-prefix.patch";
173 url = "https://bitbucket.org/josef_kemetmueller/dolfin/commits/328e94acd426ebaf2243c072b806be3379fd4340/raw";
174 sha256 = "1zj7k3y7vsx0hz3gwwlxhq6gdqamqpcw90d4ishwx5ps5ckcsb9r";
177 url = "https://bitbucket.org/fenics-project/dolfin/issues/attachments/1116/fenics-project/dolfin/1602778118.04/1116/0001-Use-__BYTE_ORDER__-instead-of-removed-Boost-endian.h.patch";
178 hash = "sha256-wPaDmPU+jaD3ce3nNEbvM5p8e3zBdLozamLTJ/0ai2c=";
181 # https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=dolfin&id=a965ad934f7b3d49a5e77fa6fb5e3c710ec2163e
183 sed -i '20 a #include <algorithm>' dolfin/geometry/IntersectionConstruction.cpp
184 sed -i '26 a #include <algorithm>' dolfin/mesh/MeshFunction.h
185 sed -i '25 a #include <cstdint>' dolfin/mesh/MeshConnectivity.h
187 propagatedBuildInputs = [
194 nativeBuildInputs = [
222 "-DDOLFIN_CXX_FLAGS=-std=c++11"
223 "-DDOLFIN_AUTO_DETECT_MPI=ON"
224 "-DDOLFIN_ENABLE_CHOLMOD=ON"
225 "-DDOLFIN_ENABLE_DOCS=ON"
226 "-DDOLFIN_ENABLE_HDF5=ON"
227 "-DDOLFIN_ENABLE_MPI=ON"
228 "-DDOLFIN_ENABLE_SCOTCH=ON"
229 "-DDOLFIN_ENABLE_UMFPACK=ON"
230 "-DDOLFIN_ENABLE_ZLIB=ON"
231 "-DDOLFIN_SKIP_BUILD_TESTS=ON" # Otherwise SCOTCH is not found
232 # TODO: Enable the following features
233 "-DDOLFIN_ENABLE_PARMETIS=OFF"
234 "-DDOLFIN_ENABLE_PETSC=OFF"
235 "-DDOLFIN_ENABLE_SLEPC=OFF"
236 "-DDOLFIN_ENABLE_TRILINOS=OFF"
238 installCheckPhase = ''
239 source $out/share/dolfin/dolfin.conf
243 description = "FEniCS Problem Solving Environment in Python and C++";
244 homepage = "https://fenicsproject.org/";
245 license = lib.licenses.lgpl3;
248 python-dolfin = pythonPackages.buildPythonPackage rec {
251 disabled = pythonPackages.isPy27;
253 sourceRoot = "${pname}-${version}/python";
254 nativeBuildInputs = [
258 dontUseCmakeConfigure = true;
260 export CMAKE_PREFIX_PATH=${pybind11}/share/cmake/pybind11:$CMAKE_PREFIX_PATH
261 substituteInPlace setup.py --replace "pybind11==2.2.4" "pybind11"
262 substituteInPlace dolfin/jit/jit.py \
263 --replace 'pkgconfig.exists("dolfin")' 'pkgconfig.exists("${dolfin}/lib/pkgconfig/dolfin.pc")' \
264 --replace 'pkgconfig.parse("dolfin")' 'pkgconfig.parse("${dolfin}/lib/pkgconfig/dolfin.pc")'
271 propagatedBuildInputs = [
277 pythonPackages.pkgconfig
278 pythonPackages.pybind11
280 doCheck = false; # Tries to orte_ess_init and call ssh to localhost
282 inherit (nixosTests) fenics;
285 description = "Python bindings for the DOLFIN FEM compiler";
286 homepage = "https://fenicsproject.org/";
287 platforms = lib.platforms.all;
288 license = lib.licenses.lgpl3;