From ff6e587dbd071b3eee2bcd03ed264fda9d7df43b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Wed, 21 May 2025 23:21:59 +0300 Subject: [PATCH] units-llnl: init at 0.13.1 https://github.com/llnl/units --- pkgs/by-name/un/units-llnl/package.nix | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pkgs/by-name/un/units-llnl/package.nix diff --git a/pkgs/by-name/un/units-llnl/package.nix b/pkgs/by-name/un/units-llnl/package.nix new file mode 100644 index 000000000000..fcba27fb936c --- /dev/null +++ b/pkgs/by-name/un/units-llnl/package.nix @@ -0,0 +1,42 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + + # This is the baseType needed by scipp - the main package that depends on + # this package. + baseType ? "uint64_t", +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "units-llnl"; + version = "0.13.1"; + + src = fetchFromGitHub { + owner = "LLNL"; + repo = "units"; + tag = "v${finalAttrs.version}"; + hash = "sha256-thJnBT+wQPF9obzXk/T6H9lvPEAH5REx3YhBXEd7n7c="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + cmake + ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" true) + (lib.cmakeFeature "UNITS_BASE_TYPE" baseType) + ]; + doCheck = true; + + meta = { + description = "Run-time C++ library for working with units of measurement and conversions between them and with string representations of units and measurements"; + homepage = "https://github.com/llnl/units"; + changelog = "https://github.com/llnl/units/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ doronbehar ]; + mainProgram = "units-llnl"; + platforms = lib.platforms.all; + }; +})