summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: d147b835db340c26bb54e746d71e25f192ffa480 (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
# Maintainer: pml68 <contact@pml68.dev>

pkgname=iced-builder
_pkgver=0.1.0
pkgver=0.1.0.gb55bd80
pkgrel=1
pkgdesc='UI builder for iced, built with iced.'
arch=(x86_64)
url='https://github.com/pml68/iced-builder'
license=('GPL-3.0-or-later')
depends=(
  gcc-libs
  glibc
  gtk3
)
makedepends=(
  git
  cargo
)
options=('!lto' '!strip' '!debug')
source=("$pkgname::git+${url}.git")
sha256sums=('SKIP')

prepare() {
  cd "${pkgname}"

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

pkgver() {
  cd "${pkgname}"
  echo "$(cargo pkgid | cut -d@ -f2).g$(git describe --always --exclude='*')"
}

build() {
  cd "${pkgname}"

  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release
}

package() {
  depends=(
    rustfmt
  )

  cd "${pkgname}"

  install -Dm755 "target/release/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}