Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Commit

Permalink
Changes needed to use the flat Installer package format on OSX.
Browse files Browse the repository at this point in the history
Currently can only be used when doing a local build instead of the full build system, but that will probably be good enough for a while.
  • Loading branch information
RobinD42 committed Sep 13, 2016
1 parent 2049b62 commit bc86337
Show file tree
Hide file tree
Showing 18 changed files with 742 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -14,6 +14,7 @@ reswig
/.gdb_history
/BUILD
/MANIFEST
/STAGING
/_build_dmg
/_build_rpm
/build
Expand Down
8 changes: 6 additions & 2 deletions build-wxpython.py
Expand Up @@ -89,6 +89,7 @@ def optionCleanCallback(option, opt_str, value, parser):
"installdir" : ("", "Installation root for wxWidgets, files will go to {installdir}/{prefix}"),
"build_dir" : ("", "Directory to store wx build files. (Not used on Windows)"),
"wxpy_installdir":("", "Installation root for wxPython, defaults to Python's site-packages."),
"multiversion" : (False, "Use the old-style multi-version install option."),
"extra_setup" : ("", "Extra args to pass on setup.py's command line."),
"extra_make" : ("", "Extra args to pass on [n]make's command line."),
}
Expand Down Expand Up @@ -374,7 +375,9 @@ def getVisCVersion():
build_options.append("--install")

PREFIX = wxbuild.getPrefixInFramework(options, WXWIN)


if options.multiversion:
wxpy_build_options.append("INSTALL_MULTIVERSION=1")

if not sys.platform.startswith("win"):
build_options.append('--builddir=%s' % WXPY_BUILD_DIR)
Expand All @@ -397,11 +400,11 @@ def getVisCVersion():
#-----------------------------------------------------------------------
# wxPython build


def macFixupInstallNames2(destprefix, # prefix where the files are currently located
instprefix, # prefix to write into the files
oldprefix # the prefix to be replaced, defaults to destprefix
):
return # TODO: is this function still needed?
print "**** macFixupInstallNames2(%s, %s, %s)" % ( destprefix, instprefix, oldprefix)
pwd = os.getcwd()
os.chdir(destprefix+'/lib')
Expand All @@ -421,6 +424,7 @@ def macFixupInstallNames2(destprefix, # prefix where the files are currently loc


def macFixDependencyInstallName(destdir, prefix, extension, buildDir):
return # TODO: is this function still needed?
print "**** macFixDependencyInstallName(%s, %s, %s, %s)" % (destdir, prefix, extension, buildDir)
pwd = os.getcwd()
os.chdir(destdir+prefix+'/lib')
Expand Down
1 change: 1 addition & 0 deletions distrib/DIRLIST
Expand Up @@ -236,6 +236,7 @@ wx/tools/Editra/src/ebmlib
wx/tools/Editra/src/eclib
wx/tools/Editra/src/extern
wx/tools/Editra/src/extern/aui
wx/tools/Editra/src/extern/dexml
wx/tools/Editra/src/extern/pygments
wx/tools/Editra/src/extern/pygments/filters
wx/tools/Editra/src/extern/pygments/formatters
Expand Down
46 changes: 31 additions & 15 deletions distrib/all/build-all
@@ -1,4 +1,4 @@
#!/usr/bin/python -u
#!/usr/bin/env python
#----------------------------------------------------------------------
# Name: build-all.py
# Purpose: Master build script for building all the wxPython
Expand All @@ -22,6 +22,8 @@ import os
import time
from taskrunner import Job, Task, TaskRunner, Config

#import mydbstub

#----------------------------------------------------------------------
# Configuration items

Expand Down Expand Up @@ -87,14 +89,23 @@ def getTasks(config_env):
Job("lenny", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/lenny", "lenny"], env=config_env),
Job("lenny64", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/lenny64", "lenny64"], env=config_env),
])

buildTasks = [ carbonTask,
cocoaTask,
cyclopsTask0,
#cyclopsTask1,
##cyclopsTask2,
#cyclopsTask3,
]


localBuild = Task([
Job("local", "distrib/all/local-build", ["2.7", "cocoa"], env=config_env)
])

if config_env['KIND'] == "local":
buildTasks = [ localBuild ]
else:

buildTasks = [ carbonTask,
cocoaTask,
cyclopsTask0,
#cyclopsTask1,
##cyclopsTask2,
#cyclopsTask3,
]

# Finalization. This is for things that must wait until all the
# builds are done, such as copying the installers someplace, sending
Expand All @@ -113,7 +124,7 @@ def usage():
print "build types:"
print " dryrun Do the build, but don't copy anywhere (default)"
print " daily Do a daily build, copy to starship"
print " release Do a normal release (cantidate) build, copy to starship"
print " release Do a normal release (candidate) build, copy to starship"
print ""
print "optional command flags:"
print " skipsource Don't build the source archives, use the ones"
Expand Down Expand Up @@ -141,12 +152,11 @@ def main(args):
if not os.path.isdir("distrib") or not os.path.isdir("wx"):
print "Please run this script from the root wxPython directory."
sys.exit(1)




# Check command line flags
for flag in args:
if flag in ["dryrun", "daily", "release"]:
if flag in ["dryrun", "daily", "release", "local"]:
config.KIND = flag

elif flag == "skipsource":
Expand Down Expand Up @@ -187,7 +197,6 @@ def main(args):
usage()
sys.exit(2)


# ensure the staging area exists
if not os.path.exists(config.STAGING_DIR):
os.makedirs(config.STAGING_DIR)
Expand All @@ -196,12 +205,19 @@ def main(args):
if config.KIND == "daily":
t = time.localtime()
config.DAILY = time.strftime("%Y%m%d") # should it include the hour too? 2-digit year?
file("DAILY_BUILD", "w").write(config.DAILY)
open("DAILY_BUILD", "w").write(config.DAILY)
sys.path.append('.')
#import imp
#print imp.find_module('setup')
import setup
v = config.VERSION = setup.VERSION
config.VER2 = '.'.join(v.split('.')[:2])

# Save the sys.platform and executable values in the environment too,
# which will be used for local builds.
config.PY_SYS_PLATFORM = sys.platform
config.PY_EXECUTABLE = sys.executable

config_env = config.asDict()
config_env.update(os.environ)

Expand Down
10 changes: 5 additions & 5 deletions distrib/all/build-docs
Expand Up @@ -8,14 +8,14 @@ if [ $skipdocs != yes ]; then
echo "Regenerating the reST docs..."
cd docs
for x in *.txt; do
rst2html $x `basename $x .txt`.html
rst2html $x `basename $x .txt`.html
done
rm -f *.orig
cd -
for doc in CHANGES BUILD MigrationGuide default; do
cp docs/$doc.* $STAGING_DIR
cp docs/$doc.* $STAGING_DIR
done

# build the doc and demo tarballs
distrib/make_demo_tarball
distrib/make_docs_tarball clean
Expand All @@ -24,8 +24,8 @@ if [ $skipdocs != yes ]; then

# build the new docs too
if [ $skipnewdocs != yes ]; then
docs/bin/everything
mv dist/wxPython-newdocs-$VERSION.tar.bz2 $STAGING_DIR
docs/bin/everything
mv dist/wxPython-newdocs-$VERSION.tar.bz2 $STAGING_DIR
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions distrib/all/build-environ.cfg
@@ -1,7 +1,7 @@

# the local spot that we put everything when done, before copying
# to remote hosts
STAGING_DIR = ./BUILD
STAGING_DIR = ./STAGING


# host name of the machine to use for windows builds
Expand All @@ -13,7 +13,7 @@ WIN_BUILD = /c/BUILD
# Just like the above
OSX_HOST_carbon = smallfry
OSX_HOST_cocoa = vm-macosx3
OSX_BUILD = /BUILD
OSX_BUILD = /tmp/BUILD


# Almost the same... Hosts and other info comes from the Job
Expand Down
4 changes: 2 additions & 2 deletions distrib/all/build-finalize
Expand Up @@ -7,9 +7,9 @@ set -o errexit

chmod a+r $STAGING_DIR/*

if [ $KIND = dryrun ]; then
if [ $KIND = dryrun -o $KIND = local ]; then
# we're done, leave the files in the staging dir and quit
echo "Not uploading dryrun."
echo "Not uploading dryrun or local build."
exit 0
fi

Expand Down
2 changes: 1 addition & 1 deletion distrib/all/do-build-osx
Expand Up @@ -181,7 +181,7 @@ EOF
$PYTHON $WXROOT/wxPython/distrib/mac/zappycfiles.py $INSTALLROOT > /dev/null
popd

# Set premissions for files in $INSTALLROOT
# Set permissions for files in $INSTALLROOT
if [ "$UID" = "0" ]; then
chown -R root:admin $INSTALLROOT
chmod -R g+w $INSTALLROOT
Expand Down
19 changes: 19 additions & 0 deletions distrib/all/local-build
@@ -0,0 +1,19 @@
#!/bin/bash
#--------------------------------------------------------------------------
# Build wxPython on the local system, without using the rest of the
# build environment, remote build machines, etc. Shells out from here
# to a platform specific script to do the actual work.
#--------------------------------------------------------------------------

echo Doing a LOCAL BUILD...

if [ $PY_SYS_PLATFORM = darwin ]; then
script=distrib/all/local-build-osx
else
echo Local builds on $PY_SYS_PLATFORM not yet supported
exit 1
fi

$script $@
exit $?

0 comments on commit bc86337

Please sign in to comment.