pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] rlwrap: make python optional



Am 18.12.2024 um 07:44 schrieb Paul W. Rankin:
> --- a/misc/rlwrap/Makefile
> +++ b/misc/rlwrap/Makefile
> @@ -33,12 +33,15 @@ REPLACE_PERL+=	filters/simple_macro
>  REPLACE_PERL+=	filters/template
>  REPLACE_PERL+=	filters/unbackspace
>
> +.if !empty(PKG_OPTIONS:Mpython)

Any condition that involves PKG_OPTIONS should not be in the package
Makefile directly, but instead in options.mk.

At this point in the package Makefile, PKG_OPTIONS is not yet set, so
this block never becomes active. To demonstrate this, I added an extra
line ".error out" to the block, and even with
PKG_DEFAULT_OPTIONS=python, this block was not reached.

To prevent this kind of mistakes, PKG_OPTIONS should not be queried
using the '!empty' idiom:

> -.if !empty(PKG_OPTIONS:Mpython)
> +.if ${PKG_OPTIONS:Mpython}

This variant complains loudly if the variable is not defined, instead of
silently skipping the 'if' clause.

> +.if !empty(PKG_OPTIONS:Mppython)

This typo is found by running pkglint on the package.

Roland


Home | Main Index | Thread Index | Old Index