|
| 1 | +# $Id$ |
| 2 | +# Maintainer: Morgan <[email protected]> |
| 3 | +# Contributor: Masato TOYOSHIMA <[email protected]> |
| 4 | +pkgname=paru-static |
| 5 | +_pkgname=paru |
| 6 | +pkgver=2.0.1 |
| 7 | +pkgrel=5 |
| 8 | +pkgdesc='Feature packed AUR helper' |
| 9 | +url='https://github.com/morganamilo/paru' |
| 10 | +source=("$_pkgname-$pkgver.tar.gz::https://github.com/Morganamilo/paru/archive/v$pkgver.tar.gz") |
| 11 | +arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64') |
| 12 | +license=('GPL3') |
| 13 | +makedepends=('rustup' 'cargo' 'musl') |
| 14 | +depends=('git' 'pacman' 'paru') |
| 15 | +optdepends=('bat: colored pkgbuild printing' 'devtools: build in chroot and downloading pkgbuilds') |
| 16 | +sha256sums=('47cae94d227cc08f86706408d234444af6dda192ba24309c251a0b43a8aa7980') |
| 17 | + |
| 18 | +# musl |
| 19 | +TARGET="$CARCH-unknown-linux-musl" |
| 20 | +# musl build for openssl-sys |
| 21 | +export PKG_CONFIG_ALLOW_CROSS=1 |
| 22 | +export RUSTUP_TOOLCHAIN=stable |
| 23 | + |
| 24 | +prepare() { |
| 25 | + cd "${srcdir}/$_pkgname-$pkgver" |
| 26 | + # target add musl |
| 27 | + rustup target add $TARGET |
| 28 | + cargo fetch --locked --target $TARGET |
| 29 | +} |
| 30 | + |
| 31 | +build () { |
| 32 | + cd "$srcdir/$_pkgname-$pkgver" |
| 33 | + |
| 34 | + # static link |
| 35 | + if [[ $TARGET =~ musl ]]; then |
| 36 | + _features+="static," |
| 37 | + fi |
| 38 | + if pacman -T pacman-git > /dev/null; then |
| 39 | + _features+="git," |
| 40 | + fi |
| 41 | + |
| 42 | + if [[ $CARCH != x86_64 ]]; then |
| 43 | + export CARGO_PROFILE_RELEASE_LTO=off |
| 44 | + fi |
| 45 | + |
| 46 | + cargo build --frozen --features "${_features:-}" --release --target-dir target --target $TARGET |
| 47 | + #./scripts/mkmo locale/ |
| 48 | +} |
| 49 | + |
| 50 | +package() { |
| 51 | + cd "$srcdir/$_pkgname-$pkgver" |
| 52 | + |
| 53 | + install -Dm755 target/$TARGET/release/paru "${pkgdir}/usr/bin/paru-static" |
| 54 | + #install -Dm644 paru.conf "${pkgdir}/etc/paru.conf" |
| 55 | + |
| 56 | + #install -Dm644 man/paru.8 "$pkgdir/usr/share/man/man8/paru.8" |
| 57 | + #install -Dm644 man/paru.conf.5 "$pkgdir/usr/share/man/man5/paru.conf.5" |
| 58 | + |
| 59 | + #install -Dm644 completions/bash "${pkgdir}/usr/share/bash-completion/completions/paru.bash" |
| 60 | + #install -Dm644 completions/fish "${pkgdir}/usr/share/fish/vendor_completions.d/paru.fish" |
| 61 | + #install -Dm644 completions/zsh "${pkgdir}/usr/share/zsh/site-functions/_paru" |
| 62 | + |
| 63 | + #install -d "$pkgdir/usr/share/" |
| 64 | + #cp -r locale "$pkgdir/usr/share/" |
| 65 | +} |
0 commit comments