[129475] trunk/dports/science/pymol

ryandesign at macports.org ryandesign at macports.org
Sat Dec 13 14:12:43 PST 2014


Revision: 129475
          https://trac.macports.org/changeset/129475
Author:   ryandesign at macports.org
Date:     2014-12-13 14:12:42 -0800 (Sat, 13 Dec 2014)
Log Message:
-----------
pymol: update to 1.7.4.0 (maintainer, #46218)

Modified Paths:
--------------
    trunk/dports/science/pymol/Portfile
    trunk/dports/science/pymol/files/pmg_tk_platform.patch
    trunk/dports/science/pymol/files/pymol-clang.diff
    trunk/dports/science/pymol/files/setup_py.diff

Added Paths:
-----------
    trunk/dports/science/pymol/files/pymol-use-glkit.diff

Removed Paths:
-------------
    trunk/dports/science/pymol/files/apbs_tkinter.patch

Modified: trunk/dports/science/pymol/Portfile
===================================================================
--- trunk/dports/science/pymol/Portfile	2014-12-13 20:40:58 UTC (rev 129474)
+++ trunk/dports/science/pymol/Portfile	2014-12-13 22:12:42 UTC (rev 129475)
@@ -6,7 +6,7 @@
 PortGroup           active_variants 1.1
 
 name                pymol
-version             1.7.2.1
+version             1.7.4.0
 categories          science chemistry
 license             PSF
 maintainers         gmail.com:howarth.at.macports
@@ -22,7 +22,7 @@
 master_sites        sourceforge
 fetch.type          svn
 svn.url             https://svn.code.sf.net/p/pymol/code/trunk/pymol
-svn.revision        4087
+svn.revision        4107
 worksrcdir          pymol
 
 python.default_version 27
@@ -46,9 +46,12 @@
                     pymol_shell.diff \
                     pmg_tk_platform.patch \
                     apbs-psize.patch \
-                    apbs_tkinter.patch \
-                    pymol-clang.diff 
+                    pymol-clang.diff
 
+if {${os.platform} eq "darwin" && ${os.major} >= 12} {
+    patchfiles-append pymol-use-glkit.diff
+}
+
 require_active_variants tcl "" corefoundation
 require_active_variants tk "" quartz
 

Deleted: trunk/dports/science/pymol/files/apbs_tkinter.patch
===================================================================
--- trunk/dports/science/pymol/files/apbs_tkinter.patch	2014-12-13 20:40:58 UTC (rev 129474)
+++ trunk/dports/science/pymol/files/apbs_tkinter.patch	2014-12-13 22:12:42 UTC (rev 129475)
@@ -1,196 +0,0 @@
---- modules/pmg_tk/startup/apbs_tools.py.orig
-+++ modules/pmg_tk/startup/apbs_tools.py
-@@ -612,7 +612,8 @@
-         # Set up the Main page
-         page = self.notebook.add('Main')
-         group = Pmw.Group(page,tag_text='Main options')
--        group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
-         self.selection = Pmw.EntryField(group.interior(),
-                                         labelpos='w',
-                                         label_text='Selection to use: ',
-@@ -658,7 +659,8 @@
-         page = self.notebook.add('Configuration')
- 
-         group = Pmw.Group(page,tag_text='Dielectric Constants')
--        group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
-+        group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
-         group.grid(column=0, row=0)
-         self.interior_dielectric = Pmw.EntryField(group.interior(),labelpos='w',
-                                    label_text = 'Protein Dielectric:',
-@@ -677,7 +679,8 @@
-             #entry.pack(side='left',fill='both',expand=1,padx=4) # side-by-side
-             entry.pack(fill='x',expand=1,padx=4,pady=1) # vertical
-         group = Pmw.Group(page,tag_text='Other')
--        group.pack(fill='both',expand=1, padx=4, pady=5)
-+        #group.pack(fill='both',expand=1, padx=4, pady=5)
-+        group.grid(padx=4, pady=5, sticky=(N, S, E, W))
-         group.grid(column=1, row=1,columnspan=4)
-         self.max_mem_allowed = Pmw.EntryField(group.interior(),labelpos='w',
-                                               label_text = 'Maximum Memory Allowed (MB):',
-@@ -735,7 +738,8 @@
- 
- 
-         group = Pmw.Group(page,tag_text='Ions')
--        group.pack(fill='both',expand=1, padx=4, pady=5)
-+        #group.pack(fill='both',expand=1, padx=4, pady=5)
-+        group.grid(padx=4, pady=5, sticky=(N, S, E, W))
-         group.grid(column=0, row=1, )
-         self.ion_plus_one_conc = Pmw.EntryField(group.interior(),
-                                                 labelpos='w',
-@@ -794,7 +798,8 @@
-             entry.pack(fill='x',expand=1,padx=4)
- 
-         group = Pmw.Group(page,tag_text = 'Coarse Mesh Length')
--        group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
-+        group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
-         group.grid(column = 1, row = 0)
-         for coord in 'x y z'.split():
-             setattr(self,'grid_coarse_%s'%coord,Pmw.EntryField(group.interior(),
-@@ -809,7 +814,8 @@
- 
- 
-         group = Pmw.Group(page,tag_text = 'Fine Mesh Length')
--        group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
-+        group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
-         group.grid(column = 2, row = 0)
-         for coord in 'x y z'.split():
-             setattr(self,'grid_fine_%s'%coord,Pmw.EntryField(group.interior(),
-@@ -824,7 +830,8 @@
- 
- 
-         group = Pmw.Group(page,tag_text = 'Grid Center')
--        group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
-+        group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
-         group.grid(column = 3, row = 0)
-         for coord in 'x y z'.split():
-             setattr(self,'grid_center_%s'%coord,Pmw.EntryField(group.interior(),
-@@ -838,7 +845,8 @@
-             getattr(self,'grid_center_%s'%coord).pack(fill='x', expand=1, padx=4, pady=1)
- 
-         group = Pmw.Group(page,tag_text = 'Grid Points')
--        group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 4, pady = 5)
-+        group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
-         group.grid(column = 4, row = 0)
-         for coord in 'x y z'.split():
-             setattr(self,'grid_points_%s'%coord,Pmw.EntryField(group.interior(),
-@@ -856,7 +864,8 @@
-         page.grid_columnconfigure(5,weight=1)
-         page = self.notebook.add('Program Locations')
-         group = Pmw.Group(page,tag_text='Locations')
--        group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
-         def quickFileValidation(s):
-             if s == '': return Pmw.PARTIAL
-             elif os.path.isfile(s): return Pmw.OK
-@@ -955,7 +964,8 @@
-         
-         page = self.notebook.add('Temp File Locations')
-         group = Pmw.Group(page,tag_text='Locations')
--        group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
-         self.pymol_generated_pqr_filename = Pmw.EntryField(group.interior(),
-                                                            labelpos = 'w',
-                                                            label_pyclass = FileDialogButtonClassFactory.get(self.setPymolGeneratedPqrFilename),
-@@ -1003,17 +1013,20 @@
-         page = self.notebook.add('Visualization (1)')
-         group = VisualizationGroup(page,tag_text='Visualization',visgroup_num=1)
-         self.visualization_group_1 = group
--        group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
- 
-         page = self.notebook.add('Visualization (2)')
-         group = VisualizationGroup(page,tag_text='Visualization',visgroup_num=2)
-         self.visualization_group_2 = group
--        group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
- 
-         # Create a couple of other empty pages
-         page = self.notebook.add('About')
-         group = Pmw.Group(page, tag_text='About PyMOL APBS Tools')
--        group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        #group.pack(fill = 'both', expand = 1, padx = 10, pady = 5)
-+        group.grid(padx = 10, pady = 5, sticky=(N, S, E, W))
-         text = """This plugin integrates PyMOL (http://PyMOL.org/) with APBS (http://www.poissonboltzmann.org/apbs/).
- 
- Documentation may be found at
-@@ -2267,7 +2280,8 @@
-             self.update_buttonbox = Pmw.ButtonBox(self.mm_group.interior(), padx=0)
-             self.update_buttonbox.pack(side=LEFT)
-             self.update_buttonbox.add('Update',command=self.refresh)
--            self.mm_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=TOP)
-+            #self.mm_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=TOP)
-+            self.mm_group.grid(padx = 4, pady = 5, sticky=(N, S, E, W))
- 
-             self.ms_group = Pmw.Group(self.interior(),tag_text='Molecular Surface')
-             self.ms_buttonbox = Pmw.ButtonBox(self.ms_group.interior(), padx=0)
-@@ -2317,8 +2331,9 @@
-                                             )
-             bars = (self.mol_surf_low,self.mol_surf_middle,self.mol_surf_high)
-             Pmw.alignlabels(bars)
--            for bar in bars: bar.pack(side=LEFT)
--            self.ms_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
-+            for bar in bars: bar.pack(expand = 1, side=LEFT)
-+            #self.ms_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
-+            self.ms_group.grid(column=0, row=1, padx = 4, pady = 5, rowspan = 2, sticky=(N, S, E, W))
- 
-             self.fl_group = Pmw.Group(self.interior(),tag_text='Field Lines')
-             self.fl_buttonbox = Pmw.ButtonBox(self.fl_group.interior(), padx=0)
-@@ -2333,11 +2348,13 @@
-                                   text = """Follows same coloring as surface.""",
-                                   )
-             label.pack()
--            self.fl_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=TOP)
-+            #self.fl_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=TOP)
-+            self.fl_group.grid(column = 1, row=0, padx = 4, pady = 5)
- 
-             self.pi_group = Pmw.Group(self.interior(),tag_text='Positive Isosurface')
-             self.pi_buttonbox = Pmw.ButtonBox(self.pi_group.interior(), padx=0)
--            self.pi_buttonbox.pack()
-+            #self.pi_buttonbox.pack()
-+            self.pi_buttonbox.grid()
-             self.pi_buttonbox.add('Show',command=self.showPosSurface)
-             self.pi_buttonbox.add('Hide',command=self.hidePosSurface)
-             self.pi_buttonbox.add('Update',command=self.updatePosSurface)
-@@ -2351,12 +2368,15 @@
-                                             datatype = 'real',
-                                             entryfield_validate = {'validator' : 'real', 'min':0}
-                                             )
--            self.pos_surf_val.pack(side=LEFT)
--            self.pi_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
-+            #self.pos_surf_val.pack(side=LEFT)
-+            self.pos_surf_val.grid()
-+            #self.pi_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
-+            self.pi_group.grid(column = 1, row = 1, padx = 4, pady = 5, sticky=(N, S, E, W))
- 
-             self.ni_group = Pmw.Group(self.interior(),tag_text='Negative Isosurface')
-             self.ni_buttonbox = Pmw.ButtonBox(self.ni_group.interior(), padx=0)
--            self.ni_buttonbox.pack()
-+            #self.ni_buttonbox.pack()
-+            self.ni_buttonbox.grid()
-             self.ni_buttonbox.add('Show',command=self.showNegSurface)
-             self.ni_buttonbox.add('Hide',command=self.hideNegSurface)
-             self.ni_buttonbox.add('Update',command=self.updateNegSurface)
-@@ -2370,8 +2390,10 @@
-                                             datatype = 'real',
-                                             entryfield_validate = {'validator' : 'real', 'max':0}
-                                             )
--            self.neg_surf_val.pack(side=LEFT)
--            self.ni_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
-+            #self.neg_surf_val.pack(side=LEFT)
-+            self.neg_surf_val.grid()
-+            #self.ni_group.pack(fill = 'both', expand = 1, padx = 4, pady = 5, side=LEFT)
-+            self.ni_group.grid(column = 1, row=2, padx = 4, pady = 5, sticky=(N, S, E, W))
- 
- 
- 

Modified: trunk/dports/science/pymol/files/pmg_tk_platform.patch
===================================================================
--- trunk/dports/science/pymol/files/pmg_tk_platform.patch	2014-12-13 20:40:58 UTC (rev 129474)
+++ trunk/dports/science/pymol/files/pmg_tk_platform.patch	2014-12-13 22:12:42 UTC (rev 129475)
@@ -1,6 +1,30 @@
---- modules/pmg_tk/skins/normal/__init__.py.orig
-+++ modules/pmg_tk/skins/normal/__init__.py
-@@ -236,7 +236,7 @@
+Index: modules/pmg_tk/PMGApp.py
+===================================================================
+--- modules/pmg_tk/PMGApp.py	(revision 4106)
++++ modules/pmg_tk/PMGApp.py	(working copy)
+@@ -210,7 +210,7 @@ class PMGApp(Pmw.MegaWidget):
+         self.fifo.put(cmmd)
+ 
+     def my_show(self,win,center=1):
+-        if sys.platform!='linux2':
++        if (sys.platform!='linux2') and (sys.platform!='darwin'):
+             win.show()
+         else: # autocenter, deiconify, and run mainloop
+             # this is a workaround for a bug in the
+@@ -228,7 +228,7 @@ class PMGApp(Pmw.MegaWidget):
+             win.deiconify()
+ 
+     def my_withdraw(self,win):
+-        if sys.platform!='linux2':
++        if (sys.platform!='linux2') or (sys.platform!='darwin'):
+             win.withdraw()
+         else: 
+             win.destroy()
+Index: modules/pmg_tk/skins/normal/__init__.py
+===================================================================
+--- modules/pmg_tk/skins/normal/__init__.py	(revision 4106)
++++ modules/pmg_tk/skins/normal/__init__.py	(working copy)
+@@ -271,7 +271,7 @@ class Normal(PMGSkin):
          self.buttonArea.destroy()
  
      def my_show(self,win,center=1):
@@ -9,7 +33,7 @@
              win.show()
          else: # autocenter, deiconify, and run mainloop
              # this is a workaround for a bug in the
-@@ -255,13 +255,13 @@
+@@ -290,13 +290,13 @@ class Normal(PMGSkin):
  #         win.show()
              
      def my_withdraw(self,win):
@@ -25,7 +49,7 @@
              win.activate()
          else: # autocenter, deiconify, and run mainloop
              # this is a workaround for a bug in the
-@@ -282,7 +282,7 @@
+@@ -317,7 +317,7 @@ class Normal(PMGSkin):
              win.mainloop()
              
      def my_deactivate(self,win):
@@ -34,23 +58,3 @@
              win.deactivate()
          else: # autocenter, deiconify, and run mainloop
              win.destroy()
---- modules/pmg_tk/PMGApp.py.orig
-+++ modules/pmg_tk/PMGApp.py
-@@ -184,7 +184,7 @@
-         self.fifo.put(cmmd)
- 
-     def my_show(self,win,center=1):
--        if sys.platform!='linux2':
-+        if (sys.platform!='linux2') and (sys.platform!='darwin'):
-             win.show()
-         else: # autocenter, deiconify, and run mainloop
-             # this is a workaround for a bug in the
-@@ -202,7 +202,7 @@
-             win.deiconify()
- 
-     def my_withdraw(self,win):
--        if sys.platform!='linux2':
-+        if (sys.platform!='linux2') or (sys.platform!='darwin'):
-             win.withdraw()
-         else: 
-             win.destroy()

Modified: trunk/dports/science/pymol/files/pymol-clang.diff
===================================================================
--- trunk/dports/science/pymol/files/pymol-clang.diff	2014-12-13 20:40:58 UTC (rev 129474)
+++ trunk/dports/science/pymol/files/pymol-clang.diff	2014-12-13 22:12:42 UTC (rev 129475)
@@ -1,815 +1,113 @@
-Index: layer0/ShaderMgr.c
+Index: layer0/ShaderMgr.cpp
 ===================================================================
---- layer0/ShaderMgr.c	(revision 4074)
-+++ layer0/ShaderMgr.c	(working copy)
-@@ -151,7 +151,7 @@
-     while (replaceStrings[i]){
-       slen = strlen(replaceStrings[i]);
-       rlen = strlen(replaceStrings[i+1]);
--      while(rstr=strstr(dest_line, replaceStrings[i])){
-+      while((rstr=strstr(dest_line, replaceStrings[i]))){
- 	strcpy(tmp_line, rstr + slen);
- 	strcpy(rstr, replaceStrings[i+1]);
- 	strcpy(rstr+rlen, tmp_line);
-@@ -499,15 +499,15 @@
-   if (I){
-     GLenum err ;
-     glBindAttribLocation(I->id, VERTEX_POS, "a_Vertex");
--    if (err = glGetError()){
-+    if ((err = glGetError())){
-       PRINTFB(G, FB_ShaderMgr, FB_Warnings) "GLERROR: a_Vertex: %d\n", err ENDFB(G);
-     }
-     glBindAttribLocation(I->id, VERTEX_NORMAL, "a_Normal");
--    if (err = glGetError()){
-+    if ((err = glGetError())){
-       PRINTFB(G, FB_ShaderMgr, FB_Warnings) "GLERROR: a_Normal: %d\n", err ENDFB(G);
-     }
-     glBindAttribLocation(I->id, VERTEX_COLOR, "a_Color");
--    if (err = glGetError()){
-+    if ((err = glGetError())){
-       PRINTFB(G, FB_ShaderMgr, FB_Warnings) "GLERROR: a_Color: %d\n", err ENDFB(G);
-     }
-     CShaderPrg_Link(I);
-@@ -538,19 +538,19 @@
-   if (I){
-     GLenum err ;
-     glBindAttribLocation(I->id, CYLINDER_ORIGIN, "attr_origin");
--    if (err = glGetError()){
-+    if ((err = glGetError())){
-       PRINTFB(G, FB_ShaderMgr, FB_Warnings) "GLERROR: attr_origin: %d\n", err ENDFB(G);
-     }
-     glBindAttribLocation(I->id, CYLINDER_AXIS, "attr_axis");
--    if (err = glGetError()){
-+    if ((err = glGetError())){
-       PRINTFB(G, FB_ShaderMgr, FB_Warnings) "GLERROR: attr_axis: %d\n", err ENDFB(G);
-     }
-     glBindAttribLocation(I->id, CYLINDER_COLOR, "attr_color");
--    if (err = glGetError()){
-+    if ((err = glGetError())){
-       PRINTFB(G, FB_ShaderMgr, FB_Warnings) "GLERROR: attr_color: %d\n", err ENDFB(G);
-     }
-     glBindAttribLocation(I->id, CYLINDER_COLOR2, "attr_color2");
--    if (err = glGetError()){
-+    if ((err = glGetError())){
-       PRINTFB(G, FB_ShaderMgr, FB_Warnings) "GLERROR: attr_color2: %d\n", err ENDFB(G);
-     }
-     CShaderPrg_Link(I);	  
-@@ -873,11 +873,11 @@
-     if (indicatorShader){
-       GLenum err ;
-       glBindAttribLocation(indicatorShader->id, VERTEX_POS, "a_Vertex");
--      if (err = glGetError()){
-+      if ((err = glGetError())){
- 	PRINTFB(G, FB_ShaderMgr, FB_Warnings) "GLERROR: a_Vertex: %d\n", err ENDFB(G);
-       }
-       glBindAttribLocation(indicatorShader->id, VERTEX_COLOR, "a_Color");
--      if (err = glGetError()){
-+      if ((err = glGetError())){
- 	PRINTFB(G, FB_ShaderMgr, FB_Warnings) "GLERROR: a_Color: %d\n", err ENDFB(G);
-       }
-       CShaderPrg_Link(indicatorShader);	
-Index: layer0/Map.c
-===================================================================
---- layer0/Map.c	(revision 4074)
-+++ layer0/Map.c	(working copy)
-@@ -588,7 +588,7 @@
-   register int *link = I->Link;
-   register int st, flag;
-   register int *i_ptr3, *i_ptr4, *i_ptr5;
--  register int *e_list;
-+  register int *e_list = NULL;
- #ifdef _MemoryCache_ON
-   register int block_offset = I->block_base + cCache_map_elist_offset;
-   register int group_id = I->group_id;
-Index: layer1/Basis.c
-===================================================================
---- layer1/Basis.c	(revision 4074)
-+++ layer1/Basis.c	(working copy)
-@@ -2868,11 +2868,11 @@
-   float ll;
-   CPrimitive *prm;
-   register int i;
--  register int *tempRef;
--  int n, h, q, x, y, z, j, k, l, e;
-+  register int *tempRef = NULL;
-+  int n = 0, h, q, x, y, z, j, k, l, e;
-   int extra_vert = 0;
-   float p[3], dd[3], *d1, *d2, vd[3], cx[3], cy[3];
--  float *tempVertex;
-+  float *tempVertex = NULL;
-   float xs, ys;
-   int remapMode = true;         /* remap mode means that some objects will span more
-                                  * than one voxel, so we have to worry about populating
-Index: layer1/CGO.c
-===================================================================
---- layer1/CGO.c	(revision 4074)
-+++ layer1/CGO.c	(working copy)
-@@ -47,7 +47,7 @@
- #define CLIP_NORMAL_VALUE(cv)  ((cv>1.f) ? 127 :  (cv < -1.f) ? -128 : pymol_roundf(((cv + 1.f)/2.f) * 255) - 128 )
+--- layer0/ShaderMgr.cpp	(revision 4107)
++++ layer0/ShaderMgr.cpp	(working copy)
+@@ -665,7 +665,7 @@ void CShaderPrg_Update_Shaders_For_Backg
+ }
  
- #define CHECK_GL_ERROR_OK(printstr)	\
--  if (err = glGetError()){    \
-+  if ((err = glGetError())){    \
-      PRINTFB(I->G, FB_CGO, FB_Errors) printstr, err ENDFB(I->G);	   \
-   }
- 
-@@ -2310,7 +2310,7 @@
-   *num_total_vertices = 0;
-   *num_total_indexes = 0;
- 
--  while(op = (CGO_MASK & CGO_read_int(pc))) {
-+  while((op = (CGO_MASK & CGO_read_int(pc)))) {
-     save_pc = pc;
-     err = 0;
-     switch (op) {
-@@ -4368,7 +4368,7 @@
-     GL_C_INT_TYPE *indexVals = 0;
-     int tot = 4 * 4 * 3 * num_total_cylinders;
-     short copyToLeftOver, copyColorToLeftOver, copyPickColorToLeftOver, copyAlphaToLeftOver, copyToReturnCGO ;
--    float *org_originVals;
-+    float *org_originVals= NULL;
-     float *org_axisVals;
-     float *org_colorVals;
-     float *org_color2Vals = NULL;
-@@ -7135,7 +7135,7 @@
-   int  texture_id = CGO_get_int(*pc);
-   float worldPos[4], screenMin[3], screenMax[3], textExtent[4];
-   CShaderPrg * shaderPrg;
--  int buf1, buf2, attr_worldpos, attr_screenoffset, attr_texcoords;
-+  int buf1 = 0, buf2 = 0, attr_worldpos, attr_screenoffset, attr_texcoords;
-   copy3f(*pc, worldPos);  worldPos[3] = 1.f;
-   copy3f(*pc+3, screenMin);
-   copy3f(*pc+6, screenMax);
-@@ -7176,7 +7176,7 @@
-   int  texture_id = CGO_get_int(*pc);
-   float worldPos[4], screenMin[3], screenMax[3], textExtent[4];
-   CShaderPrg * shaderPrg;
--  int buf1, buf2, attr_worldpos, attr_screenoffset, attr_texcoords;
-+  int buf1 = 0, buf2 = 0, attr_worldpos, attr_screenoffset, attr_texcoords;
-   copy3f(*pc, worldPos);  worldPos[3] = 1.f;
-   copy3f(*pc+3, screenMin);
-   copy3f(*pc+6, screenMax);
-@@ -9564,7 +9564,7 @@
- int CGOChangeShadersTo(CGO *I, int frommode, int tomode){
-   register float *pc = I->op;
-   int op = 0, totops = 0;
--  while(op = (CGO_MASK & CGO_read_int(pc))) {
-+  while((op = (CGO_MASK & CGO_read_int(pc)))) {
-     totops++;
-     switch (op) {
-     case CGO_ENABLE:
-Index: layer1/Ortho.c
+ int CShaderPrg_Reload(PyMOLGlobals * G, char *name, char *v, char *f){
+-  int status, howLong, needAttach = 0;
++  int status, howLong;
+   CShaderPrg * I = CShaderMgr_GetShaderPrg_NoSet(G->ShaderMgr, name);
+   if (!I){
+     CShaderMgr *SM = G->ShaderMgr;
+Index: layer0/Sphere.cpp
 ===================================================================
---- layer1/Ortho.c	(revision 4074)
-+++ layer1/Ortho.c	(working copy)
-@@ -1020,7 +1020,7 @@
-         curLine = I->CurLine & OrthoSaveLines;
-         if(I->PromptChar) {
-           strcpy(buffer, I->Line[curLine]);
--          if(PComplete(G, buffer + I->PromptChar, sizeof(OrthoLineType) - I->PromptChar));      /* just print, don't complete */
-+          PComplete(G, buffer + I->PromptChar, sizeof(OrthoLineType) - I->PromptChar);      /* just print, don't complete */
-         }
-       }
-       break;
-@@ -1400,7 +1400,7 @@
+--- layer0/Sphere.cpp	(revision 4107)
++++ layer0/Sphere.cpp	(working copy)
+@@ -32,6 +32,9 @@ Z* -------------------------------------
+ #define tau 0.8506508084F       /* t=(1+sqrt(5))/2, tau=t/sqrt(1+t^2)  */
+ #define one 0.5257311121F       /* one=1/sqrt(1+t^2) , unit sphere     */
  
-   {
-     if (!I->bgCGO) {
--      CGO *cgo = CGONew(G), *cgo2;
-+      CGO *cgo = CGONew(G), *cgo2 = NULL;
-       ok &= CGOBegin(cgo, GL_TRIANGLE_STRIP);
-       if (ok)
- 	ok &= CGOVertex(cgo, -1.f, -1.f, 0.98f);
-Index: layer1/P.c
-===================================================================
---- layer1/P.c	(revision 4074)
-+++ layer1/P.c	(working copy)
-@@ -1464,7 +1464,7 @@
- void PUnlockAPIAsGlut(PyMOLGlobals * G)
- {                               /* must call with unblocked interpreter */
-   PRINTFD(G, FB_Threads)
--    " PUnlockAPIAsGlut-DEBUG: entered as thread 0x%x\n", PyThread_get_thread_ident()
-+    " PUnlockAPIAsGlut-DEBUG: entered as thread 0x%lx\n", PyThread_get_thread_ident()
-     ENDFD;
-   PBlock(G);
-   PXDecRef(PyObject_CallFunction(G->P_inst->unlock, "iO", 0, G->P_inst->cmd));  /* NOTE this may flush the command buffer! */
-@@ -1478,7 +1478,7 @@
- void PUnlockAPIAsGlutNoFlush(PyMOLGlobals * G)
- {                               /* must call with unblocked interpreter */
-   PRINTFD(G, FB_Threads)
--    " PUnlockAPIAsGlut-DEBUG: entered as thread 0x%x\n", PyThread_get_thread_ident()
-+    " PUnlockAPIAsGlut-DEBUG: entered as thread 0x%lx\n", PyThread_get_thread_ident()
-     ENDFD;
-   PBlock(G);
-   PXDecRef(PyObject_CallFunction(G->P_inst->unlock, "iO", -1, G->P_inst->cmd)); /* prevents flushing of the buffer */
-@@ -1529,7 +1529,7 @@
- int PLockAPIAsGlut(PyMOLGlobals * G, int block_if_busy)
- {
-   PRINTFD(G, FB_Threads)
--    "*PLockAPIAsGlut-DEBUG: entered as thread 0x%x\n", PyThread_get_thread_ident()
-+    "*PLockAPIAsGlut-DEBUG: entered as thread 0x%lx\n", PyThread_get_thread_ident()
-     ENDFD;
++#define FAST_SPHERE_INIT
++
++#ifndef FAST_SPHERE_INIT
+ static const float start_points[13][3] = {
+   {tau, one, 0},
+   {-tau, one, 0},
+@@ -69,6 +72,7 @@ static const int icosahedron[21][3] = {
+   {7, 2, 9},
+   {6, 10, 2}
+ };
++#endif
  
-   PBlock(G);
-@@ -1541,7 +1541,7 @@
-   PUnlockStatus(G);
+ static const int mesh[30][2] = {
+   {0, 3},
+@@ -103,8 +107,6 @@ static const int mesh[30][2] = {
+   {9, 10}
+ };
  
-   PRINTFD(G, FB_Threads)
--    "#PLockAPIAsGlut-DEBUG: acquiring lock as thread 0x%x\n", PyThread_get_thread_ident()
-+    "#PLockAPIAsGlut-DEBUG: acquiring lock as thread 0x%lx\n", PyThread_get_thread_ident()
-     ENDFD;
+-#define FAST_SPHERE_INIT
+-
+ #ifdef FAST_SPHERE_INIT
+ #include"SphereData.h"
  
-   if(!get_api_lock(G, block_if_busy)) {
-@@ -1559,7 +1559,7 @@
-        holding the API lock, therefore it is safe even through increment
-        isn't atomic. */
-     PRINTFD(G, FB_Threads)
--      "-PLockAPIAsGlut-DEBUG: glut_thread_keep_out 0x%x\n", PyThread_get_thread_ident()
-+      "-PLockAPIAsGlut-DEBUG: glut_thread_keep_out 0x%lx\n", PyThread_get_thread_ident()
-       ENDFD;
- 
-     PXDecRef(PyObject_CallFunction(G->P_inst->unlock, "iO", -1, G->P_inst->cmd));       /* prevent buffer flushing */
-@@ -2632,7 +2632,7 @@
-       /* don't run if we're currently banned */
-       char *buffer = 0;
-       int size, curSize = 0;
--      while(size = OrthoCommandOutSize(G)){
-+      while((size = OrthoCommandOutSize(G))){
- 	if (!curSize){
- 	  buffer = VLACalloc(char, size);
- 	  curSize = size;
-@@ -2676,7 +2676,7 @@
-   int did_work = false;
-   char *buffer = 0;
-   int size, curSize = 0;
--  while(size = OrthoCommandOutSize(G)){
-+  while((size = OrthoCommandOutSize(G))){
-     if (!curSize){
-       buffer = VLACalloc(char, size);
-       curSize = size;
-@@ -2688,7 +2688,7 @@
-     OrthoCommandNest(G, 1);
-     did_work = true;
-     PRINTFD(G, FB_Threads)
--      " PFlushFast-DEBUG: executing '%s' as thread 0x%x\n", buffer,
-+      " PFlushFast-DEBUG: executing '%s' as thread 0x%lx\n", buffer,
-       PyThread_get_thread_ident()
-       ENDFD;
-     if(PyErr_Occurred()) {
-@@ -2784,7 +2784,7 @@
-       PXDecRef(PyObject_CallFunction(G->P_inst->unlock_c, "O", G->P_inst->cmd));
- 
-       PRINTFD(G, FB_Threads)
--        " PAutoBlock-DEBUG: blocked 0x%x (0x%x, 0x%x, 0x%x)\n",
-+        " PAutoBlock-DEBUG: blocked 0x%lx (0x%x, 0x%x, 0x%x)\n",
-         PyThread_get_thread_ident(), SavedThread[MAX_SAVED_THREAD - 1].id,
-         SavedThread[MAX_SAVED_THREAD - 2].id, SavedThread[MAX_SAVED_THREAD - 3].id ENDFD;
- 
-@@ -2793,7 +2793,7 @@
-     a--;
-   }
-   PRINTFD(G, FB_Threads)
--    " PAutoBlock-DEBUG: 0x%x not found, thus already blocked.\n",
-+    " PAutoBlock-DEBUG: 0x%lx not found, thus already blocked.\n",
-     PyThread_get_thread_ident()
-     ENDFD;
-   return 0;
-@@ -2814,7 +2814,7 @@
-   SavedThreadRec *SavedThread = G->P_inst->savedThread;
-   /* NOTE: ASSUMES a locked API */
-   PRINTFD(G, FB_Threads)
--    " PUnblock-DEBUG: entered as thread 0x%x\n", PyThread_get_thread_ident()
-+    " PUnblock-DEBUG: entered as thread 0x%lx\n", PyThread_get_thread_ident()
-     ENDFD;
- 
-   /* reserve a space while we have a lock */
-Index: layer1/Extrude.c
+Index: layer2/RepNonbonded.cpp
 ===================================================================
---- layer1/Extrude.c	(revision 4074)
-+++ layer1/Extrude.c	(working copy)
-@@ -687,7 +687,7 @@
-   float *v;
-   float *n;
-   float *c;
--  float *sv, *sn, *tv, *tn, *tv1, *tn1, *TV, *TN;
-+  float *sv, *sn, *tv, *tn, *tv1, *tn1, *TV, *TN = NULL;
-   float v0[3];
-   int start, stop;
+--- layer2/RepNonbonded.cpp	(revision 4107)
++++ layer2/RepNonbonded.cpp	(working copy)
+@@ -199,7 +199,7 @@ static void RepNonbondedRender(RepNonbon
    int ok = true;
-@@ -1387,7 +1387,7 @@
-   float *v;
-   float *n;
-   float *c;
--  float *sv, *sn, *tv, *tn, *tv1, *tn1, *TV, *TN;
-+  float *sv, *sn, *tv, *tn, *tv1, *tn1, *TV, *TN = NULL;
-   float v0[3];
-   int ok = true;
+   // 0.018f is found by trial and error
+   // TODO: this is not sufficient to solve the problem of disappearing cylinders
+-  float scale_bound = SettingGetGlobal_f(G, cSetting_field_of_view)  * cPI / 180.0f * 0.018f;
++  // float scale_bound = SettingGetGlobal_f(G, cSetting_field_of_view)  * cPI / 180.0f * 0.018f;
  
-@@ -1705,7 +1705,7 @@
-   float *v;
-   float *n;
-   float *c;
--  float *sv, *sn, *tv, *tn, *tv1, *tn1, *TV, *TN;
-+  float *sv, *sn, *tv, *tn, *tv1, *tn1, *TV, *TN = NULL;
-   float v0[3], n0[3], s0[3], z[3] = { 1.0, 0.0, 1.0 };
-   int subN;
-   int ok = true;
-Index: layer1/Scene.c
-===================================================================
---- layer1/Scene.c	(revision 4074)
-+++ layer1/Scene.c	(working copy)
-@@ -7623,7 +7623,7 @@
-       /* update all gadgets first (single-threaded since they're thread-unsafe) */
-       rec = NULL;
-       while(ListIterate(I->Obj, rec, next)) {
--        if((rec->obj->type == cObjectGadget)) {
-+        if(rec->obj->type == cObjectGadget) {
-           if(rec->obj->fUpdate)
-             rec->obj->fUpdate(rec->obj);
-         }
-Index: layer1/Control.c
-===================================================================
---- layer1/Control.c	(revision 4074)
-+++ layer1/Control.c	(working copy)
-@@ -637,7 +637,7 @@
-       but_bottom = y - (cControlBoxSize - 1);
-       but_height = cControlBoxSize;
+   alpha =
+     SettingGet_f(G, I->R.cs->Setting, I->R.obj->Setting, cSetting_nonbonded_transparency);
+@@ -208,7 +208,6 @@ static void RepNonbondedRender(RepNonbon
+     alpha = 1.0F;
+   if(ray) {
+     float radius;
+-    float pixel_radius = ray->PixelRadius;
+     ray->transparentf(1.0F - alpha);
  
--      if((but_num == I->Active)) {
-+      if(but_num == I->Active) {
-         draw_button(but_left, but_bottom,
-                     but_width, but_height, lightEdge, darkEdge, pushed ORTHOCGOARGVAR);
-       } else if(((but_num == 6) && (SettingGetGlobal_b(G, cSetting_seq_view))) ||
-Index: layer2/RepSphere.c
+     if(I->Radius == 0.0F) {
+@@ -360,7 +359,6 @@ static void RepNonbondedRender(RepNonbon
+ 	  CShaderPrg *shaderPrg;
+ 	  if (nonbonded_as_cylinders){
+ 	    // vertex scale is bound so that cylinders cannot disappear when it gets too low
+-	    float vertex_scale = info->vertex_scale;
+ 	    float pixel_scale_value = SettingGetGlobal_f(G, cSetting_ray_pixel_scale);
+ 	    if(pixel_scale_value < 0)
+ 	      pixel_scale_value = 1.0F;
+@@ -596,7 +594,6 @@ static void RepNonbondedRender(RepNonbon
+ 	  CShaderPrg *shaderPrg;
+ 	  if (nonbonded_as_cylinders){
+ 	    // vertex scale is bound so that cylinders cannot disappear when it gets too low
+-	    float vertex_scale = info->vertex_scale;
+ 	    float pixel_scale_value = SettingGetGlobal_f(G, cSetting_ray_pixel_scale);
+ 	    if(pixel_scale_value < 0)
+ 	      pixel_scale_value = 1.0F;
+Index: layer2/RepWireBond.cpp
 ===================================================================
---- layer2/RepSphere.c	(revision 4074)
-+++ layer2/RepSphere.c	(working copy)
-@@ -2204,8 +2204,8 @@
-   int c = I->N;
-   SphereRec *sp = I->SP;
-   float alpha;
--  int n_quad_verts;
--  float radius;
-+  int n_quad_verts = 0;
-+  float radius = 0.0;
-   int ok = true;
-   short use_shader = SettingGetGlobal_b(G, cSetting_sphere_use_shader) & 
-                      SettingGetGlobal_b(G, cSetting_use_shaders);
-Index: layer2/ObjectMolecule2.c
+--- layer2/RepWireBond.cpp	(revision 4107)
++++ layer2/RepWireBond.cpp	(working copy)
+@@ -779,7 +779,6 @@ static void RepWireBondRender(RepWireBon
+ 	  CShaderPrg *shaderPrg;
+ 	  if (line_as_cylinders){
+ 	    // vertex scale is bound so that cylinders cannot disappear when it gets too low
+-	    float vertex_scale = info->vertex_scale;
+ 	    float pixel_scale_value = SettingGetGlobal_f(G, cSetting_ray_pixel_scale);
+ 	    if(pixel_scale_value < 0)
+ 	      pixel_scale_value = 1.0F;
+@@ -973,7 +972,6 @@ static void RepWireBondRender(RepWireBon
+ 	  CShaderPrg *shaderPrg;
+ 	  if (line_as_cylinders){
+ 	    // vertex scale is bound so that cylinders cannot disappear when it gets too low
+-	    float vertex_scale = info->vertex_scale;
+ 	    float pixel_scale_value = SettingGetGlobal_f(G, cSetting_ray_pixel_scale);
+ 	    if(pixel_scale_value < 0)
+ 	      pixel_scale_value = 1.0F;
+Index: layer3/Executive.cpp
 ===================================================================
---- layer2/ObjectMolecule2.c	(revision 4074)
-+++ layer2/ObjectMolecule2.c	(working copy)
-@@ -3678,7 +3678,7 @@
- #else
-   int ok = true;
-   ObjectMolecule *I = NULL;
--  int discrete_flag;
-+  int discrete_flag = 0;
-   int ll;
-   (*result) = NULL;
+--- layer3/Executive.cpp	(revision 4107)
++++ layer3/Executive.cpp	(working copy)
+@@ -13978,7 +13978,6 @@ void ExecutiveFullScreen(PyMOLGlobals * 
  
-@@ -4305,7 +4305,7 @@
-   register int a, b;
-   CoordSet *cs, **dcs;
-   AtomInfoType *atInfo;
--  int *dAtmToIdx;
-+  int *dAtmToIdx = NULL;
-   int ok = true;
-   if(!I->DiscreteFlag) {        /* currently, discrete objects are never sorted */
-     int n_bytes = sizeof(int) * I->NAtom;
-Index: layer2/RepDot.c
-===================================================================
---- layer2/RepDot.c	(revision 4074)
-+++ layer2/RepDot.c	(working copy)
-@@ -192,7 +192,7 @@
- 	      ok &= CGOColorv(cgo, v);
- 	      v += 3;
- 	    }
--           /*      if(normals)  /* NORMALS do not get set for points 
-+           /*      if(normals)  NORMALS do not get set for points 
-                    CGONormalv(cgo, v);*/
- 	    v += 3;
- 	    if (ok)
-@@ -210,7 +210,7 @@
- 	    I->shaderCGO = CGOOptimizeSpheresToVBONonIndexed(cgo, CGO_BOUNDING_BOX_SZ + CGO_DRAW_SPHERE_BUFFERS_SZ);
- 	    CHECKOK(ok, I->shaderCGO);
- 	  } else {
--	    CGO *convertcgo = CGOCombineBeginEnd(cgo, 0), *tmpCGO;
-+	    CGO *convertcgo = CGOCombineBeginEnd(cgo, 0), *tmpCGO = NULL;
- 	    CHECKOK(ok, convertcgo);
- 	    if (ok)
- 	      tmpCGO = CGOOptimizeToVBONotIndexed(convertcgo, CGO_BOUNDING_BOX_SZ + I->N * 3 + 7);
-@@ -344,7 +344,7 @@
-   float *countPtr = NULL;
-   int colorCnt, lastColor;
-   Vector3f v1;
--  MapType *map;
-+  MapType *map = NULL;
-   SphereRec *sp = G->Sphere->Sphere[0];
-   int ds;
-   float max_vdw = MAX_VDW;
-Index: layer2/RepSurface.c
-===================================================================
---- layer2/RepSurface.c	(revision 4074)
-+++ layer2/RepSurface.c	(working copy)
-@@ -3304,7 +3304,7 @@
- 	    if (ok)
- 	      convertcgo->use_shader = true;
- 	  } else if (I->Type == 2) {
--	    CGO *convertcgo2, *simple;
-+	    CGO *convertcgo2, *simple = NULL;
- 	    convertcgo2 = CGOConvertLinesToShaderCylinders(I->shaderCGO, 0);
- 	    CHECKOK(ok, convertcgo2);
- 	    if (ok)
-@@ -4503,7 +4503,7 @@
-         }
- 	ok &= !G->Interrupt;
-         if(ok) {
--          MapType *map, *solv_map;
-+          MapType *map, *solv_map = NULL;
-           map = MapNewFlagged(G, I->maxVdw + probe_rad_more,
-                               I->coord, VLAGetSize(I->coord) / 3, NULL, NULL);
- 	  CHECKOK(ok, map);
-@@ -5747,7 +5747,7 @@
-                 SurfaceJobAtomInfo *j_atom_info = atom_info + j;
-                 if(j > a)       /* only check if this is atom trails */
-                   if((!present) || present[j]) {
--                    if((j_atom_info->vdw == a_atom_info->vdw)) {        /* handle singularities */
-+                    if(j_atom_info->vdw == a_atom_info->vdw) {        /* handle singularities */
-                       float *v1 = coord + 3 * j;
-                       if((v0[0] == v1[0]) && (v0[1] == v1[1]) && (v0[2] == v1[2]))
-                         skip_flag = true;
-@@ -5842,7 +5842,7 @@
-                   SurfaceJobAtomInfo *j_atom_info = atom_info + j;
-                   if(j > a)     /* only check if this is atom trails */
-                     if((!present) || present[j]) {
--                      if((j_atom_info->vdw == a_atom_info->vdw)) {      /* handle singularities */
-+                      if(j_atom_info->vdw == a_atom_info->vdw) {      /* handle singularities */
-                         float *v2 = coord + 3 * j;
-                         if((v0[0] == v2[0]) && (v0[1] == v2[1]) && (v0[2] == v2[2]))
-                           skip_flag = true;
-@@ -6002,7 +6002,7 @@
-                   SurfaceJobAtomInfo *j_atom_info = atom_info + j;
-                   if(j > a)       /* only check if this is atom trails */
-                     if((!present) || present[j]) {
--                      if((j_atom_info->vdw == a_atom_info->vdw)) {        /* handle singularities */
-+                      if(j_atom_info->vdw == a_atom_info->vdw) {        /* handle singularities */
-                         float *v1 = coord + 3 * j;
-                         if((v0[0] == v1[0]) && (v0[1] == v1[1]) && (v0[2] == v1[2]))
-                           skip_flag = true;
-Index: layer2/RepCartoon.c
-===================================================================
---- layer2/RepCartoon.c	(revision 4074)
-+++ layer2/RepCartoon.c	(working copy)
-@@ -2615,7 +2615,7 @@
- 
- #ifdef _PYMOL_CGO_DRAWARRAYS
- 	int nverts = nAt * 4, pl = 0;
--	float *vertexVals, *tmp_ptr;
-+	float *vertexVals = NULL, *tmp_ptr;
- 	if (ok)
- 	  vertexVals = CGODrawArrays(cgo, GL_LINES, CGO_VERTEX_ARRAY, nverts);      
- 	CHECKOK(ok, vertexVals);
-Index: layer2/ObjectMolecule.c
-===================================================================
---- layer2/ObjectMolecule.c	(revision 4074)
-+++ layer2/ObjectMolecule.c	(working copy)
-@@ -1448,7 +1448,7 @@
-   int NPHIH, MPHIA, NHPARM, NPARM, NNB, NRES;
-   int NBONA, NTHETA, NPHIA, NUMBND, NUMANG, NPTRA;
-   int NATYP, NPHB, IFPERT, NBPER, NGPER, NDPER;
--  int MBPER, MGPER, MDPER, IFBOX, NMXRS, IFCAP;
-+  int MBPER, MGPER, MDPER, IFBOX = 0, NMXRS, IFCAP;
-   int NEXTRA, IPOL = 0;
-   int wid, col;
-   float BETA;
-@@ -2076,7 +2076,7 @@
- 
-     if(IFBOX > 0) {
- 
--      int IPTRES, NSPM, NSPSOL;
-+      int IPTRES, NSPM = 0, NSPSOL;
- 
-       if(amber7) {
-         p = findflag(G, buffer, "SOLVENT_POINTERS", "3I8");
-@@ -4431,7 +4431,7 @@
-   AtomInfoType *ai;
-   int n, nn;
-   float v[3], v0[3], d;
--  CoordSet *cs;
-+  CoordSet *cs = NULL;
-   int ok = true;
- 
-   ok &= ObjectMoleculeUpdateNeighbors(I);
-@@ -9767,7 +9767,7 @@
- 			CoordSet * cs, int bondSearchFlag, int aic_mask, int invalidate)
- {
-   PyMOLGlobals *G = I->Obj.G;
--  int *index, *outdex, *a2i, *i2a;
-+  int *index, *outdex, *a2i, *i2a = NULL;
-   BondType *bond = NULL;
-   register int a, b, lb = 0, ac;
-   int c, nb, a1, a2;
-@@ -10551,7 +10551,7 @@
-                 rms = MatrixFitRMSTTTf(G, op->nvv1, op->vv1, vt, NULL, op->ttt);
-               else
-                 rms = MatrixGetRMS(G, op->nvv1, op->vv1, vt, NULL);
--              if((op->i1 == 2)) {
-+              if(op->i1 == 2) {
-                 ObjectMoleculeTransformTTTf(I, op->ttt, b);
- 
-                 if(op->i3) {
-Index: layer3/Selector.c
-===================================================================
---- layer3/Selector.c	(revision 4074)
-+++ layer3/Selector.c	(working copy)
-@@ -8658,11 +8658,11 @@
-     for(a = cNDummyAtoms; a < I->NAtom; a++) {
-       b = i_obj[i_table[a].model]->AtomInfo[i_table[a].atom].protons;
-       base[0].sele[a] = (
--          b >  2 && b <  5 ||
--          b > 10 && b < 14 ||
--          b > 18 && b < 32 ||
--          b > 36 && b < 51 ||
--          b > 54 && b < 85 ||
-+          (b >  2 && b <  5) ||
-+          (b > 10 && b < 14) ||
-+          (b > 18 && b < 32) ||
-+          (b > 36 && b < 51) ||
-+          (b > 54 && b < 85) ||
-           b > 86);
-     }
-     break;
-Index: layer3/Executive.c
-===================================================================
---- layer3/Executive.c	(revision 4074)
-+++ layer3/Executive.c	(working copy)
-@@ -15928,7 +15928,7 @@
-                           ExecutiveSpecSetVisibility(G, rec, true, mod, false);
-                           I->LastChanged = rec;
-                         }
--                        if((mod == (cOrthoSHIFT | cOrthoCTRL))) {
-+                        if(mod == (cOrthoSHIFT | cOrthoCTRL)) {
-                           if(rec != I->LastZoomed)
-                             ExecutiveWindowZoom(G, rec->name, 0.0F, -1, false, -1.0F,
-                                                 true);
-Index: layer3/PlugIOManager.c
-===================================================================
---- layer3/PlugIOManager.c	(revision 4074)
-+++ layer3/PlugIOManager.c	(working copy)
-@@ -229,7 +229,7 @@
-                       ENDFB(G);
-                   }
- 
--                  if(stop > 0 && cnt >= stop || max > 0 && ncnt >= max) {
-+                  if((stop > 0 && cnt >= stop) || (max > 0 && ncnt >= max)) {
-                     cs = NULL;
-                     break;
-                   }
-Index: layer4/Cmd.c
-===================================================================
---- layer4/Cmd.c	(revision 4074)
-+++ layer4/Cmd.c	(working copy)
-@@ -128,7 +128,7 @@
- static void APIEnter(PyMOLGlobals * G)
- {                               /* assumes API is locked */
-   PRINTFD(G, FB_API)
--    " APIEnter-DEBUG: as thread 0x%x.\n", PyThread_get_thread_ident()
-+    " APIEnter-DEBUG: as thread 0x%lx.\n", PyThread_get_thread_ident()
-     ENDFD;
- 
-   if(G->Terminating) {          /* try to bail */
-@@ -163,7 +163,7 @@
- {                               /* assumes API is locked */
- 
-   PRINTFD(G, FB_API)
--    " APIEnterBlocked-DEBUG: as thread 0x%x.\n", PyThread_get_thread_ident()
-+    " APIEnterBlocked-DEBUG: as thread 0x%lx.\n", PyThread_get_thread_ident()
-     ENDFD;
- 
-   if(G->Terminating) {          /* try to bail */
-@@ -199,7 +199,7 @@
-   if(!PIsGlutThread())
-     G->P_inst->glut_thread_keep_out--;
-   PRINTFD(G, FB_API)
--    " APIExit-DEBUG: as thread 0x%x.\n", PyThread_get_thread_ident()
-+    " APIExit-DEBUG: as thread 0x%lx.\n", PyThread_get_thread_ident()
-     ENDFD;
- }
- 
-@@ -209,7 +209,7 @@
-   if(!PIsGlutThread())
-     G->P_inst->glut_thread_keep_out--;
-   PRINTFD(G, FB_API)
--    " APIExitBlocked-DEBUG: as thread 0x%x.\n", PyThread_get_thread_ident()
-+    " APIExitBlocked-DEBUG: as thread 0x%lx.\n", PyThread_get_thread_ident()
-     ENDFD;
- }
- 
-@@ -1853,7 +1853,7 @@
- static PyObject *CmdGetRenderer(PyObject * self, PyObject * args)
- {
-   PyMOLGlobals *G = NULL;
--  char *vendor, *renderer, *version;
-+  char *vendor = NULL, *renderer = NULL, *version = NULL;
-   int ok = false;
-   ok = PyArg_ParseTuple(args, "O", &self);
-   if(ok) {
-Index: contrib/uiuc/plugins/molfile_plugin/src/pbeqplugin.cpp
-===================================================================
---- contrib/uiuc/plugins/molfile_plugin/src/pbeqplugin.cpp	(revision 4074)
-+++ contrib/uiuc/plugins/molfile_plugin/src/pbeqplugin.cpp	(working copy)
-@@ -259,7 +259,7 @@
-         int addr = z*nclx*ncly + y*nclx + x;
-         if (fread(datablock + addr, 4, 1, fd) != 1) {
-           printf("pbeqplugin) Error reading potential map cell: %d,%d,%d\n", x, y, z);
--          printf("pbeqplugin) offset: %d\n", ftell(fd));
-+          printf("pbeqplugin) offset: %ld\n", ftell(fd));
-           return MOLFILE_ERROR;
-         }
-         count++;
-Index: contrib/uiuc/plugins/molfile_plugin/src/dtrplugin.cpp
-===================================================================
---- contrib/uiuc/plugins/molfile_plugin/src/dtrplugin.cpp	(revision 4074)
-+++ contrib/uiuc/plugins/molfile_plugin/src/dtrplugin.cpp	(working copy)
-@@ -484,7 +484,7 @@
-         /* constant frame size */
-         if (keys[i].size() != m_framesize) {
-             fprintf(stderr, "non-constant framesize at frame %ld\n", i);
--            printf("size %d framesize %d\n\n",
-+            printf("size %lld framesize %lld\n\n",
-                     keys[i].size(), m_framesize);
-             return true;
-         }
-@@ -1298,7 +1298,7 @@
-   }
-   Blob pos=blobs["POSITION"];
-   if (pos.count != 3*natoms) {
--    fprintf(stderr, "ERROR, Expected %d elements in POSITION; got %ld\n",
-+    fprintf(stderr, "ERROR, Expected %d elements in POSITION; got %lld\n",
-         3*natoms, pos.count);
-     return MOLFILE_ERROR;
-   }
-@@ -1307,7 +1307,7 @@
-   if (with_velocity && ts->velocities && blobs.find("VELOCITY")!=blobs.end()) {
-     Blob vel=blobs["VELOCITY"];
-     if (vel.count != 3*natoms) {
--      fprintf(stderr, "ERROR, Expected %d elements in VELOCITY; got %ld\n",
-+      fprintf(stderr, "ERROR, Expected %d elements in VELOCITY; got %lld\n",
-           3*natoms, vel.count);
-       return MOLFILE_ERROR;
-     }
-@@ -1569,7 +1569,7 @@
-   // if required, get velocities
-   if (ts->velocities && velblob.count > 0) {
-     if (velblob.count != 3*natoms) {
--      fprintf(stderr, "VELOCITY field has %ld values; expected %d\n",
-+      fprintf(stderr, "VELOCITY field has %lld values; expected %d\n",
-           velblob.count, 3*natoms);
-       return MOLFILE_ERROR;
-     }
-Index: contrib/uiuc/plugins/molfile_plugin/src/moldenplugin.c
-===================================================================
---- contrib/uiuc/plugins/molfile_plugin/src/moldenplugin.c	(revision 4074)
-+++ contrib/uiuc/plugins/molfile_plugin/src/moldenplugin.c	(working copy)
-@@ -99,7 +99,7 @@
-                               const char *filetype,
-                               int *natoms) {
-   FILE *fd;
--  qmdata_t *data;
-+  qmdata_t *data = NULL;
-   moldendata_t *moldendata;
-   char buffer[1024];
-   char keystring[20];
-Index: contrib/uiuc/plugins/molfile_plugin/src/vtfplugin.c
-===================================================================
---- contrib/uiuc/plugins/molfile_plugin/src/vtfplugin.c	(revision 4074)
-+++ contrib/uiuc/plugins/molfile_plugin/src/vtfplugin.c	(working copy)
-@@ -231,7 +231,7 @@
-     switch (tolower(keyword[0])) {
-     case 'n': {
-       /* name */
--      if (sscanf(s, "%16s %n", &atom.name, &n) < 1) {
-+      if (sscanf(s, "%16s %n", (char *) &atom.name, &n) < 1) {
- 	vtf_error("could not get name in atom record", line);
- 	return MOLFILE_ERROR;
-       }
-@@ -240,7 +240,7 @@
-     }
-     case 't': {
-       /* type */
--      if (sscanf(s, "%16s %n", &atom.type, &n) < 1) {
-+      if (sscanf(s, "%16s %n", (char *) &atom.type, &n) < 1) {
- 	vtf_error("could not get type in atom record", line);
- 	return MOLFILE_ERROR;
-       }
-@@ -266,7 +266,7 @@
-       } else if (strcmp(keyword, "res") == 0 || 
- 		 strcmp(keyword, "resname") == 0) {
- 	/* resname */
--	if (sscanf(s, "%8s %n", &atom.resname, &n) < 1) {
-+	if (sscanf(s, "%8s %n", (char *) &atom.resname, &n) < 1) {
- 	  vtf_error("could not get resname in atom record", line);
- 	  return MOLFILE_ERROR;
- 	}
-@@ -281,7 +281,7 @@
-     }
-     case 's': {
-       /* segid */
--      if (sscanf(s, "%8s %n", &atom.segid, &n) < 1) {
-+      if (sscanf(s, "%8s %n", (char *) &atom.segid, &n) < 1) {
- 	vtf_error("could not get segid in atom record", line);
- 	return MOLFILE_ERROR;
-       }
-@@ -290,7 +290,7 @@
-     }
-     case 'i': {
-       /* insertion */
--      if (sscanf(s, "%2s %n", &atom.insertion, &n) < 1) {
-+      if (sscanf(s, "%2s %n", (char *) &atom.insertion, &n) < 1) {
- 	vtf_error("could not get insertion in atom record", line);
- 	return MOLFILE_ERROR;
-       }
-@@ -302,7 +302,7 @@
-       /* chain, charge */
-       if (strlen(keyword) == 1 || 
- 	  strcmp(keyword, "chain") == 0) {
--	if (sscanf(s, "%2s %n", &atom.chain, &n) < 1) {
-+	if (sscanf(s, "%2s %n", (char *) &atom.chain, &n) < 1) {
- 	  vtf_error("could not get chain in atom record", line);
- 	  return MOLFILE_ERROR;
- 	}
-@@ -336,7 +336,7 @@
- 	}
- 	d->optflags |= MOLFILE_ATOMICNUMBER;
-       } else if (strcmp(keyword, "altloc")) {
--	if (sscanf(s, "%2s %n", &atom.altloc, &n) < 1) {
-+	if (sscanf(s, "%2s %n", (char *) &atom.altloc, &n) < 1) {
- 	  vtf_error("could not get altloc in atom record", line);
- 	  return MOLFILE_ERROR;
- 	}
-Index: contrib/uiuc/plugins/molfile_plugin/src/gamessplugin.c
-===================================================================
---- contrib/uiuc/plugins/molfile_plugin/src/gamessplugin.c	(revision 4074)
-+++ contrib/uiuc/plugins/molfile_plugin/src/gamessplugin.c	(working copy)
-@@ -375,7 +375,7 @@
-                   const char *filetype, int *natoms) {
- 
-   FILE *fd;
--  qmdata_t *data;
-+  qmdata_t *data = NULL;
-   gmsdata *gms;
- 
-   /* open the input file */
-Index: contrib/uiuc/plugins/molfile_plugin/src/maeffplugin.cpp
-===================================================================
---- contrib/uiuc/plugins/molfile_plugin/src/maeffplugin.cpp	(revision 4074)
-+++ contrib/uiuc/plugins/molfile_plugin/src/maeffplugin.cpp	(working copy)
-@@ -1983,7 +1983,7 @@
-       }
-     }
-     catch (std::exception &e) {
--      fprintf(stderr, e.what());
-+      fprintf(stderr, "%s", e.what());
-       return MOLFILE_ERROR;
-     }
-     return MOLFILE_SUCCESS;
-Index: contrib/uiuc/plugins/molfile_plugin/src/graspplugin.cpp
-===================================================================
---- contrib/uiuc/plugins/molfile_plugin/src/graspplugin.cpp	(revision 4074)
-+++ contrib/uiuc/plugins/molfile_plugin/src/graspplugin.cpp	(working copy)
-@@ -104,7 +104,7 @@
- 
-   ///ojo aqui le quite el  !
-   if ((grassp->flag)!=POTENTIALS) {
--    if (index >=0 && index <= 4) 
-+    if (index <= 4) 
-       printf("graspplugin) No data available for '%s' option\n", name[index]);
-     else 
-       printf("graspplugin) out of range property, flag: %d index: %d\n", grassp->flag, index);
-Index: modules/cealign/src/tnt/tnt_fortran_array1d.h
-===================================================================
---- modules/cealign/src/tnt/tnt_fortran_array1d.h	(revision 4074)
-+++ modules/cealign/src/tnt/tnt_fortran_array1d.h	(working copy)
-@@ -221,7 +221,7 @@
- #ifdef TNT_DEBUG
- 		std::cout << "entered subarray. \n";
- #endif
--	if ((i0 > 0) && (i1 < n_) || (i0 <= i1))
-+	if (((i0 > 0) && (i1 < n_)) || (i0 <= i1))
- 	{
- 		Fortran_Array1D<T> X(*this);  /* create a new instance of this array. */
- 		X.n_ = i1-i0+1;
-Index: modules/cealign/src/tnt/tnt_array1d.h
-===================================================================
---- modules/cealign/src/tnt/tnt_array1d.h	(revision 4074)
-+++ modules/cealign/src/tnt/tnt_array1d.h	(working copy)
-@@ -258,7 +258,7 @@
- template <class T>
- inline Array1D<T> Array1D<T>::subarray(int i0, int i1)
- {
--	if ((i0 >= 0) && (i1 < n_) || (i0 <= i1))
-+	if (((i0 >= 0) && (i1 < n_)) || (i0 <= i1))
- 	{
- 		Array1D<T> X(*this);  /* create a new instance of this array. */
- 		X.n_ = i1-i0+1;
+ #ifndef _PYMOL_NO_GLUT
+   if(G->HaveGUI && G->ValidContext) {
+-    CExecutive *I = G->Executive;
+     if (flag) {
+ #ifndef GLUT_FULL_SCREEN
+       if(wm_flag < 1) {

Added: trunk/dports/science/pymol/files/pymol-use-glkit.diff
===================================================================
--- trunk/dports/science/pymol/files/pymol-use-glkit.diff	                        (rev 0)
+++ trunk/dports/science/pymol/files/pymol-use-glkit.diff	2014-12-13 22:12:42 UTC (rev 129475)
@@ -0,0 +1,39 @@
+Index: layer1/Scene.cpp
+===================================================================
+--- layer1/Scene.cpp	(revision 4106)
++++ layer1/Scene.cpp	(working copy)
+@@ -57,6 +57,8 @@ Z* -------------------------------------
+ #include"ScrollBar.h"
+ #include "ShaderMgr.h"
+ 
++#include <GLKit/GLKMatrix4.h>
++
+ #ifdef _PYMOL_IP_EXTRAS
+ #include "IncentiveCopyToClipboard.h"
+ #endif
+@@ -9156,7 +9158,8 @@ void SceneRender(PyMOLGlobals * G, Picki
+     }
+     if(!SettingGetGlobal_b(G, cSetting_ortho)) {
+       float fov = SettingGetGlobal_f(G, cSetting_field_of_view);
+-      gluPerspective(fov, aspRat, I->FrontSafe, I->BackSafe);
++      // gluPerspective(fov, aspRat, I->FrontSafe, I->BackSafe);
++      glMultMatrixf(GLKMatrix4MakePerspective(fov*PI/180., aspRat, I->FrontSafe, I->BackSafe).m);
+     } else {
+       height = fmax(R_SMALL4, -I->Pos[2]) * GetFovWidth(G) / 2.f;
+       width = height * aspRat;
+Index: setup.py
+===================================================================
+--- setup.py	(revision 4106)
++++ setup.py	(working copy)
+@@ -279,6 +279,11 @@ else: # unix style (linux, mac, ...)
+         glut = posix_find_lib(['glut', 'freeglut'], lib_dirs)
+         pyogl_libs += ["GL", "GLU", glut]
+ 
++    if sys.platform == 'darwin':
++       ext_link_args += [
++         "-framework", "GLKit",
++        ]
++
+     libs += ["GLEW"]
+     libs += pyogl_libs
+ 

Modified: trunk/dports/science/pymol/files/setup_py.diff
===================================================================
--- trunk/dports/science/pymol/files/setup_py.diff	2014-12-13 20:40:58 UTC (rev 129474)
+++ trunk/dports/science/pymol/files/setup_py.diff	2014-12-13 22:12:42 UTC (rev 129475)
@@ -1,25 +1,8 @@
---- setup.py.orig	2014-05-24 16:55:05.000000000 -0400
-+++ setup.py	2014-05-24 17:00:43.000000000 -0400
-@@ -47,18 +47,6 @@
-     pmap(_single_compile, objects)
-     return objects
- 
--# handle extra arguments
--class options:
--    osx_frameworks = False
--
--try:
--    import argparse
--    parser = argparse.ArgumentParser()
--    parser.add_argument('--osx-frameworks', action="store_true")
--    options, sys.argv[1:] = parser.parse_known_args(namespace=options)
--except ImportError:
--    print "argparse not available"
--
- jobs = int(os.getenv('JOBS', 0))
- pmap = map if jobs == 1 else multiprocessing.pool.ThreadPool(jobs or None).map
- 
-@@ -242,22 +230,17 @@
+Index: setup.py
+===================================================================
+--- setup.py	(revision 4106)
++++ setup.py	(working copy)
+@@ -264,7 +264,7 @@ else: # unix style (linux, mac, ...)
      try:
          prefix_path = os.environ['PREFIX_PATH'].split(os.pathsep)
      except KeyError:
@@ -27,22 +10,4 @@
 +        prefix_path = ["@PREFIX@", "/usr", "/usr/X11"]
  
      for prefix in prefix_path:
-         inc_dirs += filter(os.path.isdir, [prefix + s for s in ["/include", "/include/freetype2"]])
-         lib_dirs += filter(os.path.isdir, [prefix + s for s in ["/lib64", "/lib"]])
- 
--    if sys.platform == 'darwin' and options.osx_frameworks:
--        ext_link_args += [
--            "-framework", "OpenGL",
--            "-framework", "GLUT",
--        ]
--    else:
--        glut = posix_find_lib(['glut', 'freeglut'], lib_dirs)
--        pyogl_libs += ["GL", "GLU", glut]
-+    glut = posix_find_lib(['glut', 'freeglut'], lib_dirs)
- 
-     libs += ["GLEW"]
-+    pyogl_libs += ["GL", "GLU", glut]
-+
-     libs += pyogl_libs
- 
-     ext_comp_args += ["-ffast-math", "-funroll-loops", "-O3", "-fcommon"]
+         inc_dirs += filter(os.path.isdir, [prefix + s for s in ["/include", "/include/freetype2", "/include/libxml2"]])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20141213/e828d0cd/attachment-0001.html>


More information about the macports-changes mailing list