diff options
Diffstat (limited to 'sci-libs/dlib')
-rw-r--r-- | sci-libs/dlib/Manifest | 3 | ||||
-rw-r--r-- | sci-libs/dlib/dlib-19.24.8.ebuild | 115 | ||||
-rw-r--r-- | sci-libs/dlib/files/dlib-19.24.8-disable-upstream-flags.patch | 63 |
3 files changed, 181 insertions, 0 deletions
diff --git a/sci-libs/dlib/Manifest b/sci-libs/dlib/Manifest index aa69dda4258e..395812004c54 100644 --- a/sci-libs/dlib/Manifest +++ b/sci-libs/dlib/Manifest @@ -1,3 +1,6 @@ +AUX dlib-19.24.8-disable-upstream-flags.patch 3415 BLAKE2B 95a05459dcfedef4ed50d6bd152ec62bd2d3c3a2037973492c205666bab7e0ada934108e10bbb6f1a05cf1a11f2ab213c62db380457efa2300e7d2f8b028e536 SHA512 f646891c16eddaf7054c10786ba6b281fbc06e08a3fc777cb0de723bca1e696f6d298e531d763bd9beb0ecec97313c3b07d90c2f78a3673eaadd489f5dd848bd DIST dlib-19.24.2.tar.gz 22252165 BLAKE2B cd6a911e16d9ff6cf94a4334e84983a9c48da42e3f696de20fb28a5bba9720507ec19ddc984bb753288f86359a1c19cdf15ed29f18c43769a1c17d3177d8dedf SHA512 a38a3079c169b16d81d7aca9fc294bcd63bd2dc1a21573f9141ca310542da3629b6523fa6f348be8b41bf5b478c0846a13a4c3fee77f1ac38dfbfc4a01effb57 +DIST dlib-19.24.8.tar.gz 18965261 BLAKE2B 3dbcfcd4d1a98737a21f3618994a96b3932cfc3c12ef26411ef919d8843227418460208911aa687d5a94552588e8e1eb4c99646afc86f4b43afc6972d22c65b8 SHA512 9092768628246b682e29322b101cfb8c0cd1d5a2af850510403cc7f912aa43370db1d4b5b07ff6ce6a575b3bd8cfe666b6b8f78f5e7c2ec751ae23569edcb517 EBUILD dlib-19.24.2.ebuild 2530 BLAKE2B 6bd30eae48a08ba1626a021766104f476d7e566f24efb93d236ca8a4413577406b29a811d97f49064fef96e9fbf8d63d82df30b4c8284ca35e16caecf8336d59 SHA512 69ec18776c92dc7d8bff65adc33624dd6b0f5fcef6ad30d9681838b02a5b67bd60f07689ddd5b6f3a093f324af4f321e25e96e20b6bacf17121d985531c759d9 +EBUILD dlib-19.24.8.ebuild 2745 BLAKE2B d16c702369f408eeb262e8a158abaff7e2e2d1069c3a1b3644a690549513a90e63c844231bf183e0e51a2ea698af857dace22cedc918fdeb720ed8701d78dbee SHA512 f2517efbbb0a92c8c4b1c854b2463177a55c2b03b1f0d6388ca9f1a3fdf7ecc6ee0ccee34ca7d1fa8825ce586ee864af3185f4c74620ff7af90744edb8935743 MISC metadata.xml 1003 BLAKE2B 3c4e623c6abbd4d1ec8a9402009b2d01e6edb547bfd24f03c27853d0386170833553feecc7b0f6b751a3ad4e52f0575a4a87fbcf801a0952fc3d4e5c77645a43 SHA512 2c59cabd74e9433b9b31b96d1f476c2c9200cce51960c09de5ebd7aabbfe4cff1f4449a6a9ecaaf1907f58dd12c04039a9f58f69f2d036bc18bf82b4438cbc01 diff --git a/sci-libs/dlib/dlib-19.24.8.ebuild b/sci-libs/dlib/dlib-19.24.8.ebuild new file mode 100644 index 000000000000..c755f7445ced --- /dev/null +++ b/sci-libs/dlib/dlib-19.24.8.ebuild @@ -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 +} diff --git a/sci-libs/dlib/files/dlib-19.24.8-disable-upstream-flags.patch b/sci-libs/dlib/files/dlib-19.24.8-disable-upstream-flags.patch new file mode 100644 index 000000000000..39befb2a38ba --- /dev/null +++ b/sci-libs/dlib/files/dlib-19.24.8-disable-upstream-flags.patch @@ -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 ) + + |