source: trunk/dports/graphics/openni/Portfile

Last change on this file was 114701, checked in by ryandesign@…, 4 years ago

openni: fix github.project case

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.1 KB
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: Portfile 114701 2013-12-14 01:35:30Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           github 1.0
6
7github.setup        OpenNI OpenNI 1.5.7.10 Stable-
8name                openni
9categories          graphics
10platforms           darwin
11maintainers         ryandesign openmaintainer
12license             LGPL-3+
13supported_archs     i386 x86_64
14
15# Remove this when updating to the next version
16distname            ${name}-${version}
17
18description         APIs for natural interaction devices
19
20long_description    The OpenNI framework provides a set of APIs for accessing \
21                    natural interaction devices, including support for voice \
22                    and voice command recognition, hand gestures, and body \
23                    motion tracking.
24
25checksums           rmd160  2d78c4fce0908b1e4801649b6390c0d6a8afc68f \
26                    sha256  4b3ac2f946849d6a2b6fa12f199025a9c141fda93d4d4bda967a3fb32268b5ce
27
28depends_build       port:doxygen \
29                    path:bin/dot:graphviz
30
31depends_lib         port:libusb
32
33pre-fetch {
34    if {${os.platform} eq "darwin" && ${os.major} < 10} {
35        ui_error "${name} ${version} requires OS X 10.6 or greater."
36        return -code error "incompatible OS X version"
37    }
38}
39
40build.dir           ${worksrcpath}/Platform/Linux/CreateRedist
41
42post-extract {
43    file attributes ${build.dir}/RedistMaker -permissions a+x
44    # DOS to UNIX line endings so we can patch.
45    reinplace "s|\r||g" ${worksrcpath}/Source/OpenNI/XnOpenNI.cpp
46}
47
48patchfiles          patch-Platform-Linux-Build-Common-CommonCppMakefile.diff \
49                    patch-Platform-Linux-Build-Common-Platform.x86.diff \
50                    patch-Platform-Linux-CreateRedist-install.sh.diff \
51                    patch-Source-OpenNI-XnOpenNI.cpp.diff
52
53post-patch {
54    reinplace "s|@PREFIX@|${prefix}|g"  ${build.dir}/install.sh \
55                                        ${worksrcpath}/Platform/Linux/Build/Common/CommonCppMakefile \
56                                        ${worksrcpath}/Source/OpenNI/XnOpenNI.cpp
57
58    # Mavericks system headers have a function called "equivalent" with which this #define interferes.
59    # https://github.com/OpenNI/OpenNI2/issues/52
60    foreach sample {NiHandTracker NiSimpleViewer NiUserSelection NiUserTracker NiViewer} {
61        reinplace "s|equivalent|openni_equivalent|g" ${worksrcpath}/Samples/${sample}/glh/glh_linear.h
62    }
63}
64
65use_configure       no
66
67variant universal {}
68
69build.cmd           ./RedistMaker
70build.env           CXX="${configure.cxx} [get_canonical_archflags cxx]"
71build.target
72
73pre-destroot {
74    destroot.dir    [glob ${worksrcpath}/Platform/Linux/Redist/*]
75}
76destroot.cmd        ./install.sh
77destroot.target
78destroot.destdir    -c ${destroot}
79destroot.keepdirs   ${destroot}${prefix}/var/lib/ni
80
81set libs {libnimMockNodes.dylib libnimCodecs.dylib libnimRecorder.dylib}
82
83post-activate {
84    foreach lib ${libs} {
85        system "${prefix}/bin/niReg -r ${prefix}/lib/${lib}"
86    }
87}
88
89pre-deactivate {
90    foreach lib ${libs} {
91        system "${prefix}/bin/niReg -u ${prefix}/lib/${lib}"
92    }
93}
Note: See TracBrowser for help on using the repository browser.