Package Details: paru 2.0.4-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: 973
Popularity: 22.13
First Submitted: 2020-10-19 00:43 (UTC)
Last Updated: 2024-09-20 18:50 (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 8 9 10 .. 24 Next › Last »

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!

noahrinehart commented on 2023-12-09 19:43 (UTC)

If you're getting errors like

error: failed to select a version for the requirement env_logger = "^0.10.1" candidate versions found which didn't match: 0.9.3, 0.9.2, 0.9.1, ... location searched: crates.io index

then it might mean that you use rustup to provide cargo, and need to manually update the toolchain to use the latest cargo index. Run

rustup update

rautesamtr commented on 2023-11-30 20:21 (UTC)

cargo fetch --locked --target "$CARCH-unknown-linux-gnu"

breaks on armv7h with error: Error loading target specification: Could not find specification for target "armv7h-unknown-linux-gnu"

cargo fetch --locked --target "$(rustc -vV | sed -n 's|host: ||p')"

like in https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=cfddns

kerryeon commented on 2023-11-28 06:07 (UTC)

I think pkg-config[build] and sudo[optional; for building AUR packages] should be dependencies.

THAC0_Tuesday commented on 2023-11-27 22:41 (UTC)

@siavoshkc I had the same error. I have rustup (ie the whole rust toolchain, not just rust) installed on my system and I resolved this issue by running 'rustup update' then doing 'paru -S paru'. Hopefully this is of help to you.

siavoshkc commented on 2023-11-27 06:43 (UTC) (edited on 2023-11-27 06:43 (UTC) by siavoshkc)

Get this error while installing:

error[E0658]: use of unstable library feature 'once_cell'

--> src/pkgbuild.rs:52:11

|

52 | pkgs: OnceCell<Arc\<Vec\<PkgbuildPkg>>>,

| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

|

= note: see issue #74465 https://github.com/rust-lang/rust/issues/74465 for more information

MarsSeed commented on 2023-10-17 06:28 (UTC)

@yochananmarqos, it is a packaging problem, and a serious one at that, if a package manager can break itself without warning when the user removes a package with its orphan dependencies recursively, which includes paru removing openssl-1.1, which in turn breaks paru because paru was built earlier with openssl-1.1 without the paru package declaring its dependency on it. That happened in my case, and it's not a user error. It's actually package maintainers'.