summaryrefslogtreecommitdiff
path: root/sys-kernel/bbswitch-dkms
diff options
context:
space:
mode:
authorV3n3RiX <venerix@rogentos.ro>2016-10-23 20:51:48 +0100
committerV3n3RiX <venerix@rogentos.ro>2016-10-23 20:51:48 +0100
commit6f6762411d44f0805450901cec7c526d09ea039b (patch)
tree16673740ae02ad65232fe0a6a4b82f0cedbab260 /sys-kernel/bbswitch-dkms
parent277b051f070f314b5918868bae5a890f42f99455 (diff)
bbswitch-dkms
Diffstat (limited to 'sys-kernel/bbswitch-dkms')
-rw-r--r--sys-kernel/bbswitch-dkms/Manifest1
-rw-r--r--sys-kernel/bbswitch-dkms/bbswitch-dkms-0.8.ebuild45
-rw-r--r--sys-kernel/bbswitch-dkms/files/bbswitch-dkms-0.8-conf.patch52
-rw-r--r--sys-kernel/bbswitch-dkms/files/bbswitch.modprobe1
4 files changed, 99 insertions, 0 deletions
diff --git a/sys-kernel/bbswitch-dkms/Manifest b/sys-kernel/bbswitch-dkms/Manifest
new file mode 100644
index 00000000..b460d950
--- /dev/null
+++ b/sys-kernel/bbswitch-dkms/Manifest
@@ -0,0 +1 @@
+DIST bbswitch-0.8.tar.gz 15800 SHA256 76cabd3f734fb4fe6ebfe3ec9814138d0d6f47d47238521ecbd6a986b60d1477 SHA512 11ab163931feb6c0e202d04c4552b848e999fedea9990390c26b28abdb4a69081ccfb5a22d1e390cc274f1c0cfc9adedc719c5fece14738b17aaa93e28865b7c WHIRLPOOL 4215bb74779d5bfaacd1177f89636a9006fbce369c381e620868e7012092756417f7df732b373341254fad75e08f6de4536921f5478f0032d2961d22d56a3c15
diff --git a/sys-kernel/bbswitch-dkms/bbswitch-dkms-0.8.ebuild b/sys-kernel/bbswitch-dkms/bbswitch-dkms-0.8.ebuild
new file mode 100644
index 00000000..cfdea920
--- /dev/null
+++ b/sys-kernel/bbswitch-dkms/bbswitch-dkms-0.8.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+MY_PN="bbswitch"
+DESCRIPTION="BBswitch sources for linux"
+HOMEPAGE="https://github.com/Bumblebee-Project/bbswitch"
+SRC_URI="https://github.com/Bumblebee-Project/${MY_PN}/archive/v${PV}.tar.gz -> ${MY_PN}-${PV}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-3+"
+KEYWORDS="amd64"
+IUSE=""
+DEPEND="sys-kernel/dkms"
+RDEPEND=""
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ # Fix build failure, bug #513542
+ sed -i 's/^KDIR.*$/KDIR\ \:= \/usr\/src\/linux/g' Makefile
+ epatch ${FILESDIR}/${P}-conf.patch
+}
+
+src_compile() {
+ :
+}
+
+src_install() {
+ dodir /usr/src/${P}
+ insinto /usr/src/${P}
+ doins -r ${S}/*
+}
+
+pkg_postinst() {
+ dkms add ${PN}/${PV}
+}
+
+pkg_postrm() {
+ dkms remove ${PN}/${PV} --all
+}
diff --git a/sys-kernel/bbswitch-dkms/files/bbswitch-dkms-0.8-conf.patch b/sys-kernel/bbswitch-dkms/files/bbswitch-dkms-0.8-conf.patch
new file mode 100644
index 00000000..4b1447a4
--- /dev/null
+++ b/sys-kernel/bbswitch-dkms/files/bbswitch-dkms-0.8-conf.patch
@@ -0,0 +1,52 @@
+diff -Nur a/dkms/dkms.conf b/dkms/dkms.conf
+--- a/dkms/dkms.conf 2013-12-04 23:22:06.000000000 +0000
++++ b/dkms/dkms.conf 1970-01-01 01:00:00.000000000 +0100
+@@ -1,7 +0,0 @@
+-PACKAGE_NAME="bbswitch"
+-PACKAGE_VERSION="#MODULE_VERSION#"
+-MAKE[0]="make KVERSION=$kernelver"
+-CLEAN="make clean"
+-BUILT_MODULE_NAME[0]="bbswitch"
+-DEST_MODULE_LOCATION[0]="/kernel/drivers/acpi"
+-AUTOINSTALL="yes"
+diff -Nur a/dkms.conf b/dkms.conf
+--- a/dkms.conf 1970-01-01 01:00:00.000000000 +0100
++++ b/dkms.conf 2016-10-23 20:00:47.965369366 +0100
+@@ -0,0 +1,9 @@
++PACKAGE_NAME="bbswitch"
++PACKAGE_VERSION="0.8"
++AUTOINSTALL="yes"
++
++MAKE[0]="make KVERSION=$kernelver"
++CLEAN="make clean"
++
++BUILT_MODULE_NAME[0]="bbswitch"
++DEST_MODULE_LOCATION[0]="/kernel/drivers/acpi"
+diff -Nur a/Makefile.dkms b/Makefile.dkms
+--- a/Makefile.dkms 2013-12-04 23:22:06.000000000 +0000
++++ b/Makefile.dkms 1970-01-01 01:00:00.000000000 +0100
+@@ -1,24 +0,0 @@
+-modname := bbswitch
+-DKMS := dkms
+-modver := $(shell awk -F'"' '/define *BBSWITCH_VERSION/{print $$2}' < bbswitch.c)
+-
+-# directory in which generated files are stored
+-DKMS_DEST := /usr/src/$(modname)-$(modver)
+-
+-all: install
+-
+-src_install:
+- mkdir -p '$(DKMS_DEST)'
+- cp Makefile bbswitch.c '$(DKMS_DEST)'
+- sed 's/#MODULE_VERSION#/$(modver)/' dkms/dkms.conf > '$(DKMS_DEST)/dkms.conf'
+-
+-build: src_install
+- $(DKMS) build -m bbswitch -v $(modver)
+-
+-install: build
+- $(DKMS) install -m bbswitch -v $(modver)
+-
+-uninstall:
+- $(DKMS) remove -m bbswitch -v $(modver) --all
+-
+-.PHONY: all src_install build install uninstall
diff --git a/sys-kernel/bbswitch-dkms/files/bbswitch.modprobe b/sys-kernel/bbswitch-dkms/files/bbswitch.modprobe
new file mode 100644
index 00000000..dd6500c7
--- /dev/null
+++ b/sys-kernel/bbswitch-dkms/files/bbswitch.modprobe
@@ -0,0 +1 @@
+options bbswitch load_state=-1 unload_state=-1 \ No newline at end of file