# python-dlib: Python bindings for the dlib machine-learning toolkit. # # Fedora dropped python-dlib from its repos; Howdy needs it. This spec builds # ONLY the Python module (no GUI, no CUDA) so the build is reproducible on any # host and pulls no X11 at runtime. # # IMPORTANT: dlib's cmake auto-detects a CUDA toolkit if one exists on the # builder (e.g. /usr/local/cuda) and then fails to compile when nvcc rejects # the host gcc (gcc >= 15). dlib's setup.py forwards any DLIB_* environment # variable as a -D cmake flag, so we hard-force DLIB_USE_CUDA=OFF below. # (CMAKE_ARGS is IGNORED by dlib's setup.py -- only DLIB_* env vars work.) %global pypi_name dlib # The extension is compiled by cmake inside pip's build dir; find-debuginfo # produces an empty debugsource file list there, which aborts the build. %undefine _debugsource_packages Name: python-dlib Version: 20.0.1 Release: 1%{?dist} Summary: Python bindings for the dlib machine learning toolkit # dlib is Boost Software License 1.0 License: BSL-1.0 URL: http://dlib.net/ Source0: %{pypi_source dlib} BuildRequires: python3-devel BuildRequires: python3dist(setuptools) BuildRequires: python3dist(packaging) BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: make # BLAS/LAPACK for the matrix routines used by face recognition BuildRequires: openblas-devel BuildRequires: lapack-devel # system image codecs (dlib bundles copies it will use if these are absent; # prefer the system libraries) BuildRequires: libjpeg-turbo-devel BuildRequires: libpng-devel BuildRequires: libwebp-devel BuildRequires: giflib-devel %global _description %{expand: dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software to solve real world problems. This package provides the Python 3 bindings (the "dlib" module), built without CUDA and without GUI support.} %description %_description %package -n python3-dlib Summary: %{summary} %description -n python3-dlib %_description %prep %autosetup -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires %build # Force-disable CUDA even if the build host has a CUDA toolkit installed, # and skip GUI (X11) support entirely. setup.py forwards DLIB_* env vars # to cmake as -DDLIB_...=... flags. export DLIB_USE_CUDA=OFF export DLIB_NO_GUI_SUPPORT=ON %pyproject_wheel %install %pyproject_install %pyproject_save_files dlib '_dlib*' %check %pyproject_check_import dlib %files -n python3-dlib -f %{pyproject_files} %license dlib/LICENSE.txt %doc README.md %changelog * Sun Aug 23 2026 Scott Nelson - 20.0.1-1 - Initial package for COPR: Python module only, no CUDA, no GUI support - Force DLIB_USE_CUDA=OFF so a host CUDA toolkit can never break the build