blob: 96f2f4b4979ae2ff9a55f909a0353b0ebd09b5a0 (
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
54
55
56
57
58
59
60
61
62
63
|
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Vitalii Kuzhdin <vitaliikuzhdin@gmail.com>
pkgname=notesmd-cli
pkgver=0.3.6
pkgrel=1
pkgdesc="Interact with Obsidian in the terminal. Open, search, create, update and move notes!"
arch=('aarch64' 'x86_64')
#url="https://yakitrak.github.io/obsidian-cli-docs"
url="https://github.com/Yakitrak/${pkgname}"
license=('MIT')
depends=('glibc')
makedepends=('go')
_pkgsrc="${pkgname}-${pkgver}"
source=("${_pkgsrc}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
install="${pkgname}.install"
sha256sums=('6e0bb297027f1a37cea3ae923dc79eb92c652ecf5c839b1f9f2983e72e9f3259')
prepare() {
export GOMODCACHE="${srcdir}/go-mod-cache"
cd "${srcdir}/${_pkgsrc}"
go mod download -modcacherw
mkdir -p "build" "completions"
}
build() {
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOCACHE="${srcdir}/go-cache"
export GOMODCACHE="${srcdir}/go-mod-cache"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=vendor -modcacherw"
cd "${srcdir}/${_pkgsrc}"
go build -o "build/${pkgname}" .
for _sh in bash fish zsh powershell; do
./"build/${pkgname}" completion "${_sh}" > "completions/${pkgname}.${_sh}"
done
}
check() {
cd "${srcdir}/${_pkgsrc}"
go test ./...
}
package() {
cd "${srcdir}/${_pkgsrc}"
install -vDm755 "build/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
install -vDm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
install -vDm644 "MIGRATION.md" "${pkgdir}/usr/share/doc/${pkgname}/MIGRATION.md"
install -vDm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
cd "completions"
install -vDm644 "${pkgname}.bash" "${pkgdir}/usr/share/bash-completion/completions/${pkgname}"
install -vDm644 "${pkgname}.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/${pkgname}.fish"
install -vDm644 "${pkgname}.zsh" "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}"
install -vDm644 "${pkgname}.powershell" "${pkgdir}/usr/share/powershell/Completions/${pkgname}.ps1"
}
|