source: trunk/dports/graphics/oce/Portfile

Last change on this file was 153952, checked in by mps@…, 13 months ago

oce: future proof Sierra build issue.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.0 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 153952 2016-10-16 22:01:08Z ryandesign@macports.org $
3
4PortSystem                  1.0
5PortGroup                   cmake 1.0
6PortGroup                   github 1.0
7
8github.setup                tpaviot oce 0.17.2 OCE-
9set branch                  [join [lrange [split ${version} .] 0 1] .]
10categories                  graphics
11platforms                   darwin
12maintainers                 gmail.com:mark.brethen openmaintainer
13license                     LGPL-2.1
14
15description                 Open CASCADE Community Edition
16
17long_description            ${description}
18
19checksums                   rmd160  0894502fe6dec7dc6be566dddc00bc0914e0b9a9 \
20                            sha256  e73f1cb3bfd087abb903296944ea159d51266748a6b05162d0ee927ec3bb40cf
21
22depends_lib-append          port:freetype
23
24# disable redundant definitions provided by OS time.h
25if {16 <= ${os.major}} {
26    patchfiles-append       patch-src-OSD-OSD_Chronometer.cxx.diff
27}
28
29# tell CMake to build in a build directory
30configure.dir               ${workpath}/build
31build.dir                   ${configure.dir}
32post-extract {
33    file mkdir ${configure.dir}
34}
35configure.post_args         ${worksrcpath}
36
37configure.args-append       -DOCE_INSTALL_PREFIX:PATH=${prefix}
38
39variant test description {Build and run unit testing framework} {
40    configure.args-append   -DOCE_TESTING:BOOL=ON
41    test.run                yes
42}
43
44variant draw description {Build DRAW test harness} {
45    depends_lib-append      port:tcl port:tk
46    configure.args-append   -DTCL_INCLUDE_PATH=${prefix}/include
47    configure.args-append   -DOCE_DRAW:BOOL=ON
48    configure.args-append   -DOCE_INSTALL_PACKAGE_LIB_DIR=lib
49}
50
51variant tbb description {Use TBB for memory allocation} {
52    depends_lib-append      port:tbb
53    configure.args-append   -DOCE_MULTITHREAD_LIBRARY:STRING=TBB
54}
55
56variant freeimage description {Build with FreeImage support} {
57    depends_lib-append      port:freeimage
58    configure.args-append   -DOCE_WITH_FREEIMAGE:BOOL=ON
59}
60
61variant gl2ps description {Build with gl2ps support} {
62    depends_lib-append      port:gl2ps
63    configure.args-append   -DOCE_WITH_GL2PS:BOOL=ON
64}
65
66post-destroot {
67    # modify installation paths relative to ${prefix}/Library/Frameworks
68    reinplace "s|\\\${SELF_DIR}/../../../../include/oce|${prefix}/include/oce|g" \
69        ${destroot}${prefix}/OCE.framework/Versions/${branch}/Resources/OCEConfig.cmake
70
71    reinplace "s|^get.*_IMPORT_PREFIX.*CMAKE.*|set(_IMPORT_PREFIX \\\"${prefix}\\\")|" \
72        ${destroot}${prefix}/OCE.framework/Versions/${branch}/Resources/OCE-libraries.cmake
73
74    reinplace {/^get.*_IMPORT_PREFIX.*/d} \
75        ${destroot}${prefix}/OCE.framework/Versions/${branch}/Resources/OCE-libraries.cmake
76
77    # installing OCE.framework in ${prefix} violates the layout of the ports-filesystems!
78    # move it to ${prefix}/Library/Frameworks
79    move ${destroot}${prefix}/OCE.framework \
80        ${destroot}${frameworks_dir}/OCE.framework
81}
Note: See TracBrowser for help on using the repository browser.