I have been trying to compile an application which requires the llhttp library, I’m currently using the following derivation file:
{
stdenv,
libuv,
openssl,
llhttp,
zlib,
cmake,
pkg-config,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
version = "0.33.9";
pname = "tlsuv";
src = fetchFromGitHub {
owner = "openziti";
repo = "tlsuv";
tag = "v${version}";
hash = "sha256-um6aE0yK+lXfvaiKYugxavbXQRVm3mE+EeP6nuqYH8E=";
};
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
libuv
openssl
llhttp
zlib
];
}
When building I get the following CMake error:
CMake Error in CMakeLists.txt:
Imported target "llhttp::llhttp_static" includes non-existent path
"/nix/store/fcfxn8y0fvdzkrcbfxr6a4fl5ixrr19y-llhttp-9.2.1/include"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
I checked the llhttp-9.2.1-dev nix package and found the cmake file. If I’m understanding this correctly, it seems to have an error:
/nix/store/[…]-llhttp-9.2.1-dev/lib/cmake/llhttp/llhttp-config.cmake
(Snippet for brevity)
# The installation prefix configured by this project.
set(_IMPORT_PREFIX "/nix/store/fcfxn8y0fvdzkrcbfxr6a4fl5ixrr19y-llhttp-9.2.1")
# Create imported target llhttp::llhttp_shared
add_library(llhttp::llhttp_shared SHARED IMPORTED)
set_target_properties(llhttp::llhttp_shared PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
)
# Create imported target llhttp::llhttp_static
add_library(llhttp::llhttp_static STATIC IMPORTED)
set_target_properties(llhttp::llhttp_static PROPERTIES
# PS: this points the regular llhttp package output, which doesn't contain any headers.
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
)
I’d greatly appreciate it, if someone more experienced with nix could tell me whether this is an bug in packaging, or if I’m understanding something incorrectly.