summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5b0a99038810d7870ddeca0d9d34c5156b179c4a (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Maintainer:
# Contributor: Mark Wagie <mark dot wagie at tutanota dot com>
# Contributor: Pagnite <tymoteuszdolega at gmail dot com>
# Contributor: Bjorn Neergaard (neersighted) <bjorn@neersighted.com>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Deon Spengler <deon@spengler.co.za>

## useful links
# http://ddcutil.com/
# https://github.com/rockowitz/ddcutil

_pkgname="ddcutil"
pkgname="$_pkgname-git"
pkgver=2.1.4.r94.g1ce8d58
pkgrel=1
pkgdesc='Query and change Linux monitor settings using DDC/CI and USB.'
url='https://github.com/rockowitz/ddcutil'
license=('GPL-2.0-or-later')
arch=('x86_64')

depends=(
	'glib2'
	'i2c-tools'
	'jansson'
	'kmod'
	'libdrm'
	'libusb'
	'libxrandr'
)
makedepends=(
	'git'
	'systemd'
)

provides+=("$_pkgname=${pkgver%%.r*}")
conflicts+=("$_pkgname")

_pkgsrc="$_pkgname"
source=("$_pkgname"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
	cd "$_pkgsrc"
	git describe --long --tags --abbrev=7 --exclude='*[a-z][a-z]*' |
		sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
	cd "$_pkgsrc"

	# switch default branch, in case cache is out of date
	_branch=$(git remote show origin | grep HEAD | sed 's&^.*: &&')
	git checkout -f branch "$_branch"

	# back to regularly scheduled program
	NOCONFIGURE=1 ./autogen.sh
}

build() {
	cd "$_pkgsrc"
	./configure --prefix=/usr
	make
}

package() {
	cd "$_pkgsrc"
	make DESTDIR="$pkgdir" install
}