2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
enableShared ? !stdenv.hostPlatform.isStatic,
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
# tests
|
|
|
|
mpd,
|
|
|
|
openimageio,
|
|
|
|
fcitx5,
|
|
|
|
spdlog,
|
2021-01-05 17:05:55 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-15 13:44:38 +00:00
|
|
|
let
|
2024-07-27 06:49:29 +00:00
|
|
|
generic =
|
|
|
|
{
|
|
|
|
version,
|
|
|
|
sha256,
|
|
|
|
patches ? [ ],
|
|
|
|
}:
|
2020-11-15 13:44:38 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "fmt";
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
];
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2020-11-15 13:44:38 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fmtlib";
|
|
|
|
repo = "fmt";
|
|
|
|
rev = version;
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit patches;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}" ];
|
2020-11-15 13:44:38 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.tests = {
|
2024-07-27 06:49:29 +00:00
|
|
|
inherit
|
|
|
|
mpd
|
|
|
|
openimageio
|
|
|
|
fcitx5
|
|
|
|
spdlog
|
|
|
|
;
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-15 13:44:38 +00:00
|
|
|
description = "Small, safe and fast formatting library";
|
|
|
|
longDescription = ''
|
|
|
|
fmt (formerly cppformat) is an open-source formatting library. It can be
|
|
|
|
used as a fast and safe alternative to printf and IOStreams.
|
|
|
|
'';
|
2022-09-09 14:08:57 +00:00
|
|
|
homepage = "https://fmt.dev/";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/fmtlib/fmt/blob/${version}/ChangeLog.rst";
|
2020-11-15 13:44:38 +00:00
|
|
|
downloadPage = "https://github.com/fmtlib/fmt/";
|
|
|
|
maintainers = [ maintainers.jdehaas ];
|
2021-02-16 17:04:54 +00:00
|
|
|
license = licenses.mit;
|
2020-11-15 13:44:38 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
2021-07-14 22:03:04 +00:00
|
|
|
fmt_8 = generic {
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "8.1.1";
|
|
|
|
sha256 = "sha256-leb2800CwdZMJRWF5b1Y9ocK0jXpOX/nwo95icDf308=";
|
2021-07-14 22:03:04 +00:00
|
|
|
};
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
fmt_9 = generic {
|
2022-11-02 22:02:43 +00:00
|
|
|
version = "9.1.0";
|
|
|
|
sha256 = "sha256-rP6ymyRc7LnKxUXwPpzhHOQvpJkpnRFOt2ctvUNlYI0=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
fmt_10 = generic {
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "10.2.1";
|
|
|
|
sha256 = "sha256-pEltGLAHLZ3xypD/Ur4dWPWJ9BGVXwqQyKcDWVmC3co=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
2024-07-27 06:49:29 +00:00
|
|
|
|
|
|
|
fmt_11 = generic {
|
|
|
|
version = "11.0.1";
|
|
|
|
sha256 = "sha256-EPidbZxCvysrL64AzbpJDowiNxqy4ii+qwSWAFwf/Ps=";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|