summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a1b056c3e0b607ee0b9e0e21ea3bae37aaddea2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Maintainer: HurricanePootis <hurricanepootis@protonmail.com>
pkgname=sleepy-launcher
pkgver=1.3.0
pkgrel=1
pkgdesc="Sleepy game launcher for Linux with telemetry disabling"
arch=(x86_64)
url="https://github.com/an-anime-team/sleepy-launcher"
license=('GPL-3.0-only')
depends=('gtk4' 'libadwaita' 'glibc' 'hicolor-icon-theme' 'gcc-libs' 'glib2'
	'pango' 'xz' 'bzip2' 'cairo' 'p7zip' 'wayland')
makedepends=('cargo')
optdepends=(
	'mangohud: FPS Overlay'
	'gamescope: Micro-compositor'
	'gamemode: CPU Scaling Control')
source=("$url/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=('7285b698d219066855e2b6c51c0f186bef5e6dbe98e4aceb25c0cb87a2adbcc4')

prepare() {
	cd "$pkgname-$pkgver"
	export RUSTUP_TOOLCHAIN=stable
	cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
	cd "$pkgname-$pkgver"
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	export CFLAGS+=" -ffat-lto-objects"
	cargo build --frozen --release --target-dir target
}

package() {
	cd "$pkgname-$pkgver"
	install -Dm755 "$srcdir/$pkgname-$pkgver/target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
	install -Dm655 "$srcdir/$pkgname-$pkgver/assets/$pkgname.desktop" "$pkgdir/usr/share/applications/moe.launcher.$pkgname.desktop"
	install -Dm644 "$srcdir/$pkgname-$pkgver/assets/images/icon.png" "$pkgdir/usr/share/icons/hicolor/512x512/apps/moe.launcher.$pkgname.png"
	sed -i 's/Exec=AppRun/Exec=sleepy-launcher/g' "$pkgdir/usr/share/applications/moe.launcher.$pkgname.desktop"
	sed -i 's/Icon=icon/Icon=moe.launcher.sleepy-launcher/g' "$pkgdir/usr/share/applications/moe.launcher.$pkgname.desktop"
	echo "StartupWMClass=moe.launcher.sleepy-launcher" >> "$pkgdir/usr/share/applications/moe.launcher.$pkgname.desktop"
}