summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: beead26221ee21673152209ca11fc0bab1af3dff (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
# Maintainer: WithoutAName <withoutaname@withoutaname.eu>
pkgname=dot-manager-git
pkgver=0.2.2.r0.g76d20bd
pkgrel=1
pkgdesc="CLI Utility for easy dotfile management"
arch=("x86_64")
_repo=DotManager
url="https://github.com/WithoutAName25/$_repo"
license=("MIT")
depends=("gcc-libs" "glibc")
makedepends=("cargo" "git")
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("${pkgname%-git}::git+$url.git")
sha256sums=("SKIP")

pkgver() {
  cd "$srcdir/${pkgname%-git}"

  printf "%s" "$(git describe --long --tags --abbrev=7 | sed 's/^v//;s/-/.r/;s/-/./')"
}

prepare() {
  cd "$srcdir/${pkgname%-git}"

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

build() {
  cd "$srcdir/${pkgname%-git}"

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

package() {
  cd "$srcdir/${pkgname%-git}"

  install -Dm755 target/release/dot-manager "$pkgdir/usr/bin/dot-manager"

  install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}