core/pkgs/by-name/fm/fmt/default.nix

70 lines
1.7 KiB
Nix
Raw Normal View History

2024-05-13 21:24:10 +00:00
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, enableShared ?
!stdenv.hostPlatform.isStatic
2024-05-02 00:46:19 +00:00
2024-05-13 21:24:10 +00:00
# for passthru.tests
# , mpd
# , openimageio
# , fcitx5
# , spdlog
2024-05-02 00:46:19 +00:00
}:
let
generic = { version, sha256, patches ? [ ] }:
stdenv.mkDerivation {
pname = "fmt";
inherit version;
outputs = [ "out" "dev" ];
src = fetchFromGitHub {
owner = "fmtlib";
repo = "fmt";
rev = version;
inherit sha256;
};
inherit patches;
nativeBuildInputs = [ cmake ];
2024-05-13 21:24:10 +00:00
cmakeFlags =
[ "-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}" ];
2024-05-02 00:46:19 +00:00
doCheck = true;
# passthru.tests = {
# inherit mpd openimageio fcitx5 spdlog;
# };
meta = with lib; {
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.
'';
homepage = "https://fmt.dev/";
2024-05-13 21:24:10 +00:00
changelog =
"https://github.com/fmtlib/fmt/blob/${version}/ChangeLog.rst";
2024-05-02 00:46:19 +00:00
downloadPage = "https://github.com/fmtlib/fmt/";
maintainers = [ maintainers.jdehaas ];
license = licenses.mit;
platforms = platforms.all;
};
};
2024-05-13 21:24:10 +00:00
in {
2024-05-02 00:46:19 +00:00
fmt_8 = generic {
version = "8.1.1";
sha256 = "sha256-leb2800CwdZMJRWF5b1Y9ocK0jXpOX/nwo95icDf308=";
};
fmt_9 = generic {
version = "9.1.0";
sha256 = "sha256-rP6ymyRc7LnKxUXwPpzhHOQvpJkpnRFOt2ctvUNlYI0=";
};
fmt_10 = generic {
version = "10.2.1";
sha256 = "sha256-pEltGLAHLZ3xypD/Ur4dWPWJ9BGVXwqQyKcDWVmC3co=";
};
}