From 03002203b7b6018db65d86330705a057332f4375 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Jun 2022 18:00:10 +0200 Subject: [PATCH] Fix static build --- flake.nix | 5 ++++- src/libfetchers/input-accessor.cc | 4 ---- src/libutil/archive.cc | 4 ---- src/libutil/archive.hh | 4 +++- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 2f007b057..7ec7074c9 100644 --- a/flake.nix +++ b/flake.nix @@ -110,7 +110,10 @@ bzip2 xz brotli editline openssl sqlite libarchive - libzip + (libzip.overrideDerivation (old: { + # Temporary workaround for https://github.com/NixOS/nixpkgs/pull/178755 + cmakeFlags = old.cmakeFlags ++ [ "-DBUILD_REGRESS=0" ]; + })) boost lowdown-nix gtest diff --git a/src/libfetchers/input-accessor.cc b/src/libfetchers/input-accessor.cc index 7e4c46cff..c9472d9a8 100644 --- a/src/libfetchers/input-accessor.cc +++ b/src/libfetchers/input-accessor.cc @@ -12,10 +12,6 @@ InputAccessor::InputAccessor() { } // FIXME: merge with archive.cc. -const std::string narVersionMagic1 = "nix-archive-1"; - -static std::string caseHackSuffix = "~nix~case~hack~"; - void InputAccessor::dumpPath( const CanonPath & path, Sink & sink, diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index 30b471af5..733fb8c05 100644 --- a/src/libutil/archive.cc +++ b/src/libutil/archive.cc @@ -35,10 +35,6 @@ static ArchiveSettings archiveSettings; static GlobalConfig::Register rArchiveSettings(&archiveSettings); -const std::string narVersionMagic1 = "nix-archive-1"; - -static std::string caseHackSuffix = "~nix~case~hack~"; - PathFilter defaultPathFilter = [](const Path &) { return true; }; diff --git a/src/libutil/archive.hh b/src/libutil/archive.hh index 79ce08df0..a9a548def 100644 --- a/src/libutil/archive.hh +++ b/src/libutil/archive.hh @@ -102,7 +102,9 @@ void copyNAR(Source & source, Sink & sink); void copyPath(const Path & from, const Path & to); -extern const std::string narVersionMagic1; +inline constexpr std::string_view narVersionMagic1 = "nix-archive-1"; + +inline constexpr std::string_view caseHackSuffix = "~nix~case~hack~"; }