pkgsrc-Users archive

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


Am 14.06.2022 um 18:03 schrieb Yosuke Kawasaki:
I got a puzzling result.

When I ran the modified code below,
(Makefile code)

I guess that's rather your, not the actual
package Makefile.

.PHONY: copy-base-pkgconfig
.info ${USE_TOOLS:Uundefined}

The output of bmake says lines 7, 8, 10, and there is no empty line
between these .info lines, meaning that you didn't post the exact code
you ran.

.if !empty(USE_TOOLS:Mpkg-config)
.    if empty(${var}:M__nonexistent__)
         ${RUN} ${CP} ${${_var_}} ${WRKDIR}/.buildlink/lib/pkgconfig/
.    endif
.  endfor

The copy command still contains ${_var_} instead of the simpler ${var}.

Instead of the 'if empty', you can write the following, which I find
simpler to read, and it is more consistent with the expression in the
line below:

.    if ${${var}} != "__nonexistent__"

Did I already mention that the '.info' lines are evaluated when they are
parsed? For clarity, it would be better to move them above the .PHONY
line, to avoid the misinterpretation that they would be run together
with the ${RUN} lines. Moving the '.info' lines wouldn't change the
behavior though.

The interesting thing is the overall structure of the code:

* At which point do you include
* At which point do you evaluate the variables?

I guess that the definition of the copy-base-pkgconfig target is too
early, and that comes later.

Can you perhaps attach (or send me) the full definition of the package,
to speed up the analysis phase?

On the other hand,
sudo bmake show-var VARNAME=LIBSELINUX gave me the following.


The show-var target evaluates the variable after all the files have been
parsed. This confirms my hypothesis that you are running the steps in
the wrong order. It has to be:

1. include
2. define the copy-base-pkgconfig target based on the findings


Home | Main Index | Thread Index | Old Index