Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/dlib/
Date: Wed, 06 Jul 2022 16:53:11
Message-Id: 1657126378.d885daee659f925afca359ae795d8d5f9ea083ad.andrewammerlaan@gentoo
1 commit: d885daee659f925afca359ae795d8d5f9ea083ad
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 6 16:50:05 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 6 16:52:58 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d885daee
7
8 sci-libs/dlib: add 19.24
9
10 Fails to compile with python3_11 at the moment
11
12 Closes: https://bugs.gentoo.org/846254
13 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
14
15 sci-libs/dlib/Manifest | 1 +
16 sci-libs/dlib/dlib-19.24.ebuild | 101 ++++++++++++++++++++++++++++++++++++++++
17 2 files changed, 102 insertions(+)
18
19 diff --git a/sci-libs/dlib/Manifest b/sci-libs/dlib/Manifest
20 index 21442f52ac6e..dcf90b41e38c 100644
21 --- a/sci-libs/dlib/Manifest
22 +++ b/sci-libs/dlib/Manifest
23 @@ -1 +1,2 @@
24 DIST dlib-19.22.tar.gz 10796236 BLAKE2B 5ca840536f61b38557d39ff6c24d9727f7c494e032d5abf912ccf83f724ecad61ce241126478eeed8b14e33b994af4065b1cfaf17a3b29cfa0dafc236e4c2a06 SHA512 49af41460de9aa270e47ee1d158231e87ffdbbf56ca29a3382dd896fcf81ef04729e59bd9c26eac63fb088cefce651149e5cdb0ffed73bfd6b05127887114d94
25 +DIST dlib-19.24.tar.gz 10863367 BLAKE2B eda85c6ec38fcf212754aae2cdb68539425028735b5148a2f6668ac19f2583129585a7101b74fe202fbfa3d3d2f09e533805a82f8291540919a7eb11483812e8 SHA512 f6ef2fec0977782cdcc15c6340bd91e3471294332de391405f14d86e9fd0cfcc8195fbf5b702f8d269a90b06db23a8134d112ed3fcfb780ff0433d988c41d199
26
27 diff --git a/sci-libs/dlib/dlib-19.24.ebuild b/sci-libs/dlib/dlib-19.24.ebuild
28 new file mode 100644
29 index 000000000000..961c180ef7c2
30 --- /dev/null
31 +++ b/sci-libs/dlib/dlib-19.24.ebuild
32 @@ -0,0 +1,101 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=8
37 +
38 +PYTHON_COMPAT=( python3_{9..10} )
39 +DISTUTILS_USE_PEP517=setuptools
40 +DISTUTILS_OPTIONAL=1
41 +inherit cmake cuda distutils-r1
42 +
43 +DESCRIPTION="Numerical and networking C++ library"
44 +HOMEPAGE="http://dlib.net/"
45 +SRC_URI="https://github.com/davisking/dlib/archive/v${PV}.tar.gz -> ${P}.tar.gz"
46 +
47 +LICENSE="Boost-1.0"
48 +SLOT="0/${PV}"
49 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
50 +IUSE="cblas cuda debug examples gif jpeg lapack mkl png python sqlite test X cpu_flags_x86_avx cpu_flags_x86_sse2 cpu_flags_x86_sse4_1"
51 +REQUIRED_USE="python? ( png ${PYTHON_REQUIRED_USE} )"
52 +RESTRICT="!test? ( test )"
53 +
54 +# doc needs a bunch of deps not in portage
55 +RDEPEND="
56 + cblas? ( virtual/cblas )
57 + cuda? ( dev-libs/cudnn:= )
58 + gif? ( media-libs/giflib:= )
59 + jpeg? ( media-libs/libjpeg-turbo:0= )
60 + lapack? ( virtual/lapack )
61 + mkl? ( sci-libs/mkl )
62 + png? ( media-libs/libpng:0= )
63 + python? ( ${PYTHON_DEPS} )
64 + sqlite? ( dev-db/sqlite:3 )
65 + X? ( x11-libs/libX11 )"
66 +DEPEND="${RDEPEND}"
67 +BDEPEND="python? ( test? (
68 + dev-python/pytest[${PYTHON_USEDEP}]
69 + dev-python/pip[${PYTHON_USEDEP}]
70 +) )"
71 +
72 +DOCS=( docs/README.txt )
73 +
74 +src_prepare() {
75 + use cuda && cuda_src_prepare
76 + cmake_src_prepare
77 + use python && distutils-r1_src_prepare
78 +}
79 +
80 +src_configure() {
81 + local mycmakeargs=(
82 + -DDLIB_ENABLE_ASSERTS=$(usex debug)
83 + -DDLIB_ENABLE_STACK_TRACE=$(usex debug)
84 + -DDLIB_GIF_SUPPORT=$(usex gif)
85 + -DDLIB_JPEG_SUPPORT=$(usex jpeg)
86 + -DDLIB_PNG_SUPPORT=$(usex png)
87 + -DDLIB_LINK_WITH_SQLITE3=$(usex sqlite)
88 + -DDLIB_NO_GUI_SUPPORT=$(usex X OFF ON)
89 + -DDLIB_USE_BLAS=$(usex cblas)
90 + -DDLIB_USE_CUDA=$(usex cuda)
91 + -DDLIB_USE_LAPACK=$(usex lapack)
92 + -DUSE_AVX_INSTRUCTIONS=$(usex cpu_flags_x86_avx)
93 + -DUSE_SSE2_INSTRUCTIONS=$(usex cpu_flags_x86_sse2)
94 + -DUSE_SSE4_INSTRUCTIONS=$(usex cpu_flags_x86_sse4_1)
95 + )
96 + cmake_src_configure
97 + use python && distutils-r1_src_configure
98 +}
99 +
100 +src_compile() {
101 + cmake_src_compile
102 + use python && distutils-r1_src_compile
103 +}
104 +
105 +src_test() {
106 + (
107 + local BUILD_DIR="${BUILD_DIR}"/dlib/test
108 + mkdir -p "${BUILD_DIR}" || die
109 + cd "${BUILD_DIR}" >/dev/null || die
110 +
111 + local CMAKE_USE_DIR="${S}"/dlib/test
112 + cmake_src_configure
113 + cmake_build
114 +
115 + ./dtest --runall || die "Tests failed"
116 + )
117 +
118 + use python && distutils-r1_src_test
119 +}
120 +
121 +python_test() {
122 + epytest
123 +}
124 +
125 +src_install() {
126 + cmake_src_install
127 + use python && distutils-r1_src_install
128 +
129 + if use examples; then
130 + dodoc -r examples
131 + docompress -x /usr/share/doc/${PF}
132 + fi
133 +}