```sh git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" | while read template; do for p in ${template%/template}/patches/*; do sed -i ' \,^[+-][+-][+-] /dev/null,b /^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b s,^[*][*][*] ,&a/, /^--- /{ s,\(^--- \)\(./\)*,\1a/, s,[.-][Oo][Rr][Ii][Gg]\([ /]\),\1, s/[.-][Oo][Rr][Ii][Gg]$// s/[.]patched[.]\([^.]\)/.\1/ h } /^+++ -/{ g s/^--- a/+++ b/ b } s,\(^+++ \)\(./\)*,\1b/, ' "$p" done sed -i '/^patch_args=/d' $template done ```
20 lines
735 B
Bash
20 lines
735 B
Bash
# Template file for 'bbswitch'
|
|
pkgname=bbswitch
|
|
version=0.8
|
|
revision=4
|
|
archs="x86_64*"
|
|
depends="dkms"
|
|
short_desc="Kernel module for disabling the nVidia GPU on Optimus laptops"
|
|
maintainer="Orphaned <orphan@voidlinux.org>"
|
|
license="GPL-2.0-or-later"
|
|
homepage="http://github.com/Bumblebee-Project/bbswitch"
|
|
distfiles="https://github.com/Bumblebee-Project/bbswitch/archive/v$version.tar.gz"
|
|
checksum=76cabd3f734fb4fe6ebfe3ec9814138d0d6f47d47238521ecbd6a986b60d1477
|
|
dkms_modules="${pkgname} ${version}"
|
|
|
|
do_install() {
|
|
vinstall Makefile 644 usr/src/${pkgname}-${version}
|
|
vinstall bbswitch.c 644 usr/src/${pkgname}-${version}
|
|
sed "s,#MODULE_VERSION#,${version}," dkms/dkms.conf > \
|
|
${DESTDIR}/usr/src/${pkgname}-${version}/dkms.conf
|
|
}
|