aboutsummaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorHorodniceanu Andrei <a.horodniceanu@proton.me>2023-11-30 21:13:46 +0200
committerHorodniceanu Andrei <a.horodniceanu@proton.me>2023-12-10 23:53:34 +0200
commit1bb2eb6ab240eec201a15cb78ed0fed2d7c6f9c3 (patch)
treea78c568ad6b891f69585faaf724abab5590c6792 /eclass
parentdlang.eclass: Properly set LIBDIR_$ABI for single type packages (diff)
downloaddlang-1bb2eb6ab240eec201a15cb78ed0fed2d7c6f9c3.tar.gz
dlang-1bb2eb6ab240eec201a15cb78ed0fed2d7c6f9c3.tar.bz2
dlang-1bb2eb6ab240eec201a15cb78ed0fed2d7c6f9c3.zip
dlang.eclass: export PKG_CONFIG_* in phase functions
PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH will now be set to a list of the the system pkg-config directories and the compiler specific one, allowing packages that use build systems to easily find both their C and D dependencies. Signed-off-by: Horodniceanu Andrei <a.horodniceanu@proton.me>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/dlang.eclass18
1 files changed, 18 insertions, 0 deletions
diff --git a/eclass/dlang.eclass b/eclass/dlang.eclass
index 2817779..ab41b18 100644
--- a/eclass/dlang.eclass
+++ b/eclass/dlang.eclass
@@ -610,6 +610,17 @@ _dlang_use_build_vars() {
# The original value is exported as LIBDIR_HOST.
local libdir_var="LIBDIR_${ABI}"
export LIBDIR_HOST="${!libdir_var}"
+ # Save the default pkgconfig path
+ if [[ ! -v DLANG_SAVE_PKG_CONFIG_PATH ]]; then
+ # Copy the logic from meson.eclass for setting PKG_CONFIG_PATH
+ export DLANG_SAVE_PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${PKG_CONFIG_PATH:+:}/usr/share/pkgconfig"
+ fi
+ if [[ ! -v DLANG_SAVE_PKG_CONFIG_LIBDIR ]]; then
+ # either save the value or provide a sane default lest other eclasses get confused.
+ # e.g. meson.eclass will set PKG_CONFIG_LIBDIR using $(get_libdir) which won't
+ # work properly since we will overwrite $LIBDIR_$ABI
+ export DLANG_SAVE_PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR:-/usr/$(get_libdir)/pkgconfig}"
+ fi
export ABI="$(echo ${MULTIBUILD_VARIANT} | cut -d- -f1)"
export DC="$(echo ${MULTIBUILD_VARIANT} | cut -d- -f2)"
export DC_VERSION="$(echo ${MULTIBUILD_VARIANT} | cut -d- -f3)"
@@ -699,6 +710,13 @@ _dlang_use_build_vars() {
filter-ldflags -f{no-,}use-linker-plugin -f{no-,}lto -flto=*
fi
export LDFLAGS=`dlang_convert_ldflags`
+
+ # Add the compiler specific pkgconfig paths.
+ export PKG_CONFIG_PATH="${DLANG_SAVE_PKG_CONFIG_PATH}:/usr/$(get_libdir)/pkgconfig"
+ # Technically, this value will stay the same so it's enough to export it once
+ # but it's cleaner to keep these 2 variables close together.
+ export PKG_CONFIG_LIBDIR="${DLANG_SAVE_PKG_CONFIG_LIBDIR}"
+
"${@}"
}