You are not logged in.

#1 2020-10-24 18:05:15

MountainX
Member
Registered: 2016-02-08
Posts: 371

[SOLVED] how to use a locally modified PKGBUILD with aur-sync?

The AUR package x2godesktopsharing is missing a dependency for qt5-svg. (I left a comment on the project's AUR page.) I want to use my script to build this package in a chroot along with several other packages. Therefore, I modify the PKGBUILD before using aurutils to finish the process.

if [ -f /"$pkgsroot"/"$reponame"/x2godesktopsharing/PKGBUILD ]; then
  # x2godesktopsharing is missing dependency: qt5-svg
  grep "depends.*qt5-svg" /"$pkgsroot"/"$reponame"/x2godesktopsharing/PKGBUILD >/dev/null
  if [[ $? -ne 0 ]]; then
    sed -i.bak '/depends=/ s/\x27)/\x27 \x27qt5-svg\x27)/' /"$pkgsroot"/"$reponame"/x2godesktopsharing/PKGBUILD
  fi
fi

My script does the above step before calling "aur sync" like this:

xargs -a tobuild.txt aur sync --chroot --sign --upgrades --noconfirm --database="$reponame" --directory=/$chrootpath

However, the step above uses the unmodified PKGBUILD. It looks to be downloading it fresh. Is that because I'm using the "--upgrades" option? I do want all packages that are out of date to be updated by the script, but I want this particular package to also use my fixed PKGBUILD. How do I achieve that with an automated script?

Even when I verify that the PKGBUILD has been changed correctly, the build step fails like this:

==> Extracting sources...
  -> Extracting x2godesktopsharing-3.2.0.0.tar.gz with bsdtar
==> Starting build()...
Info: creating stash file /build/x2godesktopsharing/src/x2godesktopsharing-3.2.0.0/.qmake.stash
Project ERROR: Unknown module(s) in QT: svg
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Build failed, check /mnt/chroots/arch/test3/myuser/build
xargs: aur: exited with status 255; aborting

I am doing this to learn about aurutils, chroots, and bash automation. I know other ways to build this package, but my goal is not simply to build the package one time. I want to learn how to handle packages that have problems within my script, and this package gives me an example to work with that doesn't seem overly complex.

Last edited by MountainX (2020-10-27 06:09:59)

Offline

#2 2020-10-26 09:28:43

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: [SOLVED] how to use a locally modified PKGBUILD with aur-sync?

Once upon a tim there was a script "customizepkg" for exactly this task, AFAIR from the peaple who created yaourt. Now there are different flavours of that script. It lets you modify the PKGBUILD in an automated way.

The original script used a self-invented modification language (well, maybe language is the wrong name, it was surely not Turing-complete). I use a flavour that makes use of diff and patch.

One of the moderators of this forum wrote a flavour that uses scripts. I did not test it, but maybe I should.

Offline

#3 2020-10-26 18:31:51

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: [SOLVED] how to use a locally modified PKGBUILD with aur-sync?

Stefan Husmann wrote:

Once upon a time there was a script "customizepkg" for exactly this task, AFAIR from the peaple who created yaourt. Now there are different flavours of that script...

Here are the 3 flavors I found:

ava1ar/customizepkg: A tool for Arch Linux package manager pacman to modify PKGBUILD automatically

AUR (en) - customizepkg-patching

Scimmia22/customizepkg-scripting

Offline

#4 2020-10-28 17:57:26

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: [SOLVED] how to use a locally modified PKGBUILD with aur-sync?

With aurutils 3.0.0, you can use git commit to save your local changes. aur-sync uses aur fetch --sync=auto which then attempts git rebase if aurutils.rebase is true (run git config aurutils.rebase true in the repository where you want to have local changes).

Last edited by Alad (2020-10-28 17:57:53)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

Board footer

Powered by FluxBB