summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4d0f2ea1e9b68371c125ee81426bae526815b9ad (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
42
43
44
45
46
# Maintainer: Integral <integral@archlinuxcn.org>

pkgname=qmlmaterial-git
_pkgname=${pkgname%-git}
_srcname=QmlMaterial
pkgver=0.1.5.r20.gcf6b3c4
pkgrel=1
pkgdesc="Material Design 3 for QML"
arch=('x86_64')
url="https://github.com/hypengw/${_srcname}"
license=('MIT')
depends=('qt6-base' 'qt6-declarative' 'qt6-shadertools')
makedepends=('git' 'git-lfs' 'cmake')
provides=("${_pkgname}" "libqml_material.so")
conflicts=("${_pkgname}")
source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
	cd "${_srcname}/"
	git describe --long --tags --match="v[0-9]*" --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	cd "${_srcname}/"
	git lfs install --local
	git remote add network-origin "${url}.git"
	git lfs pull network-origin
}

build() {
	local cmake_options=(
		-B build
		-S "${_srcname}"
		-D CMAKE_BUILD_TYPE=None
		-D CMAKE_INSTALL_PREFIX=/usr
	)

	cmake "${cmake_options[@]}"
	cmake --build build
}

package() {
	DESTDIR="${pkgdir}" cmake --install build
	install -Dm644 "${_srcname}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}/"
}