Fix compilation against older Nix versions (tested with 2.13.6)
Dependencies
- [2]
3KEFKH5FImport existing code
Change contents
- edit in src/fetcher.cpp at line 27
#if NIX_VERSION >= 0x021600 - edit in src/fetcher.cpp at line 29
#endif - edit in src/fetcher.cpp at line 40
#if NIX_VERSION < 0x021800[[nodiscard]] std::optional<Input> inputFromURL(const ParsedURL &url) const override#else - edit in src/fetcher.cpp at line 44
#endif - edit in CMakeLists.txt at line 22
string(REPLACE "." ";" VERSION_LIST ${Nix_VERSION})list(GET VERSION_LIST 0 Nix_MAJOR_VERSION)list(GET VERSION_LIST 1 Nix_MINOR_VERSION)list(GET VERSION_LIST 2 Nix_PATCH_VERSION)target_compile_definitions(PkgConfig::NixINTERFACE"NIX_MAJOR_VERSION=(${Nix_MAJOR_VERSION})""NIX_MINOR_VERSION=(${Nix_MINOR_VERSION})""NIX_PATCH_VERSION=(${Nix_PATCH_VERSION})""NIX_VERSION=(((0x${Nix_MAJOR_VERSION})<<16) | ((0x${Nix_MINOR_VERSION})<<8) | (0x${Nix_PATCH_VERSION}))")