Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dlib: update to 19.24.6 #52866

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions srcpkgs/dlib/patches/pybind11cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--- a/dlib/CMakeLists.txt
+++ b/dlib/CMakeLists.txt
@@ -49,6 +49,7 @@
endif()
endif()

+find_package(pybind11 REQUIRED)

if (COMMAND pybind11_add_module AND MSVC)
# True when building a python extension module using Visual Studio. We care
--- a/tools/python/CMakeLists.txt
+++ b/tools/python/CMakeLists.txt
@@ -35,7 +35,8 @@
include(${CMAKE_CURRENT_LIST_DIR}/../../dlib/cmake_utils/tell_visual_studio_to_use_static_runtime.cmake)
endif()

-add_subdirectory(../../dlib/external/pybind11 pybind11_build)
+#add_subdirectory(../../dlib/external/pybind11 pybind11_build)
+find_package(pybind11 REQUIRED)
add_subdirectory(../../dlib dlib_build)

add_definitions(-DDLIB_VERSION=${DLIB_VERSION})

40 changes: 36 additions & 4 deletions srcpkgs/dlib/template
Original file line number Diff line number Diff line change
@@ -1,27 +1,59 @@
# Template file for 'dlib'
pkgname=dlib
version=19.20
version=19.24.6
revision=1
build_style=cmake
configure_args="-DBUILD_SHARED_LIBS=ON"
makedepends="libjpeg-turbo-devel libpng-devel zlib-devel
$(vopt_if openblas openblas-devel) $(vopt_if x11 libX11-devel)"
hostmakedepends="pkg-config python3-devel python3-setuptools python3-distutils-extra"
makedepends="libjpeg-turbo-devel libpng-devel zlib-devel ffmpeg6-devel cblas-devel
$(vopt_if openblas openblas-devel) $(vopt_if x11 libX11-devel) python3-pybind11"
short_desc="Modern C++ toolkit containing machine learning algorithms and tools"
maintainer="Felix Hanley <[email protected]>"
license="BSL-1.0"
homepage="http://dlib.net"
distfiles="https://github.com/davisking/${pkgname}/archive/v${version}.tar.gz"
checksum=fc3f0986350e8e53aceadf95a71d2f413f1eedc469abda99a462cb528741d411
checksum=22513c353ec9c153300c394050c96ca9d088e02966ac0f639e989e50318c82d6

build_options="openblas x11"
desc_option_x11="Enable X11 for GUI components"
build_options_default="openblas x11"

case "$XBPS_TARGET_MACHINE" in
#arm*) configure_args+=" -DPYBIND11_FINDPYTHON=ON";;
arm*)
configure_args+=" -DPYBIND11_FINDPYTHON=ON"
cmake_args+=" -DPYBIND11_USE_CROSSCOMPILING=ON"
;;
esac

post_extract() {
# don't prefer bundled libs
rm -rf ./dlib/external
}

post_build() {
if [[ "$XBPS_TARGET_MACHINE" == arm* ]]; then
inc="include($(pwd)/$(find -name 'cross_*cmake'))"
sed -i "1i$inc" tools/python/CMakeLists.txt
fi
# extracted from 'python setup.py build --no DLIB_USE_CUDA' failures to cross compile
CFALGS=${CFLAGS} CXXFLAGS=${CXX_FLAGS} cmake /builddir/dlib-19.24.6/tools/python \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/builddir/dlib-19.24.6/build/lib.linux-x86_64-cpython-312 \
-DPYTHON_EXECUTABLE=/usr/bin/python -DDLIB_USE_FFMPEG=OFF -DDLIB_USE_CUDA=no ${cmake_args}
}

post_install() {
python setup.py install --skip-build --prefix=/usr --root="${DESTDIR}" --optimize=1 --compiler-flags
}

python3-dlib_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - python3"
pkg_install() {
vmove "usr/lib/python*"
}
}

dlib-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
Expand Down
1 change: 1 addition & 0 deletions srcpkgs/python3-dlib