From e6db9fb9321c24821f0bca958c283d77e5e9784c Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 20 Oct 2025 23:42:23 +0200 Subject: [PATCH] openems: fix for CMake v4 + clean --- pkgs/by-name/op/openems/package.nix | 30 ++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/op/openems/package.nix b/pkgs/by-name/op/openems/package.nix index 22e92e81fa35..d336bf62f538 100644 --- a/pkgs/by-name/op/openems/package.nix +++ b/pkgs/by-name/op/openems/package.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitHub, + fetchpatch, csxcad, fparser, tinyxml, @@ -19,17 +20,32 @@ hyp2mat, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "openems"; version = "0.0.36"; src = fetchFromGitHub { owner = "thliebig"; repo = "openEMS"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-wdH+Zw7G2ZigzBMX8p3GKdFVx/AhbTNL+P3w+YjI/dc="; }; + patches = [ + # ref. https://github.com/thliebig/openEMS/pull/183 merged upstream + (fetchpatch { + name = "update-cmake-minimum-required.patch"; + url = "https://github.com/thliebig/openEMS/commit/0fa7ba3aebc8ee531077973cfa136ead8e887872.patch"; + hash = "sha256-q/ax7MZHwqSKAjx22uyV13YO/TXZa4bwikoQyItMB7E="; + }) + # ref. https://github.com/thliebig/openEMS/pull/184 merged upstream + (fetchpatch { + name = "update-nf2ff-cmake-minimum-required.patch"; + url = "https://github.com/thliebig/openEMS/commit/e02e2a8414355482145240e4c2b2464d7a26dd9e.patch"; + hash = "sha256-y3pvim/8XUKF5k7shj0D+8P6tdfSZ3E/gxTogbRtxdo="; + }) + ]; + nativeBuildInputs = [ cmake ]; @@ -60,11 +76,11 @@ stdenv.mkDerivation rec { -o $out/share/openEMS/matlab/h5readatt_octave.oct ''; - meta = with lib; { + meta = { description = "Open Source Electromagnetic Field Solver"; homepage = "https://wiki.openems.de/index.php/Main_Page.html"; - license = licenses.gpl3; - maintainers = with maintainers; [ matthuszagh ]; - platforms = platforms.linux; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ matthuszagh ]; + platforms = lib.platforms.linux; }; -} +})