⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makesetup.sh

📁 Wxpython Implemented on Windows CE, Source code
💻 SH
📖 第 1 页 / 共 2 页
字号:
#!/bin/sh

# Make a distribution of an application on MSW.
# Example:
# ../distrib/msw/makesetup.sh --wxmsw --verbose &> log

# If your zip accepts Cygwin-style paths, then
# use cygpath, else substitute echo
CYGPATHPROG=cygpath
#CYGPATHPROG=echo

INNO=1
SPINMSW=0
SPINOS2=0
SPINDOCS=0
SPINALL=0
SPINWXALL=0
SPINBASE=0
GETMAKEFILES=0
VERBOSE=0
ZIPFLAGS=

PROGNAME=$0
SCRIPTDIR=$WXWIN/distrib/scripts
. $SCRIPTDIR/msw/setup.var
. $SCRIPTDIR/utils.inc

MANIFESTDIR=$SCRIPTDIR/manifests
WEBFILES=c:/wx2dev/wxWebSite
if [ ! "$CYGPATH" = "" ]; then
  WEBFILES=`$CYGPATH "$WEBFILES"`
fi

# Set this to the required version
if [ "$VERSION" = "" ]; then
  VERSION=2.6.2
fi

getfilelist(){
  port=$1
  outfile=$2
  
  filelist="base.rsp"
  contribfiles="stc.rsp contrib.rsp ogl.rsp"
  utilsfiles="tex2rtf.rsp utils.rsp utilmake.rsp"
  commonfiles="generic.rsp jpeg.rsp tiff.rsp xml.rsp deprecated.rsp makefile.rsp $utilsfiles $contribfiles"
  
  if [ ! $port = "base" ]; then
    filelist="$filelist $commonfiles" 
  fi 
  
  if [ $port = "msw" ] || [ $port = "all" ]; then
    filelist="$filelist msw.rsp univ.rsp vc.rsp mmedia.rsp wince.rsp dmc.rsp"
  fi
  
  if [ $port = "os2" ] || [ $port = "all" ]; then
    filelist="$filelist os2.rsp"
  fi
  
  if [ $port = "x11" ] || [ $port = "all" ]; then
    filelist="$filelist x11.rsp"
  fi
  
  if [ $port = "mgl" ] || [ $port = "all" ]; then
    filelist="$filelist mgl.rsp" 
  fi
  
  if [ $port = "gtk" ] || [ $port = "all" ]; then
    filelist="$filelist gtk.rsp"
  fi
  
  if [ $port = "cocoa" ] || [ $port = "all" ]; then
    filelist="$filelist cocoa.rsp"
  fi
  
  if [ $port = "motif" ] || [ $port = "all" ]; then
    filelist="$filelist motif.rsp"
  fi
  
  if [ $port = "mac" ] || [ $port = "all" ]; then
    filelist="$filelist mac.rsp"
  fi
  
  if [ $port = "all" ]; then
    filelist="$filelist palmos.rsp"
  fi
  
  tempfile="/tmp/wx$port.files.in"
  rm -f $tempfile 
  rm -f $outfile
  
  olddir=$PWD
  cd $MANIFESTDIR
  
  cat $filelist > $tempfile
  
  cd $APPDIR
  expandlines $tempfile $outfile
  
  cd $olddir
}

doreplace()
{
    thefile=$1
    theexpr=$2

    if [ -f $thefile ]; then
      sed -e "$theexpr" < $thefile > $thefile.tmp
      mv $thefile.tmp $thefile
    else
      echo "*** $thefile not found."
    fi
}

unix2dosname()
{
    echo $1 | sed -e "s/\//\\\\\\\/g" > /tmp/filename.tmp
    RETVALUE=`cat /tmp/filename.tmp`
    rm -f /tmp/filename.tmp
}

unix2dosname2()
{
    echo $1 | sed -e "s/\//\\\\/g" > /tmp/filename.tmp
    RETVALUE=`cat /tmp/filename.tmp`
    rm -f /tmp/filename.tmp
}

doinit()
{
    if [ "$VERBOSE" != "1" ]; then
        ZIPFLAGS=-q
    fi
}

rearchive()
{
    archive=$1
    dirname=$2
    changeto=$3

    echo Re-archiving $archive as $dirname

    pushd $changeto

    if [ -d $dirname ]; then
        rm -f -r $dirname
    fi
    mkdir $dirname
    cd $dirname
    unzip $ZIPFLAGS ../$archive
    cd ..
    rm -f $archive
    zip $ZIPFLAGS -r $archive $dirname/*

    popd
}

ziptotar()
{
    archive=$1
    dirname=$2
    changeto=$3

    pushd $changeto

    unzip $ZIPFLAGS $archive
    
    tar cfz $archive.tar.gz $dirname

    tar -cvf $dirname | bzip2 -9 > $archive.tar.bz2
    
    rm -rf $dirname

    popd
}


rearchivetar()
{
    archive=$1
    dirname=$2
    changeto=$3

    echo Re-tarring $archive as $dirname

    pushd $changeto

    if [ -d $dirname ]; then
        rm -f -r $dirname
    fi
    mkdir $dirname
    cd $dirname
    tar xfz ../$archive
    cd ..
    rm -f $archive
    tar cfz $archive $dirname/*

    popd
}

# Find the version from wx/version.h
# Not yet used
findversion()
{
	echo "#include <stdio.h>" > /tmp/appver.c
	echo "#include \"$VERSIONSYMBOLFILE\"" >> /tmp/appver.c
	echo "int main() { printf(\"%.2f\", $VERSIONSYMBOL); }" >> /tmp/appver.c
	gcc /tmp/appver.c -I$APPDIR -o /tmp/appver
    VERSION=`/tmp/appver`
	rm -f /tmp/appver /tmp/appver.c
}

dospinos2()
{
    echo Zipping OS/2...

    cd $APPDIR
    getfilelist "os2" /tmp/os2files
    
    # Zip up the complete wxOS2-xxx.zip file
    zip $ZIPFLAGS -@ $DESTDIR/wxOS2-$VERSION.zip < /tmp/os2files

    # Rearchive under wxWidgets-$VERSION
    if [ -d $DESTDIR/wxWidgets-$VERSION ]; then
        rm -f -r $DESTDIR/wxWidgets-$VERSION
    fi

    mkdir $DESTDIR/wxWidgets-$VERSION
    cd $DESTDIR/wxWidgets-$VERSION
    unzip $ZIPFLAGS ../wxOS2-$VERSION.zip

    echo Copying readme files...
    cp $APPDIR/docs/os2/install.txt INSTALL-OS2.txt

    cd $DESTDIR

    rm -f wxOS2-$VERSION.zip
    zip $ZIPFLAGS -r wxOS2-$VERSION.zip wxWidgets-$VERSION/*
}

dospinmsw()
{
    echo Zipping wxMSW...
    
    cd $APPDIR

    # now expand the wildcards to actual file names
    getfilelist "msw" /tmp/mswfiles

    # Create wxWidgets-$VERSION-win.zip which is used to create wxMSW
    echo Zipping individual components
    rm -f $DESTDIR/wxWidgets-$VERSION-win.zip
    zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-win.zip < /tmp/mswfiles
}

dospinwxall()
{
    echo Zipping wxAll...
    cd $APPDIR

    echo Zipping individual components
    rm -f $DESTDIR/wxWidgets-$VERSION-all.zip

    # Save adding all the wxMSW files again    
    if [ ! -f $DESTDIR/wxWidgets-$VERSION-win.zip ]; then
        dospinmsw
    fi
    cp $DESTDIR/wxWidgets-$VERSION-win.zip $DESTDIR/wxWidgets-$VERSION-all.zip
    
    cat $MANIFESTDIR/cw_mac.rsp $MANIFESTDIR/vc.rsp $MANIFESTDIR/x11.rsp $MANIFESTDIR/gtk.rsp $MANIFESTDIR/cocoa.rsp $MANIFESTDIR/motif.rsp $MANIFESTDIR/mac.rsp $MANIFESTDIR/mgl.rsp $MANIFESTDIR/os2.rsp $MANIFESTDIR/palmos.rsp | sort | uniq > /tmp/all.txt
    zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-all.zip < /tmp/all.txt

    if [ -d $DESTDIR/wxWidgets-$VERSION ]; then
        rm -f -r $DESTDIR/wxWidgets-$VERSION
    fi

    mkdir $DESTDIR/wxWidgets-$VERSION
    cd $DESTDIR/wxWidgets-$VERSION
    unzip $ZIPFLAGS ../wxWidgets-$VERSION-all.zip

    cd $DESTDIR

    rm -f $DESTDIR/wxWidgets-$VERSION-all.zip
    zip $ZIPFLAGS -r wxWidgets-$VERSION.zip wxWidgets-$VERSION/*
}

dospinbase()
{
    cd $APPDIR

    echo Zipping wxBase...
    rm -f $DESTDIR/wxBase-$VERSION.zip
    expandlines $MANIFESTDIR/base.rsp /tmp/basefiles
    zip $ZIPFLAGS -@ $DESTDIR/wxBase-$VERSION.zip < /tmp/basefiles

    if [ -d $DESTDIR/wxWidgets-$VERSION ]; then
        rm -f -r $DESTDIR/wxWidgets-$VERSION
    fi

    mkdir $DESTDIR/wxWidgets-$VERSION
    cd $DESTDIR/wxWidgets-$VERSION
    unzip $ZIPFLAGS ../wxBase-$VERSION.zip

    echo Copying readme files...
    cp $APPDIR/docs/base/readme.txt README.txt

    cd $DESTDIR

    rm -f wxBase-$VERSION.zip
    zip $ZIPFLAGS -r wxBase-$VERSION.zip wxWidgets-$VERSION/*
}

dospindocs()
{
    cd $APPDIR

    echo Creating $DESTDIR/wxWidgets-$VERSION-DocSource.zip
    expandlines $MANIFESTDIR/docsrc.rsp /tmp/docsources
    zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-DocSource.zip < /tmp/docsources 
    rearchive wxWidgets-$VERSION-DocSource.zip wxWidgets-$VERSION $DESTDIR

    echo Creating $DESTDIR/wxWidgets-$VERSION-WinHelp.zip
    expandlines $MANIFESTDIR/wx_hlp.rsp /tmp/winhelp
    zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-WinHelp.zip < /tmp/winhelp
    rearchive wxWidgets-$VERSION-WinHelp.zip wxWidgets-$VERSION $DESTDIR

    echo Creating $DESTDIR/wxWidgets-$VERSION-HTML.zip
    expandlines $MANIFESTDIR/wx_html.rsp /tmp/htmldocs
    zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-HTML.zip < /tmp/htmldocs
    rearchive wxWidgets-$VERSION-HTML.zip wxWidgets-$VERSION $DESTDIR

    echo Creating $DESTDIR/wxWidgets-$VERSION-PDF.zip
    expandlines $MANIFESTDIR/wx_pdf.rsp /tmp/pdfdocs
    zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-PDF.zip < /tmp/pdfdocs
    rearchive wxWidgets-$VERSION-PDF.zip wxWidgets-$VERSION $DESTDIR

    echo Creating $DESTDIR/wxWidgets-$VERSION-PDF.tar.gz
    tar zcf /c/wx2dev/wxWindows/deliver/wxWidgets-$VERSION-PDF.tar.gz docs/pdf/*.pdf
    rearchivetar wxWidgets-$VERSION-PDF.tar.gz wxWidgets-$VERSION /c/wx2dev/wxWindows/deliver

    echo Creating $DESTDIR/wxWidgets-$VERSION-HTB.zip
    expandlines $MANIFESTDIR/wx_htb.rsp /tmp/htbdocs
    zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-HTB.zip < /tmp/htbdocs
    rearchive wxWidgets-$VERSION-HTB.zip wxWidgets-$VERSION $DESTDIR

    echo Creating $DESTDIR/wxWidgets-$VERSION-HTMLHelp.zip
    expandlines $MANIFESTDIR/wx_chm.rsp /tmp/chmdocs
    zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-HTMLHelp.zip < /tmp/chmdocs 
    rearchive wxWidgets-$VERSION-HTMLHelp.zip wxWidgets-$VERSION $DESTDIR

    # Add Linuxy docs to a separate archive to be transported to Linux for the
    # Linux-based releases
    echo Creating $DESTDIR/wxWidgets-$VERSION-LinuxDocs.zip
    
    cat $MANIFESTDIR/wx_html.rsp $MANIFESTDIR/wx_pdf.rsp $MANIFESTDIR/wx_htb.rsp > /tmp/linuxdocs.in
    expandlines /tmp/linuxdocs.in /tmp/linuxdocs
    
    zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-LinuxDocs.zip < /tmp/linuxdocs

    # PDF/HTML docs that should go into the Windows setup because
    # there are no WinHelp equivalents
    echo Creating $DESTDIR/wxWidgets-$VERSION-ExtraDoc.zip
    expandlines $SCRIPT/extradoc.rsp /tmp/extradocs
    zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-ExtraDoc.zip < /tmp/extradocs
    rearchive wxWidgets-$VERSION-ExtraDoc.zip wxWidgets-$VERSION $DESTDIR
}


dospinport(){
    port=$1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -