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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4CCF61382C5 for ; Fri, 11 Dec 2020 23:18:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 75D07E0946; Fri, 11 Dec 2020 23:18:11 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 210B6E093E for ; Fri, 11 Dec 2020 23:18:11 +0000 (UTC) From: Mike Gilbert To: gentoo-dev@lists.gentoo.org Cc: williamh@gentoo.org, chewi@gentoo.org, Mike Gilbert Subject: [gentoo-dev] [PATCH 2/3] meson.eclass: use meson-array script Date: Fri, 11 Dec 2020 18:17:43 -0500 Message-Id: <20201211231744.1078574-2-floppym@gentoo.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201211231744.1078574-1-floppym@gentoo.org> References: <20201211231744.1078574-1-floppym@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 925b1730-b3de-41a0-9261-3f59b3e035e7 X-Archives-Hash: d2bde0c0001700e393d45cf800ad372c This allows python-exec to pick a suitable interpreter when /usr/bin/python is missing. Closes: https://bugs.gentoo.org/759433 Signed-off-by: Mike Gilbert --- eclass/meson.eclass | 100 +++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 61 deletions(-) diff --git a/eclass/meson.eclass b/eclass/meson.eclass index 21338280df33..4cc321987dfb 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -54,7 +54,7 @@ EXPORT_FUNCTIONS src_configure src_compile src_test src_install if [[ -z ${_MESON_ECLASS} ]]; then _MESON_ECLASS=1 -MESON_DEPEND=">=dev-util/meson-0.54.0 +MESON_DEPEND=">=dev-util/meson-0.55.3-r1 >=dev-util/ninja-1.8.2" if [[ ${EAPI:-0} == [6] ]]; then @@ -107,28 +107,6 @@ print("[{}]".format( ", ".join([quote(x) for x in shlex.split(" ".join(sys.argv[1:]))]))) EOF -# @FUNCTION: _meson_env_array -# @INTERNAL -# @DESCRIPTION: -# Parses the command line flags and converts them into an array suitable for -# use in a cross file. -# -# Input: --single-quote=\' --double-quote=\" --dollar=\$ --backtick=\` -# --backslash=\\ --full-word-double="Hello World" -# --full-word-single='Hello World' -# --full-word-backslash=Hello\ World -# --simple --unicode-8=© --unicode-16=𐐷 --unicode-32=𐤅 -# -# Output: ['--single-quote=\'', '--double-quote="', '--dollar=$', -# '--backtick=`', '--backslash=\\', '--full-word-double=Hello World', -# '--full-word-single=Hello World', -# '--full-word-backslash=Hello World', '--simple', '--unicode-8=©', -# '--unicode-16=𐐷', '--unicode-32=𐤅'] -# -_meson_env_array() { - python -c "${__MESON_ARRAY_PARSER}" "$@" -} - # @FUNCTION: _meson_get_machine_info # @USAGE: # @RETURN: system/cpu_family/cpu variables @@ -173,29 +151,29 @@ _meson_create_cross_file() { cat > "${fn}" <<-EOF [binaries] - ar = $(_meson_env_array "$(tc-getAR)") - c = $(_meson_env_array "$(tc-getCC)") - cpp = $(_meson_env_array "$(tc-getCXX)") - fortran = $(_meson_env_array "$(tc-getFC)") + ar = $(meson-array "$(tc-getAR)") + c = $(meson-array "$(tc-getCC)") + cpp = $(meson-array "$(tc-getCXX)") + fortran = $(meson-array "$(tc-getFC)") llvm-config = '$(tc-getPROG LLVM_CONFIG llvm-config)' - nm = $(_meson_env_array "$(tc-getNM)") - objc = $(_meson_env_array "$(tc-getPROG OBJC cc)") - objcpp = $(_meson_env_array "$(tc-getPROG OBJCXX c++)") + nm = $(meson-array "$(tc-getNM)") + objc = $(meson-array "$(tc-getPROG OBJC cc)") + objcpp = $(meson-array "$(tc-getPROG OBJCXX c++)") pkgconfig = '$(tc-getPKG_CONFIG)' - strip = $(_meson_env_array "$(tc-getSTRIP)") - windres = $(_meson_env_array "$(tc-getRC)") + strip = $(meson-array "$(tc-getSTRIP)") + windres = $(meson-array "$(tc-getRC)") [properties] - c_args = $(_meson_env_array "${CFLAGS} ${CPPFLAGS}") - c_link_args = $(_meson_env_array "${CFLAGS} ${LDFLAGS}") - cpp_args = $(_meson_env_array "${CXXFLAGS} ${CPPFLAGS}") - cpp_link_args = $(_meson_env_array "${CXXFLAGS} ${LDFLAGS}") - fortran_args = $(_meson_env_array "${FCFLAGS}") - fortran_link_args = $(_meson_env_array "${FCFLAGS} ${LDFLAGS}") - objc_args = $(_meson_env_array "${OBJCFLAGS} ${CPPFLAGS}") - objc_link_args = $(_meson_env_array "${OBJCFLAGS} ${LDFLAGS}") - objcpp_args = $(_meson_env_array "${OBJCXXFLAGS} ${CPPFLAGS}") - objcpp_link_args = $(_meson_env_array "${OBJCXXFLAGS} ${LDFLAGS}") + c_args = $(meson-array "${CFLAGS} ${CPPFLAGS}") + c_link_args = $(meson-array "${CFLAGS} ${LDFLAGS}") + cpp_args = $(meson-array "${CXXFLAGS} ${CPPFLAGS}") + cpp_link_args = $(meson-array "${CXXFLAGS} ${LDFLAGS}") + fortran_args = $(meson-array "${FCFLAGS}") + fortran_link_args = $(meson-array "${FCFLAGS} ${LDFLAGS}") + objc_args = $(meson-array "${OBJCFLAGS} ${CPPFLAGS}") + objc_link_args = $(meson-array "${OBJCFLAGS} ${LDFLAGS}") + objcpp_args = $(meson-array "${OBJCXXFLAGS} ${CPPFLAGS}") + objcpp_link_args = $(meson-array "${OBJCXXFLAGS} ${LDFLAGS}") needs_exe_wrapper = true sys_root = '${SYSROOT}' pkg_config_libdir = '${PKG_CONFIG_LIBDIR:-${EPREFIX}/usr/$(get_libdir)/pkgconfig}' @@ -224,29 +202,29 @@ _meson_create_native_file() { cat > "${fn}" <<-EOF [binaries] - ar = $(_meson_env_array "$(tc-getBUILD_AR)") - c = $(_meson_env_array "$(tc-getBUILD_CC)") - cpp = $(_meson_env_array "$(tc-getBUILD_CXX)") - fortran = $(_meson_env_array "$(tc-getBUILD_PROG FC gfortran)") + ar = $(meson-array "$(tc-getBUILD_AR)") + c = $(meson-array "$(tc-getBUILD_CC)") + cpp = $(meson-array "$(tc-getBUILD_CXX)") + fortran = $(meson-array "$(tc-getBUILD_PROG FC gfortran)") llvm-config = '$(tc-getBUILD_PROG LLVM_CONFIG llvm-config)' - nm = $(_meson_env_array "$(tc-getBUILD_NM)") - objc = $(_meson_env_array "$(tc-getBUILD_PROG OBJC cc)") - objcpp = $(_meson_env_array "$(tc-getBUILD_PROG OBJCXX c++)") + nm = $(meson-array "$(tc-getBUILD_NM)") + objc = $(meson-array "$(tc-getBUILD_PROG OBJC cc)") + objcpp = $(meson-array "$(tc-getBUILD_PROG OBJCXX c++)") pkgconfig = '$(tc-getBUILD_PKG_CONFIG)' - strip = $(_meson_env_array "$(tc-getBUILD_STRIP)") - windres = $(_meson_env_array "$(tc-getBUILD_PROG RC windres)") + strip = $(meson-array "$(tc-getBUILD_STRIP)") + windres = $(meson-array "$(tc-getBUILD_PROG RC windres)") [properties] - c_args = $(_meson_env_array "${BUILD_CFLAGS} ${BUILD_CPPFLAGS}") - c_link_args = $(_meson_env_array "${BUILD_CFLAGS} ${BUILD_LDFLAGS}") - cpp_args = $(_meson_env_array "${BUILD_CXXFLAGS} ${BUILD_CPPFLAGS}") - cpp_link_args = $(_meson_env_array "${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}") - fortran_args = $(_meson_env_array "${BUILD_FCFLAGS}") - fortran_link_args = $(_meson_env_array "${BUILD_FCFLAGS} ${BUILD_LDFLAGS}") - objc_args = $(_meson_env_array "${BUILD_OBJCFLAGS} ${BUILD_CPPFLAGS}") - objc_link_args = $(_meson_env_array "${BUILD_OBJCFLAGS} ${BUILD_LDFLAGS}") - objcpp_args = $(_meson_env_array "${BUILD_OBJCXXFLAGS} ${BUILD_CPPFLAGS}") - objcpp_link_args = $(_meson_env_array "${BUILD_OBJCXXFLAGS} ${BUILD_LDFLAGS}") + c_args = $(meson-array "${BUILD_CFLAGS} ${BUILD_CPPFLAGS}") + c_link_args = $(meson-array "${BUILD_CFLAGS} ${BUILD_LDFLAGS}") + cpp_args = $(meson-array "${BUILD_CXXFLAGS} ${BUILD_CPPFLAGS}") + cpp_link_args = $(meson-array "${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}") + fortran_args = $(meson-array "${BUILD_FCFLAGS}") + fortran_link_args = $(meson-array "${BUILD_FCFLAGS} ${BUILD_LDFLAGS}") + objc_args = $(meson-array "${BUILD_OBJCFLAGS} ${BUILD_CPPFLAGS}") + objc_link_args = $(meson-array "${BUILD_OBJCFLAGS} ${BUILD_LDFLAGS}") + objcpp_args = $(meson-array "${BUILD_OBJCXXFLAGS} ${BUILD_CPPFLAGS}") + objcpp_link_args = $(meson-array "${BUILD_OBJCXXFLAGS} ${BUILD_LDFLAGS}") needs_exe_wrapper = false pkg_config_libdir = '${BUILD_PKG_CONFIG_LIBDIR:-${EPREFIX}/usr/$(get_libdir)/pkgconfig}' -- 2.29.2