Code

- committed patch 1710671 to osx-build.sh from John Faith which allows prior detectio...
authorjiho-sf <jiho-sf@users.sourceforge.net>
Tue, 1 May 2007 21:27:14 +0000 (21:27 +0000)
committerjiho-sf <jiho-sf@users.sourceforge.net>
Tue, 1 May 2007 21:27:14 +0000 (21:27 +0000)
- additional file existence checks in osx-build.sh
- added checks for success of each step of osx-build before proceeding to the next one (via exit status)
- split the PACKAGE action into a new PACKAGE action (creates the app bundle) and a DISTRIB action (creates the dmg image)
- added an exit status for osx-app and osx-dmg
- removed the old call to osx-dmg at the end of osx-app (it has been commented for a while anyway)

packaging/macosx/osx-app.sh
packaging/macosx/osx-build.sh
packaging/macosx/osx-dmg.sh

index 6fc9980c6f777d0d02c1e42817b754baf31aabc0..fe093d18b2eb86d114ba516a2448ff60422bdf8e 100755 (executable)
@@ -71,6 +71,11 @@ fi
 pkg=Inkscape
 package="$pkg.app"
 
+# Remove a previously existing package
+if [ -d $package ]; then
+       echo "Removing previous Inkscape.app"
+       rm -Rf $package
+fi
 
 strip=false
 while getopts 's' flag; do
@@ -245,8 +250,6 @@ fi
 # done)
 
 # Get all the icons and the rest of the script framework
-rsync -av $resdir/Resources/* $package/Contents/Resources/
+rsync -av --exclude ".svn" $resdir/Resources/* $package/Contents/Resources/
 
-# Make an image
-#/usr/bin/hdiutil create -srcfolder "$pkg.app" "$pkg.dmg"
-# ./osx-dmg.sh
+exit 0
index ad7a2eff642fa54627a8047ee83ffc71da416956..f532287c48ee2331b7ed79f2013a8e52bf58f252 100755 (executable)
@@ -56,9 +56,10 @@ Compilation script for Inkscape on Mac OS X.
     install the build products locally, inside the source
     directory (run make install)
   \033[1mp,pack,package\033[0m
-    package Inkscape in a double clickable .app bundle and
-    store it in a .dmg image for distribution
+    package Inkscape in a double clickable .app bundle 
     \033[1m-s,--strip\033[0m   remove debugging information in Inkscape package
+  \033[1md,dist,distrib\033[0m
+    store Inkscape.app in a disk image (dmg) for distribution
     \033[1m-py,--with-python\033[0m    specify python packages path for inclusion into the dmg image
        
 \033[1mEXAMPLES\033[0m
@@ -80,13 +81,17 @@ HERE=`pwd`
 SRCROOT=$HERE/../..            # we are currently in packaging/macosx
 
 # Defaults
-INSTALLPREFIX=$SRCROOT/Build/
+if [ "$INSTALLPREFIX" = "" ]
+then
+       INSTALLPREFIX=$SRCROOT/Build/
+fi
 SVNUPDATE="f"
 AUTOGEN="f"
 CONFIGURE="f"
 BUILD="f"
 INSTALL="f"
 PACKAGE="f"
+DISTRIB="f"
 
 STRIP="f"
 PYTHON="f"
@@ -99,9 +104,9 @@ do
        h|help)
                help 
                exit 1 ;;
-       u|up|update)
+   u|up|update)
                SVNUPDATE="t" ;;
-       a|auto|autogen)
+   a|auto|autogen)
                AUTOGEN="t" ;;
        c|conf|configure)
                CONFIGURE="t" ;;
@@ -111,9 +116,11 @@ do
                INSTALL="t" ;;
        p|pack|package)
                PACKAGE="t" ;;
+       d|dist|distrib)
+               DISTRIB="t" ;;
        # -p|--prefix)
-               #INSTALLPREFIX=$2
-               #shift 1 ;;
+       #       INSTALLPREFIX=$2
+       #       shift 1 ;;
        -s|-strip)
                STRIP="t" ;;
        -py|--with-python)
@@ -151,6 +158,11 @@ if [[ "$SVNUPDATE" == "t" ]]
 then
        cd $SRCROOT
        svn up
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nSVN update failed"
+               exit $status
+       fi
        cd $HERE
 fi
 
@@ -158,6 +170,11 @@ if [[ "$AUTOGEN" == "t" ]]
 then
        cd $SRCROOT
        ./autogen.sh
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nautogen failed"
+               exit $status
+       fi
        cd $HERE
 fi
 
@@ -165,7 +182,17 @@ if [[ "$CONFIGURE" == "t" ]]
 then
        ALLCONFFLAGS=`echo "$CONFFLAGS --prefix=$INSTALLPREFIX"`
        cd $SRCROOT
+       if [ ! -f configure ]
+       then
+               echo "Configure script not found in $SRCROOT. Run autogen.sh first"
+               exit 1
+       fi
        ./configure $ALLCONFFLAGS
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nConfigure failed"
+               exit $status
+       fi
        cd $HERE
 fi
 
@@ -173,6 +200,11 @@ if [[ "$BUILD" == "t" ]]
 then
        cd $SRCROOT
        make
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nBuild failed"
+               exit $status
+       fi
        cd $HERE
 fi
 
@@ -180,21 +212,58 @@ if [[ "$INSTALL" == "t" ]]
 then
        cd $SRCROOT
        make install
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nInstall failed"
+               exit $status
+       fi
        cd $HERE
 fi
 
-if [[ "$PACKAGE" == "t" ]]; then
+if [[ "$PACKAGE" == "t" ]]
+then
+       
+       # Detect strip parameter
        if [[ "$STRIP" == "t" ]]; then
                STRIPPARAM="-s"
        else
                STRIPPARAM=""
        fi
+       
+       # Test the existence of required files
+       if [ ! -e $INSTALLPREFIX/bin/inkscape ]
+       then
+               echo "The inkscape executable \"$INSTALLPREFIX/bin/inkscape\" cound not be found."
+               exit 1
+       fi
+       if [ ! -e $SRCROOT/Info.plist ]
+       then
+               echo "The file \"$SRCROOT/Info.plist\" could not be found, please re-run configure."
+               exit 1
+       fi
+       
+       # Create app bundle
        ./osx-app.sh $STRIPPARAM $INSTALLPREFIX/bin/inkscape $SRCROOT/Info.plist
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nApplication bundle creation failed"
+               exit $status
+       fi
+fi
 
+if [[ "$DISTRIB" == "t" ]]
+then   
+       # Create dmg bundle
        if [[ "$PYTHON" == "t" ]]; then
-               ./osx-dmg.sh -py "$PYTHONDIR"
+               PYTHONOPTS="-py \"$PYTHONDIR\""
        else
-               ./osx-dmg.sh
+               PYTHONOPTS=""
+       fi
+       ./osx-dmg.sh $PYTHONOPTS
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nDisk image creation failed"
+               exit $status
        fi
 
        DATE=`date "+%Y%m%d"`
@@ -214,7 +283,6 @@ if [[ "$PACKAGE" == "t" ]]; then
        Pango        `pkg-config --modversion pango`
 Configure options:
        $CONFFLAGS" > $INFOFILE
-
        if [[ "$STRIP" == "t" ]]; then
                echo "Debug info
        no" >> $INFOFILE
@@ -228,4 +296,3 @@ Configure options:
 fi
 
 exit 0
-
index d1645344d416ba4eb5d52ca330e953394a0c0e48..a8d2932ad11bbdcc359507ce98531345a694252e 100755 (executable)
@@ -43,7 +43,7 @@ do
        case $1 in
                -s)
                        set_ds_store=true ;;
-               -py|--with-python)
+               -py|--with-python)
                        add_python=true 
                        python_dir=$2 
                        ds_store_file="inkscape_python.ds_store"
@@ -150,3 +150,4 @@ hdiutil detach "$DEV_NAME"
 /usr/bin/hdiutil convert "$RWNAME" -format UDZO -imagekey zlib-level=9 -o "Inkscape.dmg"
 rm -f "$RWNAME"
 
+exit 0