Skip to content

Commit

Permalink
lenovolegionlinux: Refactor PKGBUILD and switch to git sources
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Jung <[email protected]>
  • Loading branch information
ptr1337 committed Oct 30, 2024
1 parent 2a4f48d commit 7613cbe
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 30 deletions.
8 changes: 4 additions & 4 deletions lenovolegionlinux-dkms/.SRCINFO
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
pkgbase = lenovolegionlinux-dkms
pkgdesc = LenovoLegionLinux (LLL) DKMS module
pkgver = 0.0.18
pkgrel = 0
pkgrel = 1
url = https://github.com/johnfanv2/LenovoLegionLinux
install = lenovolegionlinux.install
arch = x86_64
license = GPL-2.0-only
makedepends = lm_sensors
makedepends = i2c-tools
makedepends = dmidecode
makedepends = lenovolegionlinux
makedepends = git
depends = dkms
depends = lenovolegionlinux
source = https://github.com/johnfanv2/LenovoLegionLinux/archive/refs/tags/v0.0.18.tar.gz
sha256sums = af4ad84bc5caabfba1afb607903b5d3a700d0e4e9c0ca7600c35085462d52dea
source = lenovolegionlinux::git+https://github.com/johnfanv2/LenovoLegionLinux.git#tag=v0.0.18
sha256sums = d70575888e8ca5cdc735f9647d9506dde8a1820f23c154b998e617c763699779

pkgname = lenovolegionlinux-dkms
25 changes: 12 additions & 13 deletions lenovolegionlinux-dkms/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,33 @@
# Maintainer: xenhat <[email protected]>
# Maintainer: johnfanv2 <https://github.com/johnfanv2>

_pkgname=lenovolegionlinux
pkgname=${_pkgname}-dkms
pkgname=lenovolegionlinux-dkms
pkgver=0.0.18
pkgrel=0
pkgrel=1
pkgdesc="LenovoLegionLinux (LLL) DKMS module"
arch=("x86_64")
url="https://github.com/johnfanv2/LenovoLegionLinux"
license=('GPL-2.0-only')
makedepends=(
"lm_sensors"
"i2c-tools"
"dmidecode"
"lenovolegionlinux"
lm_sensors
i2c-tools
dmidecode
git
)
depends=(
"dkms"
"lenovolegionlinux"
dkms
lenovolegionlinux
)
source=("$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('af4ad84bc5caabfba1afb607903b5d3a700d0e4e9c0ca7600c35085462d52dea')
source=(lenovolegionlinux::git+https://github.com/johnfanv2/LenovoLegionLinux.git#tag=v${pkgver})
sha256sums=('d70575888e8ca5cdc735f9647d9506dde8a1820f23c154b998e617c763699779')
install="lenovolegionlinux.install"

package() {
cd "${srcdir}/${_pkgname}/kernel_module/"
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/"
cd "${srcdir}/${_kgname}/deploy/"
install -Dm644 LenovoLegionLinux.hook ${pkgdir}/etc/pacman.d/hooks/LenovoLegionLinux.hook
install -Dm775 LenovoLegionLinux ${pkgdir}/usr/bin/LenovoLegionLinux
}
7 changes: 4 additions & 3 deletions lenovolegionlinux/.SRCINFO
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pkgbase = lenovolegionlinux
pkgdesc = LenovoLegionLinux (LLL) brings additional drivers and tools for Lenovo Legion series laptops to Linux. PLEASE READ THE REPO BEFORE INSTALL THIS PACKAGE!!!
pkgver = 0.0.18
pkgrel = 0
pkgrel = 1
url = https://github.com/johnfanv2/LenovoLegionLinux
install = lenovolegionlinux.install
arch = x86_64
Expand All @@ -11,13 +11,14 @@ pkgbase = lenovolegionlinux
makedepends = python-setuptools
makedepends = python-wheel
makedepends = libinih
makedepends = git
depends = python-argcomplete
depends = python-yaml
depends = python-pyqt6
depends = polkit
depends = python-darkdetect
optdepends = lenovolegionlinux-dkms: DKMS module
source = https://github.com/johnfanv2/LenovoLegionLinux/archive/refs/tags/v0.0.18.tar.gz
sha256sums = af4ad84bc5caabfba1afb607903b5d3a700d0e4e9c0ca7600c35085462d52dea
source = lenovolegionlinux::git+https://github.com/johnfanv2/LenovoLegionLinux.git#tag=v0.0.18
sha256sums = d70575888e8ca5cdc735f9647d9506dde8a1820f23c154b998e617c763699779

pkgname = lenovolegionlinux
21 changes: 11 additions & 10 deletions lenovolegionlinux/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Maintainer: MrDuartePT <[email protected]>
# Maintainer: johnfanv2 <https://github.com/johnfanv2>
_pkgname=lenovolegionlinux
pkgname=${_pkgname}

pkgname=lenovolegionlinux
pkgver=0.0.18
pkgrel=0
pkgrel=1
pkgdesc="LenovoLegionLinux (LLL) brings additional drivers and tools for Lenovo Legion series laptops to Linux. PLEASE READ THE REPO BEFORE INSTALL THIS PACKAGE!!!"
arch=("x86_64")
url="https://github.com/johnfanv2/LenovoLegionLinux"
Expand All @@ -22,22 +22,23 @@ makedepends=(
python-setuptools
python-wheel
libinih
git
)
optdepends=(
"lenovolegionlinux-dkms: DKMS module"
)

source=("$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('af4ad84bc5caabfba1afb607903b5d3a700d0e4e9c0ca7600c35085462d52dea')
source=(lenovolegionlinux::git+https://github.com/johnfanv2/LenovoLegionLinux.git#tag=v${pkgver})
sha256sums=('d70575888e8ca5cdc735f9647d9506dde8a1820f23c154b998e617c763699779')
install="lenovolegionlinux.install"

prepare() {
cd "${_pkgname}"
sed -i "s/version = _VERSION/version = ${pkgver}/g" "${srcdir}/${_pkgname}/python/legion_linux/setup.cfg"
cd "${pkgname}"
sed -i "s/version = _VERSION/version = ${pkgver}/g" "${srcdir}/${pkgname}/python/legion_linux/setup.cfg"
}

build() {
cd "${srcdir}/${_pkgname}/python/legion_linux"
cd "${srcdir}/${pkgname}/python/legion_linux"
python -m build --wheel --no-isolation
# Build legiond daemon
cd legion_linux/extra/service/legiond
Expand All @@ -46,11 +47,11 @@ build() {
package() {
mkdir -p ${pkgdir}/etc/systemd/system

cd "${srcdir}/${_pkgname}/python/legion_linux"
cd "${srcdir}/${pkgname}/python/legion_linux"
python -m installer --destdir="$pkgdir" dist/*.whl

# Systemd service
cd "${srcdir}/${_pkgname}/extra"
cd "${srcdir}/${pkgname}/extra"
install -Dm664 service/*.service "${pkgdir}/etc/systemd/system"
install -Dm664 service/*.timer "${pkgdir}/etc/systemd/system"

Expand Down

0 comments on commit 7613cbe

Please sign in to comment.