Ticket #50777: Portfile

File Portfile, 3.1 KB (added by howarth.at.macports@…, 8 years ago)

Portfile for py-pymol package

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 145074 2016-01-25 16:02:22Z dstrubbe@macports.org $
3
4PortSystem          1.0
5PortGroup           python 1.0
6PortGroup           active_variants 1.1
7PortGroup           compilers 1.0
8
9name                py-pymol
10version             1.8.1.0
11revision            1
12categories          science chemistry
13license             PSF
14maintainers         gmail.com:howarth.at.macports openmaintainer
15description         Molecular graphics system
16long_description    PyMOL is a molecular graphics system with an embedded Python interpreter \
17                    designed for real-time visualization and rapid generation of high-quality \
18                    molecular graphics images and animations.
19
20platforms           darwin
21
22homepage            http://www.pymol.org/
23
24master_sites        sourceforge
25fetch.type          svn
26svn.url             https://svn.code.sf.net/p/pymol/code/trunk/pymol
27svn.revision        4150
28worksrcdir          pymol
29
30compilers.choose    cc cxx
31compilers.setup
32
33python.default_version 27
34python.versions 27 33 34 35
35python.link_binaries no
36
37if {${name} ne ${subport}} {
38     depends_lib-append  port:freeglut \
39          port:freetype \
40          port:glew \
41          port:libpng \
42          port:libGLU \
43          port:mesa \
44          port:py${python.version}-numpy \
45          port:py${python.version}-scipy \
46          port:py${python.version}-tkinter \
47          port:tcl \
48          port:tk
49     if {${python.version} == 27} {
50          depends_lib-append port:py${python.version}-pmw
51     } else {
52          depends_lib-append port:py${python.version}-pmw2
53     }
54
55     depends_run         port:xdpyinfo
56
57     # py-scipy is not universal
58     universal_variant   no
59
60     patchfiles          pymol_shell.diff \
61                         pmg_tk_platform.patch \
62                         apbs-psize.patch 
63
64     if {${os.platform} eq "darwin" && ${os.major} >= 12} {
65                         patchfiles-append pymol-use-glkit.diff
66     }
67
68     require_active_variants tcl "" corefoundation
69     require_active_variants tk "" quartz
70
71     post-patch {
72          reinplace  "s|@PREFIX@|${prefix}|g" ${worksrcpath}/setup.py
73          reinplace  "s|@@PYTHON_PKGDIR@@|${python.pkgd}|g" ${worksrcpath}/setup/pymol_macports
74          reinplace  "s|@@PYTHON_BINARY@@|${python.bin}|g" ${worksrcpath}/setup/pymol_macports
75          reinplace  "s|\"-O3\",|\"-O3\", \"-g\",|g" ${worksrcpath}/setup.py
76          reinplace  "s|cxx + \' \' + cxxflags|\'${configure.cxx} \' + cxxflags|g" ${worksrcpath}/monkeypatch_distutils.py
77      }
78
79      use_parallel_build yes
80
81      build {}
82
83      pre-destroot {
84          destroot.env CC="${configure.cc}" CXX="${configure.cxx}" PREFIX_PATH="${prefix}"
85      }
86
87     post-destroot {
88          file copy ${worksrcpath}/setup/pymol_macports ${destroot}${prefix}/bin/pymol
89          file attributes ${destroot}${prefix}/bin/pymol -permissions a+x
90          foreach d {data modules examples test scripts} {
91               copy ${worksrcpath}/${d} ${destroot}${python.pkgd}/pymol
92          }
93     }
94}