From 2e99cbcb03b1a546cae58a1ce58aa50ecdf7ec7a Mon Sep 17 00:00:00 2001 From: honjow Date: Fri, 8 Nov 2024 22:58:02 +0800 Subject: [PATCH] Add lact-libadwaita --- pkgs/lact-libadwaita/PKGBUILD | 63 ++++++++++++++++++++++++++++++ pkgs/lact-libadwaita/lact.desktop | 5 +++ pkgs/lact-libadwaita/lact.install | 6 +++ pkgs/lact-libadwaita/lactd.service | 10 +++++ 4 files changed, 84 insertions(+) create mode 100644 pkgs/lact-libadwaita/PKGBUILD create mode 100644 pkgs/lact-libadwaita/lact.desktop create mode 100644 pkgs/lact-libadwaita/lact.install create mode 100644 pkgs/lact-libadwaita/lactd.service diff --git a/pkgs/lact-libadwaita/PKGBUILD b/pkgs/lact-libadwaita/PKGBUILD new file mode 100644 index 00000000..fe5087cd --- /dev/null +++ b/pkgs/lact-libadwaita/PKGBUILD @@ -0,0 +1,63 @@ +# Maintainer: Ilya Zlobintsev +pkgname=('lact-libadwaita') +pkgbase=lact +pkgver=0.5.6 +pkgrel=1 +pkgdesc="AMDGPU Controller application" +arch=('x86_64' 'aarch64') +url="https://github.com/ilya-zlobintsev/LACT" +license=('MIT') +depends=('hwdata' 'gtk4') +makedepends=('blueprint-compiler' 'cargo' 'clang' 'libadwaita' 'git') +install="$pkgbase.install" +source=("git+https://github.com/ilya-zlobintsev/LACT.git#tag=v$pkgver") +# Since the source is a git repository tag and not an archive, there's no single file with a checksum to check +sha256sums=('9440a4d94f95d0a62124d635855817ea95fc8a5d2a70f2e52cb166364e1e630f') + +prepare() { + cd "LACT" + export CARGO_HOME="$srcdir/cargo-home" + export RUSTUP_TOOLCHAIN=stable + cargo fetch --locked --target "$CARCH-unknown-linux-gnu" +} + +build() { + cd "LACT" + export CARGO_HOME="$srcdir/cargo-home" + export RUSTUP_TOOLCHAIN=stable + export CARGO_TARGET_DIR=target + + # Libadwaita + cargo build -p "$pkgbase" --frozen --release --features=adw + mv "target/release/$pkgbase" "target/release/$pkgbase-adw" + + # Gtk 4 + cargo build -p "$pkgbase" --frozen --release +} + +check() { + cd "LACT" + export CARGO_HOME="$srcdir/cargo-home" + export RUSTUP_TOOLCHAIN=stable + cargo test --frozen --no-default-features -p lact +} + +package_lact() { + cd "LACT" + make PREFIX=/usr DESTDIR="$pkgdir/" install + + install -Dvm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgbase/" +} + +package_lact-libadwaita() { + pkgdesc+=" (libadwaita edition)" + provides=("$pkgbase") + conflicts=("$pkgbase") + depends+=('libadwaita') + + cd "LACT" + make PREFIX=/usr DESTDIR="$pkgdir/" install + + install -Dvm755 "target/release/$pkgbase-adw" "$pkgdir/usr/bin/$pkgbase" + install -Dvm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgbase/" +} diff --git a/pkgs/lact-libadwaita/lact.desktop b/pkgs/lact-libadwaita/lact.desktop new file mode 100644 index 00000000..532759fa --- /dev/null +++ b/pkgs/lact-libadwaita/lact.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Type=Application +Name=LACT +Description=AMDGPU Control Application +Exec=lact-gui \ No newline at end of file diff --git a/pkgs/lact-libadwaita/lact.install b/pkgs/lact-libadwaita/lact.install new file mode 100644 index 00000000..b2d509d5 --- /dev/null +++ b/pkgs/lact-libadwaita/lact.install @@ -0,0 +1,6 @@ +#!/bin/sh + +post_install() { + echo ":: To be able to change settings in LACT, you need to enable the lactd service:" + echo " sudo systemctl enable --now lactd" +} diff --git a/pkgs/lact-libadwaita/lactd.service b/pkgs/lact-libadwaita/lactd.service new file mode 100644 index 00000000..38835fc7 --- /dev/null +++ b/pkgs/lact-libadwaita/lactd.service @@ -0,0 +1,10 @@ +[Unit] +Description=AMDGPU Control Daemon +After=multi-user.target + +[Service] +ExecStartPre=/usr/bin/sleep 2 +ExecStart=/usr/bin/lact-daemon + +[Install] +WantedBy=graphical.target