Package Details: paru 2.0.3-1

Git Clone URL: https://aur.archlinux.org/paru.git (read-only, click to copy)
Package Base: paru
Description: Feature packed AUR helper
Upstream URL: https://github.com/morganamilo/paru
Keywords: AUR helper pacman rust wrapper yay
Licenses: GPL-3.0-or-later
Submitter: Morganamilo
Maintainer: Morganamilo
Last Packager: Morganamilo
Votes: 890
Popularity: 28.64
First Submitted: 2020-10-19 00:43 (UTC)
Last Updated: 2024-03-26 04:28 (UTC)

Dependencies (6)

Sources (1)

Pinned Comments

haxie commented on 2023-05-26 17:45 (UTC)

you're better off contacting her via the github, this comments section is 90% "it's out of date" from people who didn't scroll down before posting

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 .. 22 Next › Last »

max2000warlord commented on 2024-03-16 05:04 (UTC)

Just a heads up, if you get this error when trying to use paru: "paru: error while loading shared libraries: libalpm.so.13: cannot open shared object file: No such file or directory"

Just git clone the new version and install it that way. Fixed it for me.

Misaka13514 commented on 2024-01-28 06:16 (UTC)

Please follow Arch Linux RFC16: use SPDX license identifier in PKGBUILD.

https://gitlab.archlinux.org/archlinux/rfcs/-/blob/master/rfcs/0016-spdx-license-identifiers.rst

DaveWK commented on 2024-01-09 23:52 (UTC)

can you please add 'riscv64' to the arch's? I have tested this on a VisionFive 2 and it works fine.

arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64' 'riscv64')

phoepsilonix commented on 2023-12-27 03:25 (UTC) (edited on 2023-12-29 22:52 (UTC) by phoepsilonix)

If the .cargo/config setting is preferred

diff --git a/PKGBUILD b/PKGBUILD
index 0c6d370..d576559 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,30 +13,39 @@ depends=('git' 'pacman')
 optdepends=('bat: colored pkgbuild printing' 'devtools: build in chroot and downloading pkgbuilds')
 sha256sums=('47cae94d227cc08f86706408d234444af6dda192ba24309c251a0b43a8aa7980')

+_srcenv() {
+  cd "$srcdir/$pkgname-$pkgver"
+  export PKG_CONFIG_ALLOW_CROSS=1
+  export RUSTUP_TOOLCHAIN=stable
+  source <(cargo +nightly -Z unstable-options rustc --print cfg|grep -E "target_(arch|vendor|os|env)")
+  TARGET="${target_arch}-${target_vendor}-${target_os}-${target_env}"
+}
+
 prepare() {
-  cd "$pkgname-$pkgver"
-  cargo fetch --locked --target "$(rustc -vV | sed -n 's|host: ||p')"
+  _srcenv
+  cargo fetch --locked --target $TARGET
 }

 build () {
-  cd "$srcdir/$pkgname-$pkgver"
-
+  _srcenv
   if pacman -T pacman-git > /dev/null; then
     _features+="git,"
   fi
+  if [[ $target_env=="musl" ]]; then
+    _features+="static,"
+  fi

   if [[ $CARCH != x86_64 ]]; then
     export CARGO_PROFILE_RELEASE_LTO=off
   fi

-  cargo build --frozen --features "${_features:-}" --release --target-dir target
+  cargo build --frozen --features "${_features:-}" --release --target-dir target --target $TARGET
   ./scripts/mkmo locale/
 }

 package() {
-  cd "$srcdir/$pkgname-$pkgver"
-
-  install -Dm755 target/release/paru "${pkgdir}/usr/bin/paru"
+  _srcenv
+  install -Dm755 target/$TARGET/release/paru "${pkgdir}/usr/bin/paru"
   install -Dm644 paru.conf "${pkgdir}/etc/paru.conf"

   install -Dm644 man/paru.8 "$pkgdir/usr/share/man/man8/paru.8"

phoepsilonix commented on 2023-12-27 03:01 (UTC) (edited on 2023-12-27 04:38 (UTC) by phoepsilonix)

Ignore the standard build target in ~/.cargo/config.

diff --git a/PKGBUILD b/PKGBUILD
index 0c6d370..929072d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,9 +13,14 @@ depends=('git' 'pacman')
 optdepends=('bat: colored pkgbuild printing' 'devtools: build in chroot and downloading pkgbuilds')
 sha256sums=('47cae94d227cc08f86706408d234444af6dda192ba24309c251a0b43a8aa7980')

+export PKG_CONFIG_ALLOW_CROSS=1
+export RUSTUP_TOOLCHAIN=stable
+TARGET="$(rustc -vV | sed -n 's|host: ||p')"
+
 prepare() {
   cd "$pkgname-$pkgver"
-  cargo fetch --locked --target "$(rustc -vV | sed -n 's|host: ||p')"
+  rustup target add $TARGET
+  cargo fetch --locked --target $TARGET
 }

 build () {
@@ -24,19 +29,22 @@ build () {
   if pacman -T pacman-git > /dev/null; then
     _features+="git,"
   fi
+  if [[ $TARGET =~ musl ]]; then
+    _features+="static,"
+  fi

   if [[ $CARCH != x86_64 ]]; then
     export CARGO_PROFILE_RELEASE_LTO=off
   fi

-  cargo build --frozen --features "${_features:-}" --release --target-dir target
+  cargo build --frozen --features "${_features:-}" --release --target-dir target --target $TARGET
   ./scripts/mkmo locale/
 }

 package() {
   cd "$srcdir/$pkgname-$pkgver"

-  install -Dm755 target/release/paru "${pkgdir}/usr/bin/paru"
+  install -Dm755 target/$TARGET/release/paru "${pkgdir}/usr/bin/paru"
   install -Dm644 paru.conf "${pkgdir}/etc/paru.conf"

   install -Dm644 man/paru.8 "$pkgdir/usr/share/man/man8/paru.8"

liluzibird commented on 2023-12-20 02:05 (UTC)

Amazing

ogarcia commented on 2023-12-15 17:37 (UTC)

@Morganamilo Please add export RUSTUP_TOOLCHAIN=stable in the prepare and build sections because if you don't have any toolchain configured by default you get the following error:

error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.

The line should be added before the charge fetch:

prepare() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$(rustc -vV | sed -n 's|host: ||p')"
}

And before cargo build:

export RUSTUP_TOOLCHAIN=stable
cargo build --frozen --features...

Thanks!