[build-system]
requires = [
    "scikit-build-core>=0.10",
    "wheel",
    "setuptools",
    "PySide6=={{ QT_VERSION }}",
    "shiboken6=={{ QT_VERSION }}",
    "shiboken6-generator=={{ QT_VERSION }}",
]
build-backend = "scikit_build_core.build"

[project]
name = "pyside6-qtermwidget"
version = "0.4.{{ QT_VERSION }}"
description = "Python bindings for QTermWidget using Shiboken6"
readme = "readme.md"
requires-python = ">=3.11"
license = { text = "GPL-3.0" }
classifiers = [
    "Programming Language :: Python :: 3",
    "Operating System :: OS Independent",
]
dependencies = ["PySide6=={{ QT_VERSION }}", "PySide6_Essentials=={{ QT_VERSION }}", "shiboken6=={{ QT_VERSION }}"]

[tool.scikit-build]
build-dir = "build/{wheel_tag}"
build.verbose = true
wheel.packages = ["pyside6_qtermwidget"]
sdist.exclude = ["external"]

[tool.cibuildwheel]
environment-pass = ["CIBUILDWHEEL_WORKSPACE"]
manylinux-x86_64-image = "manylinux_2_34"
build = [
    "cp311-manylinux_x86_64",
    "cp312-manylinux_x86_64",
    "cp313-manylinux_x86_64",
    "cp311-macosx_arm64",
    "cp312-macosx_arm64",
    "cp313-macosx_arm64",
]
build-verbosity = 3
container-engine = "podman"
linux.before-build = [
    "dnf install -y tree libstdc++-devel mesa-libGL libxslt libxslt-devel libxkbcommon-devel clang clang-devel",
]
macos.before-build = [
    "brew install cmake llvm"
]
linux.repair-wheel-command = "auditwheel repair --exclude \"*\" -w {dest_dir} {wheel}"
macos.repair-wheel-command = ""
before-test = ["pip install pytest"]
test-command = [
  "pytest {project}/tests",
]

[tool.cibuildwheel.linux.environment]
Qt6_DIR = "/host$CIBUILDWHEEL_WORKSPACE/Qt/{{ QT_VERSION }}/gcc_64"
QT6_INSTALL_DIR = "/host$CIBUILDWHEEL_WORKSPACE/Qt/{{ QT_VERSION }}/gcc_64"
CMAKE_PREFIX_PATH = "/host$CIBUILDWHEEL_WORKSPACE/Qt/{{ QT_VERSION }}/gcc_64/lib/cmake"
LD_LIBRARY_PATH = "/host$CIBUILDWHEEL_WORKSPACE/Qt/{{ QT_VERSION }}/gcc_64/lib:$LD_LIBRARY_PATH"
CC = "clang"
CXX = "clang++" 

