first trial to add switcheroo to catalyst, using Gentoo files

This commit is contained in:
abveritas 2012-07-30 21:46:42 +00:00
parent 640f38d556
commit dbfe3dae1a
3 changed files with 129 additions and 4 deletions

View File

@ -7,7 +7,7 @@ _kernver="3.4.6-1-CHAKRA"
pkgname=(catalyst chd-catalyst)
pkgver=12.6
pkgrel=2
pkgrel=3
arch=('i686' 'x86_64')
url="http://www.ati.amd.com"
license=('custom')
@ -18,14 +18,18 @@ source=(http://www2.ati.com/drivers/linux/amd-driver-installer-${pkgver/./-}-x86
makefile_compat.patch
3.2.8.patch
catalyst/3.4.patch
fglrx_supported)
fglrx_supported
switchlibglx
switchlibGL)
md5sums=('6bd4f0875202390ed7122696db29be77'
'660396540b0ceaff71d6155c986734de'
'3e1b82bd69774ea808da69c983d6a43b'
'32c8142c73dcfed5db426f494feda9e3'
'7b229c6e48ee3f1af0d97059b9fa5cfe'
'8bd182de340d6ed8b2dfcedfd3e5a389')
'8bd182de340d6ed8b2dfcedfd3e5a389'
'99032d919ede27884b5c3e87ab110a96'
'99032d919ede27884b5c3e87ab110a96')
build() {
@ -101,7 +105,12 @@ package_catalyst() {
# License
install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
install -m644 "${srcdir}/archive_files/LICENSE.TXT" "${pkgdir}/usr/share/licenses/${pkgname}/"
install -m644 "${srcdir}/archive_files/LICENSE.TXT" "${pkgdir}/usr/share/licenses/${pkgname}/"
# Switcheroo files
install -m755 -d "${pkgdir}/usr/lib/fglrx"
install -m644 "${srcdir}/switchlibglx" "${pkgdir}/usr/lib/fglrx/"
install -m644 "${srcdir}/switchlibGL" "${pkgdir}/usr/lib/fglrx/"
sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" $startdir/*.install
}

58
catalyst/switchlibGL Normal file
View File

@ -0,0 +1,58 @@
#!/bin/bash
# switchlibGL and switchlibglx
#
# Copyright (c) 2011 Advanced Micro Devices, Inc.
#
# Purpose:
# For switch between AMD and Intel graphic driver library.
#
# Usage:
# switchlibGL amd|intel|query
# amd: switches to the AMD version of libGL.
# intel: switches to the open-source version of libGL .
# query: checks, which version is currently active and prints either "amd"
# or "intel" or "unknown" on the standard output.
# must be root to execute this script
ARCH=`uname -m`
E_ERR=1
# Check if root
if [ "`whoami`" != "root" ]; then
echo "Must be root to run this script." 1>&2
exit $E_ERR
fi
# One parameter
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` amd|intel|query " 1>&2
echo "Please choose one parameter " 1>&2
exit $E_ERR
fi
# Switch to right mode
case "$1" in
"amd" )
eselect opengl set ati
;;
"intel" )
eselect opengl set xorg-x11
;;
"query" )
current=`eselect opengl show`
case "$current" in
"ati" )
echo "amd"
;;
"xorg-x11" )
echo "intel"
;;
esac
;;
* ) echo "Usage: `basename $0` amd|intel|query" 1>&2; exit $E_ERR;;
# other than amd|intel|query parameter report an error
esac
# A zero return value from the script upon exit indicates success.
exit 0

58
catalyst/switchlibglx Normal file
View File

@ -0,0 +1,58 @@
#!/bin/bash
# switchlibGL and switchlibglx
#
# Copyright (c) 2011 Advanced Micro Devices, Inc.
#
# Purpose:
# For switch between AMD and Intel graphic driver library.
#
# Usage:
# switchlibGL amd|intel|query
# amd: switches to the AMD version of libGL.
# intel: switches to the open-source version of libGL .
# query: checks, which version is currently active and prints either "amd"
# or "intel" or "unknown" on the standard output.
# must be root to execute this script
ARCH=`uname -m`
E_ERR=1
# Check if root
if [ "`whoami`" != "root" ]; then
echo "Must be root to run this script." 1>&2
exit $E_ERR
fi
# One parameter
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` amd|intel|query " 1>&2
echo "Please choose one parameter " 1>&2
exit $E_ERR
fi
# Switch to right mode
case "$1" in
"amd" )
eselect opengl set ati
;;
"intel" )
eselect opengl set xorg-x11
;;
"query" )
current=`eselect opengl show`
case "$current" in
"ati" )
echo "amd"
;;
"xorg-x11" )
echo "intel"
;;
esac
;;
* ) echo "Usage: `basename $0` amd|intel|query" 1>&2; exit $E_ERR;;
# other than amd|intel|query parameter report an error
esac
# A zero return value from the script upon exit indicates success.
exit 0