Ticket #50810: Portfile

File Portfile, 4.4 KB (added by ian.rees@…, 8 years ago)

Combined ccx and cgx version 2.10

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 142633 2015-11-18 00:19:41Z ryandesign@macports.org $
3
4PortSystem              1.0
5PortGroup               compilers 1.0
6PortGroup               active_variants 1.1
7
8name                    calculix
9version                 2.10
10categories              math
11platforms               darwin
12license                 GPL-2+
13
14maintainers             gmail.com:mark.brethen \
15                        gmail.com:ian.rees \
16                        openmaintainer
17
18description             A three-dimensional finite element solver
19
20long_description        CalculiX is an open source explicit and implicit \
21    finite element analysis suite with its own pre/post processor.
22
23homepage                http://www.calculix.de/
24
25depends_build-append    port:pkgconfig
26
27depends_lib-append      port:arpack
28
29require_active_variants     arpack accelerate
30
31universal_variant       no
32use_parallel_build      no
33
34# This is just a stub that installs both CalculiX subports.
35if {${name} eq ${subport}} {
36    supported_archs noarch
37    distfiles
38    archive_sites
39
40    use_configure   no
41
42    build           {}
43
44    depends_run-append\
45        port:${name}-ccx\
46        port:${name}-cgx
47
48    destroot {
49        # Create a dummy file so the port can be successfully activated.
50        xinstall -d ${docdir}
51        set docfile [open ${docdir}/README.${name}.txt "w"]
52        puts $docfile \
53            "CalculiX ${version} (MacPorts revision ${version}_${revision})\n"
54        puts $docfile "${long_description}\n"
55        close $docfile
56    }
57    livecheck.type          none
58} else {
59   
60}
61
62subport ${name}-ccx {
63    revision            0
64   
65    # Spooles doesn't appear to be maintained, so is built and statically
66    # linked to ccx rather than making a port just for Spooles.
67    master_sites        http://www.dhondt.de/:ccx \
68                        http://www.netlib.org/linalg/spooles/:spooles
69
70    set spooles_filename spooles.2.2.tgz
71   
72    distfiles           ccx_${version}.src.tar.bz2:ccx \
73                        ${spooles_filename}:spooles
74 
75    patchfiles          patch-calculix-build.diff \
76                        patch-spooles-build.diff
77    patch.dir           ${workpath}
78
79    checksums           ccx_2.10.src.tar.bz2 \
80                        rmd160  ed66a7c39aa7fc65064ed69fac27c7e7c3424a3b \
81                        sha256  693497d19d8dd2a5376e64e038d5c248d87f0e2df46d409a83bf976596b319f5 \
82                        spooles.2.2.tgz \
83                        rmd160  caeb116e40426d3bd85dc3551c1c8491b19dc1da \
84                        sha256  a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd
85
86    compilers.choose    cc f77 f90 fc
87    compilers.setup     require_fortran
88
89    use_configure       no
90
91    # Use builtin extract for ccx...
92    extract.only                ccx_${version}.src.tar.bz2
93    extract.mkdir               yes
94    extract.post_args-append    --strip-components=3
95
96    # ...then roll our own for Spooles
97    post-extract {
98                    ui_info "Extracting ${spooles_filename}"
99                    file mkdir ${workpath}/spooles-2.2
100                    system "tar -xzf ${distpath}/${spooles_filename} -C ${workpath}/spooles-2.2"
101    }
102
103    # Spooles and ccx use raw Makefiles
104    build {
105                    ui_info "Building spooles"
106                    system "cd ${workpath} && make -C spooles-2.2 lib"
107                    system "cd ${workpath} && make -C spooles-2.2/MT/src makeLib"
108
109                    ui_info "Building calculix"
110                    variable ccx_make_flags "CC=${configure.cc} FC=${configure.fc} \"CFLAGS=-O2 "
111                    append ccx_make_flags "-I../../spooles-2.2/ -DARCH=Linux -DSPOOLES -DARPACK "
112                    append ccx_make_flags "-DMATRIXSTORAGE -DUSE_MT=1\" \"FFLAGS=-O2 -fopenmp\" "
113                    append ccx_make_flags "\"DIR=../../spooles-2.2\""
114                    system "cd ${worksrcpath}/src && make ${ccx_make_flags}"
115    }
116
117    destroot {
118                    xinstall -m 755 ${worksrcpath}/src/ccx_${version} ${destroot}${prefix}/bin/ccx
119    }
120
121    livecheck.regex         {ccx_${version}.src}
122    livecheck.url           http://www.dhondt.de/
123}
124
125subport ${name}-cgx {
126    revision                0
127    distname                cgx_${version}.all
128    checksums               rmd160   \
129        sha256
130
131    depends_run             port:gnuplot
132    livecheck.regex         {ccx_${version}.all}
133}