summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 80d3939474ac13cffdecea280bf71807dcd0e6dd (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
# Maintainer: Rin <icealtria at gmail dot com>

pkgname=geph5-client
pkgver=0.2.36
pkgrel=1
pkgdesc="The command-line Geph5 client"
arch=('x86_64')
url="https://github.com/geph-official/geph5"
license=('MPL-2.0')
backup=('etc/geph5-client/config.yml')
provides=('geph5-client')
conflicts=('geph5-client-git')
depends=('gcc-libs' 'glibc')
makedepends=('cargo')
source=("$pkgname-$pkgver.tar.gz::https://static.crates.io/crates/$pkgname/$pkgname-$pkgver.crate"
        "config.yml"
        "geph5-client.user.service"
        'geph5-client.service')
md5sums=('8efc49df31dfdc33e597da7ff3c6d735'
         '94b60374b70a387cf6bc34f58fde6d37'
         '186cca941b1c4a510a71bf79a0ef8921'
         '6077536cadaf8f80a15f62b60071efdb')

prepare() {
  export RUSTUP_TOOLCHAIN=stable
  cd "${pkgname}-${pkgver}"/
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  export CFLAGS+=" -ffat-lto-objects" # https://github.com/launchbadge/sqlx/issues/3149
  cd "${pkgname}-${pkgver}"/
  cargo build --frozen --release
}

package() {
  cd "${pkgname}-${pkgver}"/
  install -Dm0644 "${srcdir}"/geph5-client.service -t "${pkgdir}"/usr/lib/systemd/system/
  install -Dm0644 "${srcdir}"/geph5-client.user.service "${pkgdir}"/usr/lib/systemd/user/geph5-client.service
  install -Dm0644 "${srcdir}"/config.yml ${pkgdir}"/etc/geph5-client/config.yml"
  install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/geph5-client"
}