Skip to content

Commit

Permalink
lenovolegionlinux-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 a246e47 commit df2f8fd
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/lenovolegionlinux-git/.SRCINFO
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
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
pkgver = 1.c1e9b55
pkgrel = 0
url = https://github.com/johnfanv2/LenovoLegionLinux
install = lenovolegionlinux.install
arch = x86_64
license = GPL
license = GPL-2.0-only
depends = python3-pyqt6
depends = python3-argcomplete
depends = polkitd
depends = python3-darkdetect
makedepends = git
makedepends = python3
makedepends = python3-build
makedepends = python3-installer
makedepends = python3-setuptools
Expand Down
85 changes: 85 additions & 0 deletions packages/lenovolegionlinux-git/lenovolegionlinux-git.pacscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Maintainer: MrDuartePT <[email protected]>

_pkgname=lenovolegionlinux
pkgname=${_pkgname}-git
pkgver=1.c1e9b55
pkgrel=0
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"
license=('GPL-2.0-only')

depends=(
python3
python3-argcomplete
python3-yaml
python3-pyqt6
polkitd
python3-darkdetect
)

makedepends=(
git
python3-build
python3-installer
python3-setuptools
python3-wheel
libinih-dev
)

optdepends=(
"lenovolegionlinux-dkms-git: DKMS module"
)

replaces=(
"${_pkgname}"
)

source=(
"${_pkgname}::git+https://github.com/johnfanv2/LenovoLegionLinux"
"https://raw.githubusercontent.com/benhoyt/inih/refs/heads/master/ini.c"
)
sha256sums=('SKIP')

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

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

build() {
cd "${srcdir}/${_pkgname}/python/legion_linux"
python3 -m build --wheel --no-isolation

# Compile legiond daemon
cd legion_linux/extra/service/legiond
cp "${srcdir}/ini.c" ./
sed -i 's/^SOURCE1 = \$(TARGET1).c modules\/\*\.c$/SOURCE1 = $(TARGET1).c ini.c modules\/\*.c/' Makefile
make
}

package() {
mkdir -p "${pkgdir}/etc/systemd/system"

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

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

# legiond daemon
install -Dm775 service/legiond/legiond "${pkgdir}/usr/bin"
install -Dm775 service/legiond/legiond-ctl "${pkgdir}/usr/bin"
}

post_install() {
echo "Default config files are present in /usr/share/legion_linux"
echo "Frist install: Pls copy folder /usr/share/legion_linux to /etc/legion_linux"
echo "Is also provided acpi exemple on /usr/share/legion_linux/acpi"
}

0 comments on commit df2f8fd

Please sign in to comment.