Skip to content
Commits on Source (2)
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI="8"
inherit acct-group
......
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI="8"
inherit acct-user
......
......@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="7"
EAPI="8"
GCONF_DEBUG="no"
VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.50}
......@@ -30,5 +30,5 @@ DEPEND="${RDEPEND}
"
src_prepare() {
vala_src_prepare
vala_setup
}
# Copyright 2017 Canek Peláez
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI="8"
VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.50}
VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.56}
......@@ -28,7 +28,7 @@ DEPEND="${RDEPEND}
src_prepare() {
default
vala_src_prepare
vala_setup
}
src_configure() {
......
# Copyright 2013 Canek Peláez
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI="8"
VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.50}
VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.56}
......@@ -30,7 +30,7 @@ DEPEND="
src_prepare() {
default
vala_src_prepare
vala_setup
}
src_configure() {
......
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI="8"
PYTHON_COMPAT=( python3_9 python3_10 python3_11 )
......
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI="8"
PYTHON_COMPAT=( python3_9 python3_10 python3_11 )
......
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnome-meson.eclass
# @MAINTAINER:
# gnome@gentoo.org
# @BLURB: Provides phases for Gnome/Gtk+ based packages that use meosn.
# @DESCRIPTION:
# Exports portage base functions used by ebuilds written for packages using the
# GNOME framework and meson. For additional functions, see gnome2-utils.eclass.
inherit eutils gnome.org gnome2-utils meson xdg
case "${EAPI:-0}" in
6)
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
# @ECLASS-VARIABLE: GNOME-MESON_ECLASS_GIO_MODULES
# @INTERNAL
# @DESCRIPTION:
# Array containing glib GIO modules
# @FUNCTION: gnome-meson_src_prepare
# @DESCRIPTION:
# Prepare environment for build, fix build of scrollkeeper documentation,
# run elibtoolize.
gnome-meson_src_prepare() {
# FIXME add gtk-doc stuff if needed
xdg_src_prepare
# Prevent assorted access violations and test failures
gnome2_environment_reset
}
# @FUNCTION: gnome-meson_src_configure
# @DESCRIPTION:
# Gnome specific configure handling
gnome-meson_src_configure() {
# Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
addpredict "$(unset HOME; echo ~)/.gnome2"
#FIXME are these valid/needed
# "-Dgtk-doc=no"
# "-Dmaintainer-mode=no"
# "-Dschemas-install=no"
# "-Dupdate-mimedb=no"
# "-Dcompile-warnings=minimum"
local emesonargs=(
"$@"
)
meson_src_configure
}
# @FUNCTION: gnome-meson_src_compile
# @DESCRIPTION:
# Only default src_compile for now
gnome-meson_src_compile() {
meson_src_compile
}
# @FUNCTION: gnome-meson_src_install
# @DESCRIPTION:
# Gnome specific install. Handles typical GConf and scrollkeeper setup
# in packages and removal of .la files if requested
gnome-meson_src_install() {
# install docs
default
# files that are really common in gnome packages (bug #573390)
local d
for d in HACKING MAINTAINERS; do
[[ -s "${d}" ]] && dodoc "${d}"
done
# Make sure this one doesn't get in the portage db
rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
# Delete all .la files
case "${GNOME2_LA_PUNT}" in
yes) prune_libtool_files --modules;;
no) ;;
*) prune_libtool_files;;
esac
meson_src_install
}
# @FUNCTION: gnome-meson_pkg_preinst
# @DESCRIPTION:
# Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst
gnome-meson_pkg_preinst() {
xdg_pkg_preinst
gnome2_gconf_savelist
gnome2_icon_savelist
gnome2_schemas_savelist
gnome2_scrollkeeper_savelist
gnome2_gdk_pixbuf_savelist
local f
GNOME2_ECLASS_GIO_MODULES=()
while IFS= read -r -d '' f; do
GNOME2_ECLASS_GIO_MODULES+=( ${f} )
done < <(cd "${D}" && find usr/$(get_libdir)/gio/modules -type f -print0 2>/dev/null)
export GNOME2_ECLASS_GIO_MODULES
}
# @FUNCTION: gnome-meson_pkg_postinst
# @DESCRIPTION:
# Handle scrollkeeper, GConf, GSettings, Icons, desktop and mime
# database updates.
gnome-meson_pkg_postinst() {
xdg_pkg_postinst
gnome2_gconf_install
if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
gnome2_icon_cache_update
fi
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
gnome2_scrollkeeper_update
gnome2_gdk_pixbuf_update
if [[ ${#GNOME2_ECLASS_GIO_MODULES[@]} -gt 0 ]]; then
gnome2_giomodule_cache_update
fi
# This should only be in the overlay
ewarn "**************************************************************"
ewarn "This is the *experimental* Gentoo GNOME Overlay"
ewarn "Please report bugs at #gentoo-desktop @ FreeNode"
ewarn "Do NOT go to upstream with bugs without checking with us first"
ewarn "**************************************************************"
}
# # FIXME Handle GConf schemas removal
#gnome2_pkg_prerm() {
# gnome2_gconf_uninstall
#}
# @FUNCTION: gnome-meson_pkg_postrm
# @DESCRIPTION:
# GSettings, Icons, desktop and mime database updates.
gnome-meson_pkg_postrm() {
xdg_pkg_postrm
if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
gnome2_icon_cache_update
fi
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
if [[ ${#GNOME2_ECLASS_GIO_MODULES[@]} -gt 0 ]]; then
gnome2_giomodule_cache_update
fi
}
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnome2-live.eclass
# @MAINTAINER:
# gnome@gentoo.org
# @AUTHOR:
# Nirbheek Chauhan <nirbheek@gentoo.org>
# @BLURB: Live ebuild phases for GNOME packages
# @DESCRIPTION:
# Exports additional functions used by live ebuilds written for GNOME packages
# Always to be imported *AFTER* gnome2.eclass
inherit autotools eutils gnome2 gnome2-utils libtool git-r3 xdg
EXPORTED_FUNCTIONS=" "
case "${EAPI:-0}" in
4|5)
EXPORT_FUNCTIONS src_unpack src_prepare pkg_postinst
;;
6)
EXPORT_FUNCTIONS src_prepare pkg_postinst
;;
*)
die "Unknown EAPI, Bug eclass maintainers." ;;
esac
# DEPEND on
# app-text/gnome-doc-utils for gnome-doc-*
# dev-util/gtk-doc for gtkdocize
# dev-util/intltool for intltoolize
# gnome-base/gnome-common for GNOME_COMMON_INIT
DEPEND="${DEPEND}
app-text/gnome-doc-utils
app-text/yelp-tools
dev-util/gtk-doc
dev-util/intltool
gnome-base/gnome-common
sys-devel/gettext"
# Extra options passed to elibtoolize
ELTCONF=${ELTCONF:-}
# @ECLASS-VARIABLE: GNOME_LIVE_MODULE
# @DESCRIPTION:
# Default git module name is assumed to be the same as the gnome.org module name
# used on ftp.gnome.org. We have GNOME_ORG_MODULE because we inherit gnome.org
: ${GNOME_LIVE_MODULE:="${GNOME_ORG_MODULE}"}
# @ECLASS-VARIABLE: EGIT_REPO_URI
# @DESCRIPTION:
# git URI for the project, uses GNOME_LIVE_MODULE by default
: "${EGIT_REPO_URI:="https://gitlab.gnome.org/GNOME/${GNOME_LIVE_MODULE}.git"}"
# @ECLASS-VARIABLE: PATCHES
# @DESCRIPTION:
# Whitespace-separated list of patches to apply after cloning
: ${PATCHES:=""}
# Unset SRC_URI auto-set by gnome2.eclass
SRC_URI=""
# @FUNCTION: gnome2-live_get_var
# @DESCRIPTION:
# Get macro variable values from configure.ac, etc
gnome2-live_get_var() {
local var f
var="$1"
f="$2"
echo $(sed -ne "s/${var}(\(.*\))/\1/p" "${f}" | tr -d '[]')
}
# @FUNCTION: gnome2-live_src_unpack
# @DESCRIPTION:
# Calls git-2_src_unpack, and unpacks ${A} if required.
# Also calls gnome2-live_src_prepare for older EAPI.
gnome2-live_src_unpack() {
if has ${EAPI:-0} 4 5 ; then
if test -n "${A}"; then
unpack ${A}
fi
git-r3_src_unpack
gnome2-live_src_prepare
else
die "gnome2-live_src_unpack is banned starting with EAPI=6"
fi
}
# @FUNCTION: gnome2-live_src_prepare
# @DESCRIPTION:
# Lots of magic to workaround autogen.sh quirks in various packages
# Creates blank ChangeLog and necessary macro dirs. Runs various autotools
# programs if required, and finally runs eautoreconf.
gnome2-live_src_prepare() {
if has ${EAPI:-0} 4 5 ; then
for i in ${PATCHES}; do
epatch "${i}"
done
epatch_user
fi
# If ChangeLog doesn't exist, maybe it's autogenerated
# Avoid a `dodoc` failure by adding an empty ChangeLog
if ! test -e ChangeLog; then
echo > ChangeLog
fi
### Keep this in-sync with gnome2.eclass!
xdg_src_prepare
# eautoreconf is smart enough to run all necessary commands
eautoreconf
# Prevent assorted access violations and test failures
gnome2_environment_reset
# Prevent scrollkeeper access violations
# We stop to run it from EAPI=6 as scrollkeeper helpers from
# rarian are not running anything and, then, access violations
# shouldn't occur.
has ${EAPI:-0} 4 5 && gnome2_omf_fix
# Run libtoolize
# https://bugzilla.gnome.org/show_bug.cgi?id=655517
elibtoolize ${ELTCONF}
}
# @FUNCTION: gnome2_src_unpack
# @DESCRIPTION:
# Defined so that it replaces gnome2_src_unpack in ebuilds that call it
gnome2_src_unpack() {
gnome2-live_src_unpack
}
# @FUNCTION: gnome2_src_prepare
# @DESCRIPTION:
# Defined so that it replaces gnome2_src_prepare in ebuilds that call it
gnome2_src_prepare() {
gnome2-live_src_prepare
}
# @FUNCTION: gnome2-live_pkg_postinst
# @DESCRIPTION:
# Must be run manually for ebuilds that have a custom pkg_postinst
gnome2-live_pkg_postinst() {
gnome2_pkg_postinst
ewarn "This is a live ebuild, upstream trunks will mostly be UNstable"
ewarn "Do NOT report bugs about this package to Gentoo"
ewarn "Report upstream bugs (with patches if possible) instead."
}
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnome2-python.eclass
# @MAINTAINER:
# Gentoo GNOME Project <gnome@gentoo.org>
# Gentoo Python Project <python@gentoo.org>
# @BLURB: Eclass for GNOME Python packages supporting installation for multiple Python ABIs
# @DESCRIPTION:
# The gnome2-python eclass defines phase functions for GNOME Python packages supporting
# installation for multiple Python ABIs.
inherit gnome2 python
# Stolen from git.eclass
EXPORTED_FUNCTIONS="pkg_setup src_compile src_test src_install"
case "${EAPI:-0}" in
2|3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;;
0|1) ;;
*) die "Unknown EAPI, bug eclass maintainers." ;;
esac
EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
gnome2-python_pkg_setup() {
python_pkg_setup
}
gnome2-python_src_prepare() {
gnome2_src_prepare
python_clean_py-compile_files
python_copy_sources
}
gnome2-python_src_configure() {
configure() {
gnome2_src_configure PYTHON=$(PYTHON -a) "$@"
}
python_execute_function -s configure
}
gnome2-python_src_compile() {
python_execute_function -s gnome2_src_compile "$@"
}
gnome2-python_src_test() {
python_execute_function -s -d
}
gnome2-python_src_install() {
python_execute_function -s gnome2_src_install
python_clean_installation_image
}
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnome2-utils.eclass
# @MAINTAINER:
# gnome@gentoo.org
# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
# @BLURB: Auxiliary functions commonly used by Gnome packages.
# @DESCRIPTION:
# This eclass provides a set of auxiliary functions needed by most Gnome
# packages. It may be used by non-Gnome packages as needed for handling various
# Gnome stack related functions such as:
# * GSettings schemas management
# * GConf schemas management
# * scrollkeeper (old Gnome help system) management
[[ ${EAPI:-0} == [012345] ]] && inherit multilib
# eutils.eclass: emktemp
# xdg-utils.eclass: xdg_environment_reset, xdg_icon_cache_update
inherit eutils xdg-utils
case "${EAPI:-0}" in
0|1|2|3|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
# @ECLASS-VARIABLE: GCONFTOOL_BIN
# @INTERNAL
# @DESCRIPTION:
# Path to gconftool-2
: ${GCONFTOOL_BIN:="/usr/bin/gconftool-2"}
# @ECLASS-VARIABLE: SCROLLKEEPER_DIR
# @INTERNAL
# @DESCRIPTION:
# Directory where scrollkeeper-update should do its work
: ${SCROLLKEEPER_DIR:="/var/lib/scrollkeeper"}
# @ECLASS-VARIABLE: SCROLLKEEPER_UPDATE_BIN
# @INTERNAL
# @DESCRIPTION:
# Path to scrollkeeper-update
: ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
# @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
# @INTERNAL
# @DESCRIPTION:
# Path to glib-compile-schemas
: ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}
# @ECLASS-VARIABLE: GNOME2_ECLASS_SCHEMAS
# @INTERNAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of GConf schemas provided by the package
# @ECLASS-VARIABLE: GNOME2_ECLASS_ICONS
# @INTERNAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of icons provided by the package
# @ECLASS-VARIABLE: GNOME2_ECLASS_SCROLLS
# @INTERNAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of scrolls (documentation files) provided by the package
# @ECLASS-VARIABLE: GNOME2_ECLASS_GLIB_SCHEMAS
# @INTERNAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of GSettings schemas provided by the package
# @ECLASS-VARIABLE: GNOME2_ECLASS_GDK_PIXBUF_LOADERS
# @INTERNAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of gdk-pixbuf loaders provided by the package
# @FUNCTION: gnome2_environment_reset
# @DESCRIPTION:
# Reset various variables inherited from root's evironment to a reasonable
# default for ebuilds to help avoid access violations and test failures.
gnome2_environment_reset() {
xdg_environment_reset
# Respected by >=glib-2.30.1-r1
export G_HOME="${T}"
# GST_REGISTRY is to work around gst utilities trying to read/write /root
export GST_REGISTRY="${T}/registry.xml"
# Ensure we don't rely on dconf/gconf while building, bug #511946
export GSETTINGS_BACKEND="memory"
if has ${EAPI:-0} 6 7; then
# Try to cover the packages honoring this variable, bug #508124
export GST_INSPECT="$(type -P true)"
# Stop relying on random DISPLAY variable values, bug #534312
unset DISPLAY
fi
}
# @FUNCTION: gnome2_gconf_savelist
# @DESCRIPTION:
# Find the GConf schemas that are about to be installed and save their location
# in the GNOME2_ECLASS_SCHEMAS environment variable.
# This function should be called from pkg_preinst.
gnome2_gconf_savelist() {
has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null)
popd > /dev/null || die
}
# @FUNCTION: gnome2_gconf_install
# @DESCRIPTION:
# Applies any schema files installed by the current ebuild to Gconf's database
# using gconftool-2.
# This function should be called from pkg_postinst.
gnome2_gconf_install() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GCONFTOOL_BIN}"
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
return
fi
if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
debug-print "No GNOME 2 GConf schemas found"
return
fi
# We are ready to install the GCONF Scheme now
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT%/}/;")"
einfo "Installing GNOME 2 GConf schemas"
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
if [[ -e "${EROOT%/}/${F}" ]]; then
debug-print "Installing schema: ${F}"
"${updater}" --makefile-install-rule "${EROOT%/}/${F}" 1>/dev/null
fi
done
# have gconf reload the new schemas
pids=$(pgrep -x gconfd-2)
if [[ $? == 0 ]] ; then
ebegin "Reloading GConf schemas"
kill -HUP ${pids}
eend $?
fi
}
# @FUNCTION: gnome2_gconf_uninstall
# @DESCRIPTION:
# Removes schema files previously installed by the current ebuild from Gconf's
# database.
gnome2_gconf_uninstall() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GCONFTOOL_BIN}"
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
return
fi
if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
debug-print "No GNOME 2 GConf schemas found"
return
fi
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT%/}/;")"
einfo "Uninstalling GNOME 2 GConf schemas"
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
if [[ -e "${EROOT%/}/${F}" ]]; then
debug-print "Uninstalling gconf schema: ${F}"
"${updater}" --makefile-uninstall-rule "${EROOT%/}/${F}" 1>/dev/null
fi
done
# have gconf reload the new schemas
pids=$(pgrep -x gconfd-2)
if [[ $? == 0 ]] ; then
ebegin "Reloading GConf schemas"
kill -HUP ${pids}
eend $?
fi
}
# @FUNCTION: gnome2_omf_fix
# @DESCRIPTION:
# Workaround applied to Makefile rules in order to remove redundant
# calls to scrollkeeper-update and sandbox violations.
# This function should be called from src_prepare.
gnome2_omf_fix() {
local omf_makefiles filename
omf_makefiles="$@"
if [[ -f ${S}/omf.make ]] ; then
omf_makefiles="${omf_makefiles} ${S}/omf.make"
fi
if [[ -f ${S}/gnome-doc-utils.make ]] ; then
omf_makefiles="${omf_makefiles} ${S}/gnome-doc-utils.make"
fi
# testing fixing of all makefiles found
# The sort is important to ensure .am is listed before the respective .in for
# maintainer mode regeneration not kicking in due to .am being newer than .in
for filename in $(find "${S}" -name "Makefile.in" -o -name "Makefile.am" |sort) ; do
omf_makefiles="${omf_makefiles} ${filename}"
done
ebegin "Fixing OMF Makefiles"
local retval=0
local fails=( )
for omf in ${omf_makefiles} ; do
sed -i -e 's:scrollkeeper-update:true:' "${omf}"
retval=$?
if [[ $retval -ne 0 ]] ; then
debug-print "updating of ${omf} failed"
# Add to the list of failures
fails[$(( ${#fails[@]} + 1 ))]=$omf
retval=2
fi
done
eend $retval
for f in "${fails[@]}" ; do
eerror "Failed to update OMF Makefile $f"
done
}
# @FUNCTION: gnome2_scrollkeeper_savelist
# @DESCRIPTION:
# Find the scrolls that are about to be installed and save their location
# in the GNOME2_ECLASS_SCROLLS environment variable.
# This function should be called from pkg_preinst.
gnome2_scrollkeeper_savelist() {
has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCROLLS=$(find 'usr/share/omf' -type f -name "*.omf" 2> /dev/null)
popd > /dev/null || die
}
# @FUNCTION: gnome2_scrollkeeper_update
# @DESCRIPTION:
# Updates the global scrollkeeper database.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_scrollkeeper_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
if [[ ! -x "${updater}" ]] ; then
debug-print "${updater} is not executable"
return
fi
if [[ -z "${GNOME2_ECLASS_SCROLLS}" ]]; then
debug-print "No scroll cache to update"
return
fi
ebegin "Updating scrollkeeper database ..."
"${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
eend $?
}
# @FUNCTION: gnome2_schemas_savelist
# @DESCRIPTION:
# Find if there is any GSettings schema to install and save the list in
# GNOME2_ECLASS_GLIB_SCHEMAS variable. This is only necessary for eclass
# implementations that call gnome2_schemas_update conditionally.
# This function should be called from pkg_preinst.
gnome2_schemas_savelist() {
has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' -name '*.gschema.xml' 2>/dev/null)
popd > /dev/null || die
}
# @FUNCTION: gnome2_schemas_update
# @DESCRIPTION:
# Updates GSettings schemas.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_schemas_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
if [[ ! -x ${updater} ]]; then
debug-print "${updater} is not executable"
return
fi
ebegin "Updating GSettings schemas"
${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null
eend $?
}
# @FUNCTION: gnome2_gdk_pixbuf_savelist
# @DESCRIPTION:
# Find if there is any gdk-pixbuf loader to install and save the list in
# GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
# This function should be called from pkg_preinst.
gnome2_gdk_pixbuf_savelist() {
has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find usr/lib*/gdk-pixbuf-2.0 -type f 2>/dev/null)
popd > /dev/null || die
}
# @FUNCTION: gnome2_gdk_pixbuf_update
# @DESCRIPTION:
# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_gdk_pixbuf_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
if [[ ! -x ${updater} ]]; then
updater="${EROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
fi
if [[ ! -x ${updater} ]]; then
debug-print "${updater} is not executable"
return
fi
if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
debug-print "gdk-pixbuf loader cache does not need an update"
return
fi
ebegin "Updating gdk-pixbuf loader cache"
local tmp_file=$(emktemp)
${updater} 1> "${tmp_file}" &&
chmod 0644 "${tmp_file}" &&
cp -f "${tmp_file}" "${EROOT%/}/usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
rm "${tmp_file}" # don't replace this with mv, required for SELinux support
eend $?
}
# @FUNCTION: gnome2_query_immodules_gtk2
# @DESCRIPTION:
# Updates gtk2 immodules/gdk-pixbuf loaders listing.
gnome2_query_immodules_gtk2() {
local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-2.0
[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
ebegin "Updating gtk2 input method module cache"
GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
"${updater}" --update-cache
eend $?
}
# @FUNCTION: gnome2_query_immodules_gtk3
# @DESCRIPTION:
# Updates gtk3 immodules/gdk-pixbuf loaders listing.
gnome2_query_immodules_gtk3() {
local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-3.0
[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
ebegin "Updating gtk3 input method module cache"
GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
"${updater}" --update-cache
eend $?
}
# @FUNCTION: gnome2_giomodule_cache_update
# @DESCRIPTION:
# Updates glib's gio modules cache.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_giomodule_cache_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}/usr/bin/${CHOST}-gio-querymodules"
if [[ ! -x ${updater} ]]; then
updater="${EROOT%/}/usr/bin/gio-querymodules"
fi
if [[ ! -x ${updater} ]]; then
debug-print "${updater} is not executable"
return
fi
ebegin "Updating GIO modules cache"
${updater} "${EROOT%/}"/usr/$(get_libdir)/gio/modules
eend $?
}
# @FUNCTION: gnome2_disable_deprecation_warning
# @DESCRIPTION:
# Disable deprecation warnings commonly found in glib based packages.
# Should be called from src_prepare.
gnome2_disable_deprecation_warning() {
local retval=0
local fails=( )
local makefile
ebegin "Disabling deprecation warnings"
# The sort is important to ensure .am is listed before the respective .in for
# maintainer mode regeneration not kicking in due to .am being newer than .in
while read makefile ; do
if ! grep -qE "(DISABLE_DEPRECATED|GSEAL_ENABLE)" "${makefile}"; then
continue
fi
LC_ALL=C sed -r -i \
-e 's:-D[A-Z_]+_DISABLE_DEPRECATED:$(/bin/true):g' \
-e 's:-DGSEAL_ENABLE(=[A-Za-z0-9_]*)?:$(/bin/true):g' \
-i "${makefile}"
if [[ $? -ne 0 ]]; then
# Add to the list of failures
fails+=( "${makefile}" )
retval=2
fi
done < <(find "${S}" -name "Makefile.in" \
-o -name "Makefile.am" -o -name "Makefile.decl" \
| sort; [[ -f "${S}"/configure ]] && echo configure)
# TODO: sedding configure.ac can trigger maintainer mode; bug #439602
# -o -name "configure.ac" -o -name "configure.in" \
# | sort; echo configure)
eend ${retval}
for makefile in "${fails[@]}" ; do
ewarn "Failed to disable deprecation warnings in ${makefile}"
done
}
case ${EAPI:-0} in
0|1|2|3|4|5|6)
# @FUNCTION: gnome2_icon_savelist
# @DESCRIPTION:
# Find the icons that are about to be installed and save their location
# in the GNOME2_ECLASS_ICONS environment variable. This is only
# necessary for eclass implementations that call
# gnome2_icon_cache_update conditionally.
# This function should be called from pkg_preinst.
gnome2_icon_savelist() {
has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
popd > /dev/null || die
}
# @FUNCTION: gnome2_icon_cache_update
# @DESCRIPTION:
# Updates Gtk+ icon cache files under /usr/share/icons.
# Deprecated. Please use xdg_icon_cache_update from xdg-utils.eclass
gnome2_icon_cache_update() {
xdg_icon_cache_update
}
;;
esac
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnome2.eclass
# @MAINTAINER:
# gnome@gentoo.org
# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: Provides phases for Gnome/Gtk+ based packages.
# @DESCRIPTION:
# Exports portage base functions used by ebuilds written for packages using the
# GNOME framework. For additional functions, see gnome2-utils.eclass.
# @ECLASS-VARIABLE: GNOME2_EAUTORECONF
# @DEFAULT_UNSET
# @DESCRIPTION:
# Run eautoreconf instead of only elibtoolize
GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
[[ ${GNOME2_EAUTORECONF} == 'yes' ]] && inherit autotools
[[ ${EAPI} == [56] ]] && inherit eutils ltprune
inherit libtool gnome.org gnome2-utils xdg
case ${EAPI:-0} in
5)
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
6|7)
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
# @ECLASS-VARIABLE: ELTCONF
# @DEFAULT_UNSET
# @DESCRIPTION:
# Extra options passed to elibtoolize
ELTCONF=${ELTCONF:-""}
# @ECLASS-VARIABLE: G2CONF
# @DEFAULT_UNSET
# @DESCRIPTION:
# Extra configure opts passed to econf.
# Deprecated, pass extra arguments to gnome2_src_configure.
# Banned in eapi6 and newer.
if has ${EAPI} 5; then
G2CONF=${G2CONF:-""}
fi
# @ECLASS-VARIABLE: GCONF_DEBUG
# @DEFAULT_UNSET
# @DESCRIPTION:
# Whether to handle debug or not.
# Some gnome applications support various levels of debugging (yes, no, minimum,
# etc), but using --disable-debug also removes g_assert which makes debugging
# harder. This variable should be set to yes for such packages for the eclass
# to handle it properly. It will enable minimal debug with USE=-debug.
# Note that this is most commonly found in configure.ac as GNOME_DEBUG_CHECK.
#
# Banned since eapi6 as upstream is moving away from this obsolete macro in favor
# of autoconf-archive macros, that do not expose this issue (bug #270919)
if has ${EAPI} 5; then
if [[ ${GCONF_DEBUG} != "no" ]]; then
IUSE="debug"
fi
fi
# @ECLASS-VARIABLE: GNOME2_ECLASS_GIO_MODULES
# @INTERNAL
# @DESCRIPTION:
# Array containing glib GIO modules
# @ECLASS-VARIABLE: GNOME2_LA_PUNT
# @DESCRIPTION:
# In EAPIs 5 and 6, it relies on prune_libtool_files (from ltprune.eclass) for
# this. Later EAPIs use find ... -delete. Available values for GNOME2_LA_PUNT:
# - "no": will not clean any .la files
# - "yes": will run prune_libtool_files --modules
# - If it is not set, it will run prune_libtool_files
GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
# @FUNCTION: gnome2_src_unpack
# @DESCRIPTION:
# Stub function for old EAPI.
gnome2_src_unpack() {
if has ${EAPI} 5; then
unpack ${A}
cd "${S}"
else
die "gnome2_src_unpack is banned since eapi6"
fi
}
# @FUNCTION: gnome2_src_prepare
# @DESCRIPTION:
# Prepare environment for build, fix build of scrollkeeper documentation,
# run elibtoolize.
gnome2_src_prepare() {
xdg_src_prepare
# Prevent assorted access violations and test failures
gnome2_environment_reset
# Prevent scrollkeeper access violations
# We stop to run it from eapi6 as scrollkeeper helpers from
# rarian are not running anything and, then, access violations
# shouldn't occur.
has ${EAPI} 5 && gnome2_omf_fix
# Disable all deprecation warnings
gnome2_disable_deprecation_warning
# Run libtoolize or eautoreconf, bug #591584
# https://bugzilla.gnome.org/show_bug.cgi?id=655517
if [[ ${GNOME2_EAUTORECONF} == 'yes' ]]; then
eautoreconf
else
elibtoolize ${ELTCONF}
fi
}
# @FUNCTION: gnome2_src_configure
# @DESCRIPTION:
# Gnome specific configure handling
gnome2_src_configure() {
# Deprecated for a long time now and banned since eapi6, see Gnome team policies
if [[ -n ${G2CONF} ]] ; then
if has ${EAPI} 5; then
eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
else
die "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
fi
fi
local g2conf=()
if has ${EAPI} 5; then
if [[ ${GCONF_DEBUG} != 'no' ]] ; then
if use debug ; then
g2conf+=( --enable-debug=yes )
fi
fi
else
if [[ -n ${GCONF_DEBUG} ]] ; then
die "GCONF_DEBUG is banned since eapi6 in favor of each ebuild taking care of the proper handling of debug configure option"
fi
fi
# We consider packages installing gtk-doc to be handled by adding
# DEPEND="dev-util/gtk-doc-am" which provides tools to relink URLs in
# documentation to already installed documentation. This decision also
# greatly helps with constantly broken doc generation.
# Remember to drop 'doc' USE flag from your package if it was only used to
# rebuild docs.
if grep -q "enable-gtk-doc" "${ECONF_SOURCE:-.}"/configure ; then
g2conf+=( --disable-gtk-doc )
fi
# Pass --disable-maintainer-mode when needed
if grep -q "^[[:space:]]*AM_MAINTAINER_MODE(\[enable\])" \
"${ECONF_SOURCE:-.}"/configure.*; then
g2conf+=( --disable-maintainer-mode )
fi
# Pass --disable-scrollkeeper when possible
if grep -q "disable-scrollkeeper" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --disable-scrollkeeper )
fi
# Pass --disable-schemas-install when possible
if grep -q "disable-schemas-install" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --disable-schemas-install )
fi
# Pass --disable-schemas-compile when possible
if grep -q "disable-schemas-compile" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --disable-schemas-compile )
fi
# Pass --disable-update-mimedb when possible
if grep -q "disable-update-mimedb" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --disable-update-mimedb )
fi
# Pass --enable-compile-warnings=minimum as we don't want -Werror* flags, bug #471336
if grep -q "enable-compile-warnings" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --enable-compile-warnings=minimum )
fi
# Pass --docdir with proper directory, bug #482646 (not needed since eapi6)
if has ${EAPI} 5; then
if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
fi
fi
# Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
if has ${EAPI} 5; then
addwrite "$(unset HOME; echo ~)/.gnome2"
else
addpredict "$(unset HOME; echo ~)/.gnome2"
fi
if has ${EAPI} 5; then
econf ${g2conf[@]} ${G2CONF} "$@"
else
econf ${g2conf[@]} "$@"
fi
}
# @FUNCTION: gnome2_src_compile
# @DESCRIPTION:
# Only default src_compile for now
gnome2_src_compile() {
if has ${EAPI} 5; then
emake
else
default
fi
}
# @FUNCTION: gnome2_src_install
# @DESCRIPTION:
# Gnome specific install. Handles typical GConf and scrollkeeper setup
# in packages and removal of .la files if requested
gnome2_src_install() {
# we must delay gconf schema installation due to sandbox
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
local sk_tmp_dir="/var/lib/scrollkeeper"
# scrollkeeper-update from rarian doesn't do anything. Then, since eapi6
# we stop taking care of it
#
# if this is not present, scrollkeeper-update may segfault and
# create bogus directories in /var/lib/
if has ${EAPI} 5; then
dodir "${sk_tmp_dir}" || die "dodir failed"
emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
else
default
fi
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
# Handle documentation as 'default' for eapi5, bug #373131
# Since eapi6 this is handled by default on its own plus MAINTAINERS and HACKING
# files that are really common in gnome packages (bug #573390)
if has ${EAPI} 5; then
einstalldocs
else
local d
for d in HACKING MAINTAINERS; do
[[ -s "${d}" ]] && dodoc "${d}"
done
fi
# Do not keep /var/lib/scrollkeeper because:
# 1. The scrollkeeper database is regenerated at pkg_postinst()
# 2. ${ED}/var/lib/scrollkeeper contains only indexes for the current pkg
# thus it makes no sense if pkg_postinst ISN'T run for some reason.
rm -rf "${ED}${sk_tmp_dir}"
rmdir "${ED}/var/lib" 2>/dev/null
rmdir "${ED}/var" 2>/dev/null
# Make sure this one doesn't get in the portage db
rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
# Delete all .la files
if has ${EAPI} 5 6; then
case "${GNOME2_LA_PUNT}" in
yes) prune_libtool_files --modules;;
no) ;;
*) prune_libtool_files;;
esac
else
if [[ ${GNOME2_LA_PUNT} != 'no' ]]; then
find "${ED}" -name '*.la' -delete || die
fi
fi
}
# @FUNCTION: gnome2_pkg_preinst
# @DESCRIPTION:
# Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst
gnome2_pkg_preinst() {
xdg_pkg_preinst
gnome2_gconf_savelist
gnome2_schemas_savelist
gnome2_scrollkeeper_savelist
gnome2_gdk_pixbuf_savelist
local f
GNOME2_ECLASS_GIO_MODULES=()
while IFS= read -r -d '' f; do
GNOME2_ECLASS_GIO_MODULES+=( ${f} )
done < <(cd "${D}" && find usr/$(get_libdir)/gio/modules -type f -print0 2>/dev/null)
export GNOME2_ECLASS_GIO_MODULES
}
# @FUNCTION: gnome2_pkg_postinst
# @DESCRIPTION:
# Handle scrollkeeper, GConf, GSettings, Icons, desktop and mime
# database updates.
gnome2_pkg_postinst() {
xdg_pkg_postinst
gnome2_gconf_install
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
gnome2_scrollkeeper_update
gnome2_gdk_pixbuf_update
if [[ ${#GNOME2_ECLASS_GIO_MODULES[@]} -gt 0 ]]; then
gnome2_giomodule_cache_update
fi
# This should only be in the overlay
ewarn "**************************************************************"
ewarn "This is the *experimental* Gentoo GNOME Overlay"
ewarn "Please report bugs at #gentoo-desktop @ FreeNode"
ewarn "Do NOT go to upstream with bugs without checking with us first"
ewarn "**************************************************************"
}
# # FIXME Handle GConf schemas removal
#gnome2_pkg_prerm() {
# gnome2_gconf_uninstall
#}
# @FUNCTION: gnome2_pkg_postrm
# @DESCRIPTION:
# Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
gnome2_pkg_postrm() {
xdg_pkg_postrm
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
gnome2_scrollkeeper_update
if [[ ${#GNOME2_ECLASS_GIO_MODULES[@]} -gt 0 ]]; then
gnome2_giomodule_cache_update
fi
}
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: multibuild.eclass
# @MAINTAINER:
# Michał Górny <mgorny@gentoo.org>
# @AUTHOR:
# Author: Michał Górny <mgorny@gentoo.org>
# @SUPPORTED_EAPIS: 4 5 6 7
# @BLURB: A generic eclass for building multiple variants of packages.
# @DESCRIPTION:
# The multibuild eclass aims to provide a generic framework for building
# multiple 'variants' of a package (e.g. multilib, Python
# implementations).
case "${EAPI:-0}" in
0|1|2|3)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
4|5|6|7)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
;;
esac
if [[ ! ${_MULTIBUILD} ]]; then
# @ECLASS-VARIABLE: MULTIBUILD_VARIANTS
# @REQUIRED
# @DESCRIPTION:
# An array specifying all enabled variants which multibuild_foreach*
# can execute the process for.
#
# In ebuild, it can be set in global scope. Eclasses should set it
# locally in function scope to support nesting properly.
#
# Example:
# @CODE
# python_foreach_impl() {
# local MULTIBUILD_VARIANTS=( python{2_5,2_6,2_7} ... )
# multibuild_foreach_variant python_compile
# }
# @CODE
# @ECLASS-VARIABLE: MULTIBUILD_VARIANT
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The current variant which the function was executed for.
#
# Example value:
# @CODE
# python2_6
# @CODE
# @ECLASS-VARIABLE: MULTIBUILD_ID
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The unique identifier for a multibuild run. In a simple run, it is
# equal to MULTIBUILD_VARIANT. In a nested multibuild environment, it
# contains the complete selection tree.
#
# It can be used to create variant-unique directories and files.
#
# Example value:
# @CODE
# amd64-double
# @CODE
# @ECLASS-VARIABLE: BUILD_DIR
# @OUTPUT_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# The current build directory. In global scope, it is supposed
# to contain an 'initial' build directory. If unset, ${S} is used.
#
# multibuild_foreach_variant() sets BUILD_DIR locally
# to variant-specific build directories based on the initial value
# of BUILD_DIR.
#
# Example value:
# @CODE
# ${WORKDIR}/foo-1.3-python2_6
# @CODE
# @FUNCTION: multibuild_foreach_variant
# @USAGE: [<argv>...]
# @DESCRIPTION:
# Run the passed command repeatedly for each of the enabled package
# variants.
#
# Each of the runs will have variant-specific BUILD_DIR set, and output
# teed to a separate log in ${T}.
#
# The function returns 0 if all commands return 0, or the first non-zero
# exit status otherwise. However, it performs all the invocations
# nevertheless. It is preferred to call 'die' inside of the passed
# function.
multibuild_foreach_variant() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${MULTIBUILD_VARIANTS} ]] \
|| die "MULTIBUILD_VARIANTS need to be set"
local bdir=${BUILD_DIR:-${S}}
# Avoid writing outside WORKDIR if S=${WORKDIR}.
[[ ${bdir%%/} == ${WORKDIR%%/} ]] && bdir=${WORKDIR}/build
local prev_id=${MULTIBUILD_ID:+${MULTIBUILD_ID}-}
local ret=0 lret=0 v
debug-print "${FUNCNAME}: initial build_dir = ${bdir}"
for v in "${MULTIBUILD_VARIANTS[@]}"; do
local MULTIBUILD_VARIANT=${v}
local MULTIBUILD_ID=${prev_id}${v}
local BUILD_DIR=${bdir%%/}-${v}
_multibuild_run() {
# find the first non-private command
local i=1
while [[ ${!i} == _* ]]; do
(( i += 1 ))
done
[[ ${i} -le ${#} ]] && einfo "${v}: running ${@:${i}}"
"${@}"
}
_multibuild_run "${@}" \
> >(exec tee -a "${T}/build-${MULTIBUILD_ID}.log") 2>&1
lret=${?}
done
[[ ${ret} -eq 0 && ${lret} -ne 0 ]] && ret=${lret}
return ${ret}
}
# @FUNCTION: multibuild_parallel_foreach_variant
# @USAGE: [<argv>...]
# @DESCRIPTION:
# Run the passed command repeatedly for each of the enabled package
# variants. This used to run the commands in parallel but now it's
# just a deprecated alias to multibuild_foreach_variant.
#
# The function returns 0 if all commands return 0, or the first non-zero
# exit status otherwise. However, it performs all the invocations
# nevertheless. It is preferred to call 'die' inside of the passed
# function.
multibuild_parallel_foreach_variant() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}"
multibuild_foreach_variant "${@}"
}
# @FUNCTION: multibuild_for_best_variant
# @USAGE: [<argv>...]
# @DESCRIPTION:
# Run the passed command once, for the best of the enabled package
# variants.
#
# The run will have a proper, variant-specificBUILD_DIR set, and output
# teed to a separate log in ${T}.
#
# The function returns command exit status.
multibuild_for_best_variant() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${MULTIBUILD_VARIANTS} ]] \
|| die "MULTIBUILD_VARIANTS need to be set"
# bash-4.1 can't handle negative subscripts
local MULTIBUILD_VARIANTS=(
"${MULTIBUILD_VARIANTS[$(( ${#MULTIBUILD_VARIANTS[@]} - 1 ))]}"
)
multibuild_foreach_variant "${@}"
}
# @FUNCTION: multibuild_copy_sources
# @DESCRIPTION:
# Create per-variant copies of source tree. The source tree is assumed
# to be in ${BUILD_DIR}, or ${S} if the former is unset. The copies will
# be placed in directories matching BUILD_DIRs used by
# multibuild_foreach().
multibuild_copy_sources() {
debug-print-function ${FUNCNAME} "${@}"
local _MULTIBUILD_INITIAL_BUILD_DIR=${BUILD_DIR:-${S}}
einfo "Will copy sources from ${_MULTIBUILD_INITIAL_BUILD_DIR}"
local cp_args=()
if cp --reflink=auto --version &>/dev/null; then
# enable reflinking if possible to make this faster
cp_args+=( --reflink=auto )
fi
_multibuild_create_source_copy() {
einfo "${MULTIBUILD_VARIANT}: copying to ${BUILD_DIR}"
cp -p -R "${cp_args[@]}" \
"${_MULTIBUILD_INITIAL_BUILD_DIR}" "${BUILD_DIR}" || die
}
multibuild_foreach_variant _multibuild_create_source_copy
}
# @FUNCTION: run_in_build_dir
# @USAGE: <argv>...
# @DESCRIPTION:
# Run the given command in the directory pointed by BUILD_DIR.
run_in_build_dir() {
debug-print-function ${FUNCNAME} "${@}"
local ret
[[ ${#} -ne 0 ]] || die "${FUNCNAME}: no command specified."
[[ ${BUILD_DIR} ]] || die "${FUNCNAME}: BUILD_DIR not set."
mkdir -p "${BUILD_DIR}" || die
pushd "${BUILD_DIR}" >/dev/null || die
"${@}"
ret=${?}
popd >/dev/null || die
return ${ret}
}
# @FUNCTION: multibuild_merge_root
# @USAGE: <src-root> <dest-root>
# @DESCRIPTION:
# Merge the directory tree (fake root) from <src-root> to <dest-root>
# (the real root). Both directories have to be real, absolute paths
# (i.e. including ${D}). Source root will be removed.
multibuild_merge_root() {
local src=${1}
local dest=${2}
local ret
if use userland_BSD; then
# Most of BSD variants fail to copy broken symlinks, #447370
# also, they do not support --version
tar -C "${src}" -f - -c . \
| tar -x -f - -C "${dest}"
[[ ${PIPESTATUS[*]} == '0 0' ]]
ret=${?}
else
local cp_args=()
if cp -a --version &>/dev/null; then
cp_args+=( -a )
else
cp_args+=( -P -R -p )
fi
if cp --reflink=auto --version &>/dev/null; then
# enable reflinking if possible to make this faster
cp_args+=( --reflink=auto )
fi
cp "${cp_args[@]}" "${src}"/. "${dest}"/
ret=${?}
fi
if [[ ${ret} -ne 0 ]]; then
die "${MULTIBUILD_VARIANT:-(unknown)}: merging image failed."
fi
rm -rf "${src}"
}
_MULTIBUILD=1
fi
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: vala.eclass
# @MAINTAINER:
# gnome@gentoo.org
# @AUTHOR:
# Alexandre Rostovtsev <tetromino@gentoo.org>
# @SUPPORTED_EAPIS: 1 2 3 4 5 6 7
# @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 eutils multilib
case "${EAPI:-0}" in
0) die "EAPI=0 is not supported" ;;
1) ;;
*) EXPORT_FUNCTIONS src_prepare ;;
esac
# @ECLASS-VARIABLE: VALA_MIN_API_VERSION
# @DESCRIPTION:
# Minimum vala API version (e.g. 0.36).
VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.36}
# @ECLASS-VARIABLE: VALA_MAX_API_VERSION
# @DESCRIPTION:
# Maximum vala API version (e.g. 0.36).
VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.50}
# @ECLASS-VARIABLE: VALA_USE_DEPEND
# @DEFAULT_UNSET
# @DESCRIPTION:
# USE dependencies that vala must be built with (e.g. vapigen).
# @FUNCTION: vala_api_versions
# @DESCRIPTION:
# Outputs a list of vala API versions from VALA_MAX_API_VERSION down to
# VALA_MIN_API_VERSION.
vala_api_versions() {
[[ ${VALA_MIN_API_VERSION} =~ ^0\.[[:digit:]]+$ ]] || die "Invalid syntax of VALA_MIN_API_VERSION"
[[ ${VALA_MAX_API_VERSION} =~ ^0\.[[:digit:]]+$ ]] || die "Invalid syntax of VALA_MAX_API_VERSION"
local minimal_supported_minor_version minor_version
# Dependency atoms are not generated for Vala versions older than 0.${minimal_supported_minor_version}.
minimal_supported_minor_version="36"
for ((minor_version = ${VALA_MAX_API_VERSION#*.}; minor_version >= ${VALA_MIN_API_VERSION#*.}; minor_version = minor_version - 2)); do
# 0.38 was never in main tree; remove the special case once minimal_supported_minor_version >= 40
# 0.42 is EOL and removed from tree; remove special case once minimal_support_minor_version >= 44
if ((minor_version >= minimal_supported_minor_version)) && ((minor_version != 38)) && ((minor_version != 42)); then
echo "0.${minor_version}"
fi
done
}
# Outputs VALA_USE_DEPEND as a a USE-dependency string
_vala_use_depend() {
local u="" vala_use
if [[ -n ${VALA_USE_DEPEND} ]]; then
for vala_use in ${VALA_USE_DEPEND}; do
case ${vala_use} in
vapigen) u="${u},${vala_use}(+)" ;;
valadoc) u="${u},${vala_use}(-)" ;;
esac
done
u="[${u#,}]"
fi
echo -n "${u}"
}
# @FUNCTION: vala_depend
# @DESCRIPTION:
# Outputs a ||-dependency string on vala from VALA_MAX_API_VERSION down to
# VALA_MIN_API_VERSION
vala_depend() {
local u v
u=$(_vala_use_depend)
echo -n "|| ("
for v in $(vala_api_versions); do
echo -n " dev-lang/vala:${v}${u}"
done
echo " )"
}
# @FUNCTION: vala_best_api_version
# @DESCRIPTION:
# Returns the highest installed vala API version satisfying
# VALA_MAX_API_VERSION, VALA_MIN_API_VERSION, and VALA_USE_DEPEND.
vala_best_api_version() {
local u v
u=$(_vala_use_depend)
for v in $(vala_api_versions); do
has_version "dev-lang/vala:${v}${u}" && echo "${v}" && return
done
}
# @FUNCTION: vala_src_prepare
# @USAGE: [--ignore-use] [--vala-api-version api_version]
# @DESCRIPTION:
# Sets up the environment variables and pkgconfig files for the
# specified API version, or, if no version is specified, for the
# highest installed vala API version satisfying
# VALA_MAX_API_VERSION, VALA_MIN_API_VERSION, and VALA_USE_DEPEND.
# Is a no-op if called without --ignore-use when USE=-vala.
# Dies if the USE check is passed (or ignored) and a suitable vala
# version is not available.
vala_src_prepare() {
local p d valafoo version ignore_use
while [[ $1 ]]; do
case $1 in
"--ignore-use" )
ignore_use=1 ;;
"--vala-api-version" )
shift
version=$1
[[ ${version} ]] || die "'--vala-api-version' option requires API version parameter."
esac
shift
done
if [[ -z ${ignore_use} ]]; then
in_iuse vala && ! use vala && return 0
fi
if [[ ${version} ]]; then
has_version "dev-lang/vala:${version}" || die "No installed vala:${version}"
else
version=$(vala_best_api_version)
[[ ${version} ]] || die "No installed vala in $(vala_depend)"
fi
export VALAC=$(type -P valac-${version})
valafoo=$(type -P vala-gen-introspect-${version})
[[ ${valafoo} ]] && export VALA_GEN_INTROSPECT="${valafoo}"
valafoo=$(type -P vapigen-${version})
[[ ${valafoo} ]] && export VAPIGEN="${valafoo}"
valafoo=$(type -P valadoc-${version})
[[ ${valafoo} ]] && has valadoc ${VALA_USE_DEPEND} && export VALADOC="${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}-${version}.pc ]]; then
ln -s "${d}/${p}-${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}"
}
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI="8"
CDROM_OPTIONAL="yes"
inherit eutils unpacker cdrom
inherit unpacker cdrom
DESCRIPTION="Quake III Arena - data portion"
HOMEPAGE="http://icculus.org/quake3/"
......
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI="8"
PYTHON_COMPAT=( python3_9 python3_10 python3_11 )
......
# Copyright 2013 Canek Peláez
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI="8"
VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.50}
VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.56}
......
# Copyright 2020 Canek Peláez
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI="8"
inherit font xdg-utils
......
# Copyright 2013 Canek Peláez
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI="8"
inherit git-r3 font xdg-utils
......@@ -14,14 +14,9 @@ SLOT="0"
IUSE=""
KEYWORDS="~amd64 ~x86"
FONT_S="fonts/TTF"
FONT_S="fonts/VF-TTF"
FONT_SUFFIX="ttf"
src_prepare() {
default
xdg_environment_reset
}
src_install() {
font_src_install
}
# Copyright 2013 Canek Peláez
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI="8"
VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.50}
VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.56}
......@@ -31,7 +31,7 @@ DEPEND="${RDEPEND}
src_prepare() {
default
vala_src_prepare
vala_setup
}
src_configure() {
......@@ -43,13 +43,13 @@ src_install() {
}
pkg_postinst() {
gnome2_icon_cache_update
gnome2_schemas_update
xdg_icon_cache_update
xdg_desktop_database_update
gnome2_schemas_update
}
pkg_postrm() {
gnome2_icon_cache_update
gnome2_schemas_update
xdg_icon_cache_update
xdg_desktop_database_update
gnome2_schemas_update
}