summary refs log tree commit diff
path: root/pkgs/development/libraries/fmt
diff options
context:
space:
mode:
authorJeroen de Haas <jeroen@dehaas.online>2018-10-10 15:44:48 +0200
committerJeroen de Haas <jeroen@dehaas.online>2018-10-16 08:30:54 +0200
commit2f6097b783f26cb53890ace955b80948aebdf6f5 (patch)
tree00734dac901d8adf230bf21174e6a4d4514e304a /pkgs/development/libraries/fmt
parenta600f3b577283fe1901d93468c2acd402461e7a3 (diff)
downloadnixpkgs-2f6097b783f26cb53890ace955b80948aebdf6f5.tar
nixpkgs-2f6097b783f26cb53890ace955b80948aebdf6f5.tar.gz
nixpkgs-2f6097b783f26cb53890ace955b80948aebdf6f5.tar.bz2
nixpkgs-2f6097b783f26cb53890ace955b80948aebdf6f5.tar.lz
nixpkgs-2f6097b783f26cb53890ace955b80948aebdf6f5.tar.xz
nixpkgs-2f6097b783f26cb53890ace955b80948aebdf6f5.tar.zst
nixpkgs-2f6097b783f26cb53890ace955b80948aebdf6f5.zip
fmt: init at 5.2.1
This commit adds fmt, a C++ formatting library.
Diffstat (limited to 'pkgs/development/libraries/fmt')
-rw-r--r--pkgs/development/libraries/fmt/default.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/development/libraries/fmt/default.nix b/pkgs/development/libraries/fmt/default.nix
new file mode 100644
index 00000000000..c120f7c9b43
--- /dev/null
+++ b/pkgs/development/libraries/fmt/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, cmake, enableShared ? true }:
+
+stdenv.mkDerivation rec {
+  version = "5.2.1";
+  name = "fmt-${version}";
+  src = fetchFromGitHub {
+    owner = "fmtlib";
+    repo = "fmt";
+    rev = "${version}";
+    sha256 = "1cd8yq8va457iir1hlf17ksx11fx2hlb8i4jml8gj1875pizm0pk";
+  };
+  nativeBuildInputs = [ cmake ];
+  doCheck = true;
+  # preCheckHook ensures the test binaries can find libfmt.so.5
+  preCheck = if enableShared
+             then "export LD_LIBRARY_PATH=\"$PWD\""
+             else "";
+  cmakeFlags = [ "-DFMT_TEST=yes"
+                 "-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}" ];
+  meta = with stdenv.lib; {
+    homepage = http://fmtlib.net/;
+    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.
+    '';
+    maintainers = [ maintainers.jdehaas ];
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+  };
+}