diff options
author | Anthony Cowley <acowley@gmail.com> | 2017-10-11 16:34:20 -0400 |
---|---|---|
committer | Anthony Cowley <acowley@gmail.com> | 2018-02-21 20:25:55 -0500 |
commit | c6463f89132436de320d17c2032f0e432cc145b7 (patch) | |
tree | 563b697e2f3bd1628a941e083ac01d270b3a66b8 /pkgs/development/libraries/easyloggingpp | |
parent | c64639b54caa6595f9ef62ed2548593b5fe5db66 (diff) |
easyloggingpp: remove static library
Added a pkg-config file and copied the relevant source file into the nix store. The idea is that the user may now relatively easily include the library’s source file in their project using common CMake features.
Diffstat (limited to 'pkgs/development/libraries/easyloggingpp')
-rw-r--r-- | pkgs/development/libraries/easyloggingpp/default.nix | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/pkgs/development/libraries/easyloggingpp/default.nix b/pkgs/development/libraries/easyloggingpp/default.nix index fe14a1b2b77ce..e8b4abd68b3e9 100644 --- a/pkgs/development/libraries/easyloggingpp/default.nix +++ b/pkgs/development/libraries/easyloggingpp/default.nix @@ -1,3 +1,6 @@ +# To use this package with a CMake and pkg-config build: +# pkg_check_modules(EASYLOGGINGPP REQUIRED easyloggingpp) +# add_executable(main src/main.cpp ${EASYLOGGINGPP_PREFIX}/include/easylogging++.cc) { stdenv, fetchFromGitHub, cmake, gtest }: stdenv.mkDerivation rec { name = "easyloggingpp-${version}"; @@ -10,9 +13,22 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [cmake]; buildInputs = [gtest]; - cmakeFlags = [ "-Dtest=ON" "-Dbuild_static_lib=ON"]; + cmakeFlags = [ "-Dtest=ON" ]; NIX_CFLAGS_COMPILE = "-std=c++11" + stdenv.lib.optionalString stdenv.isLinux " -pthread"; + postInstall = '' + mkdir -p $out/include + cp ../src/easylogging++.cc $out/include + mkdir -p $out/lib/pkgconfig + cat << EOF > $out/lib/pkgconfig/easyloggingpp.pc + Name: easyloggingpp + Description: A C++ Logging Library + Version: ${version} + prefix=$out + includedir=\''${prefix}/include + Cflags: -I\''${includedir} + EOF + ''; meta = { description = "C++ logging library"; homepage = https://muflihun.github.io/easyloggingpp/; |