source: trunk/dports/science/flann/Portfile

Last change on this file was 152074, checked in by mmoll@…, 15 months ago

science/flann: add lz4 support

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1# $Id: Portfile 152074 2016-08-28 20:45:39Z ryandesign@macports.org $
2
3PortSystem 1.0
4PortGroup cmake 1.0
5PortGroup mpi 1.0
6PortGroup github 1.0
7cmake.out_of_source yes
8
9github.setup        mariusmuja flann 1.9.1
10revision            1
11categories          science devel
12maintainers         mmoll
13description         Fast Library for Approximate Nearest Neighbors
14long_description    FLANN is a library for performing fast approximate \
15                    nearest neighbor searches in high dimensional spaces. \
16                    It contains a collection of algorithms we found to \
17                    work best for nearest neighbor search and a system \
18                    for automatically choosing the best algorithm and \
19                    optimum parameters depending on the dataset.
20platforms           darwin
21license             BSD
22checksums           md5     9583ae34a3fd05b730f312c416ebdda7 \
23                    sha1    bb65830d02d6603137f55901aea561944086f5d5 \
24                    rmd160  05758ce066371c6d9734fcfeec248f8c252585ff
25depends_lib         port:hdf5 port:lz4
26patchfiles          patch-src-python-CMakeLists.txt.diff
27mpi.setup
28
29configure.args-append ${distname} -DBUILD_MATLAB_BINDINGS=OFF -DUSE_MPI=OFF -DBUILD_CUDA_LIB=OFF
30
31if {[ mpi_variant_isset ]} {
32    configure.args-delete       -DUSE_MPI=OFF
33    configure.args-append       -DUSE_MPI=ON
34}
35
36set pythons_suffixes {27 34 35}
37
38set pythons_ports {}
39foreach s ${pythons_suffixes} {
40    lappend pythons_ports python${s}
41}
42
43proc python_dir {} {
44    global pythons_suffixes
45    foreach s ${pythons_suffixes} {
46        if {[variant_isset python${s}]} {
47            set p python[string index ${s} 0].[string index ${s} 1]
48            return [file normalize [exec ${p} -c "import sys; print(sys.prefix)"]/lib/${p}]
49        }
50    }
51    error "Python support not enabled."
52}
53
54foreach s ${pythons_suffixes} {
55    set p python${s}
56    set v [string index ${s} 0].[string index ${s} 1]
57    set i [lsearch -exact ${pythons_ports} ${p}]
58    set c [lreplace ${pythons_ports} ${i} ${i}]
59    eval [subst {
60        variant ${p} description "Use Python ${v} for python bindings" conflicts ${c} {
61            depends_lib-append      port:${p}
62            configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python${v}
63            post-patch {
64                reinplace "s|@@PREFIX@@|${destroot}${prefix}|g" ${patch.dir}/src/python/CMakeLists.txt
65                set pylibdir \[python_dir\]
66                reinplace "s|@@PYTHON_LIB@@|${destroot}\${pylibdir}|g" ${patch.dir}/src/python/CMakeLists.txt
67            }
68        }
69    }]
70}
Note: See TracBrowser for help on using the repository browser.