diff --git a/sys-power/bbswitch/Manifest b/sys-power/bbswitch/Manifest new file mode 100644 index 00000000..b460d950 --- /dev/null +++ b/sys-power/bbswitch/Manifest @@ -0,0 +1 @@ +DIST bbswitch-0.8.tar.gz 15800 SHA256 76cabd3f734fb4fe6ebfe3ec9814138d0d6f47d47238521ecbd6a986b60d1477 SHA512 11ab163931feb6c0e202d04c4552b848e999fedea9990390c26b28abdb4a69081ccfb5a22d1e390cc274f1c0cfc9adedc719c5fece14738b17aaa93e28865b7c WHIRLPOOL 4215bb74779d5bfaacd1177f89636a9006fbce369c381e620868e7012092756417f7df732b373341254fad75e08f6de4536921f5478f0032d2961d22d56a3c15 diff --git a/sys-power/bbswitch/bbswitch-0.8-r1.ebuild b/sys-power/bbswitch/bbswitch-0.8-r1.ebuild new file mode 100644 index 00000000..24d5f107 --- /dev/null +++ b/sys-power/bbswitch/bbswitch-0.8-r1.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +inherit eutils linux-mod + +DESCRIPTION="Toggle discrete NVIDIA Optimus graphics card" +HOMEPAGE="https://github.com/Bumblebee-Project/bbswitch" +SRC_URI="https://github.com/Bumblebee-Project/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +SLOT="0" +LICENSE="GPL-3+" +KEYWORDS="amd64 x86" +IUSE="" + +DEPEND=" + virtual/linux-sources + sys-kernel/linux-headers +" +RDEPEND="" + +MODULE_NAMES="bbswitch(acpi)" + +pkg_setup() { + linux-mod_pkg_setup + + BUILD_TARGETS="default" + BUILD_PARAMS="KVERSION=${KV_FULL}" +} + +src_prepare() { + # Fix build failure, bug #513542 + sed -i 's/^KDIR.*$/KDIR\ \:= \/usr\/src\/linux/g' Makefile || die + + if kernel_is ge 4 12 0 ; then + epatch "${FILESDIR}"/linux-4.12.patch + fi +} + +src_install() { + insinto /etc/modprobe.d + newins "${FILESDIR}"/bbswitch.modprobe bbswitch.conf + dodoc NEWS README.md + + linux-mod_src_install +} diff --git a/sys-power/bbswitch/files/bbswitch.modprobe b/sys-power/bbswitch/files/bbswitch.modprobe new file mode 100644 index 00000000..dd6500c7 --- /dev/null +++ b/sys-power/bbswitch/files/bbswitch.modprobe @@ -0,0 +1 @@ +options bbswitch load_state=-1 unload_state=-1 \ No newline at end of file diff --git a/sys-power/bbswitch/files/linux-4.12.patch b/sys-power/bbswitch/files/linux-4.12.patch new file mode 100644 index 00000000..437bd3f8 --- /dev/null +++ b/sys-power/bbswitch/files/linux-4.12.patch @@ -0,0 +1,10 @@ +--- bbswitch.c 2017-07-07 18:14:51.818861595 +0300 ++++ bbswitch.c 2017-07-07 18:14:42.728655302 +0300 +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #include + #include + #include