You are not logged in.

#1 2021-08-19 17:18:29

riddle00
Member
From: Lithuania
Registered: 2015-05-26
Posts: 81

[SOLVED] Best option to install a number of packages

There is a collection of Perl, Python, C scripts in a certain repository.

The project has a "dependencies/" directory, which has a few directories corresponding to different Linux distros: "Fedora-33/" , "Debian-10" and so on. In each of them there is a "build.sh" file
which just runs the package manager to install the needed dependencies for the project. In Fedora, it's "sudo dnf install -y", in Debian - "sudo apt-get install -y", then following a list of needed packages.

I would like to make such a directory for Arch Linux as well. Pacman installs most of the packages, however, there are six Perl packages that are in AUR.

I am aware of AUR helpers as well as the packages which automate installation from a list (bacpac, packup, pacmanity, etc.).

I am considering a few options, and I am not sure which would be simple for a user and also, preferrably, would mostly resemble the Arch Way.

[1] Requiring the user to have "yay" installed before running the script.
[2] Installing "yay", installing the packages and then removing "yay", if it was not installed before running the script.
[3] Installing every AUR package from source with makepkg and then - via Pacman.
[\*] Or I could just leave the packages from AUR commented  out together with the note that the user should install them by himself. However, it would be cool to have
a script that does the same as with other distros - just installs all the packages without bothering the user at all.

Last edited by riddle00 (2021-08-19 20:45:59)


Vim is not just an editor (...); it is for all intents and purposes a universal design pattern. --  Jason Ryan

Offline

#2 2021-08-19 17:52:08

Ammako
Member
Registered: 2021-07-16
Posts: 267

Re: [SOLVED] Best option to install a number of packages

The Arch Way?

AUR helpers are unsupported, so if you're looking to do things the Arch Way, you'll have to leave AUR packages out of the script. Let the user decide whether they want them or not and they can install them themselves.

If that's too restrictive then you might want to rethink your approach.

1- Would be fair enough, plenty of install scripts around that need you to install dependencies before running them.
2- Never do this, if your script depends on certain packages then let the user install them themselves before running the script.
3- Especially never do this, you can't guarantee that a PKGBUILD might not end up becoming malicious further down the line.

Why not just ask the user at the beginning of the script whether or not they want to include AUR packages? Then if they answer Yes, check for yay, and if it's not installed, prompt to install it. If they decline then just leave the AUR packages out.

Offline

#3 2021-08-19 17:55:01

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [SOLVED] Best option to install a number of packages

I would just create a PKGBUILD for that project itself and submit it to the AUR. Then it doesn't matter which AUR helper people are using. And then just tell the maintainer to link to the AUR entry from his repo for the benefit of Arch users.

Offline

#4 2021-08-19 18:57:56

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,456

Re: [SOLVED] Best option to install a number of packages

To expand on @Morn's response: Arch users (are supposed to) know what package dependencies are and how to install those deps, either from the AUR or the standard repos. While some choose to use AUR helpers, a lot do not, and having a package that somehow forces some kind of automation that also requires an AUR helper would be bad, or at least not the Arch Way. If you define your dependencies correctly, the AUR will label those that are not in the standard repos accordingly, so the user can decide on if/how to install those deps. And those that use an AUR helper will (I assume) automatically install those AUR deps.

Offline

#5 2021-08-19 19:31:01

zpg443
Member
Registered: 2016-12-03
Posts: 316

Re: [SOLVED] Best option to install a number of packages

Why not just set up a custom repository? I use aurutils. Once your AUR packages are added to the repository, install them normally using

pacman -S --asdep [pkg]

Offline

#6 2021-08-19 20:33:29

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Best option to install a number of packages

riddle00 wrote:

[1] Requiring the user to have "yay" installed before running the script.
[2] Installing "yay", installing the packages and then removing "yay", if it was not installed before running the script.
[3] Installing every AUR package from source with makepkg and then - via Pacman.
[\*] Or I could just leave the packages from AUR commented  out together with the note that the user should install them by himself. However, it would be cool to have

Don't do any of the above.

Just list all of the dependencies in the PKGBUILD, exactly the same as every other package that has dependencies in the AUR. This way the end user can continue to use there preferred workflow without you forcing anything on them.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2021-08-19 20:45:46

riddle00
Member
From: Lithuania
Registered: 2015-05-26
Posts: 81

Re: [SOLVED] Best option to install a number of packages

Thanks everyone for the answers, these are all some really good options! smile And I'm gonna try to use PKGBUILD then, and maybe someday put the package itself in the AUR (or at least in a custom repo).


Vim is not just an editor (...); it is for all intents and purposes a universal design pattern. --  Jason Ryan

Offline

Board footer

Powered by FluxBB