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 C3858138010 for ; Sat, 25 Aug 2012 21:06:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C30D3E068E; Sat, 25 Aug 2012 21:05:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 503B7E05E8 for ; Sat, 25 Aug 2012 21:04:40 +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 4098333D898 for ; Sat, 25 Aug 2012 21:04:39 +0000 (UTC) Message-ID: <1345928676.9829.13.camel@rook> Subject: Re: [gentoo-dev] [RFC] new vala.eclass From: Alexandre Rostovtsev To: gentoo-dev@lists.gentoo.org Date: Sat, 25 Aug 2012 17:04:36 -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: 8bit X-Archives-Salt: 0d3f0a1a-3db8-4528-8594-6c65d2b0e3be X-Archives-Hash: a4d89cf44d0499d2eca2624e243d91cf Updated version, incorporating suggestions by Tomáš and Diego, and fixing VAPIGEN_MAKEFILE to work with dev-lang/vala-common. # 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 [[ -n "${VALA_API_VERSION}" ]] || die "VALA_API_VERSION not set" export VALAC=$(type -P valac-${VALA_API_VERSION}) export VALA=$(type -P vala-${VALA_API_VERSION}) export VALA_GEN_INTROSPECT=$(type -P vala-gen-introspect-${VALA_API_VERSION}) export VAPIGEN="$(type -P vapigen-${VALA_API_VERSION})" export VAPIGEN_MAKEFILE="${EPREFIX}/usr/share/vala/Makefile.vapigen" 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}" }