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 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup compilers 1.0 |
---|
6 | PortGroup active_variants 1.1 |
---|
7 | |
---|
8 | name calculix |
---|
9 | version 2.10 |
---|
10 | categories math |
---|
11 | platforms darwin |
---|
12 | maintainers openmaintainer \ |
---|
13 | gmail.com:ian.rees gmail.com:mark.brethen |
---|
14 | license GPL-2+ |
---|
15 | |
---|
16 | description A three-dimensional finite element solver |
---|
17 | |
---|
18 | long_description CalculiX is an open source explicit and implicit \ |
---|
19 | finite element analysis suite with its own pre/post processor. |
---|
20 | |
---|
21 | homepage http://www.calculix.de/ |
---|
22 | |
---|
23 | use_bzip2 yes |
---|
24 | |
---|
25 | depends_build-append port:pkgconfig |
---|
26 | |
---|
27 | universal_variant no |
---|
28 | use_parallel_build no |
---|
29 | |
---|
30 | # This is just a stub that installs both CalculiX subports. |
---|
31 | if {${name} eq ${subport}} { |
---|
32 | revision 0 |
---|
33 | supported_archs noarch |
---|
34 | distfiles |
---|
35 | archive_sites |
---|
36 | |
---|
37 | use_configure no |
---|
38 | |
---|
39 | build {} |
---|
40 | |
---|
41 | depends_run-append\ |
---|
42 | port:${name}-ccx \ |
---|
43 | port:${name}-cgx \ |
---|
44 | port:${name}-html |
---|
45 | |
---|
46 | destroot { |
---|
47 | # Create a dummy file so the port can be successfully activated. |
---|
48 | xinstall -d ${destroot}${prefix}/share/doc/CalculiX |
---|
49 | set docfile \ |
---|
50 | [open ${destroot}${prefix}/share/doc/CalculiX/README.${name}.txt "w"] |
---|
51 | puts $docfile \ |
---|
52 | "CalculiX ${version} (MacPorts revision ${version}_${revision})\n" |
---|
53 | puts $docfile "${long_description}\n" |
---|
54 | close $docfile |
---|
55 | } |
---|
56 | |
---|
57 | livecheck.type none |
---|
58 | } else { |
---|
59 | |
---|
60 | } |
---|
61 | |
---|
62 | subport ${name}-ccx { |
---|
63 | revision 0 |
---|
64 | master_sites \ |
---|
65 | http://www.dhondt.de/:ccx \ |
---|
66 | http://www.netlib.org/linalg/spooles/:spooles |
---|
67 | distfiles \ |
---|
68 | ccx_${version}.src${extract.suffix}:ccx \ |
---|
69 | spooles.2.2.tgz:spooles |
---|
70 | |
---|
71 | checksums ccx_${version}.src${extract.suffix} \ |
---|
72 | rmd160 ed66a7c39aa7fc65064ed69fac27c7e7c3424a3b \ |
---|
73 | sha256 693497d19d8dd2a5376e64e038d5c248d87f0e2df46d409a83bf976596b319f5 \ |
---|
74 | spooles.2.2.tgz \ |
---|
75 | rmd160 caeb116e40426d3bd85dc3551c1c8491b19dc1da \ |
---|
76 | sha256 a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd |
---|
77 | |
---|
78 | depends_lib-append port:arpack |
---|
79 | require_active_variants arpack accelerate |
---|
80 | |
---|
81 | patchfiles patch-ccx-build.diff \ |
---|
82 | patch-spooles-build.diff |
---|
83 | patch.dir ${workpath} |
---|
84 | |
---|
85 | compilers.choose cc f77 f90 fc |
---|
86 | compilers.setup require_fortran |
---|
87 | |
---|
88 | use_configure no |
---|
89 | |
---|
90 | # Use builtin extract for ccx... |
---|
91 | extract.only ccx_${version}.src${extract.suffix} |
---|
92 | extract.mkdir yes |
---|
93 | extract.post_args-append --strip-components=3 |
---|
94 | |
---|
95 | # ...then roll our own for Spooles |
---|
96 | post-extract { |
---|
97 | ui_info "Extracting spooles.2.2.tgz" |
---|
98 | xinstall -d ${workpath}/spooles-2.2 |
---|
99 | system -W ${distpath} \ |
---|
100 | "tar -zxf spooles.2.2.tgz -C ${workpath}/spooles-2.2" |
---|
101 | } |
---|
102 | |
---|
103 | # Spooles and ccx use raw Makefiles |
---|
104 | build { |
---|
105 | ui_info "Building spooles" |
---|
106 | system -W ${workpath} "make -C spooles-2.2 lib" |
---|
107 | system -W ${workpath} "make -C spooles-2.2/MT/src makeLib" |
---|
108 | |
---|
109 | ui_info "Building calculix" |
---|
110 | variable ccx_make_flags \ |
---|
111 | "CC=${configure.cc} FC=${configure.fc} \"CFLAGS=-O2 " |
---|
112 | append ccx_make_flags \ |
---|
113 | "-I../../spooles-2.2/ -DARCH=Linux -DSPOOLES -DARPACK " |
---|
114 | append ccx_make_flags \ |
---|
115 | "-DMATRIXSTORAGE -DUSE_MT=1\" \"FFLAGS=-O2 -fopenmp\" " |
---|
116 | append ccx_make_flags "\"DIR=../../spooles-2.2\"" |
---|
117 | system -W ${worksrcpath}/src "make ${ccx_make_flags}" |
---|
118 | } |
---|
119 | |
---|
120 | destroot { |
---|
121 | xinstall -m 755 ${worksrcpath}/src/ccx_${version} \ |
---|
122 | ${destroot}${prefix}/bin/ccx |
---|
123 | } |
---|
124 | |
---|
125 | livecheck.type regex |
---|
126 | livecheck.url http://www.dhondt.de/ |
---|
127 | livecheck.regex {ccx_${version}.src} |
---|
128 | } |
---|
129 | |
---|
130 | subport ${name}-cgx { |
---|
131 | revision 0 |
---|
132 | master_sites http://www.dhondt.de/ |
---|
133 | distname cgx_${version}.all |
---|
134 | |
---|
135 | checksums rmd160 02302101f16c2b4cdd570e81986cc4d36c2110d8 \ |
---|
136 | sha256 64810dab1c22152c7946282fac5763cc36b9e31e309f962c23b8bf8238537c7e |
---|
137 | |
---|
138 | depends_run-append port:openbrowser |
---|
139 | |
---|
140 | worksrcdir CalculiX |
---|
141 | build.dir ${worksrcpath}/cgx_${version}/src |
---|
142 | build.target |
---|
143 | |
---|
144 | # cgx routine extUtil.h causes a compiler error; using gcc 4.9 instead. |
---|
145 | compiler.blacklist *clang* *llvm-gcc-4.2 |
---|
146 | compiler.whitelist macports-gcc-4.9 |
---|
147 | |
---|
148 | patchfiles patch-cgx-build.diff \ |
---|
149 | patch-libSNL-build.diff |
---|
150 | patch.dir ${workpath} |
---|
151 | |
---|
152 | post-patch { |
---|
153 | reinplace "s|@@PREFIX@@|${prefix}|g" \ |
---|
154 | ${worksrcpath}/cgx_${version}/src/cgx.h |
---|
155 | } |
---|
156 | |
---|
157 | use_configure no |
---|
158 | |
---|
159 | pre-build { |
---|
160 | build.args CC=${configure.cc} \ |
---|
161 | CXX=${configure.cxx} |
---|
162 | } |
---|
163 | |
---|
164 | destroot { |
---|
165 | xinstall -m 755 ${worksrcpath}/cgx_${version}/src/cgx \ |
---|
166 | ${destroot}${prefix}/bin |
---|
167 | |
---|
168 | xinstall -d ${destroot}${prefix}/share/doc/CalculiX/cgx_${version} |
---|
169 | |
---|
170 | xinstall -m 644 -W ${worksrcpath}/cgx_${version} \ |
---|
171 | CHANGES \ |
---|
172 | COPYING \ |
---|
173 | README \ |
---|
174 | ${destroot}${prefix}/share/doc/CalculiX/cgx_${version}/ |
---|
175 | |
---|
176 | copy ${worksrcpath}/cgx_${version}/examples \ |
---|
177 | ${destroot}${prefix}/share/doc/CalculiX/cgx_${version}/ |
---|
178 | } |
---|
179 | |
---|
180 | livecheck.type regex |
---|
181 | livecheck.url http://www.dhondt.de/ |
---|
182 | livecheck.regex {ccx_${version}.all} |
---|
183 | } |
---|
184 | |
---|
185 | subport ${name}-html { |
---|
186 | revision 0 |
---|
187 | master_sites http://www.dhondt.de/ |
---|
188 | distfiles cgx_${version}.htm${extract.suffix} \ |
---|
189 | ccx_${version}.htm${extract.suffix} |
---|
190 | |
---|
191 | checksums cgx_${version}.htm${extract.suffix} \ |
---|
192 | rmd160 21db0c300492a7a11c07359731f7cfbd038cb0b7 \ |
---|
193 | sha256 92655f32b9909c09414509f4f05aa7ff049321b8b0bbdec884d9b1fde90ab0fa \ |
---|
194 | ccx_${version}.htm${extract.suffix} \ |
---|
195 | rmd160 cab3c9e5969b0adbff1455fd8ca6325ec00ff8d3 \ |
---|
196 | sha256 28f09511d791016dadb9f9cce382789fc250dfa5a60b105cfc4c9c2008e437c2 |
---|
197 | |
---|
198 | worksrcdir CalculiX |
---|
199 | |
---|
200 | use_configure no |
---|
201 | |
---|
202 | build {} |
---|
203 | |
---|
204 | destroot { |
---|
205 | xinstall -d ${destroot}${prefix}/share/doc/CalculiX/cgx_${version}/doc \ |
---|
206 | ${destroot}${prefix}/share/doc/CalculiX/ccx_${version}/doc |
---|
207 | |
---|
208 | copy ${worksrcpath}/cgx_${version}/doc/cgx \ |
---|
209 | ${destroot}${prefix}/share/doc/CalculiX/cgx_${version}/doc/ |
---|
210 | |
---|
211 | copy ${worksrcpath}/ccx_${version}/doc/ccx \ |
---|
212 | ${destroot}${prefix}/share/doc/CalculiX/ccx_${version}/doc/ |
---|
213 | } |
---|
214 | |
---|
215 | livecheck.type none |
---|
216 | } |
---|