diff options
author | Heinz Wiesinger <pprkut@liwjatan.at> | 2010-05-11 22:55:24 +0200 |
---|---|---|
committer | David Somero <xgizzmo@slackbuilds.org> | 2010-05-11 22:55:24 +0200 |
commit | 1db316e83478ed99d37216e6fcdd241117976bb8 (patch) | |
tree | 791dca20f57ffbe86651eaf9d68dbc6b31bcf9bc /system/nvidia-legacy96-driver | |
parent | 8599e1908bb42eba7eb03fbd7509553dcf500b1c (diff) |
system/nvidia-legacy96-driver: Added to 12.1 repository
Diffstat (limited to 'system/nvidia-legacy96-driver')
-rw-r--r-- | system/nvidia-legacy96-driver/README | 35 | ||||
-rw-r--r-- | system/nvidia-legacy96-driver/doinst.sh | 23 | ||||
-rw-r--r-- | system/nvidia-legacy96-driver/nvidia-legacy96-driver.SlackBuild | 121 | ||||
-rw-r--r-- | system/nvidia-legacy96-driver/nvidia-legacy96-driver.info | 8 | ||||
-rw-r--r-- | system/nvidia-legacy96-driver/nvidia-switch | 334 | ||||
-rw-r--r-- | system/nvidia-legacy96-driver/slack-desc | 19 |
6 files changed, 540 insertions, 0 deletions
diff --git a/system/nvidia-legacy96-driver/README b/system/nvidia-legacy96-driver/README new file mode 100644 index 0000000000000..9ef3f5ec26d02 --- /dev/null +++ b/system/nvidia-legacy96-driver/README @@ -0,0 +1,35 @@ +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 can be 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 + +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/{libGLcore.so libGLcore.la 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 0000000000000..d2ac12b1546c5 --- /dev/null +++ b/system/nvidia-legacy96-driver/doinst.sh @@ -0,0 +1,23 @@ +if [ -x /usr/bin/update-desktop-database ]; then + ./usr/bin/update-desktop-database -q usr/share/applications +fi + +if ! [ -e usr/lib/xorg/modules/libwfb.so ]; then + ( cd usr/lib/xorg/modules ; ln -s libnvidia-wfb.so.1 libwfb.so ) +fi + +( cd usr/lib/tls ; rm -rf libnvidia-tls.so.1 ) +( cd usr/lib/tls ; ln -sf tls/libnvidia-tls.so.PKGVERSION libnvidia-tls.so.1 ) +( cd usr/lib/xorg/modules ; rm -rf libnvidia-wfb.so.1 ) +( cd usr/lib/xorg/modules ; ln -sf libnvidia-wfb.so.PKGVERSION libnvidia-wfb.so.1 ) +( cd usr/lib ; rm -rf libnvidia-cfg.so.1 ) +( cd usr/lib ; ln -sf libnvidia-cfg.so.PKGVERSION libnvidia-cfg.so.1 ) +( cd usr/lib ; rm -rf libnvidia-tls.so.1 ) +( cd usr/lib ; ln -sf libnvidia-tls.so.PKGVERSION libnvidia-tls.so.1 ) +( cd usr/lib ; rm -rf libXvMCNVIDIA_dynamic.so.1 ) +( cd usr/lib ; ln -sf libXvMCNVIDIA.so.PKGVERSION libXvMCNVIDIA_dynamic.so.1 ) +( cd usr/lib ; rm -rf libnvidia-cfg.so ) +( cd usr/lib ; ln -sf libnvidia-cfg.so.1 libnvidia-cfg.so ) + +/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 0000000000000..306c960afa014 --- /dev/null +++ b/system/nvidia-legacy96-driver/nvidia-legacy96-driver.SlackBuild @@ -0,0 +1,121 @@ +#!/bin/sh + +# Slackware build script for nvidia-legacy96-driver + +# Copyright 2008 Heinz Wiesinger <pprkut@liwjatan.at> +# 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=nvidia-legacy96-driver +VERSION=96.43.07 +ARCH=${ARCH:-i586} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +SRCNAM=NVIDIA-Linux-x86-$VERSION-pkg1 + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +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,sbin} $PKG/usr/include/GL \ + $PKG/usr/lib/xorg/modules/{drivers,extensions} + +# Start with the libraries +cd usr/lib + cp -a * $PKG/usr/lib + #Rename those files which would overwrite xorg's original files + for i in libGL.so.$VERSION libGLcore.so.$VERSION; do + mv $PKG/usr/lib/$i $PKG/usr/lib/$i-nvidia ; + done +cd - + +# This is the driver itself +cd usr/X11R6/lib + cp -a * $PKG/usr/lib/xorg/ + for i in libXvMCNVIDIA.a libXvMCNVIDIA.so.$VERSION; do + mv $PKG/usr/lib/xorg/$i $PKG/usr/lib/ ; + done + + # Rename those files which would overwrite xorg's original files + mv $PKG/usr/lib/xorg/modules/extensions/libglx.so.$VERSION \ + $PKG/usr/lib/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 nvidia-installer $PKG/usr/bin/ +cd usr/bin + for i in nvidia*; do + cp -a $i $PKG/usr/bin/ + done +cd - + +# XDG stuff +cd usr/share + for i in applications pixmaps; do + cp -a $i $PKG/usr/share/ + done + cp -a man* $PKG/usr/ +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 + +# These correct wrong paths +sed -i 's|__LIBGL_PATH__|/usr/lib/|' $PKG/usr/lib/libGL.la +sed -i 's|/usr/X11R6/lib|/usr/lib/|' $PKG/usr/lib/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 +sed s/PKGVERSION/$VERSION/g $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l n -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.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 0000000000000..9825edcbf84fe --- /dev/null +++ b/system/nvidia-legacy96-driver/nvidia-legacy96-driver.info @@ -0,0 +1,8 @@ +PRGNAM="nvidia-legacy96-driver" +VERSION="96.43.07" +HOMEPAGE="http://www.nvidia.com" +DOWNLOAD="http://us.download.nvidia.com/XFree86/Linux-x86/96.43.07/NVIDIA-Linux-x86-96.43.07-pkg1.run" +MD5SUM="bce9f250b21cc024d8fcebc28ba06970" +MAINTAINER="ppr:kut" +EMAIL="pprkut@liwjatan.at" +APPROVED="dsomero"
\ No newline at end of file diff --git a/system/nvidia-legacy96-driver/nvidia-switch b/system/nvidia-legacy96-driver/nvidia-switch new file mode 100644 index 0000000000000..647c6ef2a976c --- /dev/null +++ b/system/nvidia-legacy96-driver/nvidia-switch @@ -0,0 +1,334 @@ +#!/bin/sh + +# *************************************************************************** +# * Copyright (C) 2007-2008 by Heinz Wiesinger * +# * pprkut@liwjatan.at * +# * http://www.liwjatan.at * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU General Public License as published by * +# * the Free Software Foundation; either version 3 of the License, or * +# * (at your option) any later version. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU General Public License for more details. * +# * * +# * You should have received a copy of the GNU General Public License * +# * along with this program; if not, write to the * +# * Free Software Foundation, Inc., * +# * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +# ***************************************************************************/ +# nvidia-switch utility 0.7.0 +# +# A tool to switch between nvidia-binary-driver and stock xorg-driver +# if both are installed in parallel. + +set -e + +ROOT="/" +CWD=$(pwd) +INC="${ROOT}usr/include/GL" +LIB="${ROOT}usr/lib" +XMOD="${ROOT}usr/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 libGLcore.so libGLcore.la 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 +} + +libwfb_nvidia(){ +#Recreate the link removed by --xorg +if ! [ -e "$XMOD/libwfb.so" ]; then + cd $XMOD + ln -s libnvidia-wfb.so.1 libwfb.so + cd $CWD +fi +} + +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 +} + +nvidia(){ + echo $'Switching to nvidia-driver files!\n' + echo "You have to ENABLE the nvidia driver 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 + libwfb_nvidia + + LD_NVIDIA="/usr/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 "You have to DISABLE the nvidia driver 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 + remove_link "$XMOD/libwfb.so" + + LD_NVIDIA="/usr/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 " --help Show this help message" +} + +if [ "$1" = '--nvidia' ]; then + nvidia +elif [ "$1" = '--install' ]; then + ROOT="" + CWD=$(pwd) + INC="${ROOT}usr/include/GL" + LIB="${ROOT}usr/lib" + XMOD="${ROOT}usr/lib/xorg/modules" + XLIB="$XMOD/extensions" + nvidia +elif [ "$1" = '--xorg' ]; then + xorg "" +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 0000000000000..a3d7351e062ad --- /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 (Nvidia's Binary Video Driver) +nvidia-legacy96-driver: +nvidia-legacy96-driver: This is the proprietary binary video driver for +nvidia-legacy96-driver: legacy cards (Geforce 4) from nvidia for the x.org X +nvidia-legacy96-driver: server. This package does not include the kernel +nvidia-legacy96-driver: module - it is included in the nvidia-kernel package. +nvidia-legacy96-driver: +nvidia-legacy96-driver: See /usr/doc/nvidia-legacy96-driver-PKGVERSION/ +nvidia-legacy96-driver: README.Slackware for more information. +nvidia-legacy96-driver: +nvidia-legacy96-driver: |