## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 12; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global forgeurl https://github.com/davisking/dlib # Compiling and running tests takes quite long and is resource intensive. # Turn them off using `--without ctest`. %bcond ctest 1 Name: dlib Version: 19.24.4 Release: %autorelease Summary: A modern C++ toolkit containing machine learning algorithms %forgemeta License: BSL-1.0 URL: http://dlib.net Source: %forgesource # Fix aarch64 build # https://github.com/davisking/dlib/issues/2947 Patch: fix_aarch64.patch BuildRequires: boost-devel BuildRequires: cmake BuildRequires: cmake(pybind11) BuildRequires: gcc-c++ BuildRequires: gcc-gfortran # BLAS and LAPACK support BuildRequires: pkgconfig(cblas) BuildRequires: pkgconfig(fftw3) BuildRequires: pkgconfig(lapack) BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavdevice) BuildRequires: pkgconfig(libavfilter) BuildRequires: pkgconfig(libavformat) BuildRequires: pkgconfig(libavutil) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libjxl) BuildRequires: pkgconfig(libswresample) BuildRequires: pkgconfig(libswscale) BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(x11) BuildRequires: python3dist(pytest) BuildRequires: python3dist(more-itertools) BuildRequires: time # Stop building for i686 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval # While fix_aarch64.patch (see above) also fixes the s390x build of tests, # running thos tests results in lots of failures and even coredumps. ExcludeArch: %{ix86} s390x %description Dlib is a general purpose cross-platform open source software library written in the C++ programming language. Its design is heavily influenced by ideas from design by contract and component-based software engineering. It contains components for dealing with networking, threads, graphical user interfaces, data structures, linear algebra, machine learning, image processing, data mining, XML and text parsing, numerical optimization, Bayesian networks, and numerous other tasks. %package devel Summary: Development files for dlib Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Dlib is a general purpose cross-platform open source software library written in the C++ programming language. This package contains development files for the library. %package -n python3-%{name} Summary: Python 3 interface to %{name} %description -n python3-%{name} Dlib is a general purpose cross-platform open source software library written in the C++ programming language. This package contains Python 3 API for the library. %package doc Summary: Documentation for dlib License: CC0-1.0 AND CC-BY-SA-3.0 Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Dlib is a general purpose cross-platform open source software library written in the C++ programming language. This package contains the library documentation and examples. %prep %forgeautosetup -p1 find docs -type f -exec chmod 644 {} + find examples -type f -exec chmod 644 {} + # Remove empty files find docs/docs -size 0 -print -delete # Move license files out of examples mv -v examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt . mv -v examples/video_frames/license.txt video_frames_license.txt # unbundle pybind11, see https://bugzilla.redhat.com/2098694 rm -r dlib/external/pybind11 sed -i 's@add_subdirectory(../../dlib/external/pybind11 pybind11_build)@find_package(pybind11 CONFIG)@' tools/python/CMakeLists.txt %generate_buildrequires %pyproject_buildrequires %build # dlib requires `libjxl_cms` provided by libjxl >= 0.10` currently only # available in rawhide (F41) %cmake \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ -DDLIB_USE_CUDA:BOOL=OFF \ %if 0%{?fedora} >= 41 -DDLIB_JXL_SUPPORT:BOOL=ON %else -DDLIB_JXL_SUPPORT:BOOL=OFF %endif %cmake_build %if %{with ctest} # Use `-O` instead of `-O2`. Reduces max memory for single thread from # 17GB to 12GB. It also reduces time to build. # Also reduce debuginfo using `-g1` instead of `-g` (aka `-g2`). # Memory consumption drops further to ~6GiB and build speeds up again. CXXFLAGS="${CXXFLAGS/-O2/-O}" CXXFLAGS="${CXXFLAGS/-g /-g1 }" # Unit tests # # On small builders (~15GiB) the build fails running out of memory. # With a few tweaks memory consumption peaks at just over 6GiB. # Constrain the build to 7GiB per core. # # RHEL doesn't support `%%constrain_build` nor `%%{limit_build ...}`. MAX_CPUS="$(($(cat /proc/meminfo | grep MemTotal | awk '{print $2}') / $((7168 * 1024))))" %global _smp_mflags "-j${MAX_CPUS}" pushd dlib/test %cmake \ -DDLIB_USE_CUDA:BOOL=OFF \ %if 0%{?fedora} >= 41 -DDLIB_JXL_SUPPORT:BOOL=ON %else -DDLIB_JXL_SUPPORT:BOOL=OFF %endif %cmake_build popd %endif %pyproject_wheel %install %cmake_install %pyproject_install %pyproject_save_files %{?fedora:-l} %{name} find %{buildroot} -name '.*' -exec rm -rf {} + %check %if %{with ctest} pushd dlib/test/redhat-linux-build # tests can be disabled using `--no_${TEST}` with --runall or # enabled `--${TEST}` without it. `-h` shows all tests. # test_ffmpeg fails ./dtest --runall --no_test_ffmpeg popd %endif %pytest -v %files %license LICENSE.txt %{_libdir}/libdlib.so.19* %files devel %{_libdir}/libdlib.so %{_includedir}/dlib/ %{_libdir}/cmake/dlib/ %{_libdir}/pkgconfig/*.pc %files -n python3-%{name} -f %{pyproject_files} %{python3_sitearch}/_%{name}_pybind11%{python3_ext_suffix} %doc README.md %files doc %doc docs/docs/ %doc examples %license LICENSE_FOR_EXAMPLE_PROGRAMS.txt %license video_frames_license.txt %changelog ## START: Generated by rpmautospec * Sat Apr 13 2024 Sandro - 19.24.4-5 - Clarify licenses and use SPDX throughout - All code is BSL-1.0 - Examples are CC0-1.0 AND CC-BY-SA-3.0 * Fri Apr 12 2024 Sandro - 19.24.4-3 - Update dependencies - Use `cblas` and `lapack` instead of `flexiblas` - Add `libav`, `libjxl` and `libsw` dependencies - Enable webp support * Fri Apr 12 2024 Sandro - 19.24.4-1 - Update to 19.24.4 (RHBZ#2272524) * Mon Mar 11 2024 Arthur Bols - 19.24.3-1 - Update to 19.24.3 (fedora#2268942) * Wed Jan 24 2024 Fedora Release Engineering - 19.24.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Fri Jan 19 2024 Fedora Release Engineering - 19.24.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Wed Jul 19 2023 Fedora Release Engineering - 19.24.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Tue Jul 11 2023 Sandro - 19.24.2-2 - Migrate to SPDX license * Wed Jul 05 2023 Arthur Bols - 19.24.2-1 - Update to 19.24.2 (rhbz#2203609) * Tue Jun 13 2023 Python Maint - 19.24-8.20220905git65bce59a1 - Rebuilt for Python 3.12 * Thu Jan 19 2023 Fedora Release Engineering - 19.24-7.20220905git65bce59a1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Tue Nov 01 2022 Lumir Balhar - 19.24-6.20220905git65bce59a1 - Switch from pathfix.py to %%py3_shebang_fix * Thu Sep 15 2022 Miro Hrončok - 19.24-5.20220905git65bce59a1 - Unbundle pybind11 * Thu Sep 15 2022 Luya Tshimbalanga - 19.24-4.20220905git65bce59a1 - Latest snapshot with updated py11bind * Thu Jul 21 2022 Fedora Release Engineering - 19.24-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Mon Jun 13 2022 Python Maint - 19.24-2 - Rebuilt for Python 3.11 * Tue May 10 2022 Luya Tshimbalanga - 19.24-1 - Update to 19.24 (#2045942) * Wed Jan 26 2022 Onuralp SEZER - 19.23-1 - Update to 19.23 * Thu Jan 20 2022 Fedora Release Engineering - 19.22-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Mon Jan 17 2022 Luya Tshimbalanga - 19.22-7 - Switch back to FlexiBLAS * Mon Jan 17 2022 Iñaki Úcar - Switch back to FlexiBLAS * Wed Jul 21 2021 Fedora Release Engineering - 19.22-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 04 2021 Python Maint - 19.22-4 - Rebuilt for Python 3.10 * Mon Apr 19 2021 Tomas Hrnciar - 19.22-3 - BuildRequire setuptools explicitly * Mon Mar 29 2021 Luya Tshimbalanga - 19.22-2 - Update to 19.22 Enable BLAS and LAPACK support * Mon Mar 29 2021 Luya Tshimbalanga - 19.22-1 - Update to 19.22 Enable BLAS and LAPACK support * Wed Feb 10 2021 Luya Tshimbalanga - 19.21-1 - Update to 19.21 * Tue Jan 26 2021 Fedora Release Engineering - 19.20-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Sun Oct 18 2020 Luya Tshimbalanga - 19.20-11 - Changes/Python Upstream Architecture Names * Fri Oct 02 2020 Miro Hrončok - 19.20-10 - https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names * Mon Aug 10 2020 Iñaki Úcar - 19.20-9 - https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager * Tue Aug 04 2020 Luya Tshimbalanga - 19.20-8 - Use cmake macros for build and install * Mon Aug 03 2020 Luya Tshimbalanga - 19.20-7 - Use cmake macros for build and install * Sat Aug 01 2020 Fedora Release Engineering - 19.20-6 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Mon Jul 27 2020 Fedora Release Engineering - 19.20-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Fri Jul 10 2020 Luya Tshimbalanga - 19.20-4 - Set noarch for large documentation package Use specific versioning for libraries Remove Sphinx build leftovers Use %%global instead of %%define for declaration * Fri Jul 10 2020 Luya Tshimbalanga - 19.20-3 - Set noarch for large documentation package Use specific versioning for libraries Remove Sphinx build leftovers Use %%global instead of %%define for declaration * Fri Jul 10 2020 Luya Tshimbalanga - 19.20-2 - Set noarch for large documentation package Use specific versioning for libraries Remove Sphinx build leftovers Use %%global instead of %%define for declaration * Fri Jul 10 2020 Luya Tshimbalanga - 19.20-1 - Set noarch for large documentation package Use specific versioning for libraries Remove Sphinx build leftovers Use %%global instead of %%define for declaration * Thu Jul 09 2020 Mohan Boddu - 19.4-16 - Unretirement for https://pagure.io/releng/issue/9578 * Wed Jul 24 2019 Fedora Release Engineering - 19.4-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Thu Jan 31 2019 Fedora Release Engineering - 19.4-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Tue Jan 22 2019 Igor Gnatenko - 19.4-13 - Remove obsolete ldconfig scriptlets * Mon Sep 24 2018 Miro Hrončok - 19.4-12 - Drop Python 2 subpackage (#1627444) * Tue Jul 24 2018 Miro Hrončok - 19.4-11 - Fix legacy Python boost requirement * Thu Jul 12 2018 Fedora Release Engineering - 19.4-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Tue Jun 19 2018 Miro Hrončok - 19.4-9 - Rebuilt for Python 3.7 * Sat Feb 24 2018 Adam Williamson - 19.4-8 - Fix passing SSE4 disablement option to setuptools * Wed Feb 07 2018 Fedora Release Engineering - 19.4-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Sun Aug 06 2017 Björn Esser - 19.4-6 - Rebuilt for AutoReq cmake-filesystem * Wed Aug 02 2017 Fedora Release Engineering - 19.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Wed Jul 26 2017 Fedora Release Engineering - 19.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Tue Jul 18 2017 Jonathan Wakely - 19.4-3 - Rebuilt for Boost 1.64 * Tue May 23 2017 Dmitry Mikhirev - 19.4-2 - add BR boost-python3-devel (RHBZ#1443250) * Tue Apr 25 2017 Dmitry Mikhirev - 19.4-1 - new upstream version (RHBZ #1442868) * Fri Feb 10 2017 Fedora Release Engineering - 18.18-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Dec 19 2016 Miro Hrončok - 18.18-5 - Rebuild for Python 3.6 * Tue Jul 19 2016 Fedora Release Engineering - 18.18-4 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_ Packages * Wed Feb 03 2016 Dennis Gilmore - 18.18-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Sat Jan 23 2016 Dmitry Mikhirev - 18.18-2 - Rebuild against new libboost_python * Sat Jan 09 2016 Dmitry Mikhirev - 18.18-1 - Initial package ## END: Generated by rpmautospec