abudden avatar abudden committed b05a935

Improved support for Linux compiled variant.

Comments (0)

Files changed (3)

autoload/TagHighlight/RunPythonScript.vim

 " Tag Highlighter:
 "   Author:  A. S. Budden <abudden _at_ gmail _dot_ com>
-"   Date:    25/07/2011
-"   Version: 1
+"   Date:    26/07/2011
 " Copyright: Copyright (C) 2009-2011 A. S. Budden
 "            Permission is hereby granted to use and distribute this code,
 "            with or without modifications, provided that this copyright
 						let s:python_cmd = [compiled_highlighter[0]]
 					endif
 				elseif has("unix")
-					let compiled_highlighter = split(globpath(&rtp, "plugin/TagHighlight/Compiled/Linux/TagHighlight.exe"), "\n")
+					let compiled_highlighter = split(globpath(&rtp, "plugin/TagHighlight/Compiled/Linux/TagHighlight"), "\n")
 					if len(compiled_highlighter) > 0  && executable(compiled_highlighter[0])
 						let s:python_variant = 'compiled'
 						let s:python_cmd = [compiled_highlighter[0]]

dist/make_taghighlight_release.py

     # Close the zipfile
     zipf.close()
 
-def MakeCompiled(pyexe, pyinstaller_path):
+def MakeCompiled(pyexe, pyinstaller_path, zipfilename, platform_dir):
     initial_dir = os.getcwd()
     os.chdir(os.path.join(vimfiles_dir, 'plugin/TagHighlight'))
     args = pyexe + [os.path.join(pyinstaller_path, 'Build.py'), '-y', 'TagHighlight.spec']
     p = subprocess.Popen(args)#, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     (stdout,stderr) = p.communicate()
-    zipf = zipfile.ZipFile(os.path.join(vimfiles_dir,'dist','taghighlight_win32.zip'), 'w')
-    for f in Rglob(os.path.join(vimfiles_dir,'plugin/TagHighlight/Compiled/Win32'),'*'):
+    zipf = zipfile.ZipFile(os.path.join(vimfiles_dir,'dist',zipfilename), 'w')
+    for f in Rglob(os.path.join(vimfiles_dir,'plugin/TagHighlight/Compiled/'+platform_dir),'*'):
         dirname = os.path.dirname(os.path.relpath(f,vimfiles_dir))
         zipf.write(f,os.path.join(dirname, os.path.basename(f)), zipfile.ZIP_DEFLATED)
     zipf.close()
     else:
         pyexe = ['python.exe']
     pyinstaller_path = os.environ['WINPYINSTALLERDIR']
-    MakeCompiled(pyexe, pyinstaller_path)
+    MakeCompiled(pyexe, pyinstaller_path, 'taghighlight_win32.zip', 'Win32')
+
+def MakeWin32Compiled():
+    if 'PYTHON' in os.environ:
+        # Doesn't work with spaces in the path
+        # (doing the split to allow for running python
+        # with wine).
+        pyexe = os.environ['PYTHON']
+    else:
+        pyexe = ['python']
+    pyinstaller_path = os.environ['PYINSTALLERDIR']
+    MakeCompiled(pyexe, pyinstaller_path, 'taghighlight_linux.zip', 'Win32')
 
 def CheckInChanges(r):
     args = BZR+['ci','-m','Release build {0}'.format(r)]
         new_release = UpdateReleaseVersion()
         MakeZipFile()
         MakeWin32Compiled()
+        MakeLinuxCompiled()
         CheckInChanges(new_release)
     else:
         print("Distribution not clean: check into Bazaar before making release.")

plugin/TagHighlight/TagHighlight.spec

 # -*- mode: python -*-
 # Work out what language files are needed
-a = Analysis([os.path.join(HOMEPATH,'support\\_mountzlib.py'), os.path.join(HOMEPATH,'support\\useUnicode.py'), 'TagHighlight.py'],
+a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'), os.path.join(HOMEPATH,'support/useUnicode.py'), 'TagHighlight.py'],
         pathex=['.'])
-version_data = [('version_info.txt','data/version_info.txt','DATA')]
+version_data = []#[('version_info.txt','data/version_info.txt','DATA')]
 pyz = PYZ(a.pure)
+import sys
+if sys.platform.startswith('win'):
+    exe_name = 'TagHighlight.exe'
+    compile_dir = 'Compiled/Win32'
+elif sys.platform.startswith('linux'):
+    exe_name = 'TagHighlight'
+    compile_dir = 'Compiled/Linux'
+
 exe = EXE(pyz,
         a.scripts,
         exclude_binaries=1,
-        name=os.path.join('build/', 'TagHighlight.exe'),
+        name=os.path.join('build/', exe_name),
         debug=False,
         strip=False,
         upx=True,
         version_data,
         strip=False,
         upx=True,
-        name='Compiled/Win32')
+        name=compile_dir)
 
 # vim: ft=python
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.