1 | # $Id: $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name pymol |
---|
6 | version 1.2r2 |
---|
7 | svn.revision 3866 |
---|
8 | categories science |
---|
9 | maintainers adfernandes@macports.org openmaintainer |
---|
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:443/svnroot/pymol/trunk/pymol |
---|
20 | worksrcdir pymol |
---|
21 | depends_lib port:glut port:freetype port:libpng port:python26 port:py26-tkinter port:py26-pmw |
---|
22 | |
---|
23 | set pyversion 2.6 |
---|
24 | set python_bin "${prefix}/bin/python${pyversion}" |
---|
25 | |
---|
26 | configure.args --with-x --x-include=${prefix}/include --x-lib=${prefix}/lib --with-glu |
---|
27 | configure.python "${python_bin}" |
---|
28 | |
---|
29 | variant gcc43 description {build using macports-gcc-4.3} { |
---|
30 | depends_build-append port:gcc43 |
---|
31 | configure.compiler macports-gcc-4.3 |
---|
32 | configure.ldflags-append "-L${prefix}/lib/gcc43" "-lstdc++" |
---|
33 | } |
---|
34 | |
---|
35 | destroot { |
---|
36 | |
---|
37 | set libdir "${destroot}${prefix}/lib/pymol" |
---|
38 | |
---|
39 | xinstall -m 755 -d "${libdir}/lib" |
---|
40 | |
---|
41 | set libs { lib_glu_nummodule lib_glumodule lib_glutmodule lib_opengl_nummodule lib_openglmodule libchamp libopenglutil libopenglutil_num libpymol } |
---|
42 | |
---|
43 | foreach lib $libs { |
---|
44 | xinstall -m 644 "${worksrcpath}/.libs/${lib}.lai" "${libdir}/lib" |
---|
45 | xinstall -m 755 "${worksrcpath}/.libs/${lib}.0.dylib" "${libdir}/lib" |
---|
46 | system "cd ${libdir}/lib ; ln -s ${lib}.lai ${lib}.la ; ln -s ${lib}.0.dylib ${lib}.dylib" |
---|
47 | set dylib "${prefix}/lib/pymol/lib/${lib}.0.dylib" |
---|
48 | system "install_name_tool -id ${dylib} ${destroot}${dylib}" |
---|
49 | # Note: Currently, each library is independent, so we don't need to "install_name_tool -change ... ..." them! |
---|
50 | } |
---|
51 | |
---|
52 | foreach dir { modules scripts } { |
---|
53 | system "cp -r ${worksrcpath}/${dir} ${libdir}" |
---|
54 | system "chown -R root:admin ${libdir}/${dir}" |
---|
55 | system "find ${libdir}/${dir} -type f -exec chmod 644 {} \\;" |
---|
56 | system "find ${libdir}/${dir} -type d -exec chmod 755 {} \\;" |
---|
57 | system "find ${libdir}/${dir} -name .svn -print0 | xargs -0 rm -rf" |
---|
58 | } |
---|
59 | |
---|
60 | system "cd ${libdir}/modules/pymol ; ln -s ../../lib/libpymol.0.dylib _cmd.so" |
---|
61 | system "cd ${libdir}/modules/chempy/champ ; ln -s ../../../lib/libchamp.0.dylib _champ.so" |
---|
62 | system "cd ${libdir}/modules/pymol/opengl/gl ; ln -s ../../../../lib/libopenglutil.0.dylib openglutil.so" |
---|
63 | system "cd ${libdir}/modules/pymol/opengl/gl ; ln -s ../../../../lib/libopenglutil_num.0.dylib openglutil_num.so" |
---|
64 | system "cd ${libdir}/modules/pymol/opengl/gl ; ln -s ../../../../lib/lib_openglmodule.0.dylib _openglmodule.so" |
---|
65 | system "cd ${libdir}/modules/pymol/opengl/gl ; ln -s ../../../../lib/lib_opengl_nummodule.0.dylib _opengl_nummodule.so" |
---|
66 | system "cd ${libdir}/modules/pymol/opengl/glu ; ln -s ../../../../lib/lib_glumodule.0.dylib _glumodule.so" |
---|
67 | system "cd ${libdir}/modules/pymol/opengl/glu ; ln -s ../../../../lib/lib_glu_nummodule.0.dylib _glu_nummodule.so" |
---|
68 | system "cd ${libdir}/modules/pymol/opengl/glut ; ln -s ../../../../lib/lib_glutmodule.0.dylib _glutmodule.so" |
---|
69 | |
---|
70 | set exe "${destroot}${prefix}/bin/pymol" |
---|
71 | set file [open "${exe}" "w" 0755] |
---|
72 | puts ${file} "#!/bin/bash" |
---|
73 | puts ${file} "export PYMOL_PATH=\"${prefix}/lib/pymol\"" |
---|
74 | puts ${file} "exec \"${python_bin}\" \"\$PYMOL_PATH/modules/launch_pymol.py\" \"\$@\"" |
---|
75 | close ${file} |
---|
76 | system "chown root:admin ${exe}" |
---|
77 | |
---|
78 | } |
---|