From c6463f89132436de320d17c2032f0e432cc145b7 Mon Sep 17 00:00:00 2001 From: Anthony Cowley Date: Wed, 11 Oct 2017 16:34:20 -0400 Subject: [PATCH 1/2] easyloggingpp: remove static library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../libraries/easyloggingpp/default.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/easyloggingpp/default.nix b/pkgs/development/libraries/easyloggingpp/default.nix index fe14a1b2b77..e8b4abd68b3 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/; From d12c93b62d7c4a0271412406b0064f28d68da228 Mon Sep 17 00:00:00 2001 From: Anthony Cowley Date: Wed, 14 Feb 2018 03:18:35 -0500 Subject: [PATCH 2/2] easyloggingpp: 9.95.0 -> 9.96.0 --- .../libraries/easyloggingpp/default.nix | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/easyloggingpp/default.nix b/pkgs/development/libraries/easyloggingpp/default.nix index e8b4abd68b3..80c3f7b100e 100644 --- a/pkgs/development/libraries/easyloggingpp/default.nix +++ b/pkgs/development/libraries/easyloggingpp/default.nix @@ -4,13 +4,14 @@ { stdenv, fetchFromGitHub, cmake, gtest }: stdenv.mkDerivation rec { name = "easyloggingpp-${version}"; - version = "9.95.0"; + version = "9.96.0"; src = fetchFromGitHub { owner = "muflihun"; repo = "easyloggingpp"; rev = "v${version}"; - sha256 = "0gzmznw6ffag9x55lixxffy6x7mvb7691x0md4q9rbh88zkws7kq"; + sha256 = "134arh13rksfsxa80h6xw104458ihzp1mpblz5sprx5gxkq7yqfv"; }; + nativeBuildInputs = [cmake]; buildInputs = [gtest]; cmakeFlags = [ "-Dtest=ON" ]; @@ -19,15 +20,6 @@ stdenv.mkDerivation rec { 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";