On 24/07/2025 03:07, John Haugabook via Cygwin-apps wrote:
Hello,

This patch adds an option --build-depend that, when called; installs the
packages listed in the build-depends property. It is for someone who
wants to build the binaries of a package themselves, enabling them to
pass one string value to the setup command in lieu of an array of packages.

Thanks very much for working on this!

Sorry for the ridiculous delay in responding.
On 18/07/2025, Jon Turney via Cygwin-apps [[PATCH setup] add --build-depend 
option] wrote:
If you take a look at
IniDBBuilderPackage.cc:IniDBBuilderPackage::buildBeginBuildDepends(),
you'll see where the current handling of build-requires data parsed from
setup.ini stops.

It should be relatively straightforward to add another "nodeList" here,
to assemble the data parsed from build-requires: lines in setup.ini
(identically to the existing handling of
depends/obsoletes/provides/conflicts)

It was straightforward, but I was not able to edit build_depend() in such a way
as to implement this (believe I tried). Instead I had to use
"local_dir" declared
in state.h, using the definition from ini.cc to work as the setup.ini
for build_depend() to
iterate over and parse output from. If the parsed output from that is
up-to-date, then
Hmm... so I had a go at implementing that, and while there are indeed a few wrinkles which make it not quite as simple as I thought, it does seem to be possible.

You can take a look at [1] for what I put together.
[1] https://cygwin.com/cgit/cygwin-apps/setup/log/?h=topic/build-depends> from what I've loosely tested, the packages returned are as if -P was
used to install.

Hmmm... very clever, but I'm not sure that faking command line options in this way is a good idea.

But I guess that solves the problem of getting those installation choices to interact correctly with all the other options.

On 18/07/2025, Jon Turney via Cygwin-apps [[PATCH setup] add --build-depend 
option] wrote:
In choose.cc:ChooserPage::applyCommandLinePackageSelection() there's an
existing block of code which handles, uh, command line package selection.

I was able to implement the redirect from the parsed output from build_depend()
to define a class instance of PackageOption so choose.cc can work as if -P
were used.

NOTE - currently unsure of the file name (build_depends), and option name
(--build-depend) as using the option builds one instance - hence singular
usage; and the file build-depends (implied possessive) of packages
(if that makes sense). Not attached to naming, and if maintainers want to move
forward with this patch, then would like to use whatever naming they
think is best.

Yeah, this is a good question which didn't occur to me.
I think maybe it should be plural like the existing '--pacakges', and accept multiple names?

Then there's also the question that unlike 'anjuta', there are some names which are only the names of source or install packages (e.g. the source package 'libcaca' generates an install package named 'libcaca0').

So maybe if the name given to '--build-depends' can't be found as a source package, it should be looked up as an install package, then the corresponding source package located?

Reply via email to