LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 10-09-2011, 09:43 AM   #1
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,835
Blog Entries: 15

Rep: Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188
Lightbulb Unofficial Mesa-7.11 build script for Slackware


I've been playing around with this package for a week now and I figured I'd go public with it. Please note that this package should be considered unstable or for testing ONLY and not for daily usage unless you are prepared for the unforeseen.

You will need to do some preparations before building however as my script slightly differs from Patrick's script, but follows the same concepts.

UPDATE: Found new comments to add to re-add Gallium driver acceleration for many cards to restore hardware acceleration. Gallium now is enabled on the following devices:

UPDATE 2: Fixed some configuration options. Re-enabled the i915 ARB_Fragment_Shader by default patch as a default option after some retesting on an i915 powered system.

i915
i965
nouveau
r300
r600
svga
swrast

Required dependency: llvm (may be acquired from slackbuilds.org) This is for ATI/AMD Radeon cards for Gallium.

What's enabled:

My build contains drivers for just about every OpenGL capable card known which includes the normally supported cards from Patrick's default build:

i810
i915
i965
mach64
mga
nouveau
r128
r200
r300
r600
radeon
savage
sis
tdfx
unichrome
swrast

I also have enabled support for the following outside the normal for testing:

xcb
gallium-llvm
openvg
gles1
gles2
gallium-egl

How to build it:

Go to ftp://ftp.freedesktop.org/pub/mesa/ and grab the source packages:

MesaLib-7.11.tar.gz
MesaGLUT-7.11.tar.gz

And copy the /source/x/mesa directory from the DVD to a temporary location in your files. You can delete the older MesaLib and MesaGLUT packages and replace them with the newer 7.11 versions only. The demos package hasn't been updated... yet.

Now simply replace Patrick's SlackBuild script with this one using a text editor, and run it with your architecture of choice: ARCH=i486 or ARCH=x86_64 and install the package (I recommend updating the package using "upgradepkg --install-new" as your package installer to remove older files and replace the package completely).

Here's the Build script in the code box:

Code:
#!/bin/sh

# Copyright 2006, 2007, 2008, 2009, 2010, 2011  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Editted by ReaperX7 for custom builds. Original script by Patrick J. Volkerding.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PKGNAM=mesa
VERSION=7.11
DEMOVERS=8.0.1
BUILD=${BUILD:-1}

NUMJOBS=${NUMJOBS:--j2}

# Be sure this list is up-to-date:
DRI_DRIVERS="i810,i915,i965,mach64,mga,nouveau,r128,r200,r300,r600,radeon,savage,sis,tdfx,unichrome,swrast"

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) export ARCH=i486 ;;
    arm*) export ARCH=arm ;;
       *) export ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-mesa

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf Mesa-${VERSION}

tar xvf $CWD/MesaLib-${VERSION}.tar.?z* || exit 1
# If MesaLib came from git, we might already have GLUT.
if [ ! -d Mesa-${VERSION}/src/glut/glx ]; then
  tar xvf $CWD/MesaGLUT-${VERSION}.tar.?z* || exit 1
fi

cd Mesa-$VERSION

# Make sure ownerships and permissions are sane:
chown -R root:root .
find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  -exec chmod 755 {} \; -o \
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  -exec chmod 644 {} \;

# Apply patches from git (and maybe elsewhere):
# Patches obtained by:
#   git checkout origin/7.9
#   git format-patch 67aeab0b77fb6be864088e69ea74a010b6543fa1..
if /bin/ls $CWD/patches/*.patch 1> /dev/null 2> /dev/null ; then
  for patch in $CWD/patches/*.patch ; do
    patch -p1 < $patch || exit 1 ; 
  done
fi

# Revert "i915: Enable ARB_fragment_shader by default."
# https://bugzilla.redhat.com/show_bug.cgi?id=643399 
zcat $CWD/patches/i915_fragment_shader_disable.patch.gz | patch -p1 || exit 1

## Allow Mesa 7.9.x to build against libdrm-2.4.23:
#zcat $CWD/patches/mesa-7.9-libdrm-2.4.23-nouveau-api.patch.gz | patch -p1 || exit 1

if [ ! -r configure ]; then
  autoreconf || exit 1
fi

CFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --mandir=/usr/man \
  --docdir=/usr/doc/mesa-$VERSION \
  --with-dri-driverdir=/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri \
  --with-dri-drivers="$DRI_DRIVERS" \
  --with-gallium-drivers=i915,i965,nouveau,r300,r600,svga,swrast \
  --with-driver=dri \
  --with-x \
  --enable-xcb \
  --build=$ARCH-slackware-linux \
  --enable-gallium-llvm \
  --enable-openvg \
  --enable-xorg \
  --enable-gles1 \
  --enable-gles2 \
  --enable-motif \
  --enable-gallium-egl

gmake $NUMJOBS || make || exit 1
gmake install DESTDIR=$PKG || exit 1

# Now install the demos
( cd $TMP
  rm -rf mesa-demos-$DEMOVERS
  tar xvf $CWD/mesa-demos-$DEMOVERS.tar.?z* || exit 1
  cd mesa-demos-$DEMOVERS
  chown -R root:root .
  find . \
    \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
    -exec chmod 755 {} \; -o \
    \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
    -exec chmod 644 {} \;  
  CFLAGS="$SLKCFLAGS" \
  ./configure \
    --prefix=/usr \
    --build=$ARCH-slackware-linux
  # Build and install gears and glinfo, as well as a few other demos
  make -C src/demos gears glinfo
  make -C src/xdemos \
    glthreads glxcontexts glxdemo glxgears glxgears_fbconfig \
    glxheads glxinfo glxpbdemo glxpixmap
  mkdir -p $PKG/usr/bin
  cp -a src/demos/{gears,glinfo} $PKG/usr/bin
  for i in glthreads glxcontexts glxdemo glxgears glxgears_fbconfig \
      glxheads glxinfo glxpbdemo glxpixmap ; do
        cp -a src/xdemos/$i $PKG/usr/bin ;
  done
)
  
# Strip binaries:
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done

# Compress info files, if any:
if [ -d $PKG/usr/info ]; then
  rm -f $PKG/usr/info/dir
  gzip -9 $PKG/usr/info/*
fi

mkdir -p $PKG/usr/doc/Mesa-$VERSION/html
cp -a \
  docs/COPYING* docs/relnotes-${VERSION}*.html docs/README* docs/GL* \
  $PKG/usr/doc/Mesa-$VERSION
cp -a docs/*.html $PKG/usr/doc/Mesa-$VERSION/html
rm -f $PKG/usr/doc/Mesa-$VERSION/html/relnotes*.html

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
Please note:

Package is not considered stable. Please use caution. Package is not supported officially.

Special note for Nouveau users (PLEASE READ):

Nvidia cards do not always require firmware to operate but there is a package specifically for the nouveau drivers JUST IN CASE. This Package is from ARCHLinux so all you have to do is unpack the tarball and place the package into your main root directory which will copy the path directly to your main firmware folder with a new folder titled nouveau (remember this is the main "/" directory not "/root"). You can grab it here if you feel you need it.

http://www.archlinux.org/packages/ex...veau-firmware/

Attention!!! I am asking that anyone with a chipset enabled for the Gallium API please provide feedback for your driver as to how it runs performance-wise, compatibility-wise, etc. especially users with ATi/AMD Radeon 9x00/X/HD series, and those with Intel 915/965 based graphics chips.

Special section for 3Dfx users (nobody has asked me about this YET, but...):

Please do not ask about Glide support for this package. The Glide3 SDK is very deprecated and support for the Glide3 API via the DRI driver was written out in favor of a non-Glide accelerated DRI solution. Support for Glide3 still exists within the code, though the current code defaults to a native accelerated function rather than falling back on Glide3 as a crutch, but you will have to edit in the option for Glide3 support on your own and possibly build the package externally from the SlackBuild script using make.

Take a careful note of this: Glide3 WILL NOT build on x86_64 systems.

Last edited by ReaperX7; 10-13-2011 at 04:50 PM. Reason: Minor edits to original post and updates.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 10-09-2011, 06:27 PM   #2
Martinus2u
Member
 
Registered: Apr 2010
Distribution: Slackware
Posts: 353

Rep: Reputation: 56
nice. seems you found the silver bullet (ie. the right config options). I created a mesa 7.11 package a while ago and had to resort to excluding the r200 r300 r600 drivers...
 
Old 10-09-2011, 08:41 PM   #3
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,835
Blog Entries: 15

Original Poster
Rep: Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188
Yeah llvm is required by those drivers now for Gallium support. I had no idea this was the silver bullet BTW.

I only just checked the dependencies and installed what I needed then ran a couple of test configurations and makes a few times to ensure there were no errors before I edited Patrick's Slackbuild and made the final commit to it. I actually would like to know if he has similar and if he wants to duplicate my work in an official package for -current, I have no issues with it, nor would I care if I was or wasn't credited for the effort.

The one question I have on my mind right now is does this actually help people using the Gallium enabled DRI on chipsets other than the nouveau drivers?

Update:

I tested the driver on an HP Mini Netbook with a 945GME Video chip and Gallium does in fact work, and more stable than the Tungsten Graphics driver.

Last edited by ReaperX7; 10-10-2011 at 02:21 AM. Reason: New information.
 
Old 10-10-2011, 06:30 AM   #4
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 755

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
Originally Posted by ReaperX7 View Post
Be aware this does NOT include the i915 ARB_fragment_shader enable by default patch due to the version change from 7.10.2 to 7.11.
This patch still applies without error here.

Quote:
I also have enabled support for the following outside the normal for testing:

xcb
gallium-llvm
Pat already has xcb enabled

Also note that gallium-llvm is automatically enabled on x86 or x86_64 which covers pretty much all current Slackware users.

Quote:
openvg
gles1
gles2
gallium-egl
OpenGL ES seems to be aimed at the embedded/mobile device market so I'm not sure many people will have much use for them outside of those sorts of devices (My apologies if anyone has Slackware running on an android phone)

Quote:
Code:
  --with-dri-drivers="$DRI_DRIVERS" \
  --with-gallium-drivers=i915,i965,nouveau,r300,r600,svga,swrast
I did the gallium drivers the same as the other dri drivers, looks neater but otherwise the same.

Code:
GALLIUM_DRIVERS="i915,i965,nouveau,r300,r600,swrast,svga"
<snip>
  --with-gallium-drivers="$GALLIUM_DRIVERS" \
Quote:
Code:
  --with-driver=dri
Also enabled by default when available

Quote:
Code:
  --with-x
  --enable-motif \
I'm curious as to what effect these options have

Apart from the above I'm running 7.11 just fine here, I also updated the nouveua driver in X as well as upgrading Xorg to the current release.

I also have transparency working
 
Old 10-10-2011, 06:54 AM   #5
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963
Why aren't you escaping the ends of these lines in your SlackBuild:
Code:
  --with-gallium-drivers=i915,i965,nouveau,r300,r600,svga,swrast
  --with-driver=dri
  --with-x
 
2 members found this post helpful.
Old 10-10-2011, 07:04 AM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by ruario View Post
Why aren't you escaping the ends of these lines in your SlackBuild:
Code:
  --with-gallium-drivers=i915,i965,nouveau,r300,r600,svga,swrast
  --with-driver=dri
  --with-x
If 'set -e' was used the build would halt at the errors they throw out. Update please.
 
Old 10-10-2011, 07:12 AM   #7
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 755

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
Originally Posted by dive View Post
If 'set -e' was used the build would halt at the errors they throw out. Update please.
You can't use set -e on mesa as it always errors out on the first make, there is a reason the line looks like this :-
Code:
make $NUMJOBS || make || exit 1
Come to think of it the line should look like this :-

Code:
make || make $NUMJOBS || exit 1
 
Old 10-10-2011, 07:35 AM   #8
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 293Reputation: 293Reputation: 293
NUMJOBS should be the first option.

I prefer to use MAKEFLAGS rather than explicitly set jobs in the script.

Last edited by dive; 10-10-2011 at 07:59 AM.
 
Old 10-10-2011, 10:59 PM   #9
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,835
Blog Entries: 15

Original Poster
Rep: Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188
Quote:
Originally Posted by ruario View Post
Why aren't you escaping the ends of these lines in your SlackBuild:
Code:
  --with-gallium-drivers=i915,i965,nouveau,r300,r600,svga,swrast
  --with-driver=dri
  --with-x
Whoops! Corrected that. Hah! Oddly these did not even generate an error or a warning however and I've had two successful compiles so far. Wierd...

As far as the others, yes, some are enabled by default and some are from Pat's, I did base it off his with some minor changes, so unless you're nitpicky I've only done minor edits to entire ensure an option is used actually by and not just auto-detected, or changed one option that is not longer used to the updated one.

As for the patch, I wasn't sure if I should or shouldn't keep it due to the version change. If it works, then by all means uncomment it and use it.

Again as stated I added some stuff for experimentation and testing only, but the rest is mainstream and support for general stuff and what-not.
 
Old 10-11-2011, 06:03 AM   #10
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963
Thanks for this ReaperX7. I actually needed a more recent Mesa to test Opera Hardware acceleration builds, and was about to look into this before seeing your post.
 
Old 10-12-2011, 11:21 PM   #11
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,835
Blog Entries: 15

Original Poster
Rep: Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188
Just a helpful tip.

Installing the package driconf from SlackBuilds.org and setting it up tends to be very helpful in getting smoother frame rates. I recommend this package for usage with any DRI using video card unless you are using the proprietary drivers from your video card manufacturer to gain a little more control over your video cards.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unofficial MESA/Gallium and video driver packages, built from the FreeDesktop.org Git Darth Vader Slackware 4 04-01-2011 05:00 AM
TeXLive Build Script for Slackware rworkman Slackware 14 11-15-2009 05:47 AM
[SOLVED] Help on build mesa + xcb BrZ Slackware 13 04-15-2009 03:39 AM
Mesa 6.5.2 Build Failure s3v_state.c EmrldDrgn Linux - Software 1 01-09-2009 03:27 AM
slackware build script questions gravityworks Slackware 13 03-01-2006 11:01 PM


All times are GMT -5. The time now is 05:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration