Ticket #44719: Portfile.2

File Portfile.2, 3.5 KB (added by macports@…, 10 years ago)

Portfile for cantera; modification 1

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