git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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!
Previous: Karthik Nayak
Message 10 of 10 in “meson: make GIT_HTML_PATH configurable”
  1. meson: make GIT_HTML_PATH configurableD. Ben Knoble, Nov 4, 2025
  2. Junio C HamanoNov 4, 2025
  3. Ben KnobleNov 4, 2025
  4. Patrick SteinhardtNov 6, 2025
  5. Patrick SteinhardtNov 6, 2025
  6. Ben KnobleNov 6, 2025
  7. Junio C HamanoNov 6, 2025
  8. meson: make GIT_HTML_PATH configurableD. Ben Knoble, Nov 11, 2025
  9. Karthik NayakNov 11, 2025
  10. D. Ben KnobleNov 11, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.