Re: [PATCH] meson: make GIT_HTML_PATH configurable
- From
D. Ben Knoble <ben.knoble+github@gmail.com>
- Date
- Nov 11, 2025, 18:52 UTC
- Message-ID
- <CALnO6CDwnSYr5bpSFNBTixa0dnJ3yDSy=fCRN19Aj4Ms=_mvPA@mail.gmail.com>
- In-Reply-To
- <CAOLa=ZTViq=OYoMQNdvi3rV+iUucGZ4RN0c7X_Q0PEugaEqqJQ@mail.gmail.com>
On Tue, Nov 11, 2025 at 8:43 AM Karthik Nayak <karthik.188@gmail.com> wrote:
Show 43 quoted lines
>
> "D. Ben Knoble" <ben.knoble+github@gmail.com> writes:
>
> [snip]
>
> > diff --git a/meson.build b/meson.build
> > index 2b763f7c53..1f95a06edb 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -768,13 +768,18 @@ if test_output_directory == ''
> > test_output_directory = meson.project_build_root() / 'test-output'
> > endif
> >
> > +htmldir = get_option('htmldir')
> > +if htmldir == ''
> > + htmldir = get_option('datadir') / 'doc/git-doc'
> > +endif
> > +
> > # These variables are used for building libgit.a.
> > libgit_c_args = [
> > '-DBINDIR="' + get_option('bindir') + '"',
> > '-DDEFAULT_GIT_TEMPLATE_DIR="' + get_option('datadir') / 'git-core/templates' + '"',
> > '-DFALLBACK_RUNTIME_PREFIX="' + get_option('prefix') + '"',
> > '-DGIT_HOST_CPU="' + host_machine.cpu_family() + '"',
> > - '-DGIT_HTML_PATH="' + get_option('datadir') / 'doc/git-doc"',
> > + '-DGIT_HTML_PATH="' + htmldir + '"',
> > '-DGIT_INFO_PATH="' + get_option('infodir') + '"',
> > '-DGIT_LOCALE_PATH="' + get_option('localedir') + '"',
> > '-DGIT_MAN_PATH="' + get_option('mandir') + '"',
> > diff --git a/meson_options.txt b/meson_options.txt
> > index 143dee9237..e0be260ae1 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -1,4 +1,6 @@
> > # Configuration for Git installation
> > +option('htmldir', type: 'string', value: '',
> > + description: 'Directory to install HTML docs to. Defaults to <datadir>/doc/git-doc')
> > option('perllibdir', type: 'string', value: '',
> > description: 'Directory to install perl lib to. Defaults to <datadir>/perl5')
>
> I guess meson doesn't allow recursive dependency for build options? I
> was hoping we could do `value: get_option('datadir') / 'doc/git-doc'`
> and remove the custom block which checks for empty value above.The documentation [1] did not suggest that "default" could be evaluated as an expression here, and I copied the pattern from perllibdir [2]. If there's an alternative, I'm all ears.
[1]: https://mesonbuild.com/Build-options.html [2]: https://github.com/git/git/blob/4badef0c3503dc29059d678abba7fac0f042bc84/meson.build#L1972-L1975
> Anyways the patch looks good.
Thanks!