[PATCH] meson.eclass: update localstatedir for EAPI >= 9

Mike Gilbert <[email protected]>
Newsgroups gmane.linux.gentoo.devel
Message-ID <[email protected]>
Closes: https://bugs.gentoo.org/878913
Signed-off-by: Mike Gilbert <[email protected]>
---
 eclass/meson.eclass | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 60ce6593e8d7..309e697245f8 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -404,10 +404,28 @@ setup_meson_src_configure() {
 	fi
 
 	MESONARGS+=(
-		--libdir "$(get_libdir)"
-		--localstatedir "${EPREFIX}/var/lib"
 		--prefix "${EPREFIX}/usr"
+		--libdir "$(get_libdir)"
 		--sysconfdir "${EPREFIX}/etc"
+	)
+
+	case ${EAPI} in
+		7|8)
+			# legacy behavior: emulate econf
+			MESONARGS+=( --localstatedir "${EPREFIX}/var/lib" )
+			;;
+		*)
+			MESONARGS+=(
+				# https://bugs.gentoo.org/878913
+				# meson defaults for prefix=/usr, but with EPREFIX added
+				# https://mesonbuild.com/Builtin-options.html
+				--localstatedir "${EPREFIX}/var"
+				--sharedstatedir "${EPREFIX}/var/lib"
+			)
+			;;
+	esac
+
+	MESONARGS+=(
 		--wrap-mode nodownload
 		--build.pkg-config-path "${BUILD_PKG_CONFIG_PATH}${BUILD_PKG_CONFIG_PATH:+:}${EPREFIX}/usr/share/pkgconfig"
 		--pkg-config-path "${PKG_CONFIG_PATH}${PKG_CONFIG_PATH:+:}${EPREFIX}/usr/share/pkgconfig"
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.