Skip to content

Commit

Permalink
xorg-3.eclass: pass --with-fontrootdir to configure
Browse files Browse the repository at this point in the history
The XORG_FONTROOTDIR autoconf macro calls pkg-config to obtain the
fontrootdir path defined in fontutil.pc.

pkgconf automatically prepends SYSROOT to variable values that start
with a "/". For installation paths, we don't want SYSROOT prepended.

Passing --with-fontrootdir bypasses the pkg-config call and avoids the
problem with SYSROOT.

Bug: https://bugs.gentoo.org/815520
Signed-off-by: Mike Gilbert <[email protected]>
  • Loading branch information
floppym committed Oct 24, 2021
1 parent 4e4173a commit 4bdf5e4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions eclass/xorg-3.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ xorg-3_src_unpack() {
unpack ${A}
fi

[[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}"
[[ -n ${FONT} ]] && einfo "Detected font directory: ${FONT_DIR}"
}

# @FUNCTION: xorg-3_reconf_source
Expand Down Expand Up @@ -317,13 +317,17 @@ xorg-3_src_prepare() {
xorg-3_font_configure() {
debug-print-function ${FUNCNAME} "$@"

# Pass --with-fontrootdir to override pkgconf SYSROOT behavior.
# https://bugs.gentoo.org/815520
if grep -q -s "with-fontrootdir" "${ECONF_SOURCE:-.}"/configure; then
FONT_OPTIONS+=( --with-fontrootdir="${EPREFIX}"/usr/share/fonts )
fi

if has nls ${IUSE//+} && ! use nls; then
if ! grep -q -s "disable-all-encodings" ${ECONF_SOURCE:-.}/configure; then
die "--disable-all-encodings option not available in configure"
fi
FONT_OPTIONS+="
--disable-all-encodings
--enable-iso8859-1"
FONT_OPTIONS+=( --disable-all-encodings --enable-iso8859-1 )
fi
}

Expand Down Expand Up @@ -365,6 +369,7 @@ xorg-3_src_configure() {
# @DEFAULT_UNSET
local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}")

local FONT_OPTIONS=()
[[ -n "${FONT}" ]] && xorg-3_font_configure

# Check if package supports disabling of dep tracking
Expand All @@ -388,7 +393,7 @@ xorg-3_src_configure() {
${dep_track}
${selective_werror}
${no_static}
${FONT_OPTIONS}
"${FONT_OPTIONS[@]}"
"${xorgconfadd[@]}"
)

Expand Down

0 comments on commit 4bdf5e4

Please sign in to comment.