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 311A4138010 for ; Mon, 27 Aug 2012 13:23:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1B1DEE035C; Mon, 27 Aug 2012 13:22:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id DE4D8E0329 for ; Mon, 27 Aug 2012 13:21:50 +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 2C22C33D878 for ; Mon, 27 Aug 2012 13:21:50 +0000 (UTC) Message-ID: <1346073707.9829.124.camel@rook> Subject: Re: [gentoo-dev] [RFC] new vala.eclass From: Alexandre Rostovtsev To: gentoo-dev@lists.gentoo.org Date: Mon, 27 Aug 2012 09:21:47 -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: f72c1c6b-c24f-414f-8d9c-bd20baa0d8e2 X-Archives-Hash: a1e4ba901de6b622b57bae12de7c88d7 Third update; Alexis made a convincing argument that vala_pkg_setup should be changed to vala_src_prepare. # 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: src_prepare. inherit multilib case "${EAPI:-0}" in 0|1) ;; *) EXPORT_FUNCTIONS src_prepare ;; esac # @ECLASS-VARIABLE: VALA_API_VERSION # @DEFAULT_UNSET # @DESCRIPTION: # Vala API version (e.g. 0.16). # @FUNCTION: vala_src_prepare # @DESCRIPTION: # Sets up the environment variables and pkgconfig files for $VALA_API_VERSION. vala_src_prepare() { 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}" }