Ticket #47186: Portfile

File Portfile, 2.8 KB (added by ian.rees@…, 9 years ago)

Proposed Portfile for OCE 0.17

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                   cmake 1.0
6PortGroup                   github 1.0
7
8github.setup                tpaviot oce 0.17 OCE-
9categories                  graphics
10platforms                   darwin
11maintainers                 gmail.com:mark.brethen openmaintainer
12license                     LGPL-2.1
13
14description                 Open CASCADE Community Edition
15
16long_description            ${description}
17
18checksums                   rmd160  6f9b957423bd7de7f16e2fa19fce2934be829289 \
19                            sha256  0bcc76d067cd5cbbdfe4ad477093fbdf9d08a01cfe5b4afe0e296632afaeffde
20
21depends_lib-append          port:freetype
22
23# tell CMake to build in a build directory
24configure.dir               ${workpath}/build
25build.dir                   ${configure.dir}
26post-extract {
27    file mkdir ${configure.dir}
28}
29configure.post_args         ${worksrcpath}
30
31configure.args-append       -DOCE_INSTALL_PREFIX:PATH=${prefix}
32
33variant test description {Build and run unit testing framework} {
34    configure.args-append   -DOCE_TESTING:BOOL=ON
35    test.run                yes
36}
37
38variant draw description {Build DRAW test harness} {
39    depends_lib-append      port:tcl port:tk
40    configure.args-append   -DTCL_INCLUDE_PATH=${prefix}/include
41    configure.args-append   -DOCE_DRAW:BOOL=ON
42    configure.args-append   -DOCE_INSTALL_PACKAGE_LIB_DIR=lib
43}
44
45variant tbb description {Use TBB for memory allocation} {
46    depends_lib-append      port:tbb
47    configure.args-append   -DOCE_MULTITHREAD_LIBRARY:STRING=TBB
48}
49
50variant freeimage description {Build with FreeImage support} {
51    depends_lib-append      port:freeimage
52    configure.args-append   -DOCE_WITH_FREEIMAGE:BOOL=ON
53}
54
55variant gl2ps description {Build with gl2ps support} {
56    depends_lib-append      port:gl2ps
57    configure.args-append   -DOCE_WITH_GL2PS:BOOL=ON
58}
59
60post-destroot {
61    # modify installation paths relative to ${prefix}/Library/Frameworks
62    reinplace "s|\\\${SELF_DIR}/../../../../include/oce|${prefix}/include/oce|g" \
63        ${destroot}${prefix}/OCE.framework/Versions/${version}/Resources/OCEConfig.cmake
64
65    reinplace "s|^get.*_IMPORT_PREFIX.*CMAKE.*|set(_IMPORT_PREFIX \\\"${prefix}\\\")|" \
66        ${destroot}${prefix}/OCE.framework/Versions/${version}/Resources/OCE-libraries.cmake
67
68    reinplace {/^get.*_IMPORT_PREFIX.*/d} \
69        ${destroot}${prefix}/OCE.framework/Versions/${version}/Resources/OCE-libraries.cmake
70
71    # installing OCE.framework in ${prefix} violates the layout of the ports-filesystems!
72    # move it to ${prefix}/Library/Frameworks
73    move ${destroot}${prefix}/OCE.framework \
74        ${destroot}${frameworks_dir}/OCE.framework
75}