summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1831c566c3e076af9dabbecf78eb739b7ab2849a (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: imnotpolar
# Maintainer: alba4k <blaskoazzolaaaron[at]gmail.com>
# Contributor: éclairevoyant
# Contributor: ThatOneCalculator <kainoa at t1c dot dev>

_pkgname="hyprpicker"
pkgname="$_pkgname-git"
pkgver=0.4.7.r2.gd6115ca
pkgrel=1
pkgdesc="A wlroots-compatible Wayland color picker that does not suck"
arch=('x86_64' 'aarch64')
url="https://github.com/hyprwm/hyprpicker"
license=('BSD-3-Clause')

depends=(
  cairo
  gcc-libs
  glibc
  libxkbcommon
  wayland
)
makedepends=(
	cmake
	git
	hyprutils-git
	hyprwayland-scanner-git
	libgl
	libjpeg-turbo
	meson
	ninja
	pango
	wayland-protocols
	xorgproto
)
optdepends=(
  'wl-clipboard: --autocopy'
)

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

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

pkgver() {
  cd "$_pkgsrc"
  local _tag=$(git tag -l --contains $(git describe --tags --abbrev=0) --sort=-v:refname | head -n1 | sed 's/^v//')
  printf "%s.r%s.g%s" "$_tag" $(git rev-list --count --cherry-pick "v${_tag}...HEAD") $(git rev-parse --short=7 HEAD)
}

build() {
  local cmake_options=(
    -B build
    -S "$_pkgsrc"
    -G Ninja
    -W no-dev
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
  )
  cmake "${cmake_options[@]}"
  cmake --build build
}

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