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 57F20138010 for ; Sat, 25 Aug 2012 16:10:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 95E7FE058E; Sat, 25 Aug 2012 16:10:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E69D1E0531 for ; Sat, 25 Aug 2012 16:09:30 +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 BC68633D721 for ; Sat, 25 Aug 2012 16:09:28 +0000 (UTC) Message-ID: <1345910966.9829.9.camel@rook> Subject: [gentoo-dev] [RFC] new vala.eclass From: Alexandre Rostovtsev To: gentoo-dev@lists.gentoo.org Date: Sat, 25 Aug 2012 12:09:26 -0400 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: c4a533a2-f44f-4c08-aa46-5afa38979674 X-Archives-Hash: 019efecab373d593d29bab7abfa5d2b9 Here's a proposed new eclass to make it less painful to build vala bindings in the new, vala-0.18.x, vapigen.m4-using era. See https://bugzilla.gnome.org/show_bug.cgi?id=682202 for why messing around with PKG_CONFIG_PATH is unfortunately needed for vapigen.m4-using packages from gnome-3.6 such as librsvg-2.36.2, networkmanager-0.9.6.0, libsecret-0.9.x, libgnome-keyring-3.6.x, accountsservice-0.6.24, etc. # 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 case "${EAPI:-0}" in 0|1|2) die "EAPI=${EAPI} is not supported" ;; *) EXPORT_FUNCTIONS pkg_setup ;; esac # @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() { if [[ -z "${VALA_API_VERSION}" ]]; then die "VALA_API_VERSION not set" fi 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-${VALA_API_VERSION}/Makefile.vapigen" export VAPIGEN_VAPIDIR="${EPREFIX}/usr/share/vala/vapi" if ! [[ -d "${T}/pkgconfig" ]]; then mkdir "${T}/pkgconfig" || die "mkdir failed" fi local p for p in libvala vapigen; do local d 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}" }