From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 56363138010 for ; Mon, 27 Aug 2012 01:21:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F394CE0525; Mon, 27 Aug 2012 01:21:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id A0D73E050C for ; Mon, 27 Aug 2012 01:20:41 +0000 (UTC) Received: from [192.168.1.43] (unknown [96.231.195.182]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: tetromino) by smtp.gentoo.org (Postfix) with ESMTPSA id B294A33D7E4 for ; Mon, 27 Aug 2012 01:20:40 +0000 (UTC) Message-ID: <1346030438.9829.91.camel@rook> Subject: Re: [gentoo-dev] [RFC] new vala.eclass From: Alexandre Rostovtsev To: gentoo-dev@lists.gentoo.org Date: Sun, 26 Aug 2012 21:20:38 -0400 In-Reply-To: <1345910966.9829.9.camel@rook> References: <1345910966.9829.9.camel@rook> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4 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 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Archives-Salt: e617f283-5d23-4a5e-9b44-9cacd95b0772 X-Archives-Hash: 994ca5c16e41a45eb65316c3b2eb0dde Second update, incorporating suggestions by Ulrich and Duncan. # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # @ECLASS: vala.eclass # @MAINTAINER: # gnome@gentoo.org # @AUTHOR: # Alexandre Rostovtsev # @BLURB: Sets up the environment for using a specific version of vala. # @DESCRIPTION: # This eclass sets up commonly used environment variables for using a specific # version of dev-lang/vala to configure and build a package. It is needed for # packages whose build systems assume the existence of certain unversioned vala # executables, pkgconfig files, etc., which Gentoo does not provide. # # This eclass provides one phase function: pkg_setup. inherit multilib EXPORT_FUNCTIONS pkg_setup # @ECLASS-VARIABLE: VALA_API_VERSION # @DEFAULT_UNSET # @DESCRIPTION: # Vala API version (e.g. 0.16). # @FUNCTION: vala_pkg_setup # @DESCRIPTION: # Sets up the environment variables and pkgconfig files for $VALA_API_VERSION. vala_pkg_setup() { local p d valafoo [[ ${VALA_API_VERSION} ]] || die "VALA_API_VERSION not set" valafoo=$(type -P valac-${VALA_API_VERSION}) [[ ${valafoo} ]] && export VALAC="${valafoo}" valafoo=$(type -P vala-${VALA_API_VERSION}) [[ ${valafoo} ]] && export VALA="${valafoo}" valafoo=$(type -P vala-gen-introspect-${VALA_API_VERSION}) [[ ${valafoo} ]] && export VALA_GEN_INTROSPECT="${valafoo}" valafoo=$(type -P vapigen-${VALA_API_VERSION}) [[ ${valafoo} ]] && export VAPIGEN="${valafoo}" valafoo="${EPREFIX}/usr/share/vala/Makefile.vapigen" [[ -e ${valafoo} ]] && export VAPIGEN_MAKEFILE="${valafoo}" export VAPIGEN_VAPIDIR="${EPREFIX}/usr/share/vala/vapi" mkdir -p "${T}/pkgconfig" || die "mkdir failed" for p in libvala vapigen; do for d in "${EPREFIX}/usr/$(get_libdir)/pkgconfig" "${EPREFIX}/usr/share/pkgconfig"; do if [[ -e ${d}/${p}-${VALA_API_VERSION}.pc ]]; then ln -s "${d}/${p}-${VALA_API_VERSION}.pc" "${T}/pkgconfig/${p}.pc" || die "ln failed" break fi done done : ${PKG_CONFIG_PATH:="${EPREFIX}/usr/$(get_libdir)/pkgconfig:${EPREFIX}/usr/share/pkgconfig"} export PKG_CONFIG_PATH="${T}/pkgconfig:${PKG_CONFIG_PATH}" }