[Slackbuilds-users] Learning How To Modify A SlackBuild

Rich Shepard rshepard at appl-ecosys.com
Tue Oct 2 19:59:16 UTC 2007


On Tue, 2 Oct 2007, Robby Workman wrote:

> Do everything manually (as a normal user).
> 1. Extract the source.
> 2. cd $SRCDIR
> 3. ./configure --prefix=/usr [other options]
> 4. make
> 5. mkdir -p /tmp/package-$APP
> 6. make install DESTDIR=/tmp/package-$APP
> 7. cd /tmp/package-$APP
> 8. <housekeeping> (gzip manpages, move stuff as needed, etcetera)
> 9. cd /tmp/package-$APP
> 10. su
> 11. chown -R root:root .
> 12. makepkg -c n -l y ../$PKGNAME

> Test.  If it works, then modify the build script to do exactly what you
> just did.

   I followed the build script. It seemed to work (but I su'd to root to
write to /tmp), until the next to last command: there's no requiredbuilder
on my system.

   There is a lot of Python setup.py builds and installs because wxPython is
dependent on wxWidgets and wxGTK.

   I've attached the script. When I ran it on the source tarball, it did
produce a package, so I don't know why the requiredbuilder step failed when
I ran it manually.

Rich

-- 
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.        |         Accelerators(TM)
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863
-------------- next part --------------
#!/bin/sh
# Heavily based on the Slackware 11.0 SlackBuild
# The source can be found at:
# http://www.wxpython.org/

CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-wxPython
VERSION=2.8.6.0
# I set my CFLAGS globaly..
CHOST=i486
ARCH=${ARCH:-i486}
BUILD=1rbs

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.bz2 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 \
   --with-gnomeprint \
   --with-opengl \
   --enable-debug \
   --enable-geometry \
   --enable-graphics_ctx \
   --enable-optimise \
   --enable-sound    --with-sdl \
   --enable-mediactrl \
   --enable-display \
   --enable-unicode \
   --disable-debugreport \
   $CHOST-slackware-linux

make
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/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


More information about the Slackbuilds-users mailing list