From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 218B1158015 for ; Sun, 17 Dec 2023 11:58:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BDAA22BC02F; Sun, 17 Dec 2023 11:58:10 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 859C62BC02F for ; Sun, 17 Dec 2023 11:58:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 69B1133FE49 for ; Sun, 17 Dec 2023 11:58:09 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A5E66ACA for ; Sun, 17 Dec 2023 11:58:07 +0000 (UTC) From: "Marco Leise" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Marco Leise" Message-ID: <1702245214.1bb2eb6ab240eec201a15cb78ed0fed2d7c6f9c3.mleise@gentoo> Subject: [gentoo-commits] repo/user/dlang:master commit in: eclass/ X-VCS-Repository: repo/user/dlang X-VCS-Files: eclass/dlang.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mleise X-VCS-Committer-Name: Marco Leise X-VCS-Revision: 1bb2eb6ab240eec201a15cb78ed0fed2d7c6f9c3 X-VCS-Branch: master Date: Sun, 17 Dec 2023 11:58:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 456b3cd9-7768-48a9-85a8-c9f73bc21dd1 X-Archives-Hash: c0d07ce513d0433297ef7c1bcfd30fef commit: 1bb2eb6ab240eec201a15cb78ed0fed2d7c6f9c3 Author: Horodniceanu Andrei proton me> AuthorDate: Thu Nov 30 19:13:46 2023 +0000 Commit: Marco Leise gmx de> CommitDate: Sun Dec 10 21:53:34 2023 +0000 URL: https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=1bb2eb6a 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 proton.me> eclass/dlang.eclass | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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}" + "${@}" }