diff options
author | Edward Koenig <kingbeowulf@gmail.com> | 2013-07-07 21:34:09 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2013-07-14 17:07:16 -0500 |
commit | c1d5af682190a47507a91849254640efaf784f7d (patch) | |
tree | a583491203dfead29cc11a73611504de94c21b33 /system | |
parent | 53e3bbf16f6cdf894b980e172330f40cd246698d (diff) |
system/nvidia-legacy173-driver: Added.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/nvidia-legacy173-driver/NvCtrlAttributesVidMode.diff | 10 | ||||
-rw-r--r-- | system/nvidia-legacy173-driver/README | 41 | ||||
-rw-r--r-- | system/nvidia-legacy173-driver/doinst.sh | 6 | ||||
-rw-r--r-- | system/nvidia-legacy173-driver/nvidia-legacy173-driver.SlackBuild | 229 | ||||
-rw-r--r-- | system/nvidia-legacy173-driver/nvidia-legacy173-driver.info | 16 | ||||
-rw-r--r-- | system/nvidia-legacy173-driver/nvidia-switch | 512 | ||||
-rw-r--r-- | system/nvidia-legacy173-driver/slack-desc | 19 |
7 files changed, 833 insertions, 0 deletions
diff --git a/system/nvidia-legacy173-driver/NvCtrlAttributesVidMode.diff b/system/nvidia-legacy173-driver/NvCtrlAttributesVidMode.diff new file mode 100644 index 000000000000..d3e1fae2444d --- /dev/null +++ b/system/nvidia-legacy173-driver/NvCtrlAttributesVidMode.diff @@ -0,0 +1,10 @@ +--- nvidia-settings-1.0/src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c 2010-10-28 04:23:19.000000000 +0200 ++++ nvidia-settings-1.0-mod/src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c 2011-01-04 11:43:54.888000046 +0100 +@@ -28,6 +28,7 @@ + #include "msg.h" + + #include <X11/extensions/xf86vmode.h> ++#include <X11/extensions/xf86vmproto.h> + + #include <stdlib.h> + #include <math.h> diff --git a/system/nvidia-legacy173-driver/README b/system/nvidia-legacy173-driver/README new file mode 100644 index 000000000000..5e394b63171d --- /dev/null +++ b/system/nvidia-legacy173-driver/README @@ -0,0 +1,41 @@ +This is the proprietary binary video driver for legacy cards (Geforce 5) +from NVidia for the X.Org X-server. This package does not include the +kernel-module - it is a part of the nvidia-kernel package at +SlackBuilds.org. + +Since this nvidia-driver conflicts with some files of xorg, it's a bit +complex to install/uninstall the driver. However, installation of the +nvidia-driver package itself backs up the conflicting files and puts the +nvidia-specific files into place. + +Heinz Wiesinger, the author of the build script, has written a script called +nvidia-switch, which is used to switch between the stock xorg driver and +the nvidia driver, but it will not edit xorg.conf for you; you have to do +that manually. The nvidia-switch script is installed to /usr/sbin. + +Usage of nvidia-switch: + nvidia-switch --xorg <--> switch to the stock xorg files + nvidia-switch --nvidia <--> switch to the proprietary nvidia files + nvidia-switch --cleanup <--> switch to the stock xorg file and remove all + symlinks created by nvidia-switch + +You do NOT have to run nvidia-switch after installing or upgrading the +package. ONLY if you want to explicitely switch to the xorg files, +afterwards switching back to nvidia files or before uninstalling the +package. + +No special steps are necessary when updating nvidia-legacy173-driver +from a previous package. If you update to a newer xorg, you do not have +to reinstall nvidia-legacy173-driver either. Just run +"nvidia-switch --nvidia" in that case. + +Before uninstalling this package, it is important that you execute +'nvidia-switch --cleanup', which will switch back to the stock xorg files +and remove all links created by nvidia-switch before. +If you forget to do this, you'll have to do the switch manually, or xorg +won't work on next startup. Here are the affected files: + /usr/lib/libGL.so.1.2 + /usr/include/GL/{gl.h glx.h glxext.h glext.h} + /usr/lib/xorg/modules/extensions/{libglx.so libglx.la} + +This also requires the nvidia-legacy173-kernel package from SlackBuilds.org. diff --git a/system/nvidia-legacy173-driver/doinst.sh b/system/nvidia-legacy173-driver/doinst.sh new file mode 100644 index 000000000000..9ad2ad86009d --- /dev/null +++ b/system/nvidia-legacy173-driver/doinst.sh @@ -0,0 +1,6 @@ +if [ -x /usr/bin/update-desktop-database ]; then + ./usr/bin/update-desktop-database -q usr/share/applications +fi + +/usr/sbin/nvidia-switch --install + diff --git a/system/nvidia-legacy173-driver/nvidia-legacy173-driver.SlackBuild b/system/nvidia-legacy173-driver/nvidia-legacy173-driver.SlackBuild new file mode 100644 index 000000000000..38f85eb751f4 --- /dev/null +++ b/system/nvidia-legacy173-driver/nvidia-legacy173-driver.SlackBuild @@ -0,0 +1,229 @@ +#!/bin/sh + +# Slackware build script for nvidia-legacy173-driver + +# Copyright 2007-2011 Heinz Wiesinger, Amsterdam, The Netherlands +# 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. + +# Thanks to Robby Workman for suggestions to improve this script. + +# Maintainer Edward Koenig <kingbeowulf[at]gmail.com> + +PRGNAM=nvidia-legacy173-driver +VERSION=173.14.37 +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +NVPKG="pkg1" + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + TARGET="x86" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + TARGET="x86" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + TARGET="x86_64" + LIBDIRSUFFIX="64" + NVPKG="pkg2" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +SRCNAM=NVIDIA-Linux-$TARGET-$VERSION-$NVPKG + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf nvidia-installer-1.0.7 +tar xvf $CWD/nvidia-installer-$VERSION.tar.gz +rm -rf nvidia-settings-1.0 +tar xvf $CWD/nvidia-settings-$VERSION.tar.gz +rm -rf nvidia-xconfig-1.0 +tar xvf $CWD/nvidia-xconfig-$VERSION.tar.gz +rm -rf $SRCNAM +sh $CWD/$SRCNAM.run --extract-only +cd $SRCNAM +chown -R root:root . +chmod -R u+w,go+r-w,a-s . + +mkdir -p $PKG/usr/{bin,share,lib$LIBDIRSUFFIX,sbin} $PKG/usr/include/GL \ + $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/{drivers,extensions} \ + $PKG/usr/man/man1 + +# Start with the libraries +cd usr/lib + #remove duplicate libnvidia-tls + rm libnvidia-tls.so.$VERSION + cp -a * $PKG/usr/lib$LIBDIRSUFFIX + #Rename those files which would overwrite xorg's original files + for i in libGL.so.$VERSION libGLcore.so.$VERSION; do + mv $PKG/usr/lib$LIBDIRSUFFIX/$i $PKG/usr/lib$LIBDIRSUFFIX/$i-nvidia ; + done +cd - + +# This is the driver itself +cd usr/X11R6/lib + cp -a * $PKG/usr/lib$LIBDIRSUFFIX/xorg/ + for i in libXvMCNVIDIA.a libXvMCNVIDIA.so.$VERSION; do + mv $PKG/usr/lib$LIBDIRSUFFIX/xorg/$i $PKG/usr/lib$LIBDIRSUFFIX/ ; + done + + # Rename those files which would overwrite xorg's original files + mv $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/extensions/libglx.so.$VERSION \ + $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/extensions/libglx.so.$VERSION-nvidia +cd - + +# These are the includes +cd usr/include/GL + for i in glxext.h glext.h gl.h glx.h; do + cp -a $i $PKG/usr/include/GL/$i-nvidia + done +cd - + +# Next come the apps +cp -a usr/bin/nvidia-bug-report.sh $PKG/usr/bin/ + +# XDG stuff +cd usr/share + for i in applications pixmaps; do + cp -a $i $PKG/usr/share/ + done +cd - + +# symlinks +cd $PKG/usr/lib$LIBDIRSUFFIX + for i in libnvidia-cfg; do + ln -s $i.so.$VERSION $i.so.1 + ln -s $i.so.1 $i.so + done + ln -sf tls/libnvidia-tls.so.$VERSION libnvidia-tls.so.1 + ln -sf libXvMCNVIDIA.so.$VERSION libXvMCNVIDIA_dynamic.so.1 +cd - + +cd $PKG/usr/lib$LIBDIRSUFFIX/tls + ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so.1 +cd - + +cd $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules + ln -sf libnvidia-wfb.so.$VERSION libnvidia-wfb.so.1 +cd - + +# Compiling nvidia-installer from source +cd $TMP/nvidia-installer-1.0.7 + chown -R root:root . + chmod -R u+w,go+r-w,a-s . + + CFLAGS="$SLKCFLAGS" \ + LDFLAGS="-lz" \ + make + + install -m 755 nvidia-installer $PKG/usr/bin/ + install -m 644 nvidia-installer.1 $PKG/usr/man/man1/ +cd - + +# Compiling nvidia-settings from source +cd $TMP/nvidia-settings-1.0 + chown -R root:root . + chmod -R u+w,go+r-w,a-s . + + # Fix missing include necessary for newer version of libXxf86vm + patch -p1 -i $CWD/NvCtrlAttributesVidMode.diff + + # Slackware doesn't ship a static libXxf86vm, so we link against the shared one + sed -i "s|-Wl,-Bstatic -lXxf86vm -Wl,-Bdynamic|-Wl,-Bdynamic -lXxf86vm|" \ + Makefile + + cd src/libXNVCtrl + make clean + CFLAGS="$SLKCFLAGS" \ + make + cd ../../ + + CFLAGS="$SLKCFLAGS" \ + NV_CFLAGS="$SLKCFLAGS" \ + X11_LIB_DIRS="-L/usr/lib$LIBDIRSUFFIX -ldl" \ + make + + install -m 755 nvidia-settings $PKG/usr/bin/ + install -m 644 doc/nvidia-settings.1 $PKG/usr/man/man1/ +cd ../ + +# Compiling nvidia-xconfig from source +cd $TMP/nvidia-xconfig-1.0 + chown -R root:root . + chmod -R u+w,go+r-w,a-s . + + NV_CFLAGS="$SLKCFLAGS" \ + make + + install -m 755 nvidia-xconfig $PKG/usr/bin/ + install -m 644 nvidia-xconfig.1 $PKG/usr/man/man1/ +cd - + +# Self written bash script which I use to switch between nvidia and nv. +# It is now also used by doinst.sh to switch to the nvidia-driver right +# after installation. +install -m 0755 $CWD/nvidia-switch $PKG/usr/sbin/ +sed -i s/PKGVERSION/$VERSION/g $PKG/usr/sbin/nvidia-switch +sed -i s/LIBDIRSUFFIX/$LIBDIRSUFFIX/g $PKG/usr/sbin/nvidia-switch + +# Compress man-pages +find $PKG/usr/man -type f -exec gzip -9 {} \; + +# These correct wrong paths +sed -i "s|__LIBGL_PATH__|/usr/lib$LIBDIRSUFFIX/|" $PKG/usr/lib$LIBDIRSUFFIX/libGL.la +sed -i "s|/usr/X11R6/lib|/usr/lib$LIBDIRSUFFIX/|" $PKG/usr/lib$LIBDIRSUFFIX/libGL.la +sed -i "s|__UTILS_PATH__|/usr/bin|" \ + $PKG/usr/share/applications/nvidia-settings.desktop +sed -i "s|__PIXMAP_PATH__|/usr/share/pixmaps|" \ + $PKG/usr/share/applications/nvidia-settings.desktop + +cd $TMP/$SRCNAM +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a LICENSE pkg-history.txt ./usr/share/doc* $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.Slackware +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +sed "s/PKGVERSION/$VERSION/g" $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$TARGET-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/nvidia-legacy173-driver/nvidia-legacy173-driver.info b/system/nvidia-legacy173-driver/nvidia-legacy173-driver.info new file mode 100644 index 000000000000..6327bd6febba --- /dev/null +++ b/system/nvidia-legacy173-driver/nvidia-legacy173-driver.info @@ -0,0 +1,16 @@ +PRGNAM="nvidia-legacy173-driver" +VERSION="173.14.37" +HOMEPAGE="http://www.nvidia.com" +DOWNLOAD="ftp://download.nvidia.com/XFree86/Linux-x86/173.14.37/NVIDIA-Linux-x86-173.14.37-pkg1.run \ + ftp://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-173.14.37.tar.gz \ + ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-173.14.37.tar.gz \ + ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-173.14.37.tar.gz" +MD5SUM="fc2bc82c8ddccb42d5414671b16854e2 \ + 5734a9d04e5237c992d92aebb895a4f4 \ + dc0849700fe2a2e1dbfb40f4a35a4fdd \ + 9139f7a7e4e62c17778f2cef83a5c8f8" +DOWNLOAD_x86_64="ftp://download.nvidia.com/XFree86/Linux-x86_64/173.14.37/NVIDIA-Linux-x86_64-173.14.37-pkg2.run" +MD5SUM_x86_64="ed3edf1d796129edb79703dbf3706854" +REQUIRES="nvidia-legacy173-kernel" +MAINTAINER="Edward Koenig" +EMAIL="kingbeowulf@gmail.com" diff --git a/system/nvidia-legacy173-driver/nvidia-switch b/system/nvidia-legacy173-driver/nvidia-switch new file mode 100644 index 000000000000..b700fb2f5d97 --- /dev/null +++ b/system/nvidia-legacy173-driver/nvidia-switch @@ -0,0 +1,512 @@ +#!/bin/sh + +# Copyright 2007-2009 Heinz Wiesinger, Amsterdam, The Netherlands +# 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. + +# nvidia-switch utility 0.8.2 +# +# A tool to switch between nvidia-binary-driver and stock xorg-driver +# if both are installed in parallel. + +set -e + +ROOT="/" +CWD=$(pwd) +LIBSUFFIX="LIBDIRSUFFIX" # This will be replaced in the build script +INC="${ROOT}usr/include/GL" +LIB="${ROOT}usr/lib${LIBSUFFIX}" +XMOD="${LIB}/xorg/modules" +XLIB="$XMOD/extensions" +NV_VERSION='PKGVERSION' # This will be replaced in the build script +GL_VERSION="1.2" + +remove_link(){ +if [ -L "$1" ]; then + rm -f "$1" +fi +} + +remove_existing(){ +if [ -e "$1" ]; then + rm -f $1 +fi +} + +move_existing(){ +if [ -e "$1" ]; then + mv $1 $2 +fi +} + +setup_link(){ + if [ "$1" = "mv" ]; then + mv "$2" "$3" + else + rm -f $2 + fi + ln -s "$3" "$2" +} + +# Move and rename files in /usr/include +# $1 = from +# $2 = to +incs(){ +cd "$INC" + +if [ "$2" = "cleanup" ]; then + CMD="mv" + THREE="$1" +else + CMD="ln -s" + THREE="$2" +fi + +for i in glxext.h glext.h glx.h gl.h; do + if [ -L "$i" ]; then + rm -f "$i" + $CMD "$i-$THREE" "$i" + elif [ -e "$i" ]; then + if [ "$2" = "cleanup" ]; then + rm -f "$i-$1" + else + mv "$i" "$i-$1" + ln -s "$i-$THREE" "$i" + fi + else + $CMD "$i-$THREE" "$i" + fi +done + +cd "$CWD" +} + +libs(){ +for i in libglx.la; do + if [ "$1" = "nvidia" ]; then + #If this library exists, move it to *-xorg + move_existing "$XLIB/$i" "$XLIB/$i-xorg" + else + #If .so does not exist, and *-xorg does, then remove the -xorg + if [ -e "$XLIB/$i" ]; then + remove_existing "$XLIB/$i-xorg" + else + move_existing "$XLIB/$i-xorg" "$XLIB/$i" + fi + fi +done +} + +libs_basic(){ +for i in libGL.so libGLcore.so; do + #if this link exists, remove it, if it's a file, move it to *.nvidia + if [ -L "$LIB/$i.$NV_VERSION" ]; then + rm -f "$LIB/$i.$NV_VERSION" + elif [ -e "$LIB/$i.$NV_VERSION" ]; then + mv "$LIB/$i.$NV_VERSION" "$LIB/$i.$NV_VERSION-nvidia" + fi + remove_link "$LIB/$i.1" +done +} + +libgl_nvidia(){ +#if libGL.so.$GL_VERSION does exist, move it to libGL.so.$GL_VERSION-xorg, as it conflicts if nvidia's libGL.so +# then remove the libGL.so.1 symlink and create a new one pointing to nvidia's libGL.so +if [ -e "$LIB/libGL.so.$GL_VERSION" ]; then + cd "$LIB" + mv libGL.so.$GL_VERSION libGL.so.$GL_VERSION-xorg + setup_link "" "libGL.so.1" "libGL.so.$NV_VERSION" + cd "$CWD" +fi +} + +libgl_xorg(){ +#if libGL.so.$GL_VERSION does not exist and libGL.so.$GL_VERSION-xorg does, move it to libGL.so.$GL_VERSION +# then remove the libGL.so.1 symlink and create a new one pointing to nvidia's libGL.so +if [ -e "$LIB/libGL.so.$GL_VERSION" ]; then + remove_existing "$LIB/libGL.so.$GL_VERSION-xorg" +else + if [ -e "$LIB/libGL.so.$GL_VERSION-xorg" ]; then + cd "$LIB" + mv libGL.so.$GL_VERSION-xorg libGL.so.$GL_VERSION + ln -s libGL.so.$GL_VERSION libGL.so.1 + cd "$CWD" + fi +fi +} + + +libglcore_nvidia(){ +#If libGLcore.so.$NV_VERSION-nvidia does exists, then remove the -nvidia and make it usable that way +if [ -e "$LIB/libGLcore.so.$NV_VERSION-nvidia" ]; then + cd "$LIB" + rm -f libGLcore.so.$NV_VERSION libGLcore.so.1 + ln -s libGLcore.so.$NV_VERSION-nvidia libGLcore.so.$NV_VERSION + ln -s libGLcore.so.$NV_VERSION libGLcore.so.1 + cd "$CWD" +fi +} + +lib_nvidia(){ +for i in libGL.so libglx.so; do + if [ "$i" = "libGL.so" ]; then + cd "$LIB" + elif [ "$i" = "libglx.so" ]; then + cd "$XLIB" + fi + #If libGL.so.$NV_VERSION-nvidia does exists, then remove the -nvidia and make it usable that way + if [ -e "$i.$NV_VERSION-nvidia" ]; then + setup_link "" "$i.$NV_VERSION" "$i.$NV_VERSION-nvidia" + fi + cd "$CWD" +done +} + +libglx_base(){ +for i in $(ls libglx.so* | grep -v -); do + if ! [ "$i" = "libglx.so.$NV_VERSION" ]; then + rm -f $i + fi +done +ln -s libglx.so.$NV_VERSION libglx.so +} + +libglx_nvidia(){ +# if libglx.so is not a link, back it up to *-xorg, and create a symlink to nvidia's one +# if it's a link, then remove it and create a new one. +if ! [ -L "$XLIB/libglx.so" ]; then + cd $XLIB + mv libglx.so libglx.so-xorg + libglx_base +else + cd $XLIB + libglx_base +fi +cd $CWD +} + +libglx_xorg(){ +if [ "$1" = "xorg" ]; then + CMD="ln -s" +else + CMD="mv" +fi + +#if this library exists, move it to *-nvidia +if [ -L "$XLIB/libglx.so.$NV_VERSION" ]; then + rm $XLIB/libglx.so.$NV_VERSION +elif [ -e "$XLIB/libglx.so.$NV_VERSION" ]; then + mv $XLIB/libglx.so.$NV_VERSION $XLIB/libglx.so.$NV_VERSION-nvidia +fi + +# if libglx.so exists and is a link, remove it and create a new one +# If it does exists and is not a link, remove the old one, and create the new one. +# if it does not exist, create a symlink +if [ -L "$XLIB/libglx.so" ]; then + cd $XLIB + rm libglx.so + $CMD libglx.so-xorg libglx.so +elif [ -e "$XLIB/libglx.so" ]; then + if [ "$1" = "xorg" ]; then + cd $XLIB + setup_link "mv" "libglx.so" "libglx.so-xorg" + else + remove_existing "$XLIB/libglx.so-xorg" + fi +else + cd $XLIB + $CMD libglx.so-xorg libglx.so +fi +cd $CWD +} + +nvidia_ldconfig(){ +/sbin/ldconfig +#Generate correct symink for that lib +/sbin/ldconfig -l $1 + +if [ "$2" = "xorg" ]; then + #Remove so-link, recreated by ldconfig + cd $LIB + remove_link "libGLcore.so.1" + cd $CWD +fi +} + +check(){ + echo -n "checking $2...." + if [ -e "$1/$2" ]; then + if [ "$3" = "exist" ]; then + echo "ERROR: $1/$2 does exist!!!!!" + else + echo -n "exists" + if [ -h "$1/$2" ]; then + echo "(link)" + echo -n " points to:" + ls -o "$1/$2" | cut -d ">" -f 2 + else + if [ "$3" = "link" ]; then + echo " (!)" + else + echo "" + fi + fi + fi + else + if [ "$3" = "exist" ]; then + echo "does not exist" + else + echo "ERROR: $1/$2 does not exist!!!!!" + fi + fi +} + +check_includes(){ + if [ "$1" = "cleanup" ]; then + cleanup="" + cleanup2="exist" + else + cleanup="link" + cleanup2="" + fi + + for i in glext.h glxext.h gl.h glx.h; do + check $INC $i $cleanup + check $INC $i-nvidia + check $INC $i-xorg $cleanup2 + echo "" + done +} + +check_glcore(){ + if [ "$1" = "nvidia" ]; then + CHECK="link" + else + CHECK="exist" + fi + + for i in libGLcore.so.1 libGLcore.so.$NV_VERSION libGLcore.so.$NV_VERSION-nvidia; do + if [ "$i" = "libGLcore.so.1" ]; then + check $LIB $i $CHECK + elif [ "$i" = "libGLcore.so.$NV_VERSION" ]; then + check $LIB $i $CHECK + else + check $LIB $i + fi + done + + echo "" +} + +check_glx(){ + if [ "$1" = "xorg" ]; then + xorg="exist" + cleanup="link" + cleanup2="" + EXT="-xorg" + elif [ "$1" = "cleanup" ]; then + xorg="exist" + cleanup="" + cleanup2="exist" + EXT="-xorg" + else + xorg="link" + cleanup="link" + cleanup2="" + EXT="" + fi + + for i in libglx.la libglx.so libglx.so.$NV_VERSION libglx.so.$NV_VERSION-nvidia \ + libglx.so-xorg libglx.la-xorg; do + if [ "$i" = "libglx.so" ]; then + check $XLIB $i $cleanup + elif [ "$i" = "libglx.so-xorg" ]; then + check $XLIB $i $cleanup2 + elif [ "$i" = "libglx.so.$NV_VERSION" ]; then + check $XLIB $i $xorg + elif [ "$i" = "libglx.la$EXT" ]; then + check $XLIB $i "exist" + else + check $XLIB $i + fi + done + + echo "" +} + +check_wfb(){ + for i in libnvidia-wfb.so.1 libnvidia-wfb.so.$NV_VERSION; do + if [ "$i" = "libnvidia-wfb.so.1" ]; then + check $XMOD $i "link" + else + check $XMOD $i + fi + done +} + +check_gl(){ + if [ "$1" = "nvidia" ]; then + nvidia="link" + EXT="" + else + nvidia="exist" + EXT="-xorg" + fi + + for i in libGL.la libGL.so libGL.so.1 libGL.so.$NV_VERSION libGL.so.$NV_VERSION-nvidia \ + libGL.so.$GL_VERSION libGL.so.$GL_VERSION-xorg; do + if [ "$i" = "libGL.so" ]; then + check $LIB $i "link" + elif [ "$i" = "libGL.so.1" ]; then + check $LIB $i "link" + elif [ "$i" = "libGL.so.$NV_VERSION" ]; then + check $LIB $i $nvidia + elif [ "$i" = "libGL.so.${GL_VERSION}${EXT}" ]; then + check $LIB $i "exist" + else + check $LIB $i + fi + done + + echo "" +} + +nvidia_check(){ + check_includes + + check_gl "nvidia" + + check_glcore "nvidia" + + check_glx + + check_wfb +} + +xorg_check(){ + check_includes + + check_gl + + check_glcore + + check_glx "xorg" + + check_wfb +} + +cleanup_check(){ + check_includes "cleanup" + + check_gl + + check_glcore + + check_glx "cleanup" + + check_wfb +} + +nvidia(){ + echo $'Switching to nvidia-driver files!\n' + echo "Make sure the nvidia driver is ENABLED in /etc/X11/xorg.conf." + echo "Otherwise, this may lead to improperly working drivers." + + incs "xorg" "nvidia" + lib_nvidia + libgl_nvidia + libglcore_nvidia + libs "nvidia" + libglx_nvidia + + LD_NVIDIA="${LIB}/libGL.so.$NV_VERSION-nvidia" + nvidia_ldconfig $LD_NVIDIA +} + +xorg(){ + echo $'Switching to stock xorg files.\n' + if [ "$1" = "cleanup" ]; then + echo $'Cleaning up symlinks.\n' + fi + echo "Make sure the nvidia driver is DISABLED in /etc/X11/xorg.conf." + echo "Otherwise, this may lead to improperly working drivers." + + if [ "$1" = "cleanup" ]; then + incs "xorg" "cleanup" + else + incs "xorg" "xorg" + fi + + libs_basic + libgl_xorg + libs "" + if [ "$1" = "cleanup" ]; then + libglx_xorg "" + else + libglx_xorg "xorg" + fi + + LD_NVIDIA="${LIB}/libGL.so.1.2" + nvidia_ldconfig $LD_NVIDIA "xorg" +} + +usage(){ + echo "Usage:" + echo " --nvidia Switch to nvidia driver files" + echo " --xorg Switch to stock xorg files" + echo " --cleanup Switch to stock xorg files and remove all created symlinks" + echo " --install Switch to nvidia driver files" + echo " This is used on installation to handle installroot correctly" + echo " Please use --nvidia for after-install switches instead" + echo " --check-nvidia Check if everything is setup correctly for nvidia's driver" + echo " --check-xorg Check if everything is setup correctly for xorg's driver" + echo " --check-cleanup Check if everything has been cleaned up correctly" + echo " --help Show this help message" +} + +if [ "$1" = '--nvidia' ]; then + nvidia +elif [ "$1" = '--install' ]; then + ROOT="" + CWD=$(pwd) + if [ -e "${ROOT}usr/lib64" ]; then + LIBSUFFIX="64" + else + LIBSUFFIX="" + fi + INC="${ROOT}usr/include/GL" + LIB="${ROOT}usr/lib${LIBSUFFIX}" + XMOD="${LIB}/xorg/modules" + XLIB="$XMOD/extensions" + nvidia +elif [ "$1" = '--xorg' ]; then + xorg "" +elif [ "$1" = '--check-nvidia' ]; then + nvidia_check +elif [ "$1" = '--check-xorg' ]; then + xorg_check +elif [ "$1" = '--check-cleanup' ]; then + cleanup_check +elif [ "$1" = '--cleanup' ]; then + xorg "cleanup" +elif [ "$1" = '--help' ]; then + usage +else + usage +fi diff --git a/system/nvidia-legacy173-driver/slack-desc b/system/nvidia-legacy173-driver/slack-desc new file mode 100644 index 000000000000..8d38409f5358 --- /dev/null +++ b/system/nvidia-legacy173-driver/slack-desc @@ -0,0 +1,19 @@ +# 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------------------------------------------------------| +nvidia-legacy173-driver: nvidia-legacy173-driver (Binary Nvidia Video Driver) +nvidia-legacy173-driver: +nvidia-legacy173-driver: This is the proprietary binary video driver for legacy cards +nvidia-legacy173-driver: (Geforce 5) from nvidia for the X.org X server. This package does +nvidia-legacy173-driver: not include the kernel module - it is included in the +nvidia-legacy173-driver: nvidia-legacy173-kernel package. +nvidia-legacy173-driver: +nvidia-legacy173-driver: See /usr/doc/nvidia-legacy173-driver-PKGVERSION/README.Slackware +nvidia-legacy173-driver: for more information. +nvidia-legacy173-driver: +nvidia-legacy173-driver: |