blob: 78cab5f3dcbf77397e0a56b8f1576117a42b07ce (
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: skwerlman <skw@tetrarch.co>
_pkgname=nixpkgs-fmt
pkgname=${_pkgname}-git
pkgver=v0.8.0.r130.g7301bc9
pkgrel=1
pkgdesc='Nix code formatter for nixpkgs'
arch=('x86_64')
url='https://nix-community.github.io/nixpkgs-fmt/'
license=('APACHE-2.0')
makedepends=('cargo' 'nix' 'git')
source=("git+https://github.com/nix-community/nixpkgs-fmt")
sha256sums=('SKIP')
pkgver() {
cd "$_pkgname"
( set -o pipefail
git describe --long --abbrev=7 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
)
}
prepare() {
cd "$_pkgname"
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
check() {
cd "$_pkgname"
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen --all-features
}
build() {
cd "$_pkgname"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release --all-features
}
package() {
cd "$_pkgname"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$_pkgname"
}
|