]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/distrib/mac/wxPythonOSX/build
update from herbert breunung
[wxWidgets.git] / wxPython / distrib / mac / wxPythonOSX / build
index b3221c8100cd15ee16f81229075f8816001f20ef..7af4412db953f8a88a485336a7fb2a32cd60674b 100755 (executable)
@@ -10,6 +10,13 @@ if [ ! -d wxPython -o ! -e ${spectemplate} ]; then
     exit 1
 fi
 
+if [ ! "$UID" = "0" ]; then
+    echo "-------------------------------------------------------"
+    echo " WARNING:  will be unable to change ownership of files"
+    echo " unless this script is run as root or via sudo"
+    echo "-------------------------------------------------------"
+fi
+
 #----------------------------------------------------------------------
 # Check Parameters
 
@@ -22,7 +29,6 @@ function usage {
     echo ""
     echo "optional command flags:"
     echo "   skiptar        Don't unpack the tarball"
-    echo "   use_cvs        Use the CVS workspace instead of a tarfile"
     echo "   skipconfig     Don't run configure"
     echo "   skipbuild      Don't build wxWidgets or wxPython"
     echo "   skipinstall    Don't do the installation step"
@@ -50,7 +56,6 @@ shift
 for flag in $*; do
     case ${flag} in
        skiptar)     skiptar=1                   ;;
-       use_cvs)     skiptar=1; use_cvs=1        ;;
        skipconfig)  skipconfig=1; skiptar=1     ;;
        skipbuild)   skipbuild=1; skipconfig=1; skiptar=1 ;;
        skipinstall) skipinstall=1               ;;
@@ -70,11 +75,17 @@ PYPREFIX=`$PYTHON -c "import sys; print sys.exec_prefix"`
 PYLIB=$PYPREFIX/lib/python$PYVER
 SITEPACKAGES=$PYLIB/site-packages
 
-TARBALLDIR=/stuff/Development/wxPython/dist/$VERSION
+if [ -z "$TARBALLDIR" ]; then
+    
+    # this is a spot on my fileserver where the tarballs go, adjust 
+    # as needed for where you put the wxPython tarball...
+    TARBALLDIR=/stuff/Development/wxPython/dist/$VERSION
+fi
+
 TARBALL=$TARBALLDIR/wxPythonSrc-$VERSION.tar.gz
 
-PREFIX=/usr/lib/wxPython-$VERSION
-BINPREFIX=/usr/bin
+PREFIX=/usr/local/lib/wxPython-$VERSION
+BINPREFIX=/usr/local/bin
 
 WXROOT=`dirname $PWD`
 PROGDIR="`dirname \"$0\"`"
@@ -112,37 +123,6 @@ if [ -z "$skiptar" ]; then
     tar xzf $TARBALL
 fi
 
-if [ "$use_cvs" = 1 ]; then
-    # copy the cvs workspace, except for build dirs
-
-    mkdir -p wxPythonSrc-$VERSION
-
-    echo Finding updated files...
-    if [ -e .last_copy ]; then
-       FEXPR="-cnewer .last_copy"
-    fi
-    MEASURE=$WXROOT//
-    find $WXROOT $FEXPR -print \
-       | grep -v $WXROOT/bld \
-       | grep -v wxPython/build \
-       | grep -v wxPython/_build \
-       | grep -v CVS \
-       | grep -v .pyc \
-       | cut -b ${#MEASURE}- > filelist
-
-    for x in `cat filelist`; do
-       if [ -d "$WXROOT/$x" ]; then
-           mkdir -p "wxPythonSrc-$VERSION/$x"
-       else
-           echo $x
-           cp -p "$WXROOT/$x" "wxPythonSrc-$VERSION/$x"
-       fi
-    done
-
-    touch .last_copy
-fi
-
-
 cd wxPythonSrc-$VERSION
 WXDIR=`pwd`
 mkdir -p $WXDIR/bld
@@ -158,19 +138,18 @@ if [ -z "$skipconfig" ]; then
        --with-mac \
        --disable-monolithic \
        --with-opengl \
-       --enable-geometry \
-       --enable-optimise \
        --enable-sound \
        --enable-display \
+       --enable-geometry \
        --enable-precomp=no \
-       \
-       --with-libjpeg=builtin \
-       --with-libpng=builtin \
-       --with-libtiff=builtin \
-       --with-zlib=builtin \
-       \
        --enable-debug_flag
 
+##     --enable-optimise \
+##     --with-libjpeg=builtin \
+##     --with-libpng=builtin \
+##     --with-libtiff=builtin \
+##     --with-zlib=builtin \
+
 fi
 
 # Build wxWidgets and wxPython
@@ -183,18 +162,18 @@ if [ -z "$skipbuild" ]; then
     make -C contrib/src/stc
     make -C contrib/src/xrc
 
-    if [ ! -e $WXDIR/include/wx/gizmos ]; then
-       # Make some links so the wxPython build can find all the headers it needs
-       pushd $WXDIR/include/wx
-       ln -s ../../contrib/include/wx/* .
-       popd
-    fi
+    if [ ! -e $WXDIR/include/wx/gizmos ]; then
+#      # Make some links so the wxPython build can find all the headers it needs
+#      pushd $WXDIR/include/wx
+#      ln -s ../../contrib/include/wx/* .
+#      popd
+    fi
 
     # Build wxPython
     cd $WXDIR/wxPython
     $PYTHON setup.py \
        NO_SCRIPTS=1 \
-       WX_CONFIG="$WXDIR/bld/wx-config --prefix=$WXDIR --exec-prefix=$WXDIR/bld" \
+       WX_CONFIG="$WXDIR/bld/wx-config --inplace" \
        build
 
 
@@ -247,16 +226,11 @@ if [ -z "$skipinstall" ]; then
     cp $WXDIR/bld/contrib/utils/wxrc/wxrc $INSTALLROOT$BINPREFIX
 
 
-    # install the wxPython headers
-    cd $WXDIR/wxPython
-    cp -R include $INSTALLROOT$PREFIX
-    mkdir -p      $INSTALLROOT$PREFIX/include/wx/wxPython/i_files
-    cp src/*.i    $INSTALLROOT$PREFIX/include/wx/wxPython/i_files
-
-
     # Set premissions for files in $INSTALLROOT 
-    chown -R root:admin $INSTALLROOT
-    chmod -R g+w        $INSTALLROOT
+    if [ "$UID" = "0" ]; then
+       chown -R root:admin $INSTALLROOT
+       chmod -R g+w        $INSTALLROOT
+    fi
 fi
 
 popd
@@ -362,15 +336,12 @@ package before you can use any of the items below.
 
 
 
-   Docs/wxDocs          A folder containing the wxWidgets documentation
-                        bundled in .zip files, and a small wxPython
-                        application that can be used to view the docs.
-                        Just run viewer.pyw.
+   Docs/wxDocsViewer    An application that allows you to view the 
+                        wxWidgets documentation.
 
    Docs/licence         License files.
 
-   Docs/other           A few readmes, change log, etc.  The full 
-                        documentation is downloadable separately. 
+   Docs/other           A few readmes, change log, etc.  
 
 
    Samples/samples      Several small sample applications that 
@@ -387,13 +358,30 @@ EOF
 
 
     # wxDocs
-    pushd $DMGDIR/root/Docs
+    pushd $BUILDROOT
     tar xzvf $TARBALLDIR/wxPythonDocs-$VERSION.tar.gz
-    mv wxPython-$VERSION/docs  wxDocs
-    rm -r wxPython-$VERSION
-    mv wxDocs/viewdocs.py wxDocs/viewdocs.pyw
+    popd
+
+    # Make an app to launch viewdocs.py
+    $PYTHONW $PROGDIR/../buildapp.py \
+       --builddir=$DMGDIR/root/Docs \
+       --name=wxDocsViewer \
+       --mainprogram=$BUILDROOT/wxPython-$VERSION/docs/viewdocs.py \
+       --iconfile=$PROGDIR/Info.icns \
+       build
+
+    cp $BUILDROOT/wxPython-$VERSION/docs/*.zip $DMGDIR/root/Docs/wxDocsViewer.app/Contents/Resources
+
+    cat > "$DMGDIR/root/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
 
     # license files, docs, etc.
+    pushd $DMGDIR/root/Docs
     cp -pR $SRCROOT/wxPython/licence   .
     cp -pR $SRCROOT/wxPython/docs      .
     rm -rf docs/bin