Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions pkgs/applications/science/electronics/openems/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{ stdenv
, lib
, fetchFromGitHub
, csxcad
, fparser
, tinyxml
, hdf5
, vtk
, boost
, zlib
, cmake
, octave
, gl2ps
, withQcsxcad ? true
, withMPI ? false
, withHyp2mat ? true
, qcsxcad ? null
, openmpi ? null
, hyp2mat ? null
}:

assert withQcsxcad -> qcsxcad != null;
assert withMPI -> openmpi != null;
assert withHyp2mat -> hyp2mat != null;

stdenv.mkDerivation {
pname = "openems";
version = "unstable-2020-02-15";

src = fetchFromGitHub {
owner = "thliebig";
repo = "openEMS";
rev = "ba793ac84e2f78f254d6d690bb5a4c626326bbfd";
sha256 = "1dca6b6ccy771irxzsj075zvpa3dlzv4mjb8xyg9d889dqlgyl45";
};

nativeBuildInputs = [
cmake
];

cmakeFlags = lib.optionals withMPI [ "-DWITH_MPI=ON" ];

buildInputs = [
fparser
tinyxml
hdf5
vtk
boost
zlib
csxcad
(octave.override { inherit hdf5; }) ]
++ lib.optionals withQcsxcad [ qcsxcad ]
++ lib.optionals withMPI [ openmpi ]
++ lib.optionals withHyp2mat [ hyp2mat ];

postFixup = ''
substituteInPlace $out/share/openEMS/matlab/setup.m \
--replace /usr/lib ${hdf5}/lib \
--replace /usr/include ${hdf5}/include

${octave}/bin/mkoctfile -L${hdf5}/lib -I${hdf5}/include \
-lhdf5 $out/share/openEMS/matlab/h5readatt_octave.cc \
-o $out/share/openEMS/matlab/h5readatt_octave.oct
'';

enableParallelBuilding = true;

meta = with lib; {
description = "Open Source Electromagnetic Field Solver";
homepage = "http://openems.de/index.php/Main_Page.html";
license = licenses.gpl3;
maintainers = with maintainers; [ matthuszagh ];
platforms = platforms.linux;
badPlatforms = platforms.aarch64;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25785,6 +25785,8 @@ in

ngspice = callPackage ../applications/science/electronics/ngspice { };

openems = callPackage ../applications/science/electronics/openems { };

pcb = callPackage ../applications/science/electronics/pcb { };

qcsxcad = libsForQt5.callPackage ../applications/science/electronics/qcsxcad { };
Expand Down