blob: 6eecfb3d77f9b9a666dd548bad8f114e24b6918b (
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
|
# Maintainer: Christian Burkard <phantinuss at gmx dot com>
pkgname=yara-x
pkgver=1.2.1
pkgrel=1
pkgdesc="A pure Rust implementation of YARA"
arch=('any')
url="https://github.com/VirusTotal/yara-x"
license=('BSD-3-Clause')
makedepends=('rust')
provides=(yara-x)
options=(!lto)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/VirusTotal/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('e0457c0cd4f6a7a1c4c0e5df7453af49f3d8027453fd1fc053a1491ca1823122')
prepare() {
cd "${pkgname}-${pkgver}"
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd "${pkgname}-${pkgver}"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
export RUSTFLAGS="-C target-feature=+crt-static"
cargo build --frozen --bin yr --profile release-lto --target "$(rustc -vV | sed -n 's/host: //p')"
}
check() {
cd "${pkgname}-${pkgver}"
export RUSTUP_TOOLCHAIN=stable
export RUSTFLAGS="-C target-feature=+crt-static"
cargo test --frozen --bin yr --profile release-lto --target "$(rustc -vV | sed -n 's/host: //p')"
}
package() {
cd "${pkgname}-${pkgver}"
install -Dm0755 -t "${pkgdir}/usr/bin/" "target/"$(rustc -vV | sed -n 's/host: //p')"/release-lto/yr"
mkdir -p "${pkgdir}/usr/share/zsh/site-functions"
target/"$(rustc -vV | sed -n 's/host: //p')"/release-lto/yr completion zsh > "${pkgdir}/usr/share/zsh/site-functions/_yr"
mkdir -p "${pkgdir}/usr/share/bash-completion/completions"
target/"$(rustc -vV | sed -n 's/host: //p')"/release-lto/yr completion bash > "${pkgdir}/usr/share/bash-completion/completions/yr"
mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d"
target/"$(rustc -vV | sed -n 's/host: //p')"/release-lto/yr completion fish > "${pkgdir}/usr/share/fish/vendor_completions.d/yr.fish"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|