1995-09-01 09:03:32 -03:00
|
|
|
#
|
|
|
|
# fullbuild creates everything that needs to be created before a
|
|
|
|
# distribution can be made, and puts it all in the right place.
|
|
|
|
#
|
|
|
|
# It expects the projects to be in the places where Jack likes them:
|
1997-09-01 12:37:07 -03:00
|
|
|
# in directories named like 'build.mac'. That is fixable,
|
1995-09-01 09:03:32 -03:00
|
|
|
# however.
|
|
|
|
#
|
|
|
|
# NOTE: You should proably make a copy of python with which to execute this
|
|
|
|
# script, rebuilding running programs does not work...
|
|
|
|
|
2002-06-26 19:06:08 -03:00
|
|
|
CARBON_ONLY = 1
|
|
|
|
|
1997-09-01 12:37:07 -03:00
|
|
|
MACBUILDNO=":Mac:Include:macbuildno.h"
|
|
|
|
|
1995-09-01 09:03:32 -03:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import macfs
|
1996-02-21 11:28:49 -04:00
|
|
|
import MacOS
|
1996-04-10 11:51:14 -03:00
|
|
|
import EasyDialogs
|
2001-01-02 18:02:02 -04:00
|
|
|
import re
|
1997-09-01 12:37:07 -03:00
|
|
|
import string
|
2001-08-16 17:39:17 -03:00
|
|
|
import genpluginprojects
|
2001-08-27 18:41:23 -03:00
|
|
|
import macresource
|
1995-09-01 09:03:32 -03:00
|
|
|
|
|
|
|
import aetools
|
2001-08-25 09:15:04 -03:00
|
|
|
from Carbon import AppleEvents
|
2000-08-17 19:12:12 -03:00
|
|
|
|
2002-06-26 19:06:08 -03:00
|
|
|
import CodeWarrior
|
1997-05-06 13:15:32 -03:00
|
|
|
|
2001-08-25 09:15:04 -03:00
|
|
|
from Carbon import Res
|
|
|
|
from Carbon import Dlg
|
1995-09-01 09:03:32 -03:00
|
|
|
|
1998-07-31 06:45:27 -03:00
|
|
|
import buildtools
|
1997-05-06 13:15:32 -03:00
|
|
|
import cfmfile
|
|
|
|
|
|
|
|
# Dialog resource. Note that the item numbers should correspond
|
|
|
|
# to those in the DITL resource. Also note that the order is important:
|
|
|
|
# things are built in this order, so there should be no forward dependencies.
|
|
|
|
DIALOG_ID = 512
|
|
|
|
|
|
|
|
I_OK=1
|
|
|
|
I_CANCEL=2
|
2001-01-03 07:12:21 -04:00
|
|
|
# label 3
|
|
|
|
I_PPC_EXTLIBS=4
|
|
|
|
I_GEN_PROJECTS=5
|
2001-01-21 18:25:11 -04:00
|
|
|
I_GEN_PROJECTS_FORCE=6
|
|
|
|
I_GEN_IMGPROJECTS=7
|
|
|
|
I_GEN_IMGPROJECTS_FORCE=8
|
|
|
|
I_INC_BUILDNO=9
|
|
|
|
# label 10
|
|
|
|
I_PPC_CORE=11
|
|
|
|
I_PPC_PLUGINS=12
|
|
|
|
I_PPC_EXTENSIONS=13
|
|
|
|
# label 14
|
|
|
|
I_CARBON_CORE=15
|
|
|
|
I_CARBON_PLUGINS=16
|
|
|
|
I_CARBON_EXTENSIONS=17
|
2001-02-12 10:46:53 -04:00
|
|
|
I_INTERPRETER=18
|
|
|
|
# label 19
|
|
|
|
I_PPC_FULL=20
|
|
|
|
I_PPC_SMALL=21
|
|
|
|
# label 22
|
|
|
|
I_CARBON_FULL=23
|
|
|
|
I_CARBON_SMALL=24
|
|
|
|
# label 25
|
|
|
|
I_APPLETS=26
|
2001-01-21 18:25:11 -04:00
|
|
|
|
2001-02-12 10:46:53 -04:00
|
|
|
N_BUTTONS=27
|
1997-08-27 11:10:29 -03:00
|
|
|
|
2002-06-26 19:06:08 -03:00
|
|
|
if CARBON_ONLY:
|
|
|
|
BUTTONS_DISABLE = [
|
|
|
|
I_PPC_EXTLIBS,
|
|
|
|
I_PPC_CORE,
|
|
|
|
I_PPC_PLUGINS,
|
|
|
|
I_PPC_EXTENSIONS,
|
|
|
|
I_INTERPRETER,
|
|
|
|
I_PPC_FULL,
|
|
|
|
I_PPC_SMALL,
|
|
|
|
]
|
2000-08-17 19:12:12 -03:00
|
|
|
else:
|
2002-06-26 19:06:08 -03:00
|
|
|
BUTTONS_DISABLE = []
|
|
|
|
|
1996-04-10 11:51:14 -03:00
|
|
|
RUNNING=[]
|
1995-09-01 09:03:32 -03:00
|
|
|
|
|
|
|
def buildmwproject(top, creator, projects):
|
|
|
|
"""Build projects with an MW compiler"""
|
2002-06-26 19:06:08 -03:00
|
|
|
mgr = CodeWarrior.CodeWarrior(creator, start=1)
|
1996-02-21 11:28:49 -04:00
|
|
|
mgr.send_timeout = AppleEvents.kNoTimeOut
|
|
|
|
|
2000-07-24 16:45:07 -03:00
|
|
|
failed = []
|
1995-09-01 09:03:32 -03:00
|
|
|
for file in projects:
|
1997-08-27 11:10:29 -03:00
|
|
|
if type(file) == type(()):
|
|
|
|
file, target = file
|
|
|
|
else:
|
|
|
|
target = ''
|
1995-09-01 09:03:32 -03:00
|
|
|
file = os.path.join(top, file)
|
1999-01-30 14:27:12 -04:00
|
|
|
try:
|
|
|
|
fss = macfs.FSSpec(file)
|
2001-01-03 07:12:21 -04:00
|
|
|
except MacOS.Error:
|
1999-01-30 14:27:12 -04:00
|
|
|
print '** file not found:', file
|
|
|
|
continue
|
1997-08-27 11:10:29 -03:00
|
|
|
print 'Building', file, target
|
1999-01-30 14:27:12 -04:00
|
|
|
try:
|
|
|
|
mgr.open(fss)
|
|
|
|
except aetools.Error, detail:
|
|
|
|
print '**', detail, file
|
|
|
|
continue
|
1997-08-27 11:10:29 -03:00
|
|
|
if target:
|
|
|
|
try:
|
|
|
|
mgr.Set_Current_Target(target)
|
|
|
|
except aetools.Error, arg:
|
|
|
|
print '**', file, target, 'Cannot select:', arg
|
1996-02-21 11:28:49 -04:00
|
|
|
try:
|
|
|
|
mgr.Make_Project()
|
1996-09-20 12:30:52 -03:00
|
|
|
except aetools.Error, arg:
|
1997-08-27 11:10:29 -03:00
|
|
|
print '**', file, target, 'Failed:', arg
|
2000-07-24 16:45:07 -03:00
|
|
|
failed.append(fss)
|
1995-09-01 09:03:32 -03:00
|
|
|
mgr.Close_Project()
|
2000-07-24 16:45:07 -03:00
|
|
|
if failed:
|
|
|
|
print 'Open failed projects and exit?',
|
|
|
|
rv = sys.stdin.readline()
|
|
|
|
if rv[0] in ('y', 'Y'):
|
|
|
|
for fss in failed:
|
|
|
|
mgr.open(fss)
|
|
|
|
sys.exit(0)
|
1996-04-10 11:51:14 -03:00
|
|
|
## mgr.quit()
|
1995-09-01 09:03:32 -03:00
|
|
|
|
|
|
|
def buildapplet(top, dummy, list):
|
1997-05-06 13:15:32 -03:00
|
|
|
"""Create python applets"""
|
2001-02-17 19:31:48 -04:00
|
|
|
for src, dst, tmpl in list:
|
|
|
|
template = buildtools.findtemplate(tmpl)
|
1995-09-01 09:03:32 -03:00
|
|
|
if src[-3:] != '.py':
|
|
|
|
raise 'Should end in .py', src
|
|
|
|
base = os.path.basename(src)
|
|
|
|
src = os.path.join(top, src)
|
1999-01-31 21:21:18 -04:00
|
|
|
dst = os.path.join(top, dst)
|
1995-09-01 09:03:32 -03:00
|
|
|
try:
|
|
|
|
os.unlink(dst)
|
|
|
|
except os.error:
|
|
|
|
pass
|
|
|
|
print 'Building applet', dst
|
2001-02-17 19:31:48 -04:00
|
|
|
try:
|
|
|
|
buildtools.process(template, src, dst, 1)
|
|
|
|
except buildtools.BuildError, arg:
|
|
|
|
print '**', dst, arg
|
1997-05-06 13:15:32 -03:00
|
|
|
|
2001-01-21 18:25:11 -04:00
|
|
|
def buildprojectfile(top, arg, list):
|
2001-01-03 07:12:21 -04:00
|
|
|
"""Create CodeWarrior project files with a script"""
|
|
|
|
for folder, module, routine in list:
|
|
|
|
print "Generating project files with", module
|
|
|
|
sys.path.insert(0, os.path.join(top, folder))
|
|
|
|
m = __import__(module)
|
|
|
|
r = getattr(m, routine)
|
2001-01-21 18:25:11 -04:00
|
|
|
r(arg)
|
2001-01-03 07:12:21 -04:00
|
|
|
del sys.path[0]
|
|
|
|
|
1997-05-06 13:15:32 -03:00
|
|
|
def buildfat(top, dummy, list):
|
|
|
|
"""Build fat binaries"""
|
|
|
|
for dst, src1, src2 in list:
|
|
|
|
dst = os.path.join(top, dst)
|
|
|
|
src1 = os.path.join(top, src1)
|
|
|
|
src2 = os.path.join(top, src2)
|
|
|
|
print 'Building fat binary', dst
|
|
|
|
cfmfile.mergecfmfiles((src1, src2), dst)
|
|
|
|
|
2001-02-12 10:46:53 -04:00
|
|
|
def buildcopy(top, dummy, list):
|
|
|
|
import macostools
|
|
|
|
for src, dst in list:
|
|
|
|
src = os.path.join(top, src)
|
|
|
|
dst = os.path.join(top, dst)
|
2001-03-06 18:46:25 -04:00
|
|
|
macostools.copy(src, dst, forcetype="APPL")
|
2001-02-12 10:46:53 -04:00
|
|
|
|
2002-06-27 19:09:19 -03:00
|
|
|
def buildsetup(top, dummy, list):
|
|
|
|
print 'Building extensions with setup.py ', ' '.join(list)
|
|
|
|
argv = ['setup.py'] + list[:]
|
|
|
|
save_argv = sys.argv
|
|
|
|
sys.argv = argv
|
|
|
|
sys.path.insert(0, top)
|
|
|
|
m = __import__('setup')
|
|
|
|
r = getattr(m, 'main')
|
|
|
|
r()
|
|
|
|
del sys.path[0]
|
|
|
|
sys.argv = save_argv
|
|
|
|
|
|
|
|
def buildcarbonplugins(top, dummy1, dummy2):
|
|
|
|
## XXXX Need to convert pathnames, I guess, and adapt distutils Mac-specific
|
|
|
|
## code to not call GetArgv if not needed.
|
|
|
|
## buildsetup(top, None, [
|
|
|
|
## '--dry_run',
|
|
|
|
## 'install',
|
|
|
|
## '--prefix=%s' % sys.prefix,
|
|
|
|
## '--install-scripts=%s' % os.path.join(sys.prefix, 'Scripts'),
|
|
|
|
## '--install-platlib=%s' % os.path.join(sys.prefix, 'Lib', 'lib-dynload')
|
|
|
|
## ])
|
|
|
|
buildmwproject(top, "CWIE", [
|
|
|
|
(":Mac:Build:_weakref.carbon.mcp", "_weakref.carbon"),
|
|
|
|
(":Mac:Build:_symtable.carbon.mcp", "_symtable.carbon"),
|
|
|
|
(":Mac:Build:_testcapi.carbon.mcp", "_testcapi.carbon"),
|
|
|
|
(":Mac:Build:_hotshot.carbon.mcp", "_hotshot.carbon"),
|
|
|
|
(":Mac:Build:xx.carbon.mcp", "xx.carbon"),
|
|
|
|
(":Mac:Build:xxsubtype.carbon.mcp", "xxsubtype.carbon"),
|
|
|
|
(":Mac:Build:pyexpat.carbon.mcp", "pyexpat.carbon"),
|
|
|
|
(":Mac:Build:calldll.carbon.mcp", "calldll.carbon"),
|
|
|
|
(":Mac:Build:gdbm.carbon.mcp", "gdbm.carbon"),
|
|
|
|
(":Mac:Build:icglue.carbon.mcp", "icglue.carbon"),
|
|
|
|
(":Mac:Build:waste.carbon.mcp", "waste.carbon"),
|
|
|
|
(":Mac:Build:zlib.carbon.mcp", "zlib.carbon"),
|
|
|
|
(":Mac:Build:hfsplus.carbon.mcp", "hfsplus.carbon"),
|
|
|
|
## (":Mac:Build:_dummy_tkinter.mcp", "_tkinter.carbon"),
|
|
|
|
(":Extensions:Imaging:_tkinter.mcp", "_tkinter.carbon"),
|
|
|
|
(":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"),
|
|
|
|
(":Mac:Build:_AE.carbon.mcp", "_AE.carbon"),
|
2002-09-06 19:59:00 -03:00
|
|
|
(":Mac:Build:_AH.carbon.mcp", "_AH.carbon"),
|
2002-06-27 19:09:19 -03:00
|
|
|
(":Mac:Build:_App.carbon.mcp", "_App.carbon"),
|
|
|
|
(":Mac:Build:_CF.carbon.mcp", "_CF.carbon"),
|
|
|
|
(":Mac:Build:_CG.carbon.mcp", "_CG.carbon"),
|
|
|
|
(":Mac:Build:_CarbonEvt.carbon.mcp", "_CarbonEvt.carbon"),
|
|
|
|
(":Mac:Build:_Cm.carbon.mcp", "_Cm.carbon"),
|
|
|
|
(":Mac:Build:_Ctl.carbon.mcp", "_Ctl.carbon"),
|
|
|
|
(":Mac:Build:_Dlg.carbon.mcp", "_Dlg.carbon"),
|
|
|
|
(":Mac:Build:_Drag.carbon.mcp", "_Drag.carbon"),
|
|
|
|
(":Mac:Build:_Evt.carbon.mcp", "_Evt.carbon"),
|
|
|
|
(":Mac:Build:_Fm.carbon.mcp", "_Fm.carbon"),
|
2002-08-05 11:12:24 -03:00
|
|
|
(":Mac:Build:_IBCarbon.carbon.mcp", "_IBCarbon.carbon"),
|
2002-06-27 19:09:19 -03:00
|
|
|
(":Mac:Build:_Icn.carbon.mcp", "_Icn.carbon"),
|
|
|
|
(":Mac:Build:_List.carbon.mcp", "_List.carbon"),
|
|
|
|
(":Mac:Build:_Menu.carbon.mcp", "_Menu.carbon"),
|
|
|
|
(":Mac:Build:_Mlte.carbon.mcp", "_Mlte.carbon"),
|
|
|
|
(":Mac:Build:_Qd.carbon.mcp", "_Qd.carbon"),
|
|
|
|
(":Mac:Build:_Qdoffs.carbon.mcp", "_Qdoffs.carbon"),
|
|
|
|
(":Mac:Build:_Qt.carbon.mcp", "_Qt.carbon"),
|
|
|
|
(":Mac:Build:_Res.carbon.mcp", "_Res.carbon"),
|
|
|
|
(":Mac:Build:_Scrap.carbon.mcp", "_Scrap.carbon"),
|
|
|
|
(":Mac:Build:_Snd.carbon.mcp", "_Snd.carbon"),
|
|
|
|
(":Mac:Build:_Sndihooks.carbon.mcp", "_Sndihooks.carbon"),
|
|
|
|
(":Mac:Build:_TE.carbon.mcp", "_TE.carbon"),
|
|
|
|
(":Mac:Build:_Win.carbon.mcp", "_Win.carbon"),
|
|
|
|
])
|
|
|
|
|
1997-09-09 10:57:15 -03:00
|
|
|
def handle_dialog(filename):
|
1997-05-06 13:15:32 -03:00
|
|
|
"""Handle selection dialog, return list of selected items"""
|
|
|
|
d = Dlg.GetNewDialog(DIALOG_ID, -1)
|
|
|
|
d.SetDialogDefaultItem(I_OK)
|
|
|
|
d.SetDialogCancelItem(I_CANCEL)
|
|
|
|
results = [0]*N_BUTTONS
|
2002-06-26 19:06:08 -03:00
|
|
|
for n in BUTTONS_DISABLE:
|
|
|
|
ctl = d.GetDialogItemAsControl(n)
|
|
|
|
ctl.HideControl()
|
1997-05-06 13:15:32 -03:00
|
|
|
while 1:
|
|
|
|
n = Dlg.ModalDialog(None)
|
|
|
|
if n == I_OK:
|
|
|
|
break
|
|
|
|
if n == I_CANCEL:
|
|
|
|
return []
|
1997-09-09 10:57:15 -03:00
|
|
|
if n == I_INC_BUILDNO:
|
|
|
|
incbuildno(filename)
|
|
|
|
continue
|
1997-05-06 13:15:32 -03:00
|
|
|
if n < len(results):
|
|
|
|
results[n] = (not results[n])
|
1999-12-24 09:39:23 -04:00
|
|
|
ctl = d.GetDialogItemAsControl(n)
|
|
|
|
ctl.SetControlValue(results[n])
|
1997-05-06 13:15:32 -03:00
|
|
|
rv = []
|
|
|
|
for i in range(len(results)):
|
|
|
|
if results[i]:
|
|
|
|
rv.append(i)
|
|
|
|
return rv
|
1995-09-01 09:03:32 -03:00
|
|
|
|
|
|
|
#
|
|
|
|
# The build instructions. Entries are (routine, arg, list-of-files)
|
|
|
|
# XXXX We could also include the builds for stdwin and such here...
|
1997-05-06 13:15:32 -03:00
|
|
|
BUILD_DICT = {
|
2001-01-21 18:25:11 -04:00
|
|
|
I_GEN_PROJECTS : (buildprojectfile, 0, [
|
|
|
|
(":Mac:scripts", "genpluginprojects", "genallprojects")
|
|
|
|
]),
|
|
|
|
|
|
|
|
I_GEN_PROJECTS_FORCE : (buildprojectfile, 1, [
|
2001-01-03 07:12:21 -04:00
|
|
|
(":Mac:scripts", "genpluginprojects", "genallprojects")
|
|
|
|
]),
|
|
|
|
|
2001-01-21 18:25:11 -04:00
|
|
|
I_GEN_IMGPROJECTS : (buildprojectfile, 0, [
|
2001-01-03 07:12:21 -04:00
|
|
|
(":Extensions:img:Mac", "genimgprojects", "genallprojects")
|
|
|
|
]),
|
|
|
|
|
2001-01-21 18:25:11 -04:00
|
|
|
I_GEN_IMGPROJECTS_FORCE : (buildprojectfile, 1, [
|
|
|
|
(":Extensions:img:Mac", "genimgprojects", "genallprojects")
|
|
|
|
]),
|
|
|
|
|
2001-02-12 10:46:53 -04:00
|
|
|
I_INTERPRETER : (buildcopy, None, [
|
|
|
|
("PythonInterpreterCarbon", "PythonInterpreter"),
|
|
|
|
]),
|
|
|
|
|
2001-01-21 18:25:11 -04:00
|
|
|
I_PPC_CORE : (buildmwproject, "CWIE", [
|
2000-12-03 18:36:42 -04:00
|
|
|
(":Mac:Build:PythonCore.mcp", "PythonCore"),
|
2001-02-12 10:46:53 -04:00
|
|
|
(":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterClassic"),
|
1997-05-06 13:15:32 -03:00
|
|
|
]),
|
|
|
|
|
2001-01-21 18:25:11 -04:00
|
|
|
I_CARBON_CORE : (buildmwproject, "CWIE", [
|
|
|
|
(":Mac:Build:PythonCore.mcp", "PythonCoreCarbon"),
|
|
|
|
(":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterCarbon"),
|
|
|
|
]),
|
|
|
|
|
2001-01-03 07:12:21 -04:00
|
|
|
I_PPC_EXTLIBS : (buildmwproject, "CWIE", [
|
|
|
|
## (":Mac:Build:buildlibs.mcp", "buildlibs ppc plus tcl/tk"),
|
|
|
|
(":Mac:Build:buildlibs.mcp", "buildlibs ppc"),
|
|
|
|
]),
|
|
|
|
|
1997-05-06 13:15:32 -03:00
|
|
|
I_PPC_PLUGINS : (buildmwproject, "CWIE", [
|
2001-02-12 10:46:53 -04:00
|
|
|
(":Mac:Build:_weakref.mcp", "_weakref.ppc"),
|
|
|
|
(":Mac:Build:_symtable.mcp", "_symtable.ppc"),
|
|
|
|
(":Mac:Build:_testcapi.mcp", "_testcapi.ppc"),
|
2001-10-23 19:23:44 -03:00
|
|
|
(":Mac:Build:_hotshot.mcp", "_hotshot.ppc"),
|
2001-08-29 19:08:06 -03:00
|
|
|
(":Mac:Build:xx.mcp", "xx.ppc"),
|
|
|
|
(":Mac:Build:xxsubtype.mcp", "xxsubtype.ppc"),
|
2000-12-03 18:36:42 -04:00
|
|
|
(":Mac:Build:pyexpat.mcp", "pyexpat.ppc"),
|
|
|
|
(":Mac:Build:calldll.mcp", "calldll.ppc"),
|
|
|
|
(":Mac:Build:ctb.mcp", "ctb.ppc"),
|
|
|
|
(":Mac:Build:gdbm.mcp", "gdbm.ppc"),
|
|
|
|
(":Mac:Build:icglue.mcp", "icglue.ppc"),
|
|
|
|
(":Mac:Build:macspeech.mcp", "macspeech.ppc"),
|
|
|
|
(":Mac:Build:waste.mcp", "waste.ppc"),
|
|
|
|
(":Mac:Build:zlib.mcp", "zlib.ppc"),
|
|
|
|
## (":Mac:Build:_tkinter.mcp", "_tkinter.ppc"),
|
2001-01-01 17:51:33 -04:00
|
|
|
(":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"),
|
2000-12-03 18:36:42 -04:00
|
|
|
(":Mac:Build:ColorPicker.mcp", "ColorPicker.ppc"),
|
|
|
|
(":Mac:Build:Printing.mcp", "Printing.ppc"),
|
2001-08-23 10:51:46 -03:00
|
|
|
(":Mac:Build:_AE.mcp", "_AE.ppc"),
|
|
|
|
(":Mac:Build:_App.mcp", "_App.ppc"),
|
|
|
|
(":Mac:Build:_Cm.mcp", "_Cm.ppc"),
|
|
|
|
(":Mac:Build:_Ctl.mcp", "_Ctl.ppc"),
|
|
|
|
(":Mac:Build:_Dlg.mcp", "_Dlg.ppc"),
|
|
|
|
(":Mac:Build:_Drag.mcp", "_Drag.ppc"),
|
|
|
|
(":Mac:Build:_Evt.mcp", "_Evt.ppc"),
|
|
|
|
(":Mac:Build:_Fm.mcp", "_Fm.ppc"),
|
|
|
|
(":Mac:Build:_Help.mcp", "_Help.ppc"),
|
|
|
|
(":Mac:Build:_Icn.mcp", "_Icn.ppc"),
|
|
|
|
(":Mac:Build:_List.mcp", "_List.ppc"),
|
|
|
|
(":Mac:Build:_Menu.mcp", "_Menu.ppc"),
|
|
|
|
(":Mac:Build:_Mlte.mcp", "_Mlte.ppc"),
|
|
|
|
(":Mac:Build:_Qd.mcp", "_Qd.ppc"),
|
|
|
|
(":Mac:Build:_Qdoffs.mcp", "_Qdoffs.ppc"),
|
|
|
|
(":Mac:Build:_Qt.mcp", "_Qt.ppc"),
|
|
|
|
(":Mac:Build:_Res.mcp", "_Res.ppc"),
|
|
|
|
(":Mac:Build:_Scrap.mcp", "_Scrap.ppc"),
|
|
|
|
(":Mac:Build:_Snd.mcp", "_Snd.ppc"),
|
|
|
|
(":Mac:Build:_Sndihooks.mcp", "_Sndihooks.ppc"),
|
|
|
|
(":Mac:Build:_TE.mcp", "_TE.ppc"),
|
|
|
|
(":Mac:Build:_Win.mcp", "_Win.ppc"),
|
1997-05-06 13:15:32 -03:00
|
|
|
]),
|
|
|
|
|
2002-06-27 19:09:19 -03:00
|
|
|
I_CARBON_PLUGINS : (buildcarbonplugins, None, []),
|
1997-05-06 13:15:32 -03:00
|
|
|
|
2001-01-24 10:06:35 -04:00
|
|
|
I_PPC_FULL : (buildmwproject, "CWIE", [
|
|
|
|
(":Mac:Build:PythonStandalone.mcp", "PythonStandalone"),
|
|
|
|
]),
|
|
|
|
|
1997-05-06 13:15:32 -03:00
|
|
|
I_PPC_SMALL : (buildmwproject, "CWIE", [
|
2000-12-03 18:36:42 -04:00
|
|
|
(":Mac:Build:PythonStandSmall.mcp", "PythonStandSmall"),
|
1997-05-06 13:15:32 -03:00
|
|
|
]),
|
|
|
|
|
2001-02-12 10:46:53 -04:00
|
|
|
I_CARBON_FULL : (buildmwproject, "CWIE", [
|
|
|
|
(":Mac:Build:PythonStandalone.mcp", "PythonCarbonStandalone"),
|
|
|
|
]),
|
|
|
|
|
|
|
|
I_CARBON_SMALL : (buildmwproject, "CWIE", [
|
|
|
|
(":Mac:Build:PythonStandSmall.mcp", "PythonStandSmallCarbon"),
|
|
|
|
]),
|
|
|
|
|
1997-05-06 13:15:32 -03:00
|
|
|
I_PPC_EXTENSIONS : (buildmwproject, "CWIE", [
|
2000-12-03 18:36:42 -04:00
|
|
|
(":Extensions:Imaging:_imaging.mcp", "_imaging.ppc"),
|
|
|
|
## (":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"),
|
2001-01-23 19:19:41 -04:00
|
|
|
(":Extensions:img:Mac:imgmodules.mcp", "imgmodules.ppc"),
|
1997-05-06 13:15:32 -03:00
|
|
|
]),
|
|
|
|
|
2001-01-23 19:19:41 -04:00
|
|
|
I_CARBON_EXTENSIONS : (buildmwproject, "CWIE", [
|
2001-03-01 19:15:01 -04:00
|
|
|
(":Extensions:Imaging:_imaging.mcp", "_imaging.carbon"),
|
2001-01-23 19:19:41 -04:00
|
|
|
## (":Extensions:Imaging:_tkinter.mcp", "_tkinter.carbon"),
|
|
|
|
(":Extensions:img:Mac:imgmodules.mcp", "imgmodules.carbon"),
|
|
|
|
]),
|
|
|
|
|
1997-05-06 13:15:32 -03:00
|
|
|
I_APPLETS : (buildapplet, None, [
|
2001-02-17 19:31:48 -04:00
|
|
|
(":Mac:scripts:EditPythonPrefs.py", "EditPythonPrefs", None),
|
|
|
|
(":Mac:scripts:BuildApplet.py", "BuildApplet", None),
|
|
|
|
(":Mac:scripts:BuildApplication.py", "BuildApplication", None),
|
|
|
|
(":Mac:scripts:ConfigurePython.py", "ConfigurePython", None),
|
2002-08-22 20:37:00 -03:00
|
|
|
## (":Mac:scripts:ConfigurePython.py", "ConfigurePythonCarbon", "PythonInterpreterCarbon"),
|
|
|
|
## (":Mac:scripts:ConfigurePython.py", "ConfigurePythonClassic", "PythonInterpreterClassic"),
|
2001-02-17 19:31:48 -04:00
|
|
|
(":Mac:Tools:IDE:PythonIDE.py", "Python IDE", None),
|
|
|
|
(":Mac:Tools:CGI:PythonCGISlave.py", ":Mac:Tools:CGI:PythonCGISlave", None),
|
|
|
|
(":Mac:Tools:CGI:BuildCGIApplet.py", ":Mac:Tools:CGI:BuildCGIApplet", None),
|
1997-05-06 13:15:32 -03:00
|
|
|
]),
|
|
|
|
}
|
1997-09-01 12:37:07 -03:00
|
|
|
|
|
|
|
def incbuildno(filename):
|
|
|
|
fp = open(filename)
|
|
|
|
line = fp.readline()
|
|
|
|
fp.close()
|
|
|
|
|
2001-01-02 18:02:02 -04:00
|
|
|
pat = re.compile('#define BUILD ([0-9]+)')
|
|
|
|
m = pat.search(line)
|
|
|
|
if not m or not m.group(1):
|
1997-09-01 12:37:07 -03:00
|
|
|
raise 'Incorrect macbuildno.h line', line
|
2001-01-02 18:02:02 -04:00
|
|
|
buildno = m.group(1)
|
1997-09-01 12:37:07 -03:00
|
|
|
new = string.atoi(buildno) + 1
|
|
|
|
fp = open(filename, 'w')
|
|
|
|
fp.write('#define BUILD %d\n'%new)
|
|
|
|
fp.close()
|
1995-09-01 09:03:32 -03:00
|
|
|
|
|
|
|
def main():
|
2001-08-27 18:41:23 -03:00
|
|
|
macresource.need('DLOG', DIALOG_ID, 'fullbuild.rsrc')
|
1995-09-01 09:03:32 -03:00
|
|
|
dir, ok = macfs.GetDirectory('Python source folder:')
|
|
|
|
if not ok:
|
|
|
|
sys.exit(0)
|
|
|
|
dir = dir.as_pathname()
|
2001-08-16 17:39:17 -03:00
|
|
|
# Set genpluginprojects to use this folder (slight hack)
|
|
|
|
genpluginprojects.PYTHONDIR = dir
|
1997-05-06 13:15:32 -03:00
|
|
|
|
1997-09-09 10:57:15 -03:00
|
|
|
todo = handle_dialog(os.path.join(dir, MACBUILDNO))
|
|
|
|
|
1997-05-06 13:15:32 -03:00
|
|
|
instructions = []
|
|
|
|
for i in todo:
|
|
|
|
instructions.append(BUILD_DICT[i])
|
|
|
|
|
|
|
|
for routine, arg, list in instructions:
|
1997-05-07 12:52:12 -03:00
|
|
|
routine(dir, arg, list)
|
1997-05-06 13:15:32 -03:00
|
|
|
|
2001-01-03 07:12:21 -04:00
|
|
|
if todo:
|
|
|
|
print "All done!"
|
1995-09-01 09:03:32 -03:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|
|
|
|
|