slackbuilds/x/xf86-video-nouveau/xf86-video-nouveau.Slackbuild
Gwenhael Le moine 08bce0e290 add x/libdrm/ (with nouveau) and x/xf86-video-nouveau/
Signed-off-by: Gwenhael Le moine <gwenhael.le.moine@gmail.com>
2009-12-26 22:43:47 +07:00

95 lines
2.1 KiB
Bash
Executable file

#!/bin/sh -x
#NOTE: Needs File::Next (cpan -i File::Next)
# variables
TMP=/tmp
CWD=$(pwd)
APP_NAME=$(basename $CWD)
PKG=$TMP/package-$APP_NAME
VERSION=git$(date +%F|tr -d '-')
EXT=tar.xz
DOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README TODO"
ARCH=$(uname -m)
BUILD=1cyco
PREFIX=/usr
SLCKFLAGS="-fPIC -O2"
REPOSITORIES=/home/cycojesus/projets/packages/repositories
# nettoyage préalable
rm -fr $PKG $TMP/$APP_NAME-$VERSION
mkdir -p $PKG
# mise en place
cd $TMP
if [ ! -e $REPOSITORIES/$APP_NAME ] ; then
mkdir $REPOSITORIES
( cd $REPOSITORIES
git clone git://anongit.freedesktop.org/git/nouveau/xf86-video-nouveau/ $APP_NAME
)
else
( cd $REPOSITORIES/$APP_NAME
git pull
)
fi
cp -R $REPOSITORIES/$APP_NAME $TMP/$APP_NAME-$VERSION
cd $TMP/$APP_NAME-$VERSION
# configuration
CFLAGS="$SLCKFLAGS" \
CPPFLAGS="$SLCKFLAGS" \
./autogen.sh \
--prefix=$PREFIX \
--mandir=$PREFIX/man \
--libdir=$PREFIX/lib$(echo "$ARCH" | grep -o "64")
# compilation
make -j3 PREFIX=$PREFIX
# installation
make install DESTDIR=$PKG
# correction
cd $PKG
chown -R root:root *
mkdir -p $PKG/usr/doc/$APP_NAME-$VERSION
cd $TMP/$APP_NAME-$VERSION
cp -R $DOCS $PKG/usr/doc/$APP_NAME-$VERSION
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
# Strip binaries
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$APP_NAME: $APP_NAME (Accelerated Open Source driver for nVidia cards)
$APP_NAME:
$APP_NAME: The nouveau project aims to build high-quality, open source drivers for
$APP_NAME: nVidia cards. “Nouveau” [nuvo] is the French word for “new”.
$APP_NAME:
$APP_NAME:
$APP_NAME:
$APP_NAME: http://nouveau.freedesktop.org/wiki/
$APP_NAME:
$APP_NAME: see /usr/doc/$APP_NAME-$VERSION for more details
$APP_NAME:
EOF
# empaquetage
cd $PKG
makepkg -l y -c n $TMP/$APP_NAME-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD.txz