#!/bin/sh # Heavily based on the Slackware 12.0 SlackBuild # The source can be found at: # http://www.wxpython.org/ CWD=`pwd` TMP=/tmp PKG=$TMP/package-wxPython VERSION=2.8.7.1 CHOST=i486 ARCH=i486 BUILD=1pv if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi rm -rf $PKG mkdir -p $PKG/install mkdir -p $PKG/usr/share/{applications,pixmaps} echo echo "wxPython-src-$VERSION.tar.gz is now extracting..." echo cd $TMP rm -rf wxPython-src-$VERSION tar -xjf $CWD/wxPython-src-$VERSION.tar.bz2 ################################# # Configure and build wxWidgets # ################################# cd $TMP/wxPython-src-$VERSION mkdir bld cd bld CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ../configure --prefix=/usr \ --with-gtk=2 \ --enable-monolithic \ --disable-rpath \ --enable-geometry \ --enable-optimise \ --enable-sound --with-sdl \ --enable-display \ --enable-unicode \ --enable-debug_flag \ --disable-debugreport \ --build=$CHOST-slackware-linux make make -C contrib/src/animate make -C contrib/src/gizmos make -C contrib/src/stc ################## # Build wxPython # ################## cd $TMP/wxPython-src-$VERSION/wxPython python setup.py \ WXPORT=gtk2 \ UNICODE=1 \ EP_ADD_OPTS=1 \ WX_CONFIG="$TMP/wxPython-src-$VERSION/bld/wx-config --no_rpath" \ build_ext --rpath=/usr/lib \ build ############################## # Install wxGTK and contribs # ############################## cd $TMP/wxPython-src-$VERSION/bld make prefix=$PKG/usr install make -C contrib/src/animate prefix=$PKG/usr install make -C contrib/src/gizmos prefix=$PKG/usr install make -C contrib/src/stc prefix=$PKG/usr install ############################## # Install wxPython for wxGTK # ############################## cd $TMP/wxPython-src-$VERSION/wxPython python setup.py \ WXPORT=gtk2 \ UNICODE=1 \ EP_ADD_OPTS=1 \ WX_CONFIG="$PKG/usr/bin/wx-config --prefix=$PKG/usr --no_rpath" \ build_ext --rpath=/usr/lib \ install --root=$PKG # Menu items for file in distrib/*.desktop; do install -m 644 $file $PKG/usr/share/applications done # Icons install -m 644 wx/py/PyCrust_32.png $PKG/usr/share/pixmaps/PyCrust.png install -m 644 wx/tools/XRCed/XRCed_32.png $PKG/usr/share/pixmaps/XRCed.png # Docs mkdir -p $PKG/usr/doc/wxpython-$VERSION cp -a $TMP/wxPython-src-$VERSION/docs/* $PKG/usr/doc/wxpython-$VERSION ( cd $PKG find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. |-----handy-ruler----------------------------------------------------| wxpython: wxPython (Python GUI development) wxpython: wxpython: wxPython is a GUI toolkit for the Python programming language. It wxpython: allows Python programmers to create programs with a robust, highly wxpython: functional graphical user interface, simply and easily. It is wxpython: implemented as a Python extension module (native code) that wraps wxpython: the popular wxWidgets cross platform GUI library, which is written wxpython: in C++. wxpython: wxpython: wxpython: EOF # Fix a broken symlink: ( cd $PKG/usr/bin rm -rf wx-config ln -sf ../lib/wx/config/gtk2-unicode-debug-2.8 wx-config ) cd $TMP/wxPython-src-$VERSION/wxPython sed "s/BUILD_GLCANVAS = 1/BUILD_GLCANVAS = 0/" -i config.py ./setup.py build WXPORT=gtk2 \ UNICODE=1 \ BUILD_GLCANVAS=0 \ WX_CONFIG="$PKG/usr/bin/wx-config --prefix=$PKG/usr --no_rpath" \ ./setup.py install WXPORT=gtk2 \ UNICODE=1 \ BUILD_GLCANVAS=0 \ WX_CONFIG="$PKG/usr/bin/wx-config --prefix=$PKG/usr --no_rpath" \ install --root="$PKG" # Build the package: cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $TMP/wxpython-$VERSION-$ARCH-$BUILD.tgz cp $TMP/wxpython-$VERSION-$ARCH-$BUILD.tgz $CWD