Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

easyloggingpp: init at 9.95.0 #30256

Merged
merged 1 commit into from Oct 10, 2017
Merged

Conversation

acowley
Copy link
Contributor

@acowley acowley commented Oct 9, 2017

Motivation for this change

Adding a package definition for a small C++ logging framework

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Oct 10, 2017

On Linux I also need:

diff --git a/pkgs/development/libraries/easyloggingpp/default.nix b/pkgs/development/libraries/easyloggingpp/default.nix
index 3bfcd7331c8..9fe8a998548 100644
--- a/pkgs/development/libraries/easyloggingpp/default.nix
+++ b/pkgs/development/libraries/easyloggingpp/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [cmake];
   buildInputs = [gtest];
   cmakeFlags = [ "-Dtest=ON" "-Dbuild_static_lib=ON" ];
-  NIX_CFLAGS_COMPILE = "-std=c++11";
+  NIX_CFLAGS_COMPILE = "-std=c++11 -pthread";
   meta = {
     description = "C++ logging library";
     homepage = https://muflihun.github.io/easyloggingpp/;

};
nativeBuildInputs = [cmake];
buildInputs = [gtest];
cmakeFlags = [ "-Dtest=ON" "-Dbuild_static_lib=ON" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We prefer shared libraries in nixpkgs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that would perhaps make the project's supported usage (either add the source to your project or the static library) not work for nixpkgs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can have easily extend the existing derivation in a shell.nix for your project:

(easyloggingpp.overrideAttrs (old: { cmakeFlags = old.cmakeFlags ++ ["-Dbuild_static_lib=ON"];}))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I’m the only user I can leave it defined as a local package called from my config.nix, but I don’t see much point in having an unusable configuration in nixpkgs. I suppose the required override is shorter than the package definition, but adding something in a known broken state seems unhelpful.

Copy link
Member

@Mic92 Mic92 Oct 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is a shared library unusable or unbroken?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn’t naively build as shared. The purpose of the library is that this used to be a single-header package, but compile times were bad. They moved what they could into a C++ source file so some parts could be compiled once for each project, or once altogether if you link the static library.

I’ll take another whack at resolving the linking problems I saw when trying to switch it to shared.

@Mic92 Mic92 merged commit 2197ad0 into NixOS:master Oct 10, 2017
@acowley acowley mentioned this pull request Oct 12, 2017
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants