You are not logged in.

#1 2018-08-01 14:09:15

Osiris
Member
Registered: 2003-01-18
Posts: 153
Website

Change build options depending on satisfied optdepends

Hello,

is there a way to adapt my build options (to -DFEATURE= for cmake) to the optdepends that are installed?

I am not really sure if doing something like `pacman -Qs petsc` and evaluating the return code inside the PKGBUILD is a good idea.

Thanks!

Offline

#2 2018-08-01 14:27:33

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: Change build options depending on satisfied optdepends

If the optdepends are required at compile-time, they should also be included in makedepends array. Don't try to make dynamic PKGBUILDs, that will only lead to confusion. If you want to leave comments for end users explaining how they can modify the PKGBUILD to enable or disable certain features, that's fine, but the PKGBUILD you upload to the AUR* should Just Work and produce a standard package.

*I am assuming this is why you are asking


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#3 2018-08-01 15:04:40

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Change build options depending on satisfied optdepends

While I agree with the above, there is precedent for doing otherwise.  Have a look at the mpv-git PKGBUILD.

However, note that once the compile flag has been added, those dependencies are no longer optional.  And in most cases, without the compile flag, they are also not option - just not needed.  Dynamically determined dependencies are not the same as optional depdendencies.

The mpv-git PKGBUILD dynamically determines build flags and dependencies (not optional dependencies).

Last edited by Trilby (2018-08-01 15:07:05)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB