summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Koenig <kingbeowulf@gmail.com>2013-07-07 21:26:22 -0500
committerRobby Workman <rworkman@slackbuilds.org>2013-07-14 17:07:16 -0500
commit6c513cb06e5a188279c9c6360f950c067b133767 (patch)
treec5193f3c62670625c10c0f0c132aa4c1e20d4332
parentf9c2de67549f14816b7058a8fe15b27953afbecb (diff)
downloadslackbuilds-6c513cb06e5a188279c9c6360f950c067b133767.tar.gz
system/nvidia-legacy96-driver: Added.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
-rw-r--r--system/nvidia-legacy96-driver/Makefile-libXNVCtrl32
-rw-r--r--system/nvidia-legacy96-driver/NvCtrlAttributesVidMode.diff10
-rw-r--r--system/nvidia-legacy96-driver/README40
-rw-r--r--system/nvidia-legacy96-driver/doinst.sh6
-rw-r--r--system/nvidia-legacy96-driver/nvidia-legacy96-driver.SlackBuild229
-rw-r--r--system/nvidia-legacy96-driver/nvidia-legacy96-driver.info16
-rw-r--r--system/nvidia-legacy96-driver/nvidia-switch512
-rw-r--r--system/nvidia-legacy96-driver/slack-desc19
8 files changed, 864 insertions, 0 deletions
diff --git a/system/nvidia-legacy96-driver/Makefile-libXNVCtrl b/system/nvidia-legacy96-driver/Makefile-libXNVCtrl
new file mode 100644
index 0000000000..15b03cc3ee
--- /dev/null
+++ b/system/nvidia-legacy96-driver/Makefile-libXNVCtrl
@@ -0,0 +1,32 @@
+# Copyright (c) 2008 NVIDIA, Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+RANLIB ?= ranlib
+
+libXNVCtrl.a : libXNVCtrl.a(NVCtrl.o)
+ $(RANLIB) $@
+
+NVCtrl.o : NVCtrl.h nv_control.h NVCtrlLib.h
+.INTERMEDIATE: NVCtrl.o
+
+clean ::
+ rm -f libXNVCtrl.a *.o
+.PHONY: clean
diff --git a/system/nvidia-legacy96-driver/NvCtrlAttributesVidMode.diff b/system/nvidia-legacy96-driver/NvCtrlAttributesVidMode.diff
new file mode 100644
index 0000000000..d3e1fae244
--- /dev/null
+++ b/system/nvidia-legacy96-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-legacy96-driver/README b/system/nvidia-legacy96-driver/README
new file mode 100644
index 0000000000..98ec9590e4
--- /dev/null
+++ b/system/nvidia-legacy96-driver/README
@@ -0,0 +1,40 @@
+This is the proprietary binary video driver for legacy cards (Geforce 4
+Backwards) 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-driver from a previous
+package. If you update to a newer xorg, you do not have to reinstall
+nvidia-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-legacy96-kernel package from SlackBuilds.org.
diff --git a/system/nvidia-legacy96-driver/doinst.sh b/system/nvidia-legacy96-driver/doinst.sh
new file mode 100644
index 0000000000..9ad2ad8600
--- /dev/null
+++ b/system/nvidia-legacy96-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-legacy96-driver/nvidia-legacy96-driver.SlackBuild b/system/nvidia-legacy96-driver/nvidia-legacy96-driver.SlackBuild
new file mode 100644
index 0000000000..a5d72654d0
--- /dev/null
+++ b/system/nvidia-legacy96-driver/nvidia-legacy96-driver.SlackBuild
@@ -0,0 +1,229 @@
+#!/bin/sh
+
+# Slackware build script for nvidia-legacy96-driver
+
+# Copyright 2008-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.
+#
+# Maintainer: Edward Koenig, <kingbeowulf[at]gmail.com>
+
+
+PRGNAM=nvidia-legacy96-driver
+VERSION=96.43.23
+APPVER=96.43.20
+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-$APPVER.tar.gz
+rm -rf nvidia-settings-1.0
+tar xvf $CWD/nvidia-settings-$APPVER.tar.gz
+rm -rf nvidia-xconfig-1.0
+tar xvf $CWD/nvidia-xconfig-$APPVER.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/
+
+# symlinks
+cd $PKG/usr/lib$LIBDIRSUFFIX
+ ln -sf libnvidia-cfg.so.$VERSION libnvidia-cfg.so.1
+ ln -sf libnvidia-cfg.so.1 libnvidia-cfg.so
+ 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 -
+
+# XDG stuff
+cd usr/share
+ for i in applications pixmaps; do
+ cp -a $i $PKG/usr/share/
+ done
+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
+ rm libXNVCtrl.a
+ cp $CWD/Makefile-libXNVCtrl ./Makefile
+ 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-legacy96-driver/nvidia-legacy96-driver.info b/system/nvidia-legacy96-driver/nvidia-legacy96-driver.info
new file mode 100644
index 0000000000..76ddf488e9
--- /dev/null
+++ b/system/nvidia-legacy96-driver/nvidia-legacy96-driver.info
@@ -0,0 +1,16 @@
+PRGNAM="nvidia-legacy96-driver"
+VERSION="96.43.23"
+HOMEPAGE="http://www.nvidia.com"
+DOWNLOAD="ftp://download.nvidia.com/XFree86/Linux-x86/96.43.23/NVIDIA-Linux-x86-96.43.23-pkg1.run \
+ ftp://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-96.43.20.tar.gz \
+ ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-96.43.20.tar.gz \
+ ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-96.43.20.tar.gz"
+MD5SUM="21f6eb657e651a83ff4271438122b379\
+ 8a5bdb1c455953e8cc4c089f4404f373 \
+ c27decb2951a393620bb469757314c19 \
+ 394956f6d29e642bda2a16ade02d27ad"
+DOWNLOAD_x86_64="ftp://download.nvidia.com/XFree86/Linux-x86_64/96.43.23/NVIDIA-Linux-x86_64-96.43.23-pkg2.run"
+MD5SUM_x86_64="dd8546e5ae7d10da072306e5f13952b8"
+REQUIRES="nvidia-legacy96-kernel"
+MAINTAINER="Edward Koenig"
+EMAIL="kinbeowulf@gmail.com"
diff --git a/system/nvidia-legacy96-driver/nvidia-switch b/system/nvidia-legacy96-driver/nvidia-switch
new file mode 100644
index 0000000000..b700fb2f5d
--- /dev/null
+++ b/system/nvidia-legacy96-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-legacy96-driver/slack-desc b/system/nvidia-legacy96-driver/slack-desc
new file mode 100644
index 0000000000..5fb1bf88ee
--- /dev/null
+++ b/system/nvidia-legacy96-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-legacy96-driver: nvidia-legacy96-driver (Binary Nvidia Video Driver)
+nvidia-legacy96-driver:
+nvidia-legacy96-driver: This is the proprietary binary video driver for legacy cards
+nvidia-legacy96-driver: (Geforce 4) from nvidia for the X.org X server. This package does
+nvidia-legacy96-driver: not include the kernel module - it is included in the
+nvidia-legacy96-driver: nvidia-legacy96-kernel package.
+nvidia-legacy96-driver:
+nvidia-legacy96-driver: See /usr/doc/nvidia-legacy96-driver-PKGVERSION/README.Slackware
+nvidia-legacy96-driver: for more information.
+nvidia-legacy96-driver:
+nvidia-legacy96-driver: