Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

48 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
# Build the FMUs following the latest FMI standard
FMIVersion ? 3,
}:
# C.f. <https://fmi-standard.org/>
assert lib.asserts.assertMsg (
FMIVersion >= 1 && FMIVersion <= 3
) "FMIVersion must be a valid FMI specification standard: 1, 2, or 3; not ${toString FMIVersion}";
# NB: this derivation does not package the fmusim executables, only
# the FMUs.
stdenv.mkDerivation (finalAttrs: {
pname = "reference-fmus";
version = "0.0.39";
src = fetchFromGitHub {
owner = "modelica";
repo = "reference-fmus";
rev = "v${finalAttrs.version}";
hash = "sha256-3bjqfEyPhqVrJOHHhniacyUAo82InCd6LLx3tyC8DYg=";
};
nativeBuildInputs = [ cmake ];
cmakeFlags = [
"-DFMI_VERSION=${toString FMIVersion}"
(lib.cmakeBool "WITH_FMUSIM" false)
];
CFLAGS = lib.optionalString (FMIVersion == 3) "-Wno-stringop-truncation";
meta = {
# CMakeLists.txt explicitly states support for aarch64-darwin, but
# the build fails in a Nix environment. C.f.
# <https://github.com/NixOS/nixpkgs/pull/397658#issuecomment-2851958172>.
broken = with stdenv.hostPlatform; isAarch64 && isDarwin;
description = "Functional Mock-up Units for development, testing and debugging";
homepage = "https://github.com/modelica/Reference-FMUs";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ tmplt ];
platforms = lib.platforms.all;
};
})