diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-04-12 03:41:30 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-04-12 03:41:30 +0100 |
commit | 623ee73d661e5ed8475cb264511f683407d87365 (patch) | |
tree | 993eb27c93ec7a2d2d19550300d888fc1fed9e69 /sys-power/bbswitch | |
parent | ceeeb463cc1eef97fd62eaee8bf2196ba04bc384 (diff) |
gentoo Easter resync : 12.04.2020
Diffstat (limited to 'sys-power/bbswitch')
-rw-r--r-- | sys-power/bbswitch/Manifest | 4 | ||||
-rw-r--r-- | sys-power/bbswitch/bbswitch-0.8-r3.ebuild | 57 | ||||
-rw-r--r-- | sys-power/bbswitch/bbswitch-9999.ebuild | 11 | ||||
-rw-r--r-- | sys-power/bbswitch/files/bbswitch-0.8-kernel-5.6.patch | 52 |
4 files changed, 119 insertions, 5 deletions
diff --git a/sys-power/bbswitch/Manifest b/sys-power/bbswitch/Manifest index 04316790e197..61e0662f0b2f 100644 --- a/sys-power/bbswitch/Manifest +++ b/sys-power/bbswitch/Manifest @@ -1,6 +1,8 @@ AUX bbswitch-0.8-kernel-4.12.patch 528 BLAKE2B 4c4b5dbf29338b9a8bbd4cfc974466bee4f5e73c9c39f1093dc48ab2db721743e425c12fdc80e4cfa12c296897ec367f6b255679cf5c4305bf7a844619da38d7 SHA512 52b8f8cc378d915f0671fff193041c13d756db4d4b8db01594d9411a1422e1d8ff0e364d041f472b15b7c581a2fec583ecd86bcb5477b3703c9d993504a6ab61 +AUX bbswitch-0.8-kernel-5.6.patch 1432 BLAKE2B 69c8aab963f1305dd2ffec7e46838df7538e1d87de2048fbd36525fd30a9680dccaf364297b2fae44eb68ad9358dcb865e767bf159502dc9dd2f73490a0d14ce SHA512 90e62a760e9c620b95deaa9ab1f8b8936a764f2adc9991972f3d47bf5768376c6b6007b5613b48303c17ae5ac4fa668ca8b071b7e2b236c7699a91fc01359a99 AUX bbswitch.modprobe 46 BLAKE2B e76506e79adc57bedd68f038293257e7c70f1f3bc924776741e152b7c95c691f5241066b742583af063a4bdde90134005949ce28715d0b8f0c51f59c582223c8 SHA512 a4fa992d66b401e039c995b64ac5f3b2491c3ccf4412e211d50d1e514253f9341dc77a6d8da808f03988735e44a97bb973f3303ed3c0eeed6f4e21794d3545b6 DIST bbswitch-0.8.tar.gz 15800 BLAKE2B d9a16d2ca8baebcbc7ad1d8c1daeb9822ed4ea797ff297848e7087d2a0b142b7cd1333d12346fcde85ad06ddb0640e0d6e299d00e0e8e6c7f96d0a409a08d1c6 SHA512 11ab163931feb6c0e202d04c4552b848e999fedea9990390c26b28abdb4a69081ccfb5a22d1e390cc274f1c0cfc9adedc719c5fece14738b17aaa93e28865b7c EBUILD bbswitch-0.8-r2.ebuild 1058 BLAKE2B 2de38efe1b1c147057e59b52b0138f12ff8b2c885ddbc3b467a5a91fac589ff7f682ae0887c9a1e86a752637a79da35a9fc98c5a4cf57a2cc01c022f1c3ed926 SHA512 02d646717a882a6c2ca1687c4a718ed0a7e09b741d599794af873543093ace6d7749edc7c05cca1854e35f9793ae2f77c37336df0228b7554ea056bd5858e6c3 -EBUILD bbswitch-9999.ebuild 1060 BLAKE2B 1e0d64798d692efb54aaae8c3abf8fef445b383d7758aa78c4622440206108893d5bb9bc40c715a5534935b029d7240d53dc29d3a3af899db48493f75267320b SHA512 51d60415904a06222a4c8ad6eeb353bbd659dd22a25d189d97e95e51e29f04b16aa770714d40f7b384a9538158a63447bf4ae7f1341df1dcdb2358d2892c7a6a +EBUILD bbswitch-0.8-r3.ebuild 1135 BLAKE2B ddb38409e9e6222deaf4fabe96b19ec744cfd8a7d6c94a8d3bd66996c1a6e87b19a69a2313a549fac3995743e0c9c38b9146eae7e07b79230a37588bedb056b0 SHA512 fde0d208777d494e3f8f8deacf5fc63185c16caaf2ff5e5f240faf51554b3ea08690275a208d2b4d248514050bb3a9e72a8ef9da167b57a5c932c296b68f188e +EBUILD bbswitch-9999.ebuild 1137 BLAKE2B f76f3505d8f64c195dfe5cd9335ae9e49ccb1e8500f203899122016605505d37a84a03e202115a65d94855b93a34954d71d0344b81c9b3260d11347e0a63222f SHA512 32a0912adbca5994fb59ead90815d4b6c66fa2c6968a8f23d668a49e0d1b402a81481ffdf4c929ae6d62b4601e677ed99b21e80e5318cf5235a69f2782fa5c38 MISC metadata.xml 975 BLAKE2B 37f16c518caa9f2dd7a10d312365f59ced2bee2b22d446d256f0ed49b499dd457bee37a90285ace9fbb7fc3fce3c4ac9547aa3ee1e2126ff063c534d4f7cf9d5 SHA512 8281867207c08d1383eb9b5c770637b7cb0174d08859f3838155d80c2a6bf69f40946354f548d2ab7e4461529483755e0a666759708ec5debcd3487a11219f39 diff --git a/sys-power/bbswitch/bbswitch-0.8-r3.ebuild b/sys-power/bbswitch/bbswitch-0.8-r3.ebuild new file mode 100644 index 000000000000..90af8d532409 --- /dev/null +++ b/sys-power/bbswitch/bbswitch-0.8-r3.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit linux-mod toolchain-funcs + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/Bumblebee-Project/${PN}.git" + EGIT_BRANCH="develop" +else + PATCHES=( + "${FILESDIR}/${PN}-0.8-kernel-4.12.patch" + "${FILESDIR}/${PN}-0.8-kernel-5.6.patch" + ) + SRC_URI="https://github.com/Bumblebee-Project/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="amd64 x86" +fi + +DESCRIPTION="Toggle discrete NVIDIA Optimus graphics card" +HOMEPAGE="https://github.com/Bumblebee-Project/bbswitch" + +SLOT="0" +LICENSE="GPL-3+" +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} CC=$(tc-getCC)" +} + +src_prepare() { + # Fix build failure, bug #513542 + sed "s%^KDIR :=.*%KDIR := ${KERNEL_DIR}%g" -i Makefile || die + + default +} + +src_install() { + einstalldocs + + insinto /etc/modprobe.d + newins "${FILESDIR}"/bbswitch.modprobe bbswitch.conf + + linux-mod_src_install +} diff --git a/sys-power/bbswitch/bbswitch-9999.ebuild b/sys-power/bbswitch/bbswitch-9999.ebuild index ad44354463cd..7efe9cf7ccdc 100644 --- a/sys-power/bbswitch/bbswitch-9999.ebuild +++ b/sys-power/bbswitch/bbswitch-9999.ebuild @@ -1,16 +1,19 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit linux-mod +inherit linux-mod toolchain-funcs if [[ ${PV} == 9999 ]]; then inherit git-r3 EGIT_REPO_URI="https://github.com/Bumblebee-Project/${PN}.git" EGIT_BRANCH="develop" else - PATCHES=( "${FILESDIR}/${PN}-0.8-kernel-4.12.patch" ) + PATCHES=( + "${FILESDIR}/${PN}-0.8-kernel-4.12.patch" + "${FILESDIR}/${PN}-0.8-kernel-5.6.patch" + ) SRC_URI="https://github.com/Bumblebee-Project/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" KEYWORDS="~amd64 ~x86" fi @@ -34,7 +37,7 @@ pkg_setup() { linux-mod_pkg_setup BUILD_TARGETS="default" - BUILD_PARAMS="KVERSION=${KV_FULL}" + BUILD_PARAMS="KVERSION=${KV_FULL} CC=$(tc-getCC)" } src_prepare() { diff --git a/sys-power/bbswitch/files/bbswitch-0.8-kernel-5.6.patch b/sys-power/bbswitch/files/bbswitch-0.8-kernel-5.6.patch new file mode 100644 index 000000000000..aa95a21cdb04 --- /dev/null +++ b/sys-power/bbswitch/files/bbswitch-0.8-kernel-5.6.patch @@ -0,0 +1,52 @@ +From c2f808efeb0820edf23dbb66362ad3091321253f Mon Sep 17 00:00:00 2001 +From: Mateusz Mandera <mateusz.mandera@protonmail.com> +Date: Tue, 31 Mar 2020 15:11:30 +0200 +Subject: [PATCH] Use proc_ops structure for kernel version >= 5.6.0 + +Since 5.6.0, proc_create requires a proc_ops* argument +instead of file_operations*. +--- + bbswitch.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/bbswitch.c b/bbswitch.c +index d64cdae..9ca0e42 100644 +--- a/bbswitch.c ++++ b/bbswitch.c +@@ -42,6 +42,9 @@ + #include <linux/suspend.h> + #include <linux/seq_file.h> + #include <linux/pm_runtime.h> ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) ++#include <linux/proc_fs.h> ++#endif + + #define BBSWITCH_VERSION "0.8" + +@@ -382,6 +385,15 @@ static int bbswitch_pm_handler(struct notifier_block *nbp, + return 0; + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) ++static struct proc_ops bbswitch_fops = { ++ .proc_open = bbswitch_proc_open, ++ .proc_read = seq_read, ++ .proc_write = bbswitch_proc_write, ++ .proc_lseek = seq_lseek, ++ .proc_release= single_release ++}; ++#else + static struct file_operations bbswitch_fops = { + .open = bbswitch_proc_open, + .read = seq_read, +@@ -389,6 +401,7 @@ static struct file_operations bbswitch_fops = { + .llseek = seq_lseek, + .release= single_release + }; ++#endif + + static struct notifier_block nb = { + .notifier_call = &bbswitch_pm_handler +-- +2.26.0 + |