Ticket #44042: Portfile

File Portfile, 2.5 KB (added by mbrethen, 10 years ago)

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       cmake 1.0
6PortGroup       github 1.0
7
8github.setup    tpaviot oce 0.15 OCE-
9
10categories      graphics
11maintainers     gmail.com:mark.brethen \
12                openmaintainer 
13description     Open CASCADE Community Edition
14long_description ${description}
15
16license         LGPL-2.1
17
18checksums rmd160 7e27d750950b35704cbdd64a49d19a21e30cc3d9 \
19    sha256 343f7fd600665f8e806eff7046fde9e4d6be05630f1bd1ef13bdb6c661ea860b
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}