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

Re: Help needed for cross-building tsocks



Apologies for late response, I have been quite unwell from past many days...

On 18/08/25 17:08, Helmut Grohne wrote:
Reading Dpkg/Substvars.pm, "my $maxsubsts = 50;" jumped into my eyes.
It suggests to me that expansion could be recursive. Would it be
possible to define a variable containing the C library name and then
interpolate it?

Built-Using: ${dh-builtusing:${libcdev:Package}}

I haven't tried it. I'm merely guessing. The other option could be
listing an invalid package:

Build-Using: ${dh-builtusing:libc6-dev}, ${dh-builtusing:lib6.1-dev}, ${dh-builtusing:libc0.3-dev}, ${dh-builtusing:musl-dev}

I kinda expect this latter variant to error out when it misses one of
those packages.

As expected, none of those things work.

If all of this fails, consider doing your own substitution variable and
generating suitable content yourself.

I've tried this which seems to do the trick but is manual work -- does this look ok to you?

execute_before_dh_gencontrol:
        for pkg in libc6-dev libc6.1-dev libc0.3-dev musl-dev; do \
                if [ "$(DEB_BUILD_ARCH)" != "$(DEB_HOST_ARCH)" ]; then \
                        pkg="$$pkg:$(DEB_HOST_ARCH)"; \
                fi; \
                pkgname=`dpkg-query -W -f='$${source:Package}' $$pkg`; \
                version=`dpkg-query -W -f='$${source:Version}' $$pkg`; \
                if [ -n "$$version" ]; then \
                        echo "$(DEB_SOURCE):Built-Using=$$pkgname (= $$version)" >> debian/$(DEB_SOURCE).substvars; \
                        break; \
                fi; \
        done

OTOH, I happened to notice the same libc-dev-bin B-U problem in a few other packages as well [1]. I wonder
if there could be a better solution for all of these.

[1] https://codesearch.debian.net/search?q=libc-dev-bin+path%3Adebian%2Frules&literal=0&page=1


Reply to: