📄 build
字号:
rm -r $INSTALLROOT/Library/Python/$PYVER
fi
mkdir -p $INSTALLROOT/Library/Python/$PYVER
mv $INSTALLROOT/$SITEPACKAGES/* $INSTALLROOT/Library/Python/$PYVER
rm -r $INSTALLROOT/System
SITEPACKAGES=/Library/Python/$PYVER
fi
# install wxPython's tool scripts
mkdir -p $INSTALLROOT$BINPREFIX
cd $WXROOT/wxPython/scripts
python$PYVER CreateMacScripts.py $INSTALLROOT $BINPREFIX
# Remove the .pyc/.pyo files they just take up space and can be recreated
# during the install.
pushd $WXROOT/wxPython
$PYTHON $PROGDIR/../zappycfiles.py $INSTALLROOT > /dev/null
popd
# Set premissions for files in $INSTALLROOT
if [ "$UID" = "0" ]; then
chown -R root:admin $INSTALLROOT
chmod -R g+w $INSTALLROOT
fi
fi
if [ $APPLE_PYTHON == yes ]; then
SITEPACKAGES=/Library/Python/$PYVER
fi
PKGDIR=`cat $INSTALLROOT$SITEPACKAGES/wx.pth`
popd
#----------------------------------------------------------------------
# Make the Installer packages and disk image
if [ $skipdmg != yes ]; then
#-----------------------------------------------
# The main runtime installer package
# Make the welcome message
case $OSX_VERSION in
10.4) W_MSG="the Tiger (OS X 10.4.x Intel) version of" ;;
10.3) W_MSG="the Panther (OS X 10.3.x) version of" ;;
10.2) W_MSG="the Jaguar (OS X 10.2.x) version of" ;;
esac
if [ $universal == yes ]; then
W_MSG="the Universal (OS X 10.4.x and above) version of"
fi
cat > $RESOURCEDIR/Welcome.txt <<EOF
Welcome!
This Installer package will install the wxPython $CHARTYPE runtime $VERSION for $W_MSG MacPython-OSX $PYVER. This includes:
* The wxPython packages and modules
* The wxWidgets shared libraries and headers
* Some command line tool scripts, installed to /usr/local/bin.
You must install onto your current boot disk, eventhough the installer does not enforce this, otherwise things will not work.
You can install more than one version of the wxPython runtime if you desire. The most recently installed version will be the default wxPython, but you can choose another by setting the PYTHONPATH or by using the wxversion module. See http://wiki.wxpython.org/index.cgi/MultiVersionInstalls for more details.
Build date: `date`
EOF
# make the preflight script
cat > $RESOURCEDIR/preflight <<EOF
#!/bin/sh
# Cleanup any old install of the wxPython package
rm -rf \$2$SITEPACKAGES/wxPython
rm -rf \$2$SITEPACKAGES/wx
rm -rf \$2$SITEPACKAGES/$PKGDIR
exit 0
EOF
chmod +x $RESOURCEDIR/preflight
# make the postflight script
cat > $RESOURCEDIR/postflight <<EOF
#!/bin/sh -e
# Compile the .py files in the wxPython pacakge
$PYTHON \$2$PYLIB/compileall.py \$2$SITEPACKAGES/$PKGDIR
$PYTHON -O \$2$PYLIB/compileall.py \$2$SITEPACKAGES/$PKGDIR
# and all of the wxPython pacakge should be group writable
chgrp -R admin \$2$SITEPACKAGES/$PKGDIR
chmod -R g+w \$2$SITEPACKAGES/$PKGDIR
exit 0
EOF
chmod +x $RESOURCEDIR/postflight
# Build the main Installer Package...
PKGNAME=wxPython${SHORTVER}-osx-$CHARTYPE-$TAG
if [ $PYVER != 2.3 ]; then
PKGNAME=wxPython${SHORTVER}-osx-$CHARTYPE-$TAG-py$PYVER
fi
rm -rf $PKGNAME.pkg
$PYTHON $PROGDIR/../buildpkg.py \
--Title=$PKGNAME \
--Version=$VERSION \
--Description="wxPython $CHARTYPE runtime $VERSION for $W_MSG MacPython-OSX $PYVER" \
--NeedsAuthorization="YES" \
--Relocatable="NO" \
--InstallOnly="YES" \
$INSTALLROOT \
$RESOURCEDIR
mv $PKGNAME.pkg $DMGROOT/$PKGNAME.pkg
rm $RESOURCEDIR/postflight
rm $RESOURCEDIR/preflight
rm $RESOURCEDIR/Welcome.txt
#-----------------------------------------------
# Make a README to go on the disk image
cat > "$DMGROOT/README 1st.txt" <<EOF
Welcome to wxPython!
This disk image contains the following items:
wxPython${SHORTVER}-osx-$CHARTYPE-$VERSION-$KIND
This Installer contains the wxPython runtime, compiled on a
$KIND OS X system, using the $CHARTYPE build of the wxWidgets
library. It includes the Python modules and extension
modules, as well as the wxWidgets libraries.
It is possible to have more than one version of the runtime
installed at once if you wish. The most recently installed
version will be the default wxPython, but you can choose
another by setting the PYTHONPATH or by using the wxversion
module. For more details see:
http://wiki.wxpython.org/index.cgi/MultiVersionInstalls
uninstall_wxPython.py
A simple tool to help you manage your installed versions of
wxPython. It will allow you to choose from the currently
installed wxPython packages and to select one for
uninstallation. It is a text-mode tool so you can either run
it from a Terminal command line, or you can open it with
PythonLauncher and let it create a Terminal to run it in.
NOTE: If you have versions prior to 2.5.3.1 installed, please
do run this uninstall tool to remove the older version.
EOF
cp $PROGDIR/../uninstall_wxPython.py $DMGROOT
#-----------------------------------------------
# Make a disk image to hold these files
dmgname=wxPython${SHORTVER}-osx-$CHARTYPE-$VERSION-$TAG-py$PYVER
$PROGDIR/../makedmg $DMGROOT $DMGDIR $dmgname
echo Moving $DMGDIR/$dmgname.dmg to $DESTDIR
mv $DMGDIR/$dmgname.dmg $DESTDIR/$dmgname.dmg
#---------------------------------------------------------------------------
# Now create app bundles for the demo, docs, and tools and make another
# disk image to hold it all.
#---------------------------------------------------------------------------
cat > "$DMGAPPS/README 1st.txt" <<EOF
Welcome to wxPython!
On this disk image you will find Demo, Tools, Docs, and etc. for
wxPython $VERSION. Everything here is optional and you can drag them
out of the disk image and drop them wherever you want. You will need
to have an installed wxPython runtime to be able to use any of them.
wxPython Demo An application bundle version of the demo.
(This has it's own copy of the demo sources
within the bundle.)
XRCed An application for editing wxPython resource
files (XRC files.)
PyCrust An application that provides an interactive
Python shell and also namespace inspectors.
Docs/wxDocsViewer An application that allows you to view the
wxWidgets documentation.
Docs/licence License files.
Docs/other A few readmes, change log, etc.
Samples/samples Several small sample applications that
demonstrate how to use wxPython.
Samples/demo A copy of the wxPython demo source code,
just open the folder and run demo.pyw.
Happy Hacking!
EOF
# PyAlaMode An extension of PyCrust that includes source
# file editing capabilities.
# wxDocs
if [ ! -e $TARBALLDIR/wxPython-docs-$VERSION.tar.bz2 ]; then
cat > "$DMGAPPS/Docs/Build ERROR.txt" <<EOF
The wxPython-docs tarball was not found when building this disk image!
EOF
else
pushd $BUILDROOT
tar xjvf $TARBALLDIR/wxPython-docs-$VERSION.tar.bz2
popd
# Make an app to launch viewdocs.py
$PYTHONW $PROGDIR/../buildapp.py \
--builddir=$DMGAPPS/Docs \
--name=wxDocsViewer \
--mainprogram=$BUILDROOT/wxPython-$VERSION/docs/viewdocs.py \
--iconfile=$PROGDIR/Info.icns \
build
cp $BUILDROOT/wxPython-$VERSION/docs/*.zip $DMGAPPS/Docs/wxDocsViewer.app/Contents/Resources
cat > "$DMGAPPS/Docs/README 1st.txt" <<EOF
The wxDocsViewer application needs to be copied to your Desktop (or
someplace else you have write access to) before you can run it, so it
can cache some indexes within its bundle.
EOF
fi
# license files, docs, etc.
pushd $DMGAPPS/Docs
cp -pR $SRCROOT/wxPython/licence .
cp -pR $SRCROOT/wxPython/docs .
rm -rf docs/bin
rm -rf docs/xml-raw
mv docs other
popd
if [ ! -e $TARBALLDIR/wxPython-demo-$VERSION.tar.bz2 ]; then
cat > "$DMGAPPS/Samples/Build ERROR.txt" <<EOF
The wxPython-$VERSION-demo tarball was not found when building this disk image!
EOF
cp "$DMGAPPS/Samples/Build ERROR.txt" $DMGAPPS
else
# Copy the demo and samples to the disk image from the tarball
pushd $DMGAPPS/Samples
tar xjvf $TARBALLDIR/wxPython-demo-$VERSION.tar.bz2
mv wxPython-$VERSION/* .
rm -rf wxPython-$VERSION
rm -f demo/b demo/.setup.sh
mv demo/demo.py demo/demo.pyw
popd
# Make an app bundle to run the demo
$PYTHONW $PROGDIR/../buildapp.py \
--builddir=$DMGAPPS \
--name="wxPython Demo" \
--mainprogram=$DMGAPPS/Samples/demo/demo.pyw \
--iconfile=$PROGDIR/RunDemo.icns \
build
cp -pR $DMGAPPS/Samples/demo/* "$DMGAPPS/wxPython Demo.app/Contents/Resources"
fi
# Make an app bundle to launch PyCrust
$PYTHONW $PROGDIR/../buildapp.py \
--builddir=$DMGAPPS \
--name=PyCrust \
--mainprogram=$INSTALLROOT$BINPREFIX/pycrust.py \
--iconfile=$PROGDIR/PieShell.icns \
build
## TODO: PyAlaMode needs tweaked to be able to run from a bundle. It
## needs to know to ignore command line parameters and etc...
# # and PyAlaMode
# $PYTHONW $PROGDIR/../buildapp.py \
# --builddir=$DMGAPPS \
# --name=PyAlaMode \
# --mainprogram=$INSTALLROOT$BINPREFIX/pyalamode.py \
# --iconfile=$PROGDIR/PieShell.icns \
# build
# Make an app to launch XRCed
$PYTHONW $PROGDIR/../buildapp.py \
--builddir=$DMGAPPS \
--name=XRCed \
--mainprogram=$INSTALLROOT$BINPREFIX/xrced.py \
--iconfile=$PROGDIR/XRCed.icns \
build
# and then finally make a disk image containing everything
dmgname=wxPython${SHORTVER}-osx-docs-demos-$VERSION-$TAG-py$PYVER
$PROGDIR/../makedmg $DMGAPPS $DMGDIR $dmgname
echo Moving $DMGDIR/$dmgname.dmg to $DESTDIR
mv $DMGDIR/$dmgname.dmg $DESTDIR/$dmgname.dmg
fi
# Cleanup build/install dirs
if [ $skipclean != yes ]; then
echo "Cleaning up..."
rm -rf $TMPDIR
else
echo "Cleanup is disabled. You should remove $TMPDIR when finished"
fi
exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -