SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everyone,
repost because the last one was isn't showing for some reason (sorry for the duplicate in case).
I was wondering what's the correct way to keep the Mesa package updated to the latest stable release on Slackware64 14.2, without having to track -current.
I already asked this question on the IRC channel some months ago, and the kind user Orbea provided me with some of his scripts to keep Mesa updated to the latest git version. Unfortunately I've lost the scripts and I couldn't find them anywhere on the web, so I figured I could make a post here to keep for future reference to newbie users like myself.
As I understand, to correctly build Mesa one needs updated llvm toolchain (I think -current has 3.9, whereas Slackware 14.2 has 3.8), updated libdrm and maybe some hw acceleration pkgs (vdpau,vaapi,..) but I'm unsure if there's a special build order or lib versions to consider, or even additional packages that I'm not aware of.
I was thinking of grabbing the mesa.Slackbuild from -current and start from there, but I really don't feel confident enough yet, especially building an important system package like this.
So please, share your tips/scripts/slackbuilds and thanks in advance!
The longer it goes between the latest update and 14.2's release date, the harder it will be to keep mesa up-to-date. The reason behind this is newer versions of mesa or its dependencies will eventually require newer versions of more and more dependencies.
Back in my 14.1 days, I wanted to update mesa to use some new features it provided in conjunction with the release of the 3.18 kernel. To do so, I ended up needing to update over 200 packages (although, a good chunk of those were my X packages).
Overall, you first try and build mesa with what you have installed. If it errors out, it will likely say it needs a newer version of some program. You then grab the newer version of that program and try and build it. If that first dependency fails as well, you will need to find what dependency that needs updated (or possibly added, if it's a new requirement). If that first dependency succeeds, you go back and try and rebuild mesa. If mesa fails again, it will notify you what other package needs to be updated and you just keep playing that game until all dependencies are updated and mesa builds and runs fine.
When I did it, I just grabbed the source directory of mesa and other needed dependencies from -current and then build them on my system. Once I successfully updated mesa (and libdrm, X, and a few other dependencies), I only went as far with mesa as I could before it started complaining about versions of dependencies again. I wasn't willing to go through that hassle multiple times (this added even more respect for Pat and what he does with -current).
Or orbea will hopefully see this and provide his scripts again
Thanks for the reply bassmadrigal,
I felt it was not an easy job, coming from ubuntu where there's a special repository for stable mesa that breaks other packages very often.
I don't think I'll want to keep mesa always updated, as the current stable version provides me with everything I need (in particular OpenGL 4.5 for some of the games I like to play), so in case no other user comes up with better suggestions I guess I'll go the "manual" way with fingers crossed
The issue with my mesa script is that I use nouveau and my script modified from Pat's is hardcoded for that. It would not be hard to change, but I don't have other hardware to test. Additionally a libdrm built from the git master is often needed to build mesa from the git master, I also never had to update my x packages ahead of what was provided in current other than to test bug fixes.
Other than that, the main thing you can do is build the latest stable kernel from kernel.org and use irc to report any graphical issues to the correct devs at freenode.
This is libdrm, a userspace library for accessing the DRM, direct
rendering manager, on Linux, BSD and other operating systes that
support the ioctl interface. The library provides wrapper functions
for the ioctls to avoid exposing the kernel interface directly, and
for chipsets with drm memory manager, support for tracking relocations
and buffers. libdrm is a low-level library, typically used by
graphics drivers such as the Mesa DRI drivers, the X drivers, libva
and similar projects. New functionality in the kernel DRM drivers
typically requires a new libdrm, but a new libdrm will always work
with an older kernel.
To disable intalling various Kernel Mode Setting (KMS) API use:
INTEL="no" RADEON="no" AMDGPU="no" NOUVEAU="no" VMWGFX="no"
To avoid stripping the debug symbols use:
DEBUG="yes" ./libdrm.SlackBuild
# 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------------------------------------------------------|
libdrm: libdrm (A library to support Direct Rendering)
libdrm:
libdrm: This library implements an interface to the kernel's DRM services.
libdrm: It is used to support hardware accelerated 3-D rendering.
libdrm:
libdrm:
libdrm:
libdrm:
libdrm:
libdrm:
libdrm:
libdrm.SlackBuild
Code:
#!/bin/sh
# Copyright 2015, 2017 orbea
# All rights reserved.
#
# 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.
PRGNAM=libdrm
BRANCH=${BRANCH:-master}
BUILD=${BUILD:-1}
TAG=${TAG:-_git}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -eu
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM
git clone -b $BRANCH git://anongit.freedesktop.org/mesa/drm $PRGNAM
cd $PRGNAM
HEAD="$(git rev-parse --short HEAD)"
DATE="$(git show -s --format=%ad --date=format:%Y.%m.%d)"
VERSION="${DATE}_$HEAD"
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
DEBUG="${DEBUG:-no}"
if [ "$DEBUG" = yes ]; then
SLKCFLAGS="$(printf %s "$SLKCFLAGS" | sed 's/-O2/-O0 -g/')"
fi
case "${INTEL:-yes}" in
[nN][oO]) intel='--disable-intel' ;;
*) intel= ;;
esac
case "${RADEON:-yes}" in
[nN][oO]) radeon='--disable-radeon' ;;
*) radeon= ;;
esac
case "${AMDGPU:-yes}" in
[nN][oO]) amdgpu='--disable-amdgpu' ;;
*) amdgpu= ;;
esac
case "${NOUVEAU:-yes}" in
[nN][oO]) nouveau='--disable-nouveau' ;;
*) nouveau= ;;
esac
case "${VMWGFX:-yes}" in
[nN][oO]) vmwgfx='--disable-vmwgfx' ;;
*) vmwgfx= ;;
esac
autoreconf -fi
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--enable-udev \
$intel $radeon $amdgpu $nouveau $vmwgfx \
--build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG
if [ "$DEBUG" = no ]; then
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
fi
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
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README RELEASING $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-${VERSION}_$BRANCH-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
mesa:
README
Code:
Mesa is an open-source implementation of the OpenGL specification -
a system for rendering interactive 3D graphics.
A variety of device drivers allows Mesa to be used in many different
environments ranging from software emulation to complete hardware
acceleration for modern GPUs.
Mesa ties into several other open-source projects: the Direct Rendering
Infrastructure and org to provide OpenGL support to users of X on Linux,
FreeBSD and other operating systems.
To enable debugging support use:
DEBUG="yes" ./mesa.SlackBuild
# 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 ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
mesa: mesa (open-source implementation of the OpenGL specification)
mesa:
mesa: Mesa is an open-source implementation of the OpenGL specification - a
mesa: system for rendering interactive 3D graphics.
mesa:
mesa: A variety of device drivers allows Mesa to be used in many different
mesa: environments ranging from software emulation to complete hardware
mesa: acceleration for modern GPUs.
mesa:
mesa: Homepage: http://www.mesa3d.org/
mesa:
mesa.SlackBuild
Code:
#!/bin/sh
# Slackware build script for mesa
# Copyright 2015-2017 orbea
# All rights reserved.
#
# 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.
PRGNAM=mesa
BRANCH=${BRANCH:-master}
COMMIT=${COMMIT:-}
BUILD=${BUILD:-1}
TAG=${TAG:-_git}
# Be sure this list is up-to-date:
GALLIUM_DRIVERS=${GALLIUM_DRIVERS:-"nouveau,svga,swrast"}
EGL_PLATFORMS=${EGL_PLATFORMS:-"drm,x11"}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM
git clone -b $BRANCH git://anongit.freedesktop.org/$PRGNAM/$PRGNAM
cd $PRGNAM
[ ! -z "$COMMIT" ] && git checkout "$COMMIT"
HEAD="$(git rev-parse --short HEAD)"
DATE="$(git show -s --format=%ad --date=format:%Y.%m.%d)"
VERSION="${DATE}_$HEAD"
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
DEBUG="${DEBUG:-no}"
if [ "$DEBUG" = yes ]; then
debug="--enable-debug"
SLKCFLAGS=$(printf %s "$SLKCFLAGS" | sed 's/-O2//')
else
debug=
fi
autoreconf -fi
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--with-dri-driverdir=/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri \
--without-dri-drivers \
--with-gallium-drivers="$GALLIUM_DRIVERS" \
--with-egl-platforms="$EGL_PLATFORMS" \
--disable-gles1 \
--enable-egl \
--enable-texture-float \
--enable-shared-glapi \
--enable-xa \
--enable-nine \
--enable-dri \
--enable-dri3 \
--enable-gbm \
--enable-glx \
--enable-glx-tls \
--enable-gles2 \
--enable-vdpau \
$debug \
--build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG
# Grab and install the demos
( cd $TMP
rm -rf $PRGNAM-demos
git clone -b $BRANCH git://anongit.freedesktop.org/$PRGNAM/demos $PRGNAM-demos
cd $PRGNAM-demos
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Generate the configure file
autoreconf -fi
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 )
if [ "$DEBUG" = no ]; then
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
fi
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html
cp -a docs/{README*,*.txt,VERSIONS} REVIEWERS VERSION $PKG/usr/doc/$PRGNAM-$VERSION
cp -a docs/*.html $PKG/usr/doc/$PRGNAM-$VERSION/html
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-${VERSION}_$BRANCH-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
Its depends on what card you are using, for me still using an HD5670 I just needed to compile libdrm and the latest mesa + the their multilib packages and I was good to go, no need to fiddle around with llvm for me. But for other drivers in mesa you may need a newer llvm.
Yes, amd drivers require llvm and I'm not sure if the llvm in 14.2 or even current is new enough. As for intel and nouveau, you only really need llvm if you plan to use the llvmpipe which can be useful when debugging. In which case the llvm in current is new enough, I'm still not sure about 14.2.
Many thanks orbea for the slackbuilds! Exactly the ones I've lost!
It should be easy enough to change the target to stable mesa and driver to radeon (I have an AMD card). I can take a look at the -current slackbuild for reference.
I'll fiddle with it as soon as I got an evening free, in the meantime I'll mark the thread as solved.
Thanks again to everyone!
I often build my own mesa from git since i use amd hardware and want to test the latest bells and whistles.
I use current since it updates pretty often and has a resent version of llvm which i need since i use radeonsi.
For mesa git on 14.2 i guess you need to update llvm if you build radeonsi if not i think it will build anyway.
Slackware 14.2 comes with llvm 3.8.0 and radeonsi dropped support in git for llvm 3.8.0 in 2017-05-04 https://cgit.freedesktop.org/mesa/me...c1d371c64220b9
Mesa 17.1.0 required llvm 3.8.0 for radeonsi (if i remember correctly you need llvm 3.9 for OpenGL 4.5 with radeonsi) swr needed 3.9.0 https://www.mesa3d.org/relnotes/17.1.0.html
So to round it up you need newer llvm if your an radeonsi user (or use the mesa.SlackBuild without opting out radeonsi first) and want to use git or OpenGL4.5 with radeonsi with mesa 17.1 if not llvm 3.8 will be enough.
About libdrm you should update it if you use an newer kernel.
There is normaly no need to rebuild everything, if you update major version of llvm then you need to rebuild mesa.
xorg server 1.18.3 is videodriver ABI 20 and it works even after updating driver (it's about min version of driver that will compile, we all know that often the proprietary blobs won't compile when ABI version is bumped) since the drivers compile against xorg ABI and not the other way around. https://www.x.org/wiki/XorgModuleABIVersions/
Edit: i forgot that mesa.SlackBuild in 14.2 use the deprecated --enable-gallium-llvm it should be --enable-llvm for mesa 17.1.
There is an script for mesa called get-mesa.sh that i use to grab git and make a package that i later build with mesa.SlackBuild
I edit the get-mesa.sh to BRANCH=master for grabbing latest git. https://mirrors.slackware.com/slackw...source/x/mesa/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.