# $Header: /home/cvsd/magellan-cvs/magellan-src/toolchain/toolchain-bash/toolchain-bash-2.05b-r5.smage2,v 1.1 2005-07-04 00:41:38 niro Exp $ PNAME="toolchain-bash" PVER="2.05b" PBUILD="r5" SRCFILE="bash-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/bash-${PVER}" SRC_URI=( mirror://bash/${SRCFILE} mirror://bash/bash205b-001 mirror://bash/bash205b-002 mirror://bash/bash205b-003 mirror://bash/bash205b-004 mirror://bash/bash205b-005 mirror://bash/bash205b-006 mirror://bash/bash205b-007 mirror://bash/bash-${PVER}-multibyte-locale.patch mirror://bash/bash-${PVER}-empty-herestring.patch mirror://bash/bash-${PVER}-rbash.patch mirror://bash/bash-${PVER}-parallel-build.patch mirror://bash/bash-${PVER}-jobs.patch ) # needs: ncurses-5.1 ## global toolchain var ## # export CFLAGS, CHOST, TOOLCHAIN_PREFIX export CFLAGS="-mtune=i486 -Os -pipe" export CXXFLAGS="${CFLAGS}" export TOOLCHAIN_PREFIX="/tools" zapmost() { local rootdir rootdir="${1}/" [ ! -e "$rootdir" ] && echo "zapmost: $rootdir not found; skipping..." && return 1 install -d ${BUILDDIR}/zap local dirs shift local x for x in ${*} do if [ "${x##*/}" = "${x}" ] then #one deep mv ${rootdir}${x} ${BUILDDIR}/zap else #more than one deep; create intermediate directories dirs=${x%/*} install -d ${BUILDDIR}/zap/${dirs} mv ${rootdir}${x} ${BUILDDIR}/zap/${x} fi done rm -rf ${rootdir}* mv ${BUILDDIR}/zap/* ${rootdir} } src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # official patches: mpatch -Np0 bash205b-001 || die mpatch -Np0 bash205b-002 || die mpatch -Np0 bash205b-003 || die mpatch -Np0 bash205b-004 || die mpatch -Np0 bash205b-005 || die mpatch -Np0 bash205b-006 || die mpatch -Np0 bash205b-007 || die # readline is slow with multibyte locale mpatch -Np1 bash-${PVER}-multibyte-locale.patch || die # segfault on empty herestring mpatch -Np1 bash-${PVER}-empty-herestring.patch || die # fix broken rbash functionality mpatch -Np1 bash-${PVER}-rbash.patch || die # fix parallel make mpatch -Np0 bash-${PVER}-parallel-build.patch || die # fix using bash with post-20040808 glibc mpatch -Np1 bash-${PVER}-jobs.patch || die # enable SSH_SOURCE_BASHRC sed -e 's:^.*\(#define SSH_SOURCE_BASHRC\).*$:\1:' \ -i config-top.h || die # Force pgrp synchronization # (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653) # # The session will hang cases where you 'su' (not 'su -') and # then run a piped command in emacs. # This problem seem to happen due to scheduler changes kernel # side - although reproduceble with later 2.4 kernels, it is # especially easy with 2.6 kernels. echo '#define PGRP_PIPE 1' >> config-bot.h || die } src_compile() { cd ${SRCDIR} ./configure \ --host=${CHOST} \ --prefix=${TOOLCHAIN_PREFIX} \ --disable-profiling \ --with-curses \ --without-gnu-malloc \ --disable-nls \ || die mmake || die } src_install() { cd ${SRCDIR} make DESTDIR=${BINDIR} install || die # needed symlink ln -snf bash ${BINDIR}/${TOOLCHAIN_PREFIX}/bin/sh || die # remove unwanted stuff KEEPFILES="bin/bash bin/sh" zapmost ${BINDIR}${TOOLCHAIN_PREFIX} ${KEEPFILES} || die }