summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3a5ee3c61168a3cf06afa1701cb63c7f1098ab79 (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
# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=lnx
pkgver=0.9.0
pkgrel=1
pkgdesc='An adaptable search engine API'
arch=('x86_64')
url='https://lnx.rs'
license=('MIT')
depends=('gcc-libs')
makedepends=('git' 'rust')
options=('!lto')
_commit='6fbb7defe4c4d8331bfb19ae72b815b5d9933bb4'
source=("$pkgname::git+https://github.com/lnx-search/lnx.git#commit=$_commit")
md5sums=('SKIP')

pkgver() {
  cd "$pkgname"
  git describe --tags | sed 's/^v//'
}

prepare() {
  cd "$pkgname"

  # download dependencies
  cargo fetch --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname"

  cargo build --frozen --release
}

check() {
  cd "$pkgname"
  # skip failing test
  cargo test --frozen -- --skip index::tests::default_writer_settings_expect_ok
}

package() {
  cd "$pkgname"

  # binary
  install -vDm755 -t "$pkgdir/usr/bin" target/release/lnx

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}