Ticket #44719: Portfile

File Portfile, 3.3 KB (added by macports@…, 10 years ago)

Portfile for cantera; added mention to select the appropriate python version

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         nomaintainer, 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
23master_sites        sourceforge:project/cantera/cantera/${version}
24distname            ${name}-${version}
25checksums           sha1    439dfc583ad225e06bcc5f00ce0173720ac8942a \
26                    md5     06eb65039818aabfdb49830a65751b95
27
28variant devel description {Use the latest development version} {
29    fetch.type          git
30    git.url             https://github.com/Cantera/${name}.git
31    git.branch          2.1-svn
32}
33
34depends_lib         port:py${python.version}-numpy \
35                    port:py${python.version}-cython
36
37depends_build       port:scons
38
39python.versions     26 27
40
41use_configure       no
42
43build.cmd           ${prefix}/bin/scons install
44build.target
45build.args          prefix=${prefix} \
46                    CC=${configure.cc} \
47                    CXX=${configure.cxx} \
48                    f90_interface=n \
49                    python_prefix=${python.prefix} \
50                    stage_dir=$destroot
51
52pre-destroot {}
53destroot {
54    system "mv $destroot$prefix/man/man1/* $destroot$prefix/share/man/man1/"
55    system "cd $destroot$prefix/share/man/man1 && gzip *"
56}
57
58post-install {
59    notes-append "
60
61Cantera C++ demos are installed in:
62$prefix/share/cantera/samples
63Cantera python demos are installed in:
64${python.pkgd}/cantera/examples
65Cantera data files are installed in:
66$prefix/share/cantera/data
67
68Try the following in python to find the equilibrium composition
69of a stoichiometric methane/air mixture at 1000 K and 1 atm:
70>>> import cantera as ct
71>>> g = ct.Solution('gri30.xml')
72>>> g.TPX = 1000, ct.one_atm, 'CH4:1, O2:2, N2:8'
73>>> g.equilibrate('TP')
74>>> g()
75
76Don't forget to set the appropriate python interpreter using
77sudo port select python
78
79"
80}
81
82variant sundials description {Build with sundials support (default)} {
83    depends_lib-append  port:sundials
84
85    build.args-append   use_sundials=y \
86                        sundials_include=$prefix/include \
87                        sundials_libdir=$prefix/lib
88}
89
90variant old_python conflicts devel description { Install legacy Python interface} {
91    build.args-append   python_package='full'
92}
93
94# # possibly a variant for python3, but it would be a mess and prone to break
95# variant python34 {
96#      depends_lib-append port:python34 \
97#                         port:py34-numpy \
98#                         port:py34-cython
99#
100#      build.args-append  python3_package=y \
101#                         python3_prefix=${prefix}/Library/Frameworks/Python.framework/Versions/3.4 \
102#                         python3_cmd=$prefix/bin/python3.4
103# }
104
105default_variants    +sundials