Ticket #44719: Portfile.3

File Portfile.3, 3.7 KB (added by macports@…, 10 years ago)

implemented comments by mf2k

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               python 1.0
6
7name                    cantera
8version                 2.1.1
9
10categories              science
11platforms               darwin
12maintainers             macports@thomasfiala.de openmaintainer
13license                 BSD
14
15description             Cantera software package
16long_description        Cantera is a suite of object-oriented software tools for \
17                        problems involving chemical kinetics, thermodynamics, \
18                        and/or transport processes. \
19                        Fortran support is disabled by install using MacPorts
20
21homepage                https://cantera.github.io/docs/sphinx/html/index.html
22
23variant sourceforge conflicts devel description {Use the stable version from sourceforge} {
24    master_sites        sourceforge:project/cantera/cantera/${version}
25    distname            ${name}-${version}
26    checksums           rmd160  0348e98ba856e8e184d0438469de137b94c04331 \
27                        sha256  d052baf268883c4b1ccef9d4406de5adb4974b5fd85f056f8bcd85fb3e946f1b
28}
29
30variant devel conflicts sourceforge \
31    description {Use the latest development version from github} {
32    PortGroup           github 1.0
33    github.setup        Cantera cantera master
34    checksums           rmd160  8ff606651de5a371853d6bdda9c0e459eb5f3b7d \
35                        sha256  83bb8c6af6cc11515d450ab3226319518f246859979eba85a71a0f21054f4c30
36}
37
38depends_lib-append      port:py${python.version}-numpy \
39                        port:py${python.version}-cython
40
41depends_build-append    port:scons
42
43python.versions         27
44
45use_configure           no
46
47build.cmd               ${prefix}/bin/scons install
48build.target
49build.args              prefix=${prefix} \
50                        CC=${configure.cc} \
51                        CXX=${configure.cxx} \
52                        f90_interface=n \
53                        python_prefix=${python.prefix} \
54                        stage_dir=$destroot
55
56pre-destroot            {}
57destroot {
58    eval move [glob $destroot$prefix/man/man1/*] $destroot$prefix/share/man/man1/
59    system -W $destroot$prefix/share/man/man1/ "gzip *"
60}
61
62post-install {
63    notes-append "
64
65Cantera C++ demos are installed in:
66$prefix/share/cantera/samples
67Cantera python demos are installed in:
68${python.pkgd}/cantera/examples
69Cantera data files are installed in:
70$prefix/share/cantera/data
71
72Try the following in python to find the equilibrium composition
73of a stoichiometric methane/air mixture at 1000 K and 1 atm:
74>>> import cantera as ct
75>>> g = ct.Solution('gri30.xml')
76>>> g.TPX = 1000, ct.one_atm, 'CH4:1, O2:2, N2:8'
77>>> g.equilibrate('TP')
78>>> g()
79
80Don't forget to set the appropriate python interpreter using
81sudo port select python
82
83"
84}
85
86variant sundials description {Build with sundials support (default)} {
87    depends_lib-append  port:sundials
88
89    build.args-append   use_sundials=y \
90                        sundials_include=$prefix/include \
91                        sundials_libdir=$prefix/lib
92}
93
94variant old_python conflicts devel description {Install legacy Python interface} {
95    build.args-append   python_package='full'
96}
97
98# # possibly a variant for python3, but it would be a mess and prone to break
99# variant python34 {
100#      depends_lib-append port:python34 \
101#                         port:py34-numpy \
102#                         port:py34-cython
103#
104#      build.args-append  python3_package=y \
105#                         python3_prefix=${prefix}/Library/Frameworks/Python.framework/Versions/3.4 \
106#                         python3_cmd=$prefix/bin/python3.4
107# }
108
109default_variants    +sourceforge +sundials