sci-libs/dlib: add 19.24.8

Signed-off-by: Kai-Chun Ning (Github Signing key) <kaichun.ning@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/41464
Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org>
This commit is contained in:
Kai-Chun Ning (Github Signing key) 2025-04-05 11:48:46 +02:00 committed by Nowa Ammerlaan
parent fde4de40c3
commit 2f8b24e25c
No known key found for this signature in database
GPG Key ID: A2E2304370447E8E
3 changed files with 179 additions and 0 deletions

View File

@ -1 +1,2 @@
DIST dlib-19.24.2.tar.gz 22252165 BLAKE2B cd6a911e16d9ff6cf94a4334e84983a9c48da42e3f696de20fb28a5bba9720507ec19ddc984bb753288f86359a1c19cdf15ed29f18c43769a1c17d3177d8dedf SHA512 a38a3079c169b16d81d7aca9fc294bcd63bd2dc1a21573f9141ca310542da3629b6523fa6f348be8b41bf5b478c0846a13a4c3fee77f1ac38dfbfc4a01effb57
DIST dlib-19.24.8.tar.gz 18965261 BLAKE2B 3dbcfcd4d1a98737a21f3618994a96b3932cfc3c12ef26411ef919d8843227418460208911aa687d5a94552588e8e1eb4c99646afc86f4b43afc6972d22c65b8 SHA512 9092768628246b682e29322b101cfb8c0cd1d5a2af850510403cc7f912aa43370db1d4b5b07ff6ce6a575b3bd8cfe666b6b8f78f5e7c2ec751ae23569edcb517

View File

@ -0,0 +1,115 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
DISTUTILS_USE_PEP517=setuptools
DISTUTILS_EXT=1
DISTUTILS_OPTIONAL=1
inherit cmake cuda distutils-r1
DESCRIPTION="Numerical and networking C++ library"
HOMEPAGE="https://dlib.net/"
SRC_URI="https://github.com/davisking/dlib/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Boost-1.0"
SLOT="0/${PV}"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="cblas cuda debug examples ffmpeg gif jpeg lapack mkl png python sqlite test webp X cpu_flags_x86_avx cpu_flags_x86_sse2 cpu_flags_x86_sse4_1"
REQUIRED_USE="python? ( png ${PYTHON_REQUIRED_USE} )"
RESTRICT="!test? ( test )"
# doc needs a bunch of deps not in portage
RDEPEND="
cblas? ( virtual/cblas )
cuda? ( dev-libs/cudnn:= )
ffmpeg? ( media-video/ffmpeg:=[X?] )
gif? ( media-libs/giflib:= )
jpeg? ( media-libs/libjpeg-turbo:0= )
lapack? ( virtual/lapack )
mkl? ( sci-libs/mkl )
png? ( media-libs/libpng:0= )
python? ( ${PYTHON_DEPS} )
sqlite? ( dev-db/sqlite:3 )
webp? ( media-libs/libwebp:= )
X? ( x11-libs/libX11 )"
DEPEND="${RDEPEND}"
BDEPEND="
python? (
${DISTUTILS_DEPS}
test? (
dev-python/pytest[${PYTHON_USEDEP}]
dev-python/pip[${PYTHON_USEDEP}]
)
)
"
DOCS=( docs/README.txt )
PATCHES=(
"${FILESDIR}/${P}"-disable-upstream-flags.patch
)
src_prepare() {
use cuda && cuda_src_prepare
cmake_src_prepare
use python && distutils-r1_src_prepare
}
src_configure() {
local mycmakeargs=(
-DDLIB_ENABLE_ASSERTS=$(usex debug)
-DDLIB_ENABLE_STACK_TRACE=$(usex debug)
-DDLIB_USE_FFMPEG=$(usex ffmpeg)
-DDLIB_GIF_SUPPORT=$(usex gif)
-DDLIB_JPEG_SUPPORT=$(usex jpeg)
-DDLIB_PNG_SUPPORT=$(usex png)
-DDLIB_LINK_WITH_SQLITE3=$(usex sqlite)
-DDLIB_NO_GUI_SUPPORT=$(usex X OFF ON)
-DDLIB_USE_BLAS=$(usex cblas)
-DDLIB_USE_CUDA=$(usex cuda)
-DDLIB_USE_LAPACK=$(usex lapack)
-DDLIB_WEBP_SUPPORT=$(usex webp)
-DUSE_AVX_INSTRUCTIONS=$(usex cpu_flags_x86_avx)
-DUSE_SSE2_INSTRUCTIONS=$(usex cpu_flags_x86_sse2)
-DUSE_SSE4_INSTRUCTIONS=$(usex cpu_flags_x86_sse4_1)
)
cmake_src_configure
use python && distutils-r1_src_configure
}
src_compile() {
cmake_src_compile
use python && distutils-r1_src_compile
}
src_test() {
(
local BUILD_DIR="${BUILD_DIR}"/dlib/test
mkdir -p "${BUILD_DIR}" || die
cd "${BUILD_DIR}" >/dev/null || die
local CMAKE_USE_DIR="${S}"/dlib/test
cmake_src_configure
cmake_build
./dtest --runall || die "Tests failed"
)
use python && distutils-r1_src_test
}
python_test() {
epytest
}
src_install() {
cmake_src_install
use python && distutils-r1_src_install
if use examples; then
dodoc -r examples
docompress -x /usr/share/doc/${PF}
fi
}

View File

@ -0,0 +1,63 @@
diff --git a/dlib/test/CMakeLists.txt b/dlib/test/CMakeLists.txt
index 330ac241..3d0df673 100644
--- a/dlib/test/CMakeLists.txt
+++ b/dlib/test/CMakeLists.txt
@@ -168,58 +168,6 @@ add_executable(${target_name} main.cpp tester.cpp
get_filename_component(DLIB_FFMPEG_DATA ${CMAKE_SOURCE_DIR}/ffmpeg_data/details.cfg REALPATH)
target_compile_definitions(${target_name} PRIVATE DLIB_FFMPEG_DATA="${DLIB_FFMPEG_DATA}")
-if (CMAKE_COMPILER_IS_GNUCXX)
- # Turn on all warnings, and treat them as errors.
- add_compile_options(-W -Wall -Wextra -Wpedantic -Werror)
- add_compile_options(-fdiagnostics-color=always)
- # I don't care about unused testing functions though. I like to keep them
- # around. Don't warn about it.
- add_compile_options(-Wno-unused-function)
- add_compile_options(-Wno-strict-overflow)
- add_compile_options(-Wno-maybe-uninitialized)
-
- if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 11.4.0) OR
- (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 14.0.1))
- # These versions of gcc wrongly yield this warning:
- # dlib::row_major_layout::layout<double, 0, 2, dlib::memory_manager_stateless_kernel_1<char> >::data with nonzero offset 8 [-Werror=free-nonheap-object]
- # 61 | delete [] item;
- # Which by inspection of the dlib::row_major_layout::layout class you can see is clearly incorrect, as `data` is most
- # definitely heap allocated.
- add_compile_options(-Wno-free-nonheap-object)
- endif()
-
- if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 14.0.1)
- # These versions of gcc wrongly yield this warning:
- # In member function allocate_array,
- # inlined from set_max_size at /builddir/build/BUILD/dlib-19.24.4/dlib/../dlib/svm/../matrix/../array/array_kernel.h:438:59,
- # inlined from push_back.constprop at /builddir/build/BUILD/dlib-19.24.4/dlib/../dlib/svm/../matrix/../array/array_kernel.h:769:30:
- # /builddir/build/BUILD/dlib-19.24.4/dlib/../dlib/svm/../memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
- # 54 | return new T[size];
- # when compiling dlib example programs that most definitely do not ask for such allocations.
- add_compile_options(-Wno-alloc-size-larger-than)
- endif()
-
- if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0")
- # strip debug symbols to make the binary smaller
- target_link_options(${target_name} PRIVATE $<$<CONFIG:RELEASE>:-s>)
- endif()
-
-elseif (MSVC)
- # Treat warnings as errors.
- add_compile_options(/WX)
-else() # basically Clang
- # Treat warnings as errors, but do not turn on all warnings.
- add_compile_options(-W -Werror)
- # This is for the comment in face_detection_ex.cpp that says "faces/*.jpg"
- add_compile_options(-Wno-comment)
-
- if(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
- # strip debug symbols to make the binary smaller
- target_link_options(${target_name} PRIVATE $<$<CONFIG:RELEASE>:-s>)
- endif()
-endif()
-
-
target_link_libraries(${target_name} dlib::dlib )