Bug 263872 - www/webkit2-gtk3: Patch for installing gtk-doc/devhelp documentation
Summary: www/webkit2-gtk3: Patch for installing gtk-doc/devhelp documentation
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gnome (Nobody)
Depends on:
Reported: 2022-05-08 23:54 UTC by Sean Champ
Modified: 2022-05-10 12:27 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (gnome)

patch for adding a docs option to the www/webkit2-gtk3 build (17.23 KB, patch)
2022-05-08 23:56 UTC, Sean Champ
no flags Details | Diff
patch for adding docs option with dynamic plist gen (1.30 KB, patch)
2022-05-09 21:49 UTC, Sean Champ
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Champ 2022-05-08 23:54:51 UTC
webkit2-gtk3 provides a cmake option for enabling a gtk-doc build for the JavaScriptCore, WebKitGTK and WebKitDOMGTK+ components. If installed to a directory accessible to Devhelp, the documentation can be browsed like other devhelp manuals.

The attached patch adds a DOCS option to the www/webkit2-gtk3 port and patches plist, for the documentation to be installed to a path accessible to devhelp.

Candidly, in looking at the patch before publishing it here I notice that the patch has set a -DCMAKE_INSTALL_DOCDIR=share/gtk-doc/html/${PORTNAME}${PKGNAMESUFFIX} while the documentation actually winds up installed under other subdirectories of -DCMAKE_INSTALL_DOCDIR=share/gtk-doc/html e.g with one manual installed to share/gtk-doc/html/jsc-glib-4.0/ under the prefix dir. 

I haven't tried building with a different CMAKE_INSTALL_DOCDIR. The docs are at least installed to the pathnames conditionally in the pkg-plist and can be browsed with Devhelp, with the port as patched with the attached diff. 

After the next port-updates build locally, I'll try to test out how CMAKE_INSTALL_DOCDIR is being used in the docs build

Maybe the documention could even help to inform any goal of using the Ruby, Python, or other GTK WebKit bindings.
Comment 1 Sean Champ 2022-05-08 23:56:31 UTC
Created attachment 233815 [details]
patch for adding a docs option to the www/webkit2-gtk3 build
Comment 2 Sean Champ 2022-05-09 16:23:20 UTC
In review of my own patch here lol, I was able to get the patched pkg to build at least once, sufficient to view the documentation in devhelp. I'm not certain if the plist that was in effect then might change across any subsequent builds, even with the same distfiles.

I'd seen the following today, building the patched pkg under poudriere with the  ostensible docs option enabled:

====> Compressing man pages (compress-man)
=======================<phase: package        >============================
===== env: 'PKG_NOTES=build_timestamp built_by' 'PKG_NOTE_build_timestamp=2022-05-09T13:52:08+0000' 'PKG_NOTE_built_by=poudriere-git-' NO_DEPENDS=yes USER=poudriere UID=65532 G>
===>  Building package for webkit2-gtk3-2.34.6_3
pkg-static: Unable to access file /wrkdirs/usr/ports/www/webkit2-gtk3/work/stage/usr/local/share/gtk-doc/html/webkit2gtk-4.0/api-index-2-31.html:No such file or directory
*** Error code 1

By now, using ccache in this build config, the build ran only for about a half hour on the build host. Once the poudriere run completes, I'll try to figure out how to handle the docs index files for the pkg-plist, can possibly generate that part of the plist manually
Comment 3 Sean Champ 2022-05-09 21:49:21 UTC
Created attachment 233827 [details]
patch for adding docs option with dynamic plist gen

It's possible to generate a dynamic plist for the gtk-doc files. The updated patch, as attached, uses one approach to this, using add-plist-docs

add-plist-docs is supported under bsd.port.mk, mainly for handling PORTDOCS, in a manner similar to PORTEXAMPLES under an EXAMPLES port option. By defininig add-plist-docs in a port, in effect it will override any handling for PORTDOCS. That variable was not previously being used in the port.

The updated patch will use add-plist-docs to update ${TMPPLIST} before the pkg is built. This approach would entail no further modification on the static pkg-plist for the port, and no hacks on the PLIST variable. 

The updated patch also removes the earlier CMAKE_INSTALL_DOCDIR parameter from the cmake parameters for the DOCS port option.

Also in the updated patch, installing NEWS from the distfile under the port's DOCSDIR
Comment 4 Sean Champ 2022-05-10 12:27:53 UTC
With the DOCS option enabled, it might be advised to use CC as LD. Possibly something in the docs build may be passing cflags to LD.

I've managed this locally with some hacks on toolchain variables, have not tested the build without this configuration.