source: trunk/dports/science/ccpnmr/Portfile

Last change on this file was 144223, checked in by sean@…, 19 months ago

ccpnmr: use compilers portgroup; fixes #49010

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 KB
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 144223 2016-01-05 00:49:16Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           compilers 1.0
6
7name                ccpnmr
8version             2.4.2
9revision            1
10set branch          [join [lrange [split $version .] 0 1] .]
11categories          science python
12maintainers         gmail.com:howarth.at.macports
13description         CCPNMR
14long_description    The CcpNmr software suite is a series of programs \
15                    for macromolecular NMR spectroscopy integrated with \
16                    the CCP data model. The CCP Data Model for macro- \
17                    molecular NMR is intended to cover all data needed \
18                    for macromolecular NMR spectroscopy from the initial \
19                    experimental data to the final validation.
20platforms           darwin
21homepage            http://www.ccpn.ac.uk/ccpn/software/ccpnmr-suite
22master_sites        http://www2.ccpn.ac.uk/download/ccpnmr/
23distname            analysis${version}
24checksums           rmd160  d87e6bfee8ab3f64790f925eee8fcf6e1efad257 \
25                    sha256  14941131033cbd4b0b13d6d4fe3f9253360a7c2ace8ece9194be00c1fe4b2903
26worksrcdir          ${name}
27depends_lib         port:py27-scipy port:mesa port:libGLU port:freeglut port:tk port:py27-tkinter
28patchfiles          ccpnmr.patch
29use_configure       no
30
31compilers.choose    cc cxx
32compilers.setup     -clang -dragonegg -g95 -gfortran -llvm
33
34set python.branch       2.7
35set python.prefix       ${frameworks_dir}/Python.framework/Versions/${python.branch}
36set python.bin  ${python.prefix}/bin/python${python.branch}
37set python.pkgd ${python.prefix}/lib/python${python.branch}/site-packages
38set python.libdir ${python.prefix}/lib/python${python.branch}
39set python.include      ${python.prefix}/include/python${python.branch}
40
41post-patch {
42    set lib ""
43    if {[gcc_variant_isset]} {
44        set lib "${prefix}/lib/[gcc_variant_name]"
45    }
46    reinplace  "s|@PYTHON_BIN@|${python.bin}|g"   ${worksrcpath}/bin/analysis \
47                                                  ${worksrcpath}/bin/formatConverter \
48                                                  ${worksrcpath}/bin/pipe2azara \
49                                                  ${worksrcpath}/ccpnmr${branch}/c/environment-opengl.txt \
50                                                  ${worksrcpath}/bin/dataShifter \
51                                                  ${worksrcpath}/bin/updateAll \
52                                                  ${worksrcpath}/bin/updateCheck
53    reinplace  "s|@PYTHON_PKGD@|${python.pkgd}|g" ${worksrcpath}/bin/analysis \
54                                                  ${worksrcpath}/bin/formatConverter \
55                                                  ${worksrcpath}/bin/pipe2azara \
56                                                  ${worksrcpath}/bin/dataShifter \
57                                                  ${worksrcpath}/bin/updateAll \
58                                                  ${worksrcpath}/bin/updateCheck
59    reinplace  "s|@PREFIX@|${prefix}|g" ${worksrcpath}/ccpnmr${branch}/c/environment-opengl.txt
60    reinplace  "s|/usr/X11R6|${prefix}|g" ${worksrcpath}/ccpnmr${branch}/c/environment-opengl.txt
61    reinplace  "s|@PYTHON_INCL@|${python.include}|g" ${worksrcpath}/ccpnmr${branch}/c/environment-opengl.txt
62    reinplace  "s|@CC@|${configure.cc}|g" ${worksrcpath}/ccpnmr${branch}/c/environment-opengl.txt
63    reinplace  "s|@GCCLIB@|${lib}|g" ${worksrcpath}/ccpnmr${branch}/c/environment-opengl.txt
64}
65pre-build {
66    copy ${worksrcpath}/ccpnmr${branch}/c/environment-opengl.txt ${worksrcpath}/ccpnmr${branch}/c/environment.txt
67}
68
69build.args      CC=${configure.cc} ARCHFLAGS="${configure.cc_archflags}"
70build.dir       ${worksrcpath}/ccpnmr${branch}/c
71build.target    all links
72destroot {
73    foreach f {analysis dataShifter formatConverter pipe2azara updateAll updateCheck} {
74        xinstall -m 755 ${worksrcpath}/bin/${f} ${destroot}${prefix}/bin
75    }
76    file mkdir ${destroot}${python.pkgd}/${name}/${name}${branch}/
77    foreach d {c python data model doc} {
78        copy ${worksrcpath}/ccpnmr${branch}/${d} ${destroot}${python.pkgd}/${name}/${name}${branch}
79    }
80    system "echo '${name}/${name}${branch}/python' > ${destroot}${python.pkgd}/${name}.pth"
81    copy ${worksrcpath}/doc ${destroot}${python.pkgd}/${name}
82}
83post-destroot {
84    system "${python.bin} -O ${python.libdir}/compileall.py -d ${python.pkgd}/${name}/${name}${branch} ${destroot}${python.pkgd}/${name}/${name}${branch}"
85}
86
87if {![gcc_variant_isset]} {
88    default_variants-append +${compilers.gcc_default}
89}
Note: See TracBrowser for help on using the repository browser.