Ticket #37276: Portfile

File Portfile, 2.7 KB (added by josephhowse@…, 12 years ago)

graphics/openni-devel/Portfile

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id$
3
4PortSystem          1.0
5PortGroup           github 1.0
6
7github.setup        OpenNI openni 1.5.4.0 Unstable-
8name                openni-devel
9categories          graphics
10platforms           darwin
11maintainers         nummist.com:josephhowse openmaintainer
12license             LGPL-3+
13supported_archs     i386 x86_64
14
15description         APIs for natural interaction devices
16
17long_description    The OpenNI framework provides a set of APIs for accessing \
18                    natural interaction devices, including support for voice \
19                    and voice command recognition, hand gestures, and body \
20                    motion tracking.
21
22checksums           rmd160  763f4a73fd1eb4f8e219c5903b2b16100dd9fe7c \
23                    sha256  ec3dbc990b0067a776096e88d9171d8e21212115b58feaa800d0d7bfdb9151cb
24
25conflicts           openni
26
27depends_build       port:doxygen
28
29depends_lib         port:libusb
30
31pre-fetch {
32    if {${os.platform} == "darwin" && ${os.major} < 10} {
33        ui_error "${name} ${version} requires OS X 10.6 or greater."
34        return -code error "incompatible OS X version"
35    }
36}
37
38build.dir           ${worksrcpath}/Platform/Linux/CreateRedist
39
40post-extract {
41    file attributes ${build.dir}/RedistMaker -permissions a+x
42    # DOS to UNIX line endings so we can patch.
43    reinplace "s|\r||g" ${worksrcpath}/Source/OpenNI/XnOpenNI.cpp
44}
45
46patchfiles          patch-Platform-Linux-Build-Common-CommonCppMakefile.diff \
47                    patch-Platform-Linux-Build-Common-Platform.x86.diff \
48                    patch-Platform-Linux-CreateRedist-install.sh.diff \
49                    patch-Source-OpenNI-XnOpenNI.cpp.diff
50
51post-patch {
52    reinplace "s|@PREFIX@|${prefix}|g"  ${build.dir}/install.sh \
53                                        ${worksrcpath}/Platform/Linux/Build/Common/CommonCppMakefile \
54                                        ${worksrcpath}/Source/OpenNI/XnOpenNI.cpp
55}
56
57use_configure       no
58
59variant universal {}
60
61build.cmd           ./RedistMaker
62build.env           CXX="${configure.cxx} [get_canonical_archflags cxx]"
63build.target
64
65pre-destroot {
66    destroot.dir    [glob ${worksrcpath}/Platform/Linux/Redist/*]
67}
68destroot.cmd        ./install.sh
69destroot.target
70destroot.destdir    -c ${destroot}
71destroot.keepdirs   ${destroot}${prefix}/var/lib/ni
72
73set libs {libnimMockNodes.dylib libnimCodecs.dylib libnimRecorder.dylib}
74
75post-activate {
76    foreach lib ${libs} {
77        system "${prefix}/bin/niReg -r ${prefix}/lib/${lib}"
78    }
79}
80
81pre-deactivate {
82    foreach lib ${libs} {
83        system "${prefix}/bin/niReg -u ${prefix}/lib/${lib}"
84    }
85}