2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake
|
2021-01-05 17:05:55 +00:00
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-15 13:44:38 +00:00
|
|
|
let
|
|
|
|
generic = { version, sha256, patches ? [ ] }:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "fmt";
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-15 13:44:38 +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 ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
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/";
|
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
|
|
|
|
{
|
|
|
|
fmt_7 = generic {
|
2020-11-30 08:33:03 +00:00
|
|
|
version = "7.1.3";
|
|
|
|
sha256 = "08hyv73qp2ndbs0isk8pspsphdzz5qh8czl3wgyxy3mmif9xdg29";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
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
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|