summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c921a1cf9abe4695daf510286a4b3dbdee7456af (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
# Maintainer: sQVe <oskargrunning@gmail.com>
pkgname=markdown-oxide-git
_pkgname=markdown-oxide
pkgver=r255.3ea0b15
pkgrel=1
pkgdesc="A markdown language server with Obsidian syntax support."
arch=('x86_64')
url="https://github.com/Feel-ix-343/markdown-oxide"
license=('CC0')
makedepends=('git' 'rustup')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("${_pkgname}::git+https://github.com/Feel-ix-343/markdown-oxide.git")
sha256sums=('SKIP') # 'SKIP' since content is fetched from git.

pkgver() {
  cd "${_pkgname}"

  # Use git to get the version.
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  rustup toolchain install nightly
}

build() {
  cd "${_pkgname}"

  rustup run nightly cargo build --release --locked
}

package() {
  cd "${_pkgname}"

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