I am working on a cross-platform project and they use conan as their package manager and cmake as build system. Problem arises, when conan tries to install system dependencies such as opengl and xorg. Log from conan:
Detecting target platform...
Target platform: linux
-- Conan executing:
Setting profile: /home/senpie/my-project/common/cmake/platform/conan/linux.profile
Setting build profile: /home/senpie/my-project/common/cmake/platform/conan/linux.profile
Running conan in /home/senpie/Documents/my-project
======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Debug
compiler=clang
compiler.cppstd=20
compiler.libcxx=libstdc++
compiler.version=16
os=Linux
[conf]
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
Profile build:
[settings]
arch=x86_64
build_type=Debug
compiler=clang
compiler.cppstd=20
compiler.libcxx=libstdc++
compiler.version=16
os=Linux
[conf]
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
======== Computing dependency graph ========
... etc
opengl/system#4df6fecde4084386beded3ed0e56e4ea - Cache
xorg/system#98f82cb669e4ebc6b4d9d8a4f3f1faf4 - Cache
... etc
======== Computing necessary packages ========
opengl/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
opengl/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
opengl/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
opengl/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
opengl/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
opengl/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
xorg/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
xorg/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
xorg/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
xorg/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
xorg/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
xorg/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
xorg/system: A default system package manager couldn't be found for nixos, system packages will not be installed.
======== Installing packages ========
opengl/system: Already installed! (8 of 15)
xorg/system: Already installed! (11 of 15)
ERROR: xorg/system: Error in package_info() method, line 102
pkg_config.fill_cpp_info(
ConanException: PkgConfig failed. Command: pkg-config --print-provides xcb-icccm --print-errors
stdout:
stderr:
Package xcb-icccm was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-icccm.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xcb-icccm' found
CMake Error at common/cmake/conan.cmake:74 (message):
Conan install failed for Debug (1)
Call Stack (most recent call first):
common/cmake/conan.cmake:127 (invoke_conan)
CMakeLists.txt:17 (include)
-- Configuring incomplete, errors occurred!
Inside my flake:
{
...
{
self,
nixpkgs,
}@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.${system}.default = pkgs.mkShellNoCC {
...
nativeBuildInputs = with pkgs; [
git
cmake
pkg-config
ninja
conan
clang_16
xorg.libX11 # needs maintainer
xorg.libfontenc # needs maintainer
xorg.libICE # needs maintainer
xorg.libSM # needs maintainer
xorg.libXau # needs maintainer
xorg.libXaw # xaw7 needs maintainer
xorg.libXcomposite # needs maintainer
xorg.libXcursor # needs maintainer
xorg.libXdamage # needs maintainer
xorg.libXdmcp # needs maintainer
xorg.libXext # needs maintainer
xorg.libXi # needs maintianer
xorg.libXfixes
xorg.libXinerama
xorg.libXmu
xorg.libXpm
xorg.libXrandr
xorg.libXrender
xorg.libXres
xorg.libXt
xorg.libXtst
xorg.libXv
xorg.libXvMC
xorg.libXxf86dga
xorg.libXxf86misc
xorg.libXxf86vm
xorg.libxcb
xorg.libxkbfile
xorg.libXScrnSaver
xorg.libxshmfence
xorg.libXp
xorg.libXpresent
xorg.libpciaccess
xorg.libpthreadstubs
];
shellHook = ''
echo "Setting up project..."
'';
};
};
}
As you can see from the flake, I run conan, it failed on a single xorg package, I would add it and run again. It again would fail, I would add it, and it would fail on the next package. So the question is how to avoid listing every xorg dependency and make it work? In nix center I saw there are like 3000+ packages in xorg namespace. I really don’t want to name them one by one. Thanks!