summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 67a369b4be8c3cbc2d20a78da873fe942858bd55 (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
# Maintainer:
# Contributor: James Williams <jowilliams12000 at gmail dot com>

: ${CARGO_HOME:=$SRCDEST/cargo-home}
: ${CARGO_TARGET_DIR:=target}
: ${RUSTUP_TOOLCHAIN:=stable}
export CARGO_HOME CARGO_TARGET_DIR RUSTUP_TOOLCHAIN

_pkgname="wallust"
pkgname="$_pkgname-git"
pkgver=3.1.0.r4.g7ff46aa
pkgrel=2
pkgdesc="Generate colors from an image"
url="https://codeberg.org/explosion-mental/wallust"
license=('MIT')
arch=('x86_64')

depends=(
  'gcc-libs'
)
makedepends=(
  'cargo'
  'git'
  'make'
)
optdepends=(
  'imagemagick'
)

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

options=('!lto')

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

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

prepare() {
  cd "$_pkgsrc"
  sed -E '/FISHPREFIX/s&(\$\{PREFIX\})/fish&\1/share/fish&' -i Makefile

  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd "$_pkgsrc"
  cargo build --frozen --release --all-features
}

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