Skip to content

Commit

Permalink
dlib: Add Python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
essandess committed Sep 27, 2020
1 parent 32eeb52 commit 3ae4a14
Showing 1 changed file with 62 additions and 13 deletions.
75 changes: 62 additions & 13 deletions math/dlib/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,30 @@ PortGroup github 1.0
PortGroup cmake 1.1
PortGroup compiler_blacklist_versions 1.0

github.setup davisking dlib 19.20 v
homepage http://dlib.net
github.setup davisking dlib 19.21 v
categories math
platforms darwin
maintainers nomaintainer
license MIT

description Modern C++ toolkit for machine learning, image processing, and more.
long_description \
Dlib is a modern C++ toolkit containing machine learning algorithms and\
tools for creating complex software in C++ to solve real world problems. It \
is used in both industry and academia in a wide range of domains including \
robotics, embedded devices, mobile phones, and large high performance \
computing environments. Dlib's open source licensing allows you to use it\
in any application, free of charge.
description Modern C++ toolkit for machine learning, image \
processing, and more.

long_description Dlib is a modern C++ toolkit containing machine \
learning algorithms and tools for creating \
complex software in C++ to solve real world \
problems. It is used in both industry and \
academia in a wide range of domains including \
robotics, embedded devices, mobile phones, and \
large high performance computing \
environments. Dlib's open source licensing allows \
you to use it in any application, free of charge.

homepage http://dlib.net

checksums rmd160 d9eb9b0e1c40df807f58df5fdee7bdb7cdad56cb \
sha256 733a844f1fa645597d30d8b03d0eee91d7ee066c9f516b12e1a792950fffff68 \
size 10583402
checksums rmd160 58abe0906d68ee92936360e8c4c57076bacee75a \
sha256 5895369a1625f833b41bafaf18a5587cbc293eb2f60a1905315441fbd83ecc23 \
size 10587515

compiler.cxx_standard 2011
compiler.thread_local_storage yes
Expand All @@ -33,3 +38,47 @@ compiler.blacklist-append {clang < 800}

configure.cxxflags-append -fvisibility=hidden -fvisibility-inlines-hidden
cmake.build_type Release

# create Python subports
set python_versions {37 38}
foreach v ${python_versions} {
subport py${v}-${github.project} {
PortGroup python 1.0
python.default_version ${v}
}
}

# Python bindings for supported Python versions
if {[string match "py*" ${subport}]} {
categories-append math
description Python ${python.branch} bindings for ${description}
long_description\
This package provides Python ${python.branch}\
bindings, modules, and scripts.

depends_lib-append \
port:sqlite3

depends_build-append \
port:py${python.version}-setuptools

depends_test-append \
port:py${python.version}-pytest

build.dir ${worksrcpath}
build.post_args

destroot.target install

post-destroot {
set docdir ${prefix}/share/doc/${subport}
xinstall -d ${destroot}${docdir}
xinstall -m 0644 -W ${worksrcpath} README.md \
${destroot}${docdir}
}

test.run yes
test.env PYTHONPATH=[glob -nocomplain ${worksrcpath}/build/lib*]

livecheck.type none
}

0 comments on commit 3ae4a14

Please sign in to comment.