Skip to content

Commit

Permalink
lenovolegionlinux-dkms-git: add package
Browse files Browse the repository at this point in the history
Signed-off-by: Gonçalo Negrier Duarte <[email protected]>
  • Loading branch information
MrDuartePT committed Dec 27, 2024
1 parent 86bc895 commit 98e56fe
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/lenovolegionlinux-dkms-git/.SRCINFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pkgbase = lenovolegionlinux-dkms-git
pkgdesc = LenovoLegionLinux (LLL) DKMS module
pkgver = 1.c1e9b55
pkgrel = 0
url = https://github.com/johnfanv2/LenovoLegionLinux
install = lenovolegionlinux.install
arch = x86_64
license = GPL-2.0-only
makedepends = git
makedepends = lm-sensors
makedepends = i2c-tools
makedepends = dmidecode
depends = lenovolegionlinux-git
depends = dkms
options = !makeflags
options = !buildflags
options = !strip
source = lenovolegionlinux::git+https://github.com/johnfanv2/LenovoLegionLinux
sha256sums = SKIP

pkgname = lenovolegionlinux-dkms-git
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Maintainer: MrDuartePT <[email protected]>

_pkgname=lenovolegionlinux
pkgname=${_pkgname}-dkms-git
pkgver=1.c1e9b55
pkgrel=0
pkgdesc="LenovoLegionLinux (LLL) DKMS module"
arch=("x86_64")
url="https://github.com/johnfanv2/LenovoLegionLinux"
license=('GPL-2.0-only')
makedepends=(
"git"
"lm-sensors"
"i2c-tools"
"dmidecode"
)
depends=(
"dkms"
"${_pkgname}-git"
)

replaces=(
"${_pkgname}-dkms"
)

source=("${_pkgname}::git+https://github.com/johnfanv2/LenovoLegionLinux")
sha256sums=('SKIP')

pkgver() {
cd "${_pkgname}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
cd "${_pkgname}"
}

package() {
cd "${srcdir}/${_pkgname}/kernel_module/"
install -Dm644 dkms.conf "${pkgdir}"/usr/src/"${_pkgname}"-1.0.0/dkms.conf
cp -r {issue-warning.sh,legion-laptop-unused-snippets.c,legion-laptop.c,Makefile} "${pkgdir}"/usr/src/"${_pkgname}"-1.0.0/

cd "${srcdir}/${_pkgname}/deploy/"
install -Dm644 LenovoLegionLinux.hook "${pkgdir}"/etc/pacman.d/hooks/LenovoLegionLinux.hook
install -Dm775 LenovoLegionLinux "${pkgdir}"/usr/bin/LenovoLegionLinux
}

post_install() {
rmmod legion-laptop.ko #unload old module
echo Installation Finished!
echo Reboot the system or run modprobe legion-laptop to load the module!
}

post_upgrade() {
post_install "$1"
}

post_remove() {
rmmod legion-laptop.ko #unload old module
echo Uninstall finished.
echo Reboot the system.
RED='\033[0;31m'
BOLD=$(tput bold)
echo -e "${RED} ${BOLD} If you have a 2022 or 2023 model, please help testing the new features '\e]8;;https://github.com/johnfanv2/LenovoLegionLinux/issues/46\ahere\e]8;;\a'"
}
28 changes: 28 additions & 0 deletions packages/lenovolegionlinux-git/.SRCINFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pkgbase = lenovolegionlinux-git
pkgdesc = LenovoLegionLinux (LLL) brings additional drivers and tools for Lenovo Legion series laptops to Linux. PLEASE READ THE REPO BEFORE INSTALL THIS PACKAGE!!!
pkgver = r1.c1e9b55
pkgrel = 0
url = https://github.com/johnfanv2/LenovoLegionLinux
install = lenovolegionlinux.install
arch = x86_64
license = GPL
depends = python3-pyqt6
depends = python3-argcomplete
depends = polkitd
depends = python3-darkdetect
makedepends = git
makedepends = python3-build
makedepends = python3-installer
makedepends = python3-setuptools
makedepends = python3-yaml
makedepends = libinih-dev
makedepends = python3-wheel
replaces = lenovolegionlinux
optdepends = lenovolegionlinux-dkms-git: DKMS module (install if your distro dosent patch in the kernel our you are not sure to haveit)
options = !makeflags
options = !buildflags
options = !strip
source = lenovolegionlinux::git+https://github.com/johnfanv2/LenovoLegionLinux
sha256sums = SKIP

pkgname = lenovolegionlinux-git

0 comments on commit 98e56fe

Please sign in to comment.