This commit is contained in:
Kolan Sh 2012-03-24 11:16:52 +04:00
parent eb6e53db77
commit 5a79e109e0
6 changed files with 78 additions and 73 deletions

View File

@ -1,32 +1,37 @@
SHELL = /bin/sh
PREFIX = /usr/local
PREFIX = /usr
all:
install:
install --mode=644 etc/X11/* /etc/X11
install etc/init.d/* /etc/init.d
install bin/* ${PREFIX}/bin
install sbin/* ${PREFIX}/sbin
install lib64/*.so ${PREFIX}/lib64
install -d ${PREFIX}/lib64/snail
ln -sf /usr/lib64/opengl/nvidia/extensions ${PREFIX}/lib64/snail
install -d ${PREFIX}/lib64/snail/modules
ln -sf /usr/lib64/xorg/modules/drivers ${PREFIX}/lib64/snail/modules
ln -sf /usr/lib64/xorg/modules/extensions ${PREFIX}/lib64/snail/modules
ln -sf /usr/lib64/xorg/modules/libfb.so ${PREFIX}/lib64/snail/modules
ln -sf /usr/lib64/xorg/modules/libwfb.so ${PREFIX}/lib64/snail/modules
install -d ${DESTDIR}/etc/X11
install --mode=644 etc/X11/* ${DESTDIR}/etc/X11
install -d ${DESTDIR}/etc/init.d
install etc/init.d/* ${DESTDIR}/etc/init.d
install -d ${DESTDIR}/${PREFIX}/bin
install bin/* ${DESTDIR}/${PREFIX}/bin
install -d ${DESTDIR}/${PREFIX}/sbin
install sbin/* ${DESTDIR}/${PREFIX}/sbin
install -d ${DESTDIR}/${PREFIX}/lib64
install lib64/*.so ${DESTDIR}/${PREFIX}/lib64
install -d ${DESTDIR}/${PREFIX}/lib64/snail
ln -sf /usr/lib64/opengl/nvidia/extensions ${DESTDIR}/${PREFIX}/lib64/snail
install -d ${DESTDIR}/${PREFIX}/lib64/snail/modules
ln -sf /usr/lib64/xorg/modules/drivers ${DESTDIR}/${PREFIX}/lib64/snail/modules
ln -sf /usr/lib64/xorg/modules/extensions ${DESTDIR}/${PREFIX}/lib64/snail/modules
ln -sf /usr/lib64/xorg/modules/libfb.so ${DESTDIR}/${PREFIX}/lib64/snail/modules
ln -sf /usr/lib64/xorg/modules/libwfb.so ${DESTDIR}/${PREFIX}/lib64/snail/modules
uninstall:
rm -f /etc/X11/xorg.conf.*.snail
rm -f /etc/init.d/snail-*
rm -f ${PREFIX}/lib64/libdlfaker.so
rm -f ${PREFIX}/lib64/libgefaker.so
rm -f ${PREFIX}/lib64/librrfaker.so
rm -rf ${PREFIX}/lib64/snail
rm -f ${PREFIX}/bin/nvrun
rm -f ${PREFIX}/bin/snail.vglrun
rm -f ${PREFIX}/sbin/snail.nv_pwr_off
rm -f ${PREFIX}/sbin/snail.nv_pwr_on
rm -f ${PREFIX}/sbin/snail-watcher.sh
rm -f ${PREFIX}/sbin/snail.configure
rm -f ${DESTDIR}/etc/X11/xorg.conf.*.snail
rm -f ${DESTDIR}/etc/init.d/snail-*
rm -f ${DESTDIR}/${PREFIX}/lib64/libdlfaker.so
rm -f ${DESTDIR}/${PREFIX}/lib64/libgefaker.so
rm -f ${DESTDIR}/${PREFIX}/lib64/librrfaker.so
rm -rf ${DESTDIR}/${PREFIX}/lib64/snail
rm -f ${DESTDIR}/${PREFIX}/bin/nvrun
rm -f ${DESTDIR}/${PREFIX}/bin/snail.vglrun
rm -f ${DESTDIR}/${PREFIX}/sbin/snail.nv_pwr_off
rm -f ${DESTDIR}/${PREFIX}/sbin/snail.nv_pwr_on
rm -f ${DESTDIR}/${PREFIX}/sbin/snail-watcher.sh
rm -f ${DESTDIR}/${PREFIX}/sbin/snail.configure

View File

@ -1,6 +1,6 @@
#!/sbin/runscript
DAEMON="/usr/local/sbin/snail-watcher.sh"
DAEMON="snail-watcher.sh"
DAEMON_ARGS=""
PIDFILE=/var/run/snail.pid
PATH=$PATH:/usr/local/bin

View File

@ -1,7 +1,7 @@
#!/sbin/runscript
DAEMON=/usr/bin/X
DAEMON_ARGS="-ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/local/lib/snail -nolisten tcp -noreset :1 vt9"
DAEMON_ARGS="-ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/lib/snail -nolisten tcp -noreset :1 vt9"
PIDFILE=/tmp/.X1-lock
depend() {

View File

@ -1,5 +1,16 @@
#!/bin/bash
echo "Test for nVidia driver"
lsmod | grep '^nvidia ' &>/dev/null
[ 0 -ne $? ] && snail.nv_pwr_on && modprobe nvidia ; snail.nv_pwr_off
if [ 0 -eq $? ]; then
echo "nVidia driver is OK! ;-)"
modprobe -r nvidia
else
echo "You must install standart nVidia driver first!"
exit -1
fi
echo "Test for acpi_call module..."
lsmod | grep '^acpi_call ' &>/dev/null
if [ 0 -eq $? ]; then
@ -82,7 +93,7 @@ if [ "gentoo" == "$DISTRIB_ID" ]; then
eselect rc delete snail-watcher boot
eselect rc add snail-watcher default
eselect rc stop snail-xserver
eselect rc start snail-watcher
eselect rc restart snail-watcher
elif [ "fedora" == "$DISTRIB_ID" ]; then
echo ""
else

View File

@ -1,45 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
inherit eutils
DESCRIPTION="Snail - nVidia Optimus support in a simple way"
SRC_URI="ftp://backbone.myftp.org/projects/snail/snail-0.0.1.tar.gz"
HOMEPAGE="http://backbone.myftp.org/projects/snail"
KEYWORDS="-* ~x86 ~amd64"
SLOT="0"
LICENSE="GPL-3"
IUSE=""
DEPEND="x11-drivers/nvidia-drivers"
RDEPEND="${DEPEND}"
src_prepare() {
echo "src_prepare=`pwd`" >>/tmp/snail.log
}
src_configure() {
echo "src_configure=`pwd`" >>/tmp/snail.log
}
src_compile() {
echo "src_compile=`pwd`" >>/tmp/snail.log
}
src_install() {
echo "src_install=`pwd`" >>/tmp/snail.log
}
pkg_postinst() {
echo "src_postinst=`pwd`" >>/tmp/snail.log
}

34
snail-1.0.0.ebuild Normal file
View File

@ -0,0 +1,34 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
inherit eutils
DESCRIPTION="Snail - nVidia Optimus support"
SRC_URI="ftp://backbone.ws/projects/snail/snail-1.0.0.tar.bz2"
HOMEPAGE="https://chili.backbone.ws/projects/snail"
KEYWORDS="-* ~x86 ~amd64"
SLOT="0"
LICENSE="GPL-3"
IUSE=""
DEPEND="x11-drivers/nvidia-drivers"
RDEPEND="${DEPEND}"
src_install() {
echo "src_install=`pwd`" >>/tmp/snail.log
emake install DESTDIR="${D}" || die
}
pkg_postinst() {
snail.configure
}