Gentoo Archives: gentoo-dev

From: Alexandre Rostovtsev <tetromino@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] new vala.eclass
Date: Sat, 25 Aug 2012 21:06:05
Message-Id: 1345928676.9829.13.camel@rook
In Reply to: [gentoo-dev] [RFC] new vala.eclass by Alexandre Rostovtsev
1 Updated version, incorporating suggestions by Tomáš and Diego, and
2 fixing VAPIGEN_MAKEFILE to work with dev-lang/vala-common.
3
4 # Copyright 1999-2012 Gentoo Foundation
5 # Distributed under the terms of the GNU General Public License v2
6 # $Header: $
7
8 # @ECLASS: vala.eclass
9 # @MAINTAINER:
10 # gnome@g.o
11 # @AUTHOR:
12 # Alexandre Rostovtsev <tetromino@g.o>
13 # @BLURB: Sets up the environment for using a specific version of vala.
14 # @DESCRIPTION:
15 # This eclass sets up commonly used environment variables for using a specific
16 # version of dev-lang/vala to configure and build a package. It is needed for
17 # packages whose build systems assume the existence of certain unversioned vala
18 # executables, pkgconfig files, etc., which Gentoo does not provide.
19 #
20 # This eclass provides one phase function: pkg_setup.
21
22 inherit multilib
23
24 EXPORT_FUNCTIONS pkg_setup
25
26 # @ECLASS-VARIABLE: VALA_API_VERSION
27 # @DEFAULT_UNSET
28 # @DESCRIPTION:
29 # Vala API version (e.g. 0.16).
30
31 # @FUNCTION: vala_pkg_setup
32 # @DESCRIPTION:
33 # Sets up the environment variables and pkgconfig files for $VALA_API_VERSION.
34 vala_pkg_setup() {
35 local p d
36
37 [[ -n "${VALA_API_VERSION}" ]] || die "VALA_API_VERSION not set"
38
39 export VALAC=$(type -P valac-${VALA_API_VERSION})
40 export VALA=$(type -P vala-${VALA_API_VERSION})
41 export VALA_GEN_INTROSPECT=$(type -P vala-gen-introspect-${VALA_API_VERSION})
42 export VAPIGEN="$(type -P vapigen-${VALA_API_VERSION})"
43 export VAPIGEN_MAKEFILE="${EPREFIX}/usr/share/vala/Makefile.vapigen"
44 export VAPIGEN_VAPIDIR="${EPREFIX}/usr/share/vala/vapi"
45
46 mkdir -p "${T}/pkgconfig" || die "mkdir failed"
47 for p in libvala vapigen; do
48 for d in "${EPREFIX}/usr/$(get_libdir)/pkgconfig" "${EPREFIX}/usr/share/pkgconfig"; do
49 if [[ -e "${d}/${p}-${VALA_API_VERSION}.pc" ]]; then
50 ln -s "${d}/${p}-${VALA_API_VERSION}.pc" "${T}/pkgconfig/${p}.pc" || die "ln failed"
51 break
52 fi
53 done
54 done
55 : ${PKG_CONFIG_PATH:="${EPREFIX}/usr/$(get_libdir)/pkgconfig:${EPREFIX}/usr/share/pkgconfig"}
56 export PKG_CONFIG_PATH="${T}/pkgconfig:${PKG_CONFIG_PATH}"
57 }

Replies

Subject Author
Re: [gentoo-dev] [RFC] new vala.eclass Ulrich Mueller <ulm@g.o>
[gentoo-dev] Re: [RFC] new vala.eclass Duncan <1i5t5.duncan@×××.net>