Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-libs/efl: use docs.eclass for building docs #18530

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 17 additions & 9 deletions dev-libs/efl/efl-1.25.1-r10.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ EAPI=7

LUA_COMPAT=( lua5-{1..3} luajit )

inherit lua-single meson xdg-utils
DOCS_BUILDER="doxygen"
DOCS_DIR="${S}/doc"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the ${S} need to get specified now with doxygen? Or is this specific to efl?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sphinx you can get away with using a relative path. For doxygen and mkdocs DOCS_OUTDIR has to be a absolute path because those docbuilders have to be run in the directory where the config file is, which means that if DOCS_DIR is not equal to S (the default) the docbuilder and einstalldocs are not run from the same directory which will cause einstalldocs to fail because it can't find the directory specified in HTML_DOCS. Because DOCS_OUTDIR is set relative to DOCS_DIR this means that DOCS_DIR has to be an absolute path.

This morning I thought of a solution that will allow the eclass to be used with relative paths in DOCS_DIR (changing the default DOCS_OUTDIR from DOCS_DIR/_build/html to S/_build/html). That way DOCS_OUTDIR is an absolute path by default, and it is not longer strictly necessary for DOCS_DIR to be an absolute path as well.


inherit docs lua-single meson xdg-utils

DESCRIPTION="Enlightenment Foundation Libraries all-in-one package"
HOMEPAGE="https://www.enlightenment.org"
Expand All @@ -14,7 +17,7 @@ SRC_URI="https://download.enlightenment.org/rel/libs/${PN}/${P}.tar.xz"
LICENSE="BSD-2 GPL-2 LGPL-2.1 ZLIB"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86"
IUSE="+X avif bmp connman cpu_flags_arm_neon dds debug doc drm +eet efl-one elogind examples fbcon
IUSE="+X avif bmp connman cpu_flags_arm_neon dds debug drm +eet efl-one elogind examples fbcon
+fontconfig fribidi gif gles2-only gnutls glib +gstreamer harfbuzz hyphen ibus ico libressl
jpeg2k json nls mono opengl +pdf physics pmaps postscript psd pulseaudio raw scim
sdl +sound +ssl +svg +system-lz4 systemd tga tgv tiff tslib unwind v4l vnc wayland webp xcf
Expand Down Expand Up @@ -125,7 +128,6 @@ RDEPEND="${LUA_DEPS}
zeroconf? ( net-dns/avahi )"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig
doc? ( app-doc/doxygen )
nls? ( sys-devel/gettext )"

pkg_setup() {
Expand All @@ -142,6 +144,17 @@ src_prepare() {
sed -i "/config_h.set('HAVE_UNWIND/,/eina_ext_deps += unwind/d" src/lib/eina/meson.build ||
die "Failed to remove libunwind dep"
fi

# Fixup Doxyfile
pushd "${DOCS_DIR}"
cp Doxyfile.in Doxyfile || die
sed -i \
-e "s/@PACKAGE_VERSION@/${PV}/g" \
-e "s/@top_builddir@/../g" \
-e "s/@top_srcdir@/../g" \
-e "s/@srcdir@/./g" \
Doxyfile || die
popd
}

src_configure() {
Expand Down Expand Up @@ -273,16 +286,11 @@ src_configure() {
}

src_compile() {
docs_compile
meson_src_compile

if use doc; then
cd doc/ || die "Failed to switch into doc/ dir."
doxygen . || die "Doxygen failed to run."
fi
}

src_install() {
use doc && local HTML_DOCS=( "${S}"/doc/html/. )
meson_src_install

if use examples; then
Expand Down
26 changes: 17 additions & 9 deletions dev-libs/efl/efl-1.25.1-r2.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

EAPI=7

inherit meson xdg-utils
DOCS_BUILDER="doxygen"
DOCS_DIR="${S}/doc"

inherit docs meson xdg-utils

DESCRIPTION="Enlightenment Foundation Libraries all-in-one package"
HOMEPAGE="https://www.enlightenment.org"
Expand All @@ -12,7 +15,7 @@ SRC_URI="https://download.enlightenment.org/rel/libs/${PN}/${P}.tar.xz"
LICENSE="BSD-2 GPL-2 LGPL-2.1 ZLIB"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 x86"
IUSE="+X avif bmp connman cpu_flags_arm_neon dds debug doc drm +eet efl-one elogind examples fbcon
IUSE="+X avif bmp connman cpu_flags_arm_neon dds debug drm +eet efl-one elogind examples fbcon
+fontconfig fribidi gif gles2-only gnutls glib +gstreamer harfbuzz hyphen ibus ico libressl
lua +luajit jpeg2k json nls mono opengl +pdf physics pmaps postscript psd pulseaudio raw scim
sdl +sound +ssl +svg +system-lz4 systemd tga tgv tiff tslib unwind v4l vnc wayland webp xcf
Expand Down Expand Up @@ -128,7 +131,6 @@ RDEPEND="
"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig
doc? ( app-doc/doxygen )
nls? ( sys-devel/gettext )"

pkg_setup() {
Expand All @@ -145,6 +147,17 @@ src_prepare() {
sed -i "/config_h.set('HAVE_UNWIND/,/eina_ext_deps += unwind/d" src/lib/eina/meson.build ||
die "Failed to remove libunwind dep"
fi

# Fixup Doxyfile
pushd "${DOCS_DIR}"
cp Doxyfile.in Doxyfile || die
sed -i \
-e "s/@PACKAGE_VERSION@/${PV}/g" \
-e "s/@top_builddir@/../g" \
-e "s/@top_srcdir@/../g" \
-e "s/@srcdir@/./g" \
Doxyfile || die
popd
}

src_configure() {
Expand Down Expand Up @@ -276,16 +289,11 @@ src_configure() {
}

src_compile() {
docs_compile
meson_src_compile

if use doc; then
cd doc/ || die "Failed to switch into doc/ dir."
doxygen . || die "Doxygen failed to run."
fi
}

src_install() {
use doc && local HTML_DOCS=( "${S}"/doc/html/. )
meson_src_install

if use examples; then
Expand Down
2 changes: 1 addition & 1 deletion eclass/docs.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ doxygen_compile() {
mkdir -p "${DOCS_OUTDIR}" || die

pushd "${DOCS_DIR}" || die
(cat "${doxyfile}" ; echo "HTML_OUTPUT=${DOCS_OUTDIR}") | doxygen "${DOCS_EXTRA_ARGS}" - || die "${FUNCNAME}: doxygen failed"
(cat "${DOCS_CONFIG_NAME}" ; echo "HTML_OUTPUT=${DOCS_OUTDIR}") | doxygen - "${DOCS_EXTRA_ARGS}" || die "${FUNCNAME}: doxygen failed"
popd || die
}

Expand Down