spdlog: use nixpkgs' fmt instead of bundled one

This commit is contained in:
SCOTT-HAMILTON 2020-12-09 20:53:17 +01:00
parent 2959bb7028
commit ddf90cb942
6 changed files with 39 additions and 15 deletions

View file

@ -17,6 +17,7 @@
, mtxclient , mtxclient
, boost17x , boost17x
, spdlog , spdlog
, fmt
, olm , olm
, pkgconfig , pkgconfig
, nlohmann_json , nlohmann_json
@ -47,6 +48,7 @@ mkDerivation rec {
boost17x boost17x
lmdb lmdb
spdlog spdlog
fmt
cmark cmark
qtbase qtbase
qtmultimedia qtmultimedia

View file

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, cmake, ninja, pkgconfig, python3Packages { stdenv, fetchFromGitHub, cmake, ninja, pkgconfig, python3Packages
, boost, rapidjson, qtbase, qtsvg, igraph, spdlog, wrapQtAppsHook , boost, rapidjson, qtbase, qtsvg, igraph, spdlog, wrapQtAppsHook
, llvmPackages ? null , fmt, llvmPackages ? null
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
''; '';
nativeBuildInputs = [ cmake ninja pkgconfig ]; nativeBuildInputs = [ cmake ninja pkgconfig ];
buildInputs = [ qtbase qtsvg boost rapidjson igraph spdlog wrapQtAppsHook ] buildInputs = [ qtbase qtsvg boost rapidjson igraph spdlog fmt wrapQtAppsHook ]
++ (with python3Packages; [ python pybind11 ]) ++ (with python3Packages; [ python pybind11 ])
++ stdenv.lib.optional stdenv.cc.isClang llvmPackages.openmp; ++ stdenv.lib.optional stdenv.cc.isClang llvmPackages.openmp;
@ -42,11 +42,11 @@ stdenv.mkDerivation rec {
# the qt mkDerivation - the latter forcibly overrides this. # the qt mkDerivation - the latter forcibly overrides this.
cmakeBuildType = "MinSizeRel"; cmakeBuildType = "MinSizeRel";
meta = { meta = with stdenv.lib {
description = "A comprehensive reverse engineering and manipulation framework for gate-level netlists"; description = "A comprehensive reverse engineering and manipulation framework for gate-level netlists";
homepage = "https://github.com/emsec/hal"; homepage = "https://github.com/emsec/hal";
license = stdenv.lib.licenses.mit; license = licenses.mit;
platforms = with stdenv.lib.platforms; unix; platforms = platforms.unix;
maintainers = with stdenv.lib.maintainers; [ ris ]; maintainers = with maintainers; [ ris shamilton ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, cmake }: { stdenv, fetchFromGitHub, cmake, fmt }:
let let
generic = { version, sha256 }: generic = { version, sha256 }:
@ -14,12 +14,14 @@ let
}; };
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
buildInputs = [ fmt ];
cmakeFlags = [ cmakeFlags = [
"-DSPDLOG_BUILD_SHARED=ON" "-DSPDLOG_BUILD_SHARED=ON"
"-DSPDLOG_BUILD_EXAMPLE=OFF" "-DSPDLOG_BUILD_EXAMPLE=OFF"
"-DSPDLOG_BUILD_BENCH=OFF" "-DSPDLOG_BUILD_BENCH=OFF"
"-DSPDLOG_BUILD_TESTS=ON" "-DSPDLOG_BUILD_TESTS=ON"
"-DSPDLOG_FMT_EXTERNAL=ON"
]; ];
outputs = [ "out" "doc" ]; outputs = [ "out" "doc" ];

View file

@ -8,6 +8,7 @@
, catch2 , catch2
, cmake , cmake
, cython , cython
, fmt
, muparserx , muparserx
, ninja , ninja
, nlohmann_json , nlohmann_json
@ -47,6 +48,7 @@ buildPythonPackage rec {
buildInputs = [ buildInputs = [
blas blas
catch2 catch2
fmt
muparserx muparserx
nlohmann_json nlohmann_json
spdlog spdlog

View file

@ -0,0 +1,11 @@
diff --color -ur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2020-12-10 10:39:37.775694976 +0100
+++ b/CMakeLists.txt 2020-12-10 10:40:41.984575938 +0100
@@ -127,6 +127,7 @@
add_definitions(-D__STDC_LIMIT_MACROS)
add_definitions(-D__STDC_CONSTANT_MACROS)
add_definitions(-D__STDC_FORMAT_MACROS)
+add_definitions(-DSPDLOG_FMT_EXTERNAL)
if(MINGW)
add_definitions(-DWINVER=0x0602)
add_definitions(-D_WIN32_WINNT=0x0602)

View file

@ -16,6 +16,7 @@
, judy , judy
, pam , pam
, spdlog , spdlog
, fmt
, zlib # optional , zlib # optional
}: }:
@ -30,13 +31,6 @@ stdenv.mkDerivation rec {
sha256 = "0zk73wmx82ari3m2mv0zx04x1ggsdmwcwn7k6bkl5c0jnxffc4ax"; sha256 = "0zk73wmx82ari3m2mv0zx04x1ggsdmwcwn7k6bkl5c0jnxffc4ax";
}; };
nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
buildInputs =
[ db fuse asciidoc libxml2 libxslt docbook_xml_dtd_412 docbook_xsl
zlib boost judy pam spdlog python2
];
patches = [ patches = [
# Use system-provided spdlog instead of downloading an old one (next two patches) # Use system-provided spdlog instead of downloading an old one (next two patches)
(fetchpatch { (fetchpatch {
@ -53,13 +47,26 @@ stdenv.mkDerivation rec {
url = "https://github.com/lizardfs/lizardfs/commit/5d20c95179be09241b039050bceda3c46980c004.patch"; url = "https://github.com/lizardfs/lizardfs/commit/5d20c95179be09241b039050bceda3c46980c004.patch";
sha256 = "185bfcz2rjr4cnxld2yc2nxwzz0rk4x1fl1sd25g8gr5advllmdv"; sha256 = "185bfcz2rjr4cnxld2yc2nxwzz0rk4x1fl1sd25g8gr5advllmdv";
}) })
# Add SPDLOG_FMT_EXTERNAL flag to disable spdlog from using bundled fmt
# Would use https://github.com/lizardfs/lizardfs/commit/31b0cd40f84ee75f99643ad19122061e3d6fb6cc.patch
# if it didn't failed to patch
./cmake-def-spdlog-fmt-external.patch
]; ];
nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
buildInputs =
[ db fuse asciidoc libxml2 libxslt docbook_xml_dtd_412 docbook_xsl
zlib boost judy pam spdlog fmt python2
];
cmakeFlags = [ "-DSPDLOG_FMT_EXTERNAL=ON" ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = "https://lizardfs.com"; homepage = "https://lizardfs.com";
description = "A highly reliable, scalable and efficient distributed file system"; description = "A highly reliable, scalable and efficient distributed file system";
platforms = platforms.linux; platforms = platforms.linux;
license = licenses.gpl3; license = licenses.gpl3;
maintainers = [ maintainers.rushmorem ]; maintainers = with maintainers; [ rushmorem shamilton ];
}; };
} }