You are not logged in.

#1 2023-05-20 12:37:37

soloturn
Member
Registered: 2016-04-18
Posts: 5

how to put runtime dependencies in package () function, example?

@allan suggested to put runtime dependencies in the package function. somebody has an example PKGBUILD how to do so?

discussin in this pacman issue:
https://gitlab.archlinux.org/pacman/pacman/-/issues/22

Offline

#2 2023-05-20 12:46:18

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,703

Re: how to put runtime dependencies in package () function, example?

You're defining the variable, you're just doing it inside the function instead of globally.

Offline

#3 2023-05-20 12:49:26

seth
Member
Registered: 2012-09-03
Posts: 53,203

Re: how to put runtime dependencies in package () function, example?

https://wiki.archlinux.org/title/Talk:P … on_depends

Edit: to be fair, from the notion in the wiki alone it's not clear whether the array should be grown, replaced or shadowed w/ a local namesake

Last edited by seth (2023-05-20 12:52:43)

Offline

#4 2023-05-20 13:28:27

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,703

Re: how to put runtime dependencies in package () function, example?

seth wrote:

Edit: to be fair, from the notion in the wiki alone it's not clear whether the array should be grown, replaced or shadowed w/ a local namesake

Because you can do any of them, depending on what you're trying to accomplish.

Offline

#5 2023-05-20 14:13:40

seth
Member
Registered: 2012-09-03
Posts: 53,203

Re: how to put runtime dependencies in package () function, example?

The wiki wrote:

Dependencies defined inside the package() function are only required to run the software.

I'm not gonna pretend to teach English, but "defined" sounds like the array is "defined" there and the goal is to have "Dependencies … only required to run the software."

Defining "depends" inside "package" is gonna replace it, a local variable is inert and only "depends+=" will achieve what's suggested.

From my naive understanding as a non-native English babbler

Dependencies defined added inside the package() function are only required to run the software.

would much rather catch the situation, but I'll grant that's maybe just me.

Offline

#6 2023-05-20 14:24:15

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,703

Re: how to put runtime dependencies in package () function, example?

"depends+=" is just a bashism for "depends=$depends". It's still defining the array.

Who says you don't want to completely redefine/replace it? Or who says there's even a depends array in the global scope? 'Added' only covers a subset of what's possible.

Offline

#7 2023-05-20 14:49:19

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,167

Re: how to put runtime dependencies in package () function, example?

I also prefer to separate build & runtime dependencies (and don't mind listing a dep that is both multiple times) .

https://aur.archlinux.org/cgit/aur.git/ … inimal-git only has runtime depends in the package-*() functions and none in the main body of the PKGBUILD.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB