Ticket #65628: Portfile

File Portfile, 4.4 KB (added by mbrethen, 22 months ago)
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
3PortSystem              1.0
4PortGroup               compilers 1.0
5
6name                    CalculiX
7version                 2.18
8categories              cad
9platforms               darwin
10license                 GPL-2+
11maintainers             {gmail.com:mark.brethen @mbrethen} openmaintainer
12description             CalculiX GraphiX pre- and post-processor cgx
13long_description        {*}${description} is an interactive 3D-tool using \
14                        the openGL API. \
15                        \n \
16                        \nSupported solvers \
17                        \n* CalculiX ccx, Abaqus FEM (pre, post) \
18                        \n* Nastran FEM (pre) \
19                        \n* Ansys FEM (pre) \
20                        \n* DUNS-CFD (pre, post) \
21                        \n* ISAAC-CFD (pre, post) \
22                        \n* OpenFOAM (pre, post)
23homepage                http://www.calculix.de/
24master_sites            http://www.dhondt.de/
25use_bzip2               yes
26
27distname                cgx_${version}
28distfiles               ${distname}.all${extract.suffix} \
29                        ${distname}.exa${extract.suffix} \
30                        ${distname}.htm${extract.suffix}
31dist_subdir             CalculiX
32
33checksums \
34    ${distname}.all${extract.suffix} \
35    sha256  dea36f02f36f35a420241b8ed9836f0121b75b5af1abb8e13ca48e31dc4f8734 \
36    size    5749856 \
37    ${distname}.exa${extract.suffix} \
38    sha256  498d239ae77be8f3f5d1f48acc431724dd297a246755bfb651dcbc03ba233873 \
39    size    3921273 \
40    ${distname}.htm${extract.suffix} \
41    sha256  486ce50880cb0c298f6ccdde353bc8982bfb095294a7404eb966b3345d790312 \
42    size    377755
43
44extract.only             ${distname}.all${extract.suffix} \
45                         ${distname}.exa${extract.suffix} \
46                         ${distname}.htm${extract.suffix} 
47
48# gcc is not really supported for c++ builds
49compilers.choose         cxx cc
50compilers.setup          -gcc
51
52depends_build-append     port:xorg-xorgproto \
53                         port:xorg-libice \
54                         port:xorg-libsm \
55                         port:xorg-libX11 \
56                         port:xorg-libXext \
57                         port:xorg-libXi \
58                         port:xorg-libXmu \
59                         port:xorg-libXt
60
61depends_run-append       port:CalculiX-ccx \
62                         port:gnuplot \
63                         port:ImageMagick \
64                         port:openbrowser \
65                         port:psutils \
66                         port:tetgen
67
68depends_lib-append       port:libGLU \
69                         port:freeglut
70
71patchfiles               patch-cgx-build.diff \
72                         patch-libSNL-build.diff
73
74use_configure            no
75
76worksrcdir               CalculiX
77build.dir                ${worksrcpath}/cgx_${version}/src
78build.target           
79
80variant docs description {Install html documentation} {}
81
82variant examples description {Install test examples} {}
83
84universal_variant        no
85
86default_variants         +docs +examples
87
88pre-build {
89    # Patch calculix library
90    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/cgx_${version}/src/cgx.h
91    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/cgx_${version}/src/Makefile
92
93    # Set environment variables for build
94    set args    [list \
95                     "CC=${configure.cc}" \
96                     "CXX=${configure.cxx}" \
97                     "CFLAGS=${configure.cflags} [get_canonical_archflags cc]" \
98                     "CXXFLAGS=${configure.cxxflags} [get_canonical_archflags cxx]" \
99                     "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"
100                ]
101
102    build.env-append    {*}${args}
103}
104
105destroot {
106    xinstall -m a+rx ${build.dir}/cgx ${destroot}${prefix}/bin/.
107
108    if {[variant_isset docs]} {
109        set docsdir     ${prefix}/share/doc/CalculiX/cgx
110        xinstall -d ${destroot}${docsdir}
111        copy {*}[glob ${worksrcpath}/cgx_${version}/doc/cgx/*] ${destroot}${docsdir}
112    }
113
114    if {[variant_isset examples]} {
115        set examplesdir    ${prefix}/share/examples/cgx
116        xinstall -d ${destroot}${examplesdir}
117        copy {*}[glob ${worksrcpath}/cgx_${version}/examples/*] ${destroot}${examplesdir}
118    }
119}
120
121livecheck.type           regex
122livecheck.url            http://www.dhondt.de/
123livecheck.regex          {cgx_${version}.all}