diff --git a/flake.nix b/flake.nix index f1f9a71..6f76f26 100644 --- a/flake.nix +++ b/flake.nix @@ -17,14 +17,17 @@ sqlite ]; - buildCommand = '' + buildCommand = let + nixHasSignalsHh = nixpkgs.lib.strings.versionAtLeast nix.version "2.19"; + in '' mkdir -p $out/bin g++ -Os -g ${./index-debuginfo.cc} -Wall -std=c++14 -o $out/bin/index-debuginfo -I . \ $(pkg-config --cflags nix-main) \ $(pkg-config --libs nix-main) \ $(pkg-config --libs nix-store) \ - -lsqlite3 + -lsqlite3 \ + ${nixpkgs.lib.optionalString nixHasSignalsHh "-DHAS_SIGNALS_HH"} ''; }; diff --git a/index-debuginfo.cc b/index-debuginfo.cc index 8dd7dba..e320ccb 100644 --- a/index-debuginfo.cc +++ b/index-debuginfo.cc @@ -8,6 +8,11 @@ #include "thread-pool.hh" #include "nar-info.hh" +// https://github.com/NixOS/nix/commit/ac89bb064aeea85a62b82a6daf0ecca7190a28b7 +#ifdef HAS_SIGNALS_HH +#include "signals.hh" +#endif + #include // cache.nixos.org/debuginfo/