Commits

Josh VanderLinden committed 5ed903a

Adding some OSX packaging stuff

  • Participants
  • Parent commits 337266b

Comments (0)

Files changed (7)

osx_pkg.pmdoc/01treedo-contents.xml

+<pkg-contents spec="1.12"><f n="TreeDo.app" o="root" g="admin" p="16893" pt="/Volumes/Dev/treedo/dist/TreeDo.app" m="true" t="file"><f n="Contents" o="root" g="admin" p="16893"><f n="Frameworks" o="root" g="admin" p="16893"><f n="Python.framework" o="root" g="admin" p="16893"><f n="Versions" o="root" g="admin" p="16893"><f n="2.5" o="root" g="admin" p="16893"><f n="Python" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="Resources" o="root" g="admin" p="16893"><f n="Info.plist" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="version.plist" o="root" g="admin" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="include" o="root" g="admin" p="16893"><f n="python2.5" o="root" g="admin" p="16893"><f n="pyconfig.h" o="root" g="admin" p="33204"><mod>mode</mod></f><mod>mode</mod></f><mod>mode</mod></f><f n="lib" o="root" g="admin" p="16893"><f n="python2.5" o="root" g="admin" p="16893"><f n="config" o="root" g="admin" p="16893"><f n="Makefile" o="root" g="admin" p="33204"><mod>mode</mod></f><mod>mode</mod></f><mod>mode</mod></f><mod>mode</mod></f><mod>mode</mod></f><mod>mode</mod></f><mod>mode</mod></f><f n="libwx_macud-2.8.0.dylib" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="libwx_macud_gizmos-2.8.0.dylib" o="root" g="admin" p="33277"><mod>mode</mod></f><mod>mode</mod></f><f n="Info.plist" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="MacOS" o="root" g="admin" p="16893"><f n="TreeDo" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="python" o="root" g="admin" p="33277"><mod>mode</mod></f><mod>mode</mod></f><f n="PkgInfo" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="Resources" o="root" g="admin" p="16893"><f n="LICENSE" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="README" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="__boot__.py" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="__error__.sh" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="include" o="root" g="admin" p="16893"><f n="python2.5" o="root" g="admin" p="16893"><f n="pyconfig.h" o="root" g="admin" p="33204"><mod>mode</mod></f><mod>mode</mod></f><mod>mode</mod></f><f n="lib" o="root" g="admin" p="16893"><f n="python2.5" o="root" g="admin" p="16893"><f n="config" o="root" g="admin" p="16893"><f n="Makefile" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="Setup" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="Setup.config" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="Setup.local" o="root" g="admin" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="lib-dynload" o="root" g="admin" p="16893"><f n="MacOS.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="Nav.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_AE.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_Ctl.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_Dlg.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_Evt.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_File.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_Folder.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_Menu.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_Qd.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_Res.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_Win.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_bisect.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_codecs_cn.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_codecs_hk.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_codecs_iso2022.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_codecs_jp.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_codecs_kr.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_codecs_tw.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_ctypes.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_functools.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_hashlib.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_heapq.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_locale.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_multibytecodec.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_random.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_socket.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_ssl.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_struct.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_weakref.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="array.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="binascii.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="bz2.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="cStringIO.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="collections.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="datetime.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="fcntl.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="icglue.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="itertools.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="math.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="operator.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="pyexpat.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="strop.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="termios.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="time.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="unicodedata.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="wx" o="root" g="admin" p="16893"><f n="_calendar.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_controls_.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_core_.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_gdi_.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_gizmos.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_misc_.so" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_windows_.so" o="root" g="admin" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="zlib.so" o="root" g="admin" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="lxml" o="root" g="admin" p="16893"><f n="ElementInclude.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="ElementInclude.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="__init__.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="__init__.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_elementpath.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="_elementpath.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="builder.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="builder.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="cssselect.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="cssselect.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="doctestcompare.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="doctestcompare.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="etree.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="etree.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="etree.so" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="html" o="root" g="admin" p="16893"><f n="ElementSoup.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="ElementSoup.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="__init__.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="__init__.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_dictmixin.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="_dictmixin.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_diffcommand.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="_diffcommand.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_html5builder.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="_html5builder.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="_setmixin.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="_setmixin.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="builder.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="builder.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="clean.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="clean.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="defs.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="defs.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="diff.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="diff.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="formfill.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="formfill.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="html5parser.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="html5parser.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="soupparser.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="soupparser.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="usedoctest.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="usedoctest.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="objectify.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="objectify.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="objectify.so" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="pyclasslookup.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="pyclasslookup.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="sax.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="sax.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="usedoctest.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="usedoctest.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="site-packages.zip" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="site.py" o="root" g="admin" p="41469"><mod>mode</mod></f><mod>mode</mod></f><mod>mode</mod></f><f n="res" o="root" g="admin" p="16893"><f n="add.png" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="add_subtask.png" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="collapse.png" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="expand.png" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="save.jpg" o="root" g="admin" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="site.py" o="root" g="admin" p="33277"><mod>mode</mod></f><f n="site.pyc" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="treedo.icns" o="root" g="admin" p="33204"><mod>mode</mod></f><f n="treedo.py" o="root" g="admin" p="33277"><mod>mode</mod></f><mod>mode</mod></f><mod>mode</mod></f><mod>mode</mod></f></pkg-contents>

osx_pkg.pmdoc/01treedo.xml

+<pkgref spec="1.12" uuid="D0B970DB-D013-41AD-97C4-EB3BC697F597"><config><identifier>com.codekoala.treedo.TreeDo.pkg</identifier><version>0.3</version><description/><post-install type="none"/><requireAuthorization/><installFrom relative="true" includeRoot="true">dist/TreeDo.app</installFrom><installTo mod="true">/Applications</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>installFrom.isRelativeType</mod><mod>installTo</mod><mod>identifier</mod><mod>relocatable</mod><mod>version</mod><mod>parent</mod></config><contents><file-list>01treedo-contents.xml</file-list><component id="com.codekoala.treedo" path="/Volumes/Dev/treedo/dist/TreeDo.app" version="0.3" isRelocatable="true"><locator-info><token title="pkmk-token-10"><search-rule><combo identifier="com.codekoala.treedo" default-path="/Applications/TreeDo.app"/></search-rule></token></locator-info><component id="org.python.python" path="/Volumes/Dev/treedo/dist/TreeDo.app/Contents/Frameworks/Python.framework/Versions/2.5" version="2.5"><version-plist>/Volumes/Dev/treedo/dist/TreeDo.app/Contents/Frameworks/Python.framework/Versions/2.5/Resources/version.plist</version-plist></component></component><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>

osx_pkg.pmdoc/index.xml

+<pkmkdoc spec="1.12"><properties><title>TreeDo</title><build>/Volumes/Dev/treedo/TreeDo 0.3 Installer.pkg</build><organization>com.codekoala</organization><userSees ui="easy"/><min-target os="3"/><domain/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>TreeDo is an XML-based todo application.  It allows you to arbitrarily nest tasks.</description><contents><choice title="TreeDo" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><customLoc mod="true">/Applications</customLoc><pkgref id="com.codekoala.treedo.TreeDo.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"/></resources><flags/><item type="file">01treedo.xml</item><mod>properties.anywhereDomain</mod><mod>properties.title</mod><mod>properties.userDomain</mod><mod>description</mod><mod>properties.systemDomain</mod></pkmkdoc>
 extra = {}
 
 if 'py2app' in sys.argv and sys.platform == 'darwin':
-    import py2app
+    from upx import Py2App
 
     options = dict(
-        #iconfile='treedo/res/treedo.incs',
+        iconfile='treedo/res/treedo.icns',
         compressed=1,
         optimize=1,
         plist=dict(
             'py2app',
             'lxml',
         ],
+        cmdclass={
+            'py2app': Py2App,
+        }
     )
 
 setup(
     STANDARD = ('summary', 'notes', 'due')
 
     def __init__(self, summary=None, is_complete=False, priority=3, notes="",
-                 due_date=None, children=None, uuid=None, parent=None):
+                 due_date=None, children=None, uuid=None, parent=None, 
+                 custom=None):
 
         if uuid is None or uuid.strip() == '':
             uuid = str(uuid4())
         self.notes = notes or ''
         self.due_date = due_date
         self.parent = parent
+        self.custom = custom or []
 
         if children is None:
             children = []

treedo/res/treedo.icns

Binary file added.
+"""UPX allows us to compress our resulting binary applications"""
+
+import os
+import sys
+
+if sys.platform == 'darwin':
+    from py2app.build_app import py2app
+
+    # TODO: Find out how to make UPX useful with py2app
+    class Py2App(py2app):
+
+        def initialize_options(self):
+            # Add a new "upx" option for compression with upx
+            py2app.initialize_options(self)
+            self.upx = 1
+
+else:
+    from py2exe.build_exe import py2exe
+
+    class Py2exe(py2exe):
+
+        def initialize_options(self):
+            # Add a new "upx" option for compression with upx
+            py2exe.initialize_options(self)
+            self.upx = 1
+
+        def copy_file(self, *args, **kwargs):
+            # Override to UPX copied binaries.
+            (fname, copied) = result = py2exe.copy_file(self, *args, **kwargs)
+
+            basename = os.path.basename(fname)
+            if (copied and self.upx and
+                (basename[:6]+basename[-4:]).lower() != 'python.dll' and
+                fname[-4:].lower() in ('.pyd', '.dll')):
+                os.system('upx --best "%s"' % os.path.normpath(fname))
+            return result
+
+        def patch_python_dll_winver(self, dll_name, new_winver=None):
+            # Override this to first check if the file is upx'd and skip if so
+            if not self.dry_run:
+                if not os.system('upx -qt "%s" >nul' % dll_name):
+                    if self.verbose:
+                        print "Skipping setting sys.winver for '%s' (UPX'd)" % \
+                              dll_name
+                else:
+                    py2exe.patch_python_dll_winver(self, dll_name, new_winver)
+                    # We UPX this one file here rather than in copy_file so
+                    # the version adjustment can be successful
+                    if self.upx:
+                        os.system('upx --best "%s"' % os.path.normpath(dll_name))
+