1 | # $Id: $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name pymol |
---|
6 | version 1.1 |
---|
7 | revision 1 |
---|
8 | categories science |
---|
9 | maintainers andrew@fernandes.org |
---|
10 | description A Popular X11-based Molecular Visualization System |
---|
11 | long_description PyMOL is a user-sponsored, X11-based molecular visualization system that uses python. |
---|
12 | |
---|
13 | platforms darwin |
---|
14 | |
---|
15 | homepage http://www.pymol.org/ |
---|
16 | |
---|
17 | master_sites sourceforge |
---|
18 | fetch.type svn |
---|
19 | svn.url https://pymol.svn.sourceforge.net/svnroot/pymol/branches/b11/pymol |
---|
20 | worksrcdir pymol |
---|
21 | |
---|
22 | depends_lib port:glut port:freetype port:libpng port:python25 port:py25-tkinter port:py25-pmw |
---|
23 | |
---|
24 | set pyversion 2.5 |
---|
25 | set python_bin "${prefix}/bin/python${pyversion}" |
---|
26 | |
---|
27 | configure.args --with-x --with-glu |
---|
28 | configure.python "${python_bin}" |
---|
29 | configure.cflags-append "-I${x11prefix}/include" |
---|
30 | configure.ldflags-append "-L${x11prefix}/lib" |
---|
31 | |
---|
32 | variant gcc43 description {build using macports-gcc-4.3} { |
---|
33 | depends_build-append port:gcc43 |
---|
34 | configure.compiler macports-gcc-4.3 |
---|
35 | } |
---|
36 | |
---|
37 | destroot { |
---|
38 | |
---|
39 | set libdir "${destroot}${prefix}/lib/pymol" |
---|
40 | |
---|
41 | xinstall -m 755 -d "${libdir}/lib" |
---|
42 | |
---|
43 | set libs { lib_glu_nummodule lib_glumodule lib_glutmodule lib_opengl_nummodule lib_openglmodule libchamp libopenglutil libopenglutil_num libpymol } |
---|
44 | |
---|
45 | foreach lib $libs { |
---|
46 | xinstall -m 644 "${worksrcpath}/.libs/${lib}.lai" "${libdir}/lib" |
---|
47 | xinstall -m 755 "${worksrcpath}/.libs/${lib}.0.0.0.dylib" "${libdir}/lib" |
---|
48 | system "cd ${libdir}/lib ; ln -s ${lib}.lai ${lib}.la ; ln -s ${lib}.0.0.0.dylib ${lib}.0.dylib ; ln -s ${lib}.0.0.0.dylib ${lib}.dylib" |
---|
49 | set dylib "${prefix}/lib/pymol/lib/${lib}.0.0.0.dylib" |
---|
50 | system "install_name_tool -id ${dylib} ${destroot}${dylib}" |
---|
51 | # Note: for PyMOL-1.1, each library is independent, so we don't need to "install_name_tool -change ... ..." them! |
---|
52 | } |
---|
53 | |
---|
54 | foreach dir { modules scripts } { |
---|
55 | system "cp -r ${worksrcpath}/${dir} ${libdir}" |
---|
56 | system "chown -R root:admin ${libdir}/${dir}" |
---|
57 | system "find ${libdir}/${dir} -type f -exec chmod 644 {} \\;" |
---|
58 | system "find ${libdir}/${dir} -type d -exec chmod 755 {} \\;" |
---|
59 | system "find ${libdir}/${dir} -name .svn -print0 | xargs -0 rm -rf" |
---|
60 | } |
---|
61 | |
---|
62 | system "cd ${libdir}/modules/pymol ; ln -s ../../lib/libpymol.0.0.0.dylib _cmd.so" |
---|
63 | system "cd ${libdir}/modules/chempy/champ ; ln -s ../../../lib/libchamp.0.0.0.dylib _champ.so" |
---|
64 | system "cd ${libdir}/modules/pymol/opengl/gl ; ln -s ../../../../lib/libopenglutil.0.0.0.dylib openglutil.so" |
---|
65 | system "cd ${libdir}/modules/pymol/opengl/gl ; ln -s ../../../../lib/libopenglutil_num.0.0.0.dylib openglutil_num.so" |
---|
66 | system "cd ${libdir}/modules/pymol/opengl/gl ; ln -s ../../../../lib/lib_openglmodule.0.0.0.dylib _openglmodule.so" |
---|
67 | system "cd ${libdir}/modules/pymol/opengl/gl ; ln -s ../../../../lib/lib_opengl_nummodule.0.0.0.dylib _opengl_nummodule.so" |
---|
68 | system "cd ${libdir}/modules/pymol/opengl/glu ; ln -s ../../../../lib/lib_glumodule.0.0.0.dylib _glumodule.so" |
---|
69 | system "cd ${libdir}/modules/pymol/opengl/glu ; ln -s ../../../../lib/lib_glu_nummodule.0.0.0.dylib _glu_nummodule.so" |
---|
70 | system "cd ${libdir}/modules/pymol/opengl/glut ; ln -s ../../../../lib/lib_glutmodule.0.0.0.dylib _glutmodule.so" |
---|
71 | |
---|
72 | set exe "${destroot}${prefix}/bin/pymol" |
---|
73 | set file [open "${exe}" "w" 0755] |
---|
74 | puts ${file} "#!/bin/bash" |
---|
75 | puts ${file} "export PYMOL_PATH=\"${prefix}/lib/pymol\"" |
---|
76 | puts ${file} "exec \"${python_bin}\" \"\$PYMOL_PATH/modules/launch_pymol.py\" \"\$@\"" |
---|
77 | close ${file} |
---|
78 | system "chown root:admin ${exe}" |
---|
79 | |
---|
80 | } |
---|