I’m using vcpkg to get the qtdeclarative port (Qt 6.8.2), but I keep getting the following error when compiling.
CMake Error at /nix/store/xh4gd0g8j4sfwb4gg164a2hc22i0b7jh-cmake-3.31.5/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find Python (missing: Python_EXECUTABLE Interpreter)
Call Stack (most recent call first):
/nix/store/xh4gd0g8j4sfwb4gg164a2hc22i0b7jh-cmake-3.31.5/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
/nix/store/xh4gd0g8j4sfwb4gg164a2hc22i0b7jh-cmake-3.31.5/share/cmake-3.31/Modules/FindPython.cmake:673 (find_package_handle_standard_args)
/nix/store/wh6jyld823x0zbr1a71ir6xnf3fajwl1-vcpkg-2025.02.14/share/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
/Users/denniseum/Projects/internal/cs2620/converse/exe_client/build/vcpkg_installed/arm64-osx/share/Qt6/QtFindPackageHelpers.cmake:141 (find_package)
src/qml/configure.cmake:14 (qt_find_package)
/Users/denniseum/Projects/internal/cs2620/converse/exe_client/build/vcpkg_installed/arm64-osx/share/Qt6/QtFeature.cmake:678 (include)
src/qml/CMakeLists.txt:13 (qt_feature_evaluate_features)
I tried checking with
cmake_minimum_required(VERSION 3.30)
find_package(
Python
COMPONENTS Interpreter Development
REQUIRED)
message(STATUS "Python Interpreter: ${Python_EXECUTABLE}")
message(STATUS "Python Version: ${Python_VERSION}")
message(STATUS "Python Include Dir: ${Python_INCLUDE_DIRS}")
message(STATUS "Python Library: ${Python_LIBRARIES}")
but that resolves correctly with
-- Found Python: /nix/store/3p3agnh4792y8bgjp0s8xx5bym1ahpks-python3-3.12.9/bin/python3.12 (found version "3.12.9") found components: Interpreter Development Development.Module Development.Embed
-- Python Interpreter: /nix/store/3p3agnh4792y8bgjp0s8xx5bym1ahpks-python3-3.12.9/bin/python3.12
-- Python Version: 3.12.9
-- Python Include Dir: /nix/store/3p3agnh4792y8bgjp0s8xx5bym1ahpks-python3-3.12.9/include/python3.12
-- Python Library: /nix/store/3p3agnh4792y8bgjp0s8xx5bym1ahpks-python3-3.12.9/lib/libpython3.12.dylib
The flake I am using is
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
system = "aarch64-darwin";
pkgs = import nixpkgs {
inherit system;
};
in
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
apple-sdk_15
];
nativeBuildInputs = with pkgs; [
autoconf
autoconf-archive
automake
cmake
cups
libtool
llvmPackages_20.clang-tools
llvmPackages_20.clangWithLibcAndBasicRtAndLibcxx
ninja
perl
python3
pkg-config
vcpkg
zlib
];
shellHook = ''
export VCPKG_ROOT=${pkgs.vcpkg}/share/vcpkg
export VCPKG_FORCE_SYSTEM_BINARIES=1
'';
};
};
}
Does this have something to do with Nix’s isolation? I’ve tried setting Python_EXECUTABLE
and PYTHON_EXECUTABLE
when calling cmake, but it makes no difference when compiling qtdeclarative.