| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent be95462 commit c77f6df
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,7 +60,7 @@ def findtemplate(template=None): | |||
| 60 | 60 | return file | |
| 61 | 61 | ||
| 62 | 62 | def process(template, filename, destname, copy_codefragment=0, | |
| 63 | - rsrcname=None, others=[], raw=0, progress="default"): | ||
| 63 | + rsrcname=None, others=[], raw=0, progress="default", destroot=""): | ||
| 64 | 64 | ||
| 65 | 65 | if progress == "default": | |
| 66 | 66 | progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120) | |
@@ -108,7 +108,7 @@ def process(template, filename, destname, copy_codefragment=0, | |||
| 108 | 108 | except os.error: | |
| 109 | 109 | pass | |
| 110 | 110 | process_common(template, progress, code, rsrcname, destname, 0, | |
| 111 | - copy_codefragment, raw, others, filename) | ||
| 111 | + copy_codefragment, raw, others, filename, destroot) | ||
| 112 | 112 | ||
| 113 | 113 | ||
| 114 | 114 | def update(template, filename, output): | |
@@ -130,10 +130,10 @@ def update(template, filename, output): | |||
| 130 | 130 | ||
| 131 | 131 | ||
| 132 | 132 | def process_common(template, progress, code, rsrcname, destname, is_update, | |
| 133 | - copy_codefragment, raw=0, others=[], filename=None): | ||
| 133 | + copy_codefragment, raw=0, others=[], filename=None, destroot=""): | ||
| 134 | 134 | if MacOS.runtimemodel == 'macho': | |
| 135 | 135 | return process_common_macho(template, progress, code, rsrcname, destname, | |
| 136 | - is_update, raw, others, filename) | ||
| 136 | + is_update, raw, others, filename, destroot) | ||
| 137 | 137 | if others: | |
| 138 | 138 | raise BuildError, "Extra files only allowed for MachoPython applets" | |
| 139 | 139 | # Create FSSpecs for the various files | |
@@ -265,7 +265,7 @@ def process_common(template, progress, code, rsrcname, destname, is_update, | |||
| 265 | 265 | progress.inc(0) | |
| 266 | 266 | ||
| 267 | 267 | def process_common_macho(template, progress, code, rsrcname, destname, is_update, | |
| 268 | - raw=0, others=[], filename=None): | ||
| 268 | + raw=0, others=[], filename=None, destroot=""): | ||
| 269 | 269 | # Check that we have a filename | |
| 270 | 270 | if filename is None: | |
| 271 | 271 | raise BuildError, "Need source filename on MacOSX" | |
@@ -302,6 +302,7 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update | |||
| 302 | 302 | builder.mainprogram = filename | |
| 303 | 303 | builder.builddir = destdir | |
| 304 | 304 | builder.name = shortname | |
| 305 | + builder.destroot = destroot | ||
| 305 | 306 | if rsrcname: | |
| 306 | 307 | realrsrcname = macresource.resource_pathname(rsrcname) | |
| 307 | 308 | builder.files.append((realrsrcname, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -110,6 +110,9 @@ class BundleBuilder(Defaults): | |||
| 110 | 110 | ||
| 111 | 111 | # Verbosity level. | |
| 112 | 112 | verbosity = 1 | |
| 113 | + | ||
| 114 | + # Destination root directory | ||
| 115 | + destroot = "" | ||
| 113 | 116 | ||
| 114 | 117 | def setup(self): | |
| 115 | 118 | # XXX rethink self.name munging, this is brittle. | |
@@ -445,7 +448,7 @@ def preProcess(self): | |||
| 445 | 448 | execname = os.path.basename(self.executable) | |
| 446 | 449 | execpath = pathjoin(self.execdir, execname) | |
| 447 | 450 | if not self.symlink_exec: | |
| 448 | - self.files.append((self.executable, execpath)) | ||
| 451 | + self.files.append((self.destroot + self.executable, execpath)) | ||
| 449 | 452 | self.execpath = execpath | |
| 450 | 453 | ||
| 451 | 454 | if self.mainprogram is not None: | |
@@ -828,7 +831,7 @@ def main(builder=None): | |||
| 828 | 831 | "mainprogram=", "creator=", "nib=", "plist=", "link", | |
| 829 | 832 | "link-exec", "help", "verbose", "quiet", "argv", "standalone", | |
| 830 | 833 | "exclude=", "include=", "package=", "strip", "iconfile=", | |
| 831 | - "lib=", "python=", "semi-standalone", "bundle-id=") | ||
| 834 | + "lib=", "python=", "semi-standalone", "bundle-id=", "destroot=") | ||
| 832 | 835 | ||
| 833 | 836 | try: | |
| 834 | 837 | options, args = getopt.getopt(sys.argv[1:], shortopts, longopts) | |
@@ -890,6 +893,8 @@ def main(builder=None): | |||
| 890 | 893 | builder.includePackages.append(arg) | |
| 891 | 894 | elif opt == '--strip': | |
| 892 | 895 | builder.strip = 1 | |
| 896 | + elif opt == '--destroot': | ||
| 897 | + builder.destroot = arg | ||
| 893 | 898 | ||
| 894 | 899 | if len(args) != 1: | |
| 895 | 900 | usage("Must specify one command ('build', 'report' or 'help')") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | # main Makefile. The next couple of variables are overridden on the | |
| 3 | 3 | # commandline in that case. | |
| 4 | 4 | ||
| 5 | - VERSION=2.4 | ||
| 5 | + VERSION=2.5 | ||
| 6 | 6 | builddir = ../.. | |
| 7 | 7 | srcdir = ../.. | |
| 8 | 8 | prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION) | |
@@ -120,10 +120,12 @@ install_IDE: | |||
| 120 | 120 | echo See Mac/OSX/README for details; \ | |
| 121 | 121 | else \ | |
| 122 | 122 | echo $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \ | |
| 123 | + --destroot $(DESTDIR) \ | ||
| 123 | 124 | --python $(INSTALLED_PYTHONW) \ | |
| 124 | 125 | --output $(DESTDIR)$(PYTHONAPPSDIR)/PythonIDE.app --noargv \ | |
| 125 | 126 | $(srcdir)/Mac/Tools/IDE/PythonIDE.py ; \ | |
| 126 | 127 | $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \ | |
| 128 | + --destroot $(DESTDIR) \ | ||
| 127 | 129 | --python $(INSTALLED_PYTHONW) \ | |
| 128 | 130 | --output $(DESTDIR)$(PYTHONAPPSDIR)/PythonIDE.app --noargv \ | |
| 129 | 131 | $(srcdir)/Mac/Tools/IDE/PythonIDE.py; \ | |
@@ -136,13 +138,15 @@ install_PackageManager: | |||
| 136 | 138 | else \ | |
| 137 | 139 | echo $(BUILDPYTHON) $(bundlebuilder) \ | |
| 138 | 140 | --builddir $(DESTDIR)$(PYTHONAPPSDIR)/ \ | |
| 141 | + --destroot $(DESTDIR) \ | ||
| 139 | 142 | --python $(INSTALLED_PYTHONW) \ | |
| 140 | 143 | --resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \ | |
| 141 | 144 | --mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \ | |
| 142 | 145 | --iconfile $(srcdir)/Mac/Tools/IDE/PackageManager.icns \ | |
| 143 | 146 | --creator Pimp build; \ | |
| 144 | 147 | $(BUILDPYTHON) $(bundlebuilder) \ | |
| 145 | 148 | --builddir $(DESTDIR)$(PYTHONAPPSDIR)/ \ | |
| 149 | + --destroot $(DESTDIR) \ | ||
| 146 | 150 | --python $(INSTALLED_PYTHONW) \ | |
| 147 | 151 | --resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \ | |
| 148 | 152 | --mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \ | |
@@ -157,11 +161,13 @@ install_IDLE: | |||
| 157 | 161 | else \ | |
| 158 | 162 | echo $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \ | |
| 159 | 163 | --python $(INSTALLED_PYTHONW) \ | |
| 164 | + --destroot $(DESTDIR) \ | ||
| 160 | 165 | --output $(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app \ | |
| 161 | 166 | --extra $(srcdir)/Lib/idlelib \ | |
| 162 | 167 | $(srcdir)/Tools/scripts/idle ; \ | |
| 163 | 168 | $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \ | |
| 164 | 169 | --python $(INSTALLED_PYTHONW) \ | |
| 170 | + --destroot $(DESTDIR) \ | ||
| 165 | 171 | --output $(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app \ | |
| 166 | 172 | --extra $(srcdir)/Lib/idlelib:Contents/Resources/idlelib \ | |
| 167 | 173 | $(srcdir)/Tools/scripts/idle ; \ | |
@@ -170,6 +176,7 @@ install_IDLE: | |||
| 170 | 176 | ||
| 171 | 177 | install_BuildApplet: | |
| 172 | 178 | $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \ | |
| 179 | + --destroot $(DESTDIR) \ | ||
| 173 | 180 | --python $(INSTALLED_PYTHONW) \ | |
| 174 | 181 | --output $(DESTDIR)$(PYTHONAPPSDIR)/BuildApplet.app \ | |
| 175 | 182 | $(srcdir)/Mac/scripts/BuildApplet.py | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,8 +53,8 @@ def buildapplet(): | |||
| 53 | 53 | buildtools.process(template, filename, dstfilename, 1) | |
| 54 | 54 | else: | |
| 55 | 55 | ||
| 56 | - SHORTOPTS = "o:r:ne:v?P" | ||
| 57 | - LONGOPTS=("output=", "resource=", "noargv", "extra=", "verbose", "help", "python=") | ||
| 56 | + SHORTOPTS = "o:r:ne:v?PR" | ||
| 57 | + LONGOPTS=("output=", "resource=", "noargv", "extra=", "verbose", "help", "python=", "destroot=") | ||
| 58 | 58 | try: | |
| 59 | 59 | options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) | |
| 60 | 60 | except getopt.error: | |
@@ -67,6 +67,7 @@ def buildapplet(): | |||
| 67 | 67 | raw = 0 | |
| 68 | 68 | extras = [] | |
| 69 | 69 | verbose = None | |
| 70 | + destroot = '' | ||
| 70 | 71 | for opt, arg in options: | |
| 71 | 72 | if opt in ('-o', '--output'): | |
| 72 | 73 | dstfilename = arg | |
@@ -87,6 +88,8 @@ def buildapplet(): | |||
| 87 | 88 | verbose = Verbose() | |
| 88 | 89 | elif opt in ('-?', '--help'): | |
| 89 | 90 | usage() | |
| 91 | + elif opt in ('-d', '--destroot'): | ||
| 92 | + destroot = arg | ||
| 90 | 93 | # On OS9 always be verbose | |
| 91 | 94 | if sys.platform == 'mac' and not verbose: | |
| 92 | 95 | verbose = 'default' | |
@@ -97,7 +100,8 @@ def buildapplet(): | |||
| 97 | 100 | buildtools.update(template, filename, dstfilename) | |
| 98 | 101 | else: | |
| 99 | 102 | buildtools.process(template, filename, dstfilename, 1, | |
| 100 | - rsrcname=rsrcfilename, others=extras, raw=raw, progress=verbose) | ||
| 103 | + rsrcname=rsrcfilename, others=extras, raw=raw, | ||
| 104 | + progress=verbose, destroot=destroot) | ||
| 101 | 105 | ||
| 102 | 106 | def usage(): | |
| 103 | 107 | print "BuildApplet creates an application from a Python source file" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments