toolchain.eclass: fix ada build with lto
[gentoo.git] / eclass / gnome.org.eclass
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: gnome.org.eclass
5 # @MAINTAINER:
6 # gnome@gentoo.org
7 # @AUTHOR:
8 # Authors: Spidler <spidler@gentoo.org> with help of carparski.
9 # eclass variable additions and documentation: Gilles Dartiguelongue <eva@gentoo.org>
10 # @BLURB: Helper eclass for gnome.org hosted archives
11 # @DESCRIPTION:
12 # Provide a default SRC_URI for tarball hosted on gnome.org mirrors.
13
14 # versionator inherit kept for older EAPIs due to ebuilds (potentially) relying on it
15 [[ ${EAPI} == [0123456] ]] && inherit eapi7-ver versionator
16
17 # @ECLASS-VARIABLE: GNOME_TARBALL_SUFFIX
18 # @DESCRIPTION:
19 # Most projects hosted on gnome.org mirrors provide tarballs as tar.bz2 or
20 # tar.xz. This eclass defaults to bz2 for EAPI 0, 1, 2, 3 and defaults to xz for
21 # everything else. This is because the gnome mirrors are moving to only have xz
22 # tarballs for new releases.
23 if has "${EAPI:-0}" 0 1 2 3; then
24         : ${GNOME_TARBALL_SUFFIX:="bz2"}
25 else
26         : ${GNOME_TARBALL_SUFFIX:="xz"}
27 fi
28
29 # Even though xz-utils are in @system, they must still be added to DEPEND; see
30 # https://archives.gentoo.org/gentoo-dev/msg_a0d4833eb314d1be5d5802a3b710e0a4.xml
31 if [[ ${GNOME_TARBALL_SUFFIX} == "xz" ]]; then
32         if [[ ${EAPI:-0} != [0123456] ]]; then
33                 BDEPEND="app-arch/xz-utils"
34         else
35                 DEPEND="app-arch/xz-utils"
36         fi
37 fi
38
39 # @ECLASS-VARIABLE: GNOME_ORG_MODULE
40 # @DESCRIPTION:
41 # Name of the module as hosted on gnome.org mirrors.
42 # Leave unset if package name matches module name.
43 : ${GNOME_ORG_MODULE:=$PN}
44
45 # @ECLASS-VARIABLE: GNOME_ORG_PVP
46 # @INTERNAL
47 # @DESCRIPTION:
48 # Major and minor numbers of the version number.
49 : ${GNOME_ORG_PVP:=$(ver_cut 1-2)}
50
51 SRC_URI="mirror://gnome/sources/${GNOME_ORG_MODULE}/${GNOME_ORG_PVP}/${GNOME_ORG_MODULE}-${PV}.tar.${GNOME_TARBALL_SUFFIX}"
52
53 S="${WORKDIR}/${GNOME_ORG_MODULE}-${PV}"