Merge pull request #290 from flatcar-linux/krnowak/pkg-updates-2011

Update/drop eclasses from 2011
This commit is contained in:
Krzesimir Nowak 2022-02-18 10:47:13 +01:00 committed by GitHub
commit 05ffa99fbe
11 changed files with 61 additions and 1378 deletions

View File

@ -1,238 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: apache-module.eclass
# @MAINTAINER:
# apache-devs@gentoo.org
# @BLURB: Provides a common set of functions for apache modules
# @DESCRIPTION:
# This eclass handles apache modules in a sane way.
#
# To make use of this eclass simply call one of the need/want_apache functions
# described in depend.apache.eclass. Make sure you use the need/want_apache call
# after you have defined DEPEND and RDEPEND. Also note that you can not rely on
# the automatic RDEPEND=DEPEND that portage does if you use this eclass.
#
# See Bug 107127 for more information.
#
# @EXAMPLE:
#
# Here is a simple example of an ebuild for mod_foo:
#
# @CODE
# APACHE2_MOD_CONF="42_mod_foo"
# APACHE2_MOD_DEFINE="FOO"
# need_apache2
# @CODE
#
# A more complicated example for a module with non-standard locations:
#
# @CODE
# APXS2_S="${S}/apache22/src"
# APACHE2_MOD_FILE="${APXS2_S}/${PN}.so"
# APACHE2_MOD_CONF="42_${PN}"
# APACHE2_MOD_DEFINE="FOO"
# DOCFILES="docs/*.html"
# need_apache2_2
# @CODE
#
# A basic module configuration which just loads the module into apache:
#
# @CODE
# <IfDefine FOO>
# LoadModule foo_module modules/mod_foo.so
# </IfDefine>
# @CODE
inherit depend.apache
# ==============================================================================
# PUBLIC VARIABLES
# ==============================================================================
# @VARIABLE: APXS2_S
# @DESCRIPTION:
# Path to temporary build directory. (Defaults to `${S}/src' if it exists,
# `${S}' otherwise)
# @VARIABLE: APXS2_ARGS
# @DESCRIPTION:
# Arguments to pass to the apxs tool. (Defaults to `-c ${PN}.c')
# @VARIABLE: APACHE2_EXECFILES
# @DESCRIPTION:
# List of files that will be installed into ${APACHE_MODULE_DIR} beside
# ${APACHE2_MOD_FILE}. In addition, this function also sets the executable
# permission on those files.
# @VARIABLE: APACHE2_MOD_CONF
# @DESCRIPTION:
# Module configuration file installed by src_install (minus the .conf suffix and
# relative to ${FILESDIR}).
# @VARIABLE: APACHE2_MOD_DEFINE
# @DESCRIPTION:
# Name of define (e.g. FOO) to use in conditional loading of the installed
# module/its config file, multiple defines should be space separated.
# @VARIABLE: APACHE2_MOD_FILE
# @DESCRIPTION:
# Name of the module that src_install installs minus the .so suffix. (Defaults
# to `${APXS2_S}/.libs/${PN}.so')
# @VARIABLE: APACHE2_VHOST_CONF
# @DESCRIPTION:
# Virtual host configuration file installed by src_install (minus the .conf
# suffix and relative to ${FILESDIR}).
# @VARIABLE: DOCFILES
# @DESCRIPTION:
# If the exported src_install() is being used, and ${DOCFILES} is non-zero, some
# sed-fu is applied to split out html documentation (if any) from normal
# documentation, and dodoc'd or dohtml'd.
# ==============================================================================
# INTERNAL FUNCTIONS
# ==============================================================================
# Internal function to construct the default ${APXS2_S} path if required.
apache_cd_dir() {
debug-print-function $FUNCNAME $*
local CD_DIR="${APXS2_S}"
if [[ -z "${CD_DIR}" ]] ; then
if [[ -d "${S}/src" ]] ; then
CD_DIR="${S}/src"
else
CD_DIR="${S}"
fi
fi
debug-print $FUNCNAME "CD_DIR=${CD_DIR}"
echo "${CD_DIR}"
}
# Internal function to construct the default ${APACHE2_MOD_FILE} if required.
apache_mod_file() {
debug-print-function $FUNCNAME $*
local MOD_FILE="${APACHE2_MOD_FILE:-$(apache_cd_dir)/.libs/${PN}.so}"
debug-print $FUNCNAME "MOD_FILE=${MOD_FILE}"
echo "${MOD_FILE}"
}
# Internal function for picking out html files from ${DOCFILES}. It takes an
# optional first argument `html'; if the first argument is equals `html', only
# html files are returned, otherwise normal (non-html) docs are returned.
apache_doc_magic() {
debug-print-function $FUNCNAME $*
local DOCS=
if [[ -n "${DOCFILES}" ]] ; then
if [[ "x$1" == "xhtml" ]] ; then
DOCS="`echo ${DOCFILES} | sed -e 's/ /\n/g' | sed -e '/^[^ ]*.html$/ !d'`"
else
DOCS="`echo ${DOCFILES} | sed 's, *[^ ]*\+.html, ,g'`"
fi
fi
debug-print $FUNCNAME "DOCS=${DOCS}"
echo "${DOCS}"
}
# ==============================================================================
# EXPORTED FUNCTIONS
# ==============================================================================
# @FUNCTION: apache-module_src_compile
# @DESCRIPTION:
# The default action is to call ${APXS} with the value of ${APXS2_ARGS}. If a
# module requires a different build setup than this, use ${APXS} in your own
# src_compile routine.
apache-module_src_compile() {
debug-print-function $FUNCNAME $*
local CD_DIR=$(apache_cd_dir)
cd "${CD_DIR}" || die "cd ${CD_DIR} failed"
APXS2_ARGS="${APXS2_ARGS:--c ${PN}.c}"
${APXS} ${APXS2_ARGS} || die "${APXS} ${APXS2_ARGS} failed"
}
# @FUNCTION: apache-module_src_install
# @DESCRIPTION:
# This installs the files into apache's directories. The module is installed
# from a directory chosen as above (apache_cd_dir). In addition, this function
# can also set the executable permission on files listed in
# ${APACHE2_EXECFILES}. The configuration file name is listed in
# ${APACHE2_MOD_CONF} without the .conf extensions, so if you configuration is
# 55_mod_foo.conf, APACHE2_MOD_CONF would be 55_mod_foo. ${DOCFILES} contains
# the list of files you want filed as documentation.
apache-module_src_install() {
debug-print-function $FUNCNAME $*
local CD_DIR=$(apache_cd_dir)
pushd "${CD_DIR}" >/dev/null || die "cd ${CD_DIR} failed"
local MOD_FILE=$(apache_mod_file)
exeinto "${APACHE_MODULESDIR}"
doexe ${MOD_FILE} || die "internal ebuild error: '${MOD_FILE}' not found"
[[ -n "${APACHE2_EXECFILES}" ]] && doexe ${APACHE2_EXECFILES}
if [[ -n "${APACHE2_MOD_CONF}" ]] ; then
insinto "${APACHE_MODULES_CONFDIR}"
set -- ${APACHE2_MOD_CONF}
newins "${FILESDIR}/${1}.conf" "$(basename ${2:-$1}).conf" \
|| die "internal ebuild error: '${FILESDIR}/${1}.conf' not found"
fi
if [[ -n "${APACHE2_VHOST_CONF}" ]] ; then
insinto "${APACHE_VHOSTS_CONFDIR}"
set -- ${APACHE2_VHOST_CONF}
newins "${FILESDIR}/${1}.conf" "$(basename ${2:-$1}).conf " \
|| die "internal ebuild error: '${FILESDIR}/${1}.conf' not found"
fi
cd "${S}"
if [[ -n "${DOCFILES}" ]] ; then
local OTHER_DOCS=$(apache_doc_magic)
local HTML_DOCS=$(apache_doc_magic html)
[[ -n "${OTHER_DOCS}" ]] && dodoc ${OTHER_DOCS}
[[ -n "${HTML_DOCS}" ]] && dohtml ${HTML_DOCS}
fi
popd >/dev/null
}
# @FUNCTION: apache-module_pkg_postinst
# @DESCRIPTION:
# This prints out information about the installed module and how to enable it.
apache-module_pkg_postinst() {
debug-print-function $FUNCNAME $*
if [[ -n "${APACHE2_MOD_DEFINE}" ]] ; then
local my_opts="-D ${APACHE2_MOD_DEFINE// / -D }"
einfo
einfo "To enable ${PN}, you need to edit your /etc/conf.d/apache2 file and"
einfo "add '${my_opts}' to APACHE2_OPTS."
einfo
fi
if [[ -n "${APACHE2_MOD_CONF}" ]] ; then
set -- ${APACHE2_MOD_CONF}
einfo
einfo "Configuration file installed as"
einfo " ${APACHE_MODULES_CONFDIR}/$(basename ${2:-$1}).conf"
einfo "You may want to edit it before turning the module on in /etc/conf.d/apache2"
einfo
fi
}
EXPORT_FUNCTIONS src_compile src_install pkg_postinst

View File

@ -1,86 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: bsdmk.eclass
# @MAINTAINER:
# bsd@gentoo.org
# @BLURB: Some functions for BSDmake
inherit toolchain-funcs portability flag-o-matic
EXPORT_FUNCTIONS src_compile src_install
RDEPEND=""
# this should actually be BDEPEND, but this works.
DEPEND="virtual/pmake"
ESED="/usr/bin/sed"
# @ECLASS-VARIABLE: mymakeopts
# @DESCRIPTION:
# Options for bsd-make
# @FUNCTION: append-opt
# @USAGE: < options >
# @DESCRIPTION:
# append options to enable or disable features
append-opt() {
mymakeopts="${mymakeopts} $@"
}
# @FUNCTION: mkmake
# @USAGE: [ options ]
# @DESCRIPTION:
# calls bsd-make command with the given options, passing ${mymakeopts} to
# enable ports to useflags bridge.
mkmake() {
[[ -z ${BMAKE} ]] && BMAKE="$(get_bmake)"
tc-export CC CXX LD RANLIB
set -- ${BMAKE} ${MAKEOPTS} ${EXTRA_EMAKE} ${mymakeopts} NO_WERROR= STRIP= "$@"
echo "${@}"
"${@}"
}
# @FUNCTION: mkinstall
# @USAGE: [ options ]
# @DESCRIPTION:
# Calls "bsd-make install" with the given options, passing ${mamakeopts} to
# enable ports to useflags bridge
mkinstall() {
[[ -z ${BMAKE} ]] && BMAKE="$(get_bmake)"
# STRIP= will replace the default value of -s, leaving to portage the
# task of stripping executables.
set -- ${BMAKE} ${mymakeopts} NO_WERROR= STRIP= MANSUBDIR= DESTDIR="${D}" "$@" install
echo "${@}"
"${@}"
}
# @FUNCTION: dummy_mk
# @USAGE: < dirnames >
# @DESCRIPTION:
# removes the specified subdirectories and creates a dummy makefile in them
# useful to remove the need for "minimal" patches
dummy_mk() {
for dir in $@; do
[ -d ${dir} ] || ewarn "dummy_mk called on a non-existing directory: $dir"
[ -f ${dir}/Makefile ] || ewarn "dummy_mk called on a directory without Makefile: $dir"
echo ".include <bsd.lib.mk>" > ${dir}/Makefile
done
}
# @FUNCTION: bsdmk_src_compile
# @DESCRIPTION:
# The bsdmk src_compile function, which is exported
bsdmk_src_compile() {
mkmake "$@" || die "make failed"
}
# @FUNCTION: bsdmk_src_install
# @DESCRIPTION:
# The bsdmk src_install function, which is exported
bsdmk_src_install() {
mkinstall "$@" || die "install failed"
}

View File

@ -1,58 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: findlib.eclass
# @MAINTAINER:
# ml@gentoo.org
# @AUTHOR:
# Original author: Matthieu Sozeau <mattam@gentoo.org> (retired)
# @BLURB: ocamlfind (a.k.a. findlib) eclass
# @DESCRIPTION:
# ocamlfind (a.k.a. findlib) eclass
# From this findlib version there is proper stublibs support.
DEPEND=">=dev-ml/findlib-1.0.4-r1"
[[ ${FINDLIB_USE} ]] && DEPEND="${FINDLIB_USE}? ( ${DEPEND} )"
check_ocamlfind() {
if [ ! -x "${EPREFIX}"/usr/bin/ocamlfind ]
then
eerror "In findlib.eclass: could not find the ocamlfind executable"
eerror "Please report this bug on gentoo's bugzilla, assigning to ml@gentoo.org"
die "ocamlfind executabled not found"
fi
}
# @FUNCTION: findlib_src_preinst
# @DESCRIPTION:
# Prepare the image for a findlib installation.
# We use the stublibs style, so no ld.conf needs to be
# updated when a package installs C shared libraries.
findlib_src_preinst() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
has "${EAPI:-0}" 0 1 2 && use !prefix && ED="${D}"
check_ocamlfind
# destdir is the ocaml sitelib
local destdir=`ocamlfind printconf destdir`
# strip off prefix
destdir=${destdir#${EPREFIX}}
dodir ${destdir} || die "dodir failed"
export OCAMLFIND_DESTDIR=${ED}${destdir}
# stublibs style
dodir ${destdir}/stublibs || die "dodir failed"
export OCAMLFIND_LDCONF=ignore
}
# @FUNCTION: findlib_src_install
# @DESCRIPTION:
# Install with a properly setup findlib
findlib_src_install() {
findlib_src_preinst
make DESTDIR="${D}" "$@" install || die "make failed"
}

View File

@ -1,45 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Author: Robin H. Johnson <robbat2@gentoo.org>
# font-ebdftopcf.eclass
# Eclass to make PCF font generator from BDF uniform and optimal
# The manpage for this eclass is in media-gfx/ebdftopcf.
# inherit this eclass after font.eclass
# if USE="-X", this eclass is basically a no-op, since bdftopcf requires Xorg.
IUSE="X"
# Variable declarations
DEPEND="X? ( media-gfx/ebdftopcf )"
RDEPEND=""
#
# Public functions
#
ebdftopcf() {
local bdffiles
bdffiles="$@"
[ -z "$bdffiles" ] && die "No BDF files specified."
emake -f "${EPREFIX}"/usr/share/ebdftopcf/Makefile.ebdftopcf \
BDFFILES="${bdffiles}" \
BDFTOPCF_PARAMS="${BDFTOPCF_PARAMS}" \
|| die "Failed to build PCF files"
}
#
# Public inheritable functions
#
font-ebdftopcf_src_compile() {
use X && FONT_SUFFIX="pcf.gz"
use X || FONT_SUFFIX="bdf"
if use X; then
[ -z "${BDFFILES}" ] && BDFFILES="$(find . -name '*.bdf')"
ebdftopcf ${BDFFILES}
fi
}
EXPORT_FUNCTIONS src_compile

View File

@ -1,333 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @MAINTAINER:
# maintainer-needed@gentoo.org
# @AUTHOR:
# Diego Pettenò <flameeyes@gentoo.org>
inherit versionator eutils flag-o-matic bsdmk
# Drop patch level from ${PV}
MY_PV=${PV/_p*}
PLEVEL=${PV##*_p}
LICENSE="BSD"
HOMEPAGE="http://www.freebsd.org/"
# Define global package names
LIB="freebsd-lib-${PV}"
BIN="freebsd-bin-${PV}"
CONTRIB="freebsd-contrib-${PV}"
SHARE="freebsd-share-${PV}"
UBIN="freebsd-ubin-${PV}"
USBIN="freebsd-usbin-${PV}"
CRYPTO="freebsd-crypto-${PV}"
LIBEXEC="freebsd-libexec-${PV}"
SBIN="freebsd-sbin-${PV}"
GNU="freebsd-gnu-${PV}"
ETC="freebsd-etc-${PV}"
SYS="freebsd-sys-${PV}"
INCLUDE="freebsd-include-${PV}"
RESCUE="freebsd-rescue-${PV}"
CDDL="freebsd-cddl-${PV}"
SECURE="freebsd-secure-${PV}"
# Release version (5.3, 5.4, 6.0, etc)
RV="$(get_version_component_range 1-2 ${MY_PV})"
# SVN ebuild support.
# 9.1.0.9999 --> release/9.1.0
# 9.1.9999 --> releng/9.1
# 9.9999 --> stable/9
# 9999 --> head
#
# svn revision can be specified by patch level:
# freebsd-lib-9.9999_p247000 --> set svn -r 247000
if [[ ${MY_PV} == *9999* ]]; then
inherit subversion
# Set SVN revision using patch level.
[[ ${PV} == *_p* ]] && ESVN_REVISION="${PLEVEL}"
case ${MY_PV%.9999} in
*.*.*) BRANCH="release";;
*.*) BRANCH="releng" ;;
9999) BRANCH="head" ;;
*) BRANCH="stable" ;;
esac
if [[ ${BRANCH} == head ]] ; then
SVN_SUB_URI="${BRANCH}"
else
SVN_SUB_URI="${BRANCH}/${MY_PV%.9999}"
fi
ESVN_REPO_URI="svn://svn.freebsd.org/base/${SVN_SUB_URI}"
ESVN_PROJECT="freebsd-${BRANCH}"
fi
# Use the original source code.
if [[ ${MY_PV} != *9999* ]] && version_is_at_least 10.0 ${RV} ; then
DL_PV=${MY_PV/_rc/-RC}
DL_PV=${DL_PV/_beta/-BETA}
DL_PV=${DL_PV/_alpha/-ALPHA}
if [[ ${DL_PV} == ${MY_PV} ]]; then
DL_PV="${DL_PV}-RELEASE"
fi
SRC_URI="mirror://freebsd/releases/i386/${DL_PV}/src.txz -> freebsd-src-${MY_PV}.tar.xz"
fi
IUSE="profile"
#unalias -a
alias install-info='/usr/bin/bsdinstall-info'
EXPORT_FUNCTIONS src_compile src_install src_unpack
# doperiodic <kind> <file> ...
doperiodic() {
local kind=$1
shift
( # dont want to pollute calling env
insinto /etc/periodic/${kind}
insopts -m 0755
doins "$@"
)
}
freebsd_get_bmake() {
local bmake
bmake=$(get_bmake)
if version_is_at_least 11.0 ${RV} ; then
if [[ ${CBUILD} == *-freebsd* ]] ; then
bmake="${bmake} -m /usr/share/mk/system"
else
bmake="${bmake} -m /usr/share/mk/freebsd/system"
fi
else
[[ ${CBUILD} == *-freebsd* ]] || bmake="${bmake} -m /usr/share/mk/freebsd"
fi
echo "${bmake}"
}
# Generates SRC_URI or DISTDIR for the upstream patch.
freebsd_upstream_patches() {
local opt=$1
[[ ${#UPSTREAM_PATCHES[@]} -eq 0 ]] && return 1
for x in "${UPSTREAM_PATCHES[@]}"
do
local out=${PN}-${x/\//-}
out=${out/:/}
if [[ ${opt} == -s ]] ; then
echo "${DISTDIR}/${out}"
else
echo "https://security.freebsd.org/patches/${x} -> ${out}"
fi
done
}
freebsd_do_patches() {
if [[ ${#PATCHES[@]} -gt 1 ]] ; then
for x in "${PATCHES[@]}"; do
epatch "${x}"
done
else
for x in ${PATCHES} ; do
epatch "${x}"
done
fi
# Upstream patches need to be applied on WORKDIR.
if [[ ${#UPSTREAM_PATCHES[@]} -gt 0 ]] ; then
cd "${WORKDIR}" || die
epatch $(freebsd_upstream_patches -s)
cd "${S}" || die
fi
epatch_user
}
freebsd_rename_libraries() {
ebegin "Renaming libraries"
# We don't use libtermcap, we use libncurses
find "${S}" -name Makefile -print0 | xargs -0 \
sed -i -e 's:-ltermcap:-lncurses:g; s:{LIBTERMCAP}:{LIBNCURSES}:g'
# flex provides libfl, not libl
find "${S}" -name Makefile -print0 | xargs -0 \
sed -i -e 's:-ll$:-lfl:g; s:-ll :-lfl :g; s:{LIBL}:{LIBFL}:g'
# ncurses provides libncursesw not libcursesw
find "${S}" -name Makefile -print0 | xargs -0 \
sed -i -e 's:-lcursesw:-lncursesw:g'
# we use expat instead of bsdxml
find "${S}" -name Makefile -print0 | xargs -0 \
sed -i -e 's:-lbsdxml:-lexpat:g'
eend $?
}
freebsd_src_unpack() {
if [[ ${MY_PV} == *9999* ]]; then
S="${WORKDIR}" subversion_src_unpack
# When share/mk exists in ${WORKDIR}, BSD's make will try to use it on FreeBSD 10.0 or later.
# We should remove "${WORKDIR}"/share/mk/*.mk to use /usr/share/mk{,/system}.
if [[ ${PN} != freebsd-mk-defs ]] ; then
[[ -e "${WORKDIR}"/share/mk ]] && rm -rf "${WORKDIR}"/share/mk/*.mk
fi
else
if version_is_at_least 10.0 ${RV} ; then
local tarball="freebsd-src-${MY_PV}.tar.xz"
local topdir="usr/src/"
local extractlist=()
for i in ${EXTRACTONLY} tools/ ; do
extractlist+=( ${topdir}${i} )
done
ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
cd "${WORKDIR}" || die
tar -xJpf "${DISTDIR}/${tarball}" --strip-components=2 "${extractlist[@]}" 2> /dev/null || die "tar extract command failed"
cd - || die
else
for f in ${A} ; do
[[ ${f} == *.tar.* ]] && unpack ${f}
done
fi
fi
cd "${S}"
dummy_mk ${REMOVE_SUBDIRS}
freebsd_do_patches
if ! version_is_at_least 11.0 ${RV} ; then
freebsd_rename_libraries
fi
# Starting from FreeBSD 9.2, its install command supports the -l option and
# they now use it. Emulate it if we are on a system that does not have it.
if version_is_at_least 9.2 ${RV} && ! has_version '>=sys-freebsd/freebsd-ubin-9.2_beta1' ; then
export INSTALL_LINK="ln -f"
export INSTALL_SYMLINK="ln -fs"
fi
# An older version of install command doesn't support the -T option.
if version_is_at_least 11.0 ${RV} && ! has_version ">=sys-freebsd/freebsd-ubin-${RV}" ; then
export INSTALL="sh ${WORKDIR}/tools/install.sh"
fi
# If CC=clang, we should use clang-cpp instead of cpp. #478810, #595878
if [[ $(tc-getCC) == *clang* ]] ; then
if type -P clang-cpp > /dev/null ; then
export CPP=clang-cpp
else
mkdir "${WORKDIR}"/workaround_clang-cpp || die "Could not create ${WORKDIR}/workaround_clang-cpp"
ln -s "$(type -P clang)" "${WORKDIR}"/workaround_clang-cpp/clang-cpp || die "Could not create clang-cpp symlink."
export CPP="${WORKDIR}/workaround_clang-cpp/clang-cpp"
fi
fi
# Add the special CFLAGS required for multilib support.
use amd64-fbsd && export CFLAGS_x86_fbsd="${CFLAGS_x86_fbsd} -DCOMPAT_32BIT -B/usr/lib32 -L/usr/lib32"
}
freebsd_src_compile() {
use profile && filter-flags "-fomit-frame-pointer"
if version_is_at_least 11.0 ${RV} ; then
if ! use profile ; then
mymakeopts="${mymakeopts} WITHOUT_PROFILE= "
fi
# Disable the debugging information, use FEATURES=splitdebug instead.
mymakeopts="${mymakeopts} WITHOUT_DEBUG_FILES= "
# We don't support test yet.
mymakeopts="${mymakeopts} WITHOUT_TESTS= "
# Set the SRCTOP to detect the source directory.
mymakeopts="${mymakeopts} SRCTOP=${WORKDIR} "
# Set the common settings.
mymakeopts="${mymakeopts} WITHOUT_MANCOMPRESS= WITHOUT_INFOCOMPRESS= "
else
use profile || mymakeopts="${mymakeopts} NO_PROFILE= "
mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= "
fi
mymakeopts="${mymakeopts} NO_FSCHG="
# Make sure to use FreeBSD definitions while crosscompiling
[[ -z "${BMAKE}" ]] && BMAKE="$(freebsd_get_bmake)"
# Create objdir if MAKEOBJDIRPREFIX is defined, so that we can make out of
# tree builds easily.
if [[ -n "${MAKEOBJDIRPREFIX}" ]] ; then
mkmake obj || die
fi
bsdmk_src_compile "$@"
}
# Helper function to make a multilib build with FreeBSD Makefiles.
# Usage:
# MULTIBUILD_VARIANTS=( $(get_all_abis) )
# multibuild_foreach_variant freebsd_multilib_multibuild_wrapper my_function
#
# Important note: To use this function you _have_ to:
# - inherit multilib.eclass and multibuild.eclass
# - set MULTIBUILD_VARIANTS
freebsd_multilib_multibuild_wrapper() {
# Get the ABI from multibuild.eclass
# This assumes MULTIBUILD_VARIANTS contains only valid ABIs.
local ABI=${MULTIBUILD_VARIANT}
# First, save the variables: CFLAGS, CXXFLAGS, LDFLAGS, LDADD and mymakeopts.
for i in CFLAGS CXXFLAGS LDFLAGS LDADD mymakeopts ; do
export ${i}_SAVE="${!i}"
done
# Setup the variables specific to this ABI.
multilib_toolchain_setup "${ABI}"
local target="$(tc-arch-kernel ${CHOST})"
mymakeopts="${mymakeopts} TARGET=${target} MACHINE=${target} MACHINE_ARCH=${target} SHLIBDIR=/usr/$(get_libdir) LIBDIR=/usr/$(get_libdir)"
if [ "${ABI}" != "${DEFAULT_ABI}" ] ; then
mymakeopts="${mymakeopts} COMPAT_32BIT="
fi
einfo "Building for ABI=${ABI} and TARGET=${target}"
export MAKEOBJDIRPREFIX="${BUILD_DIR}"
if [ ! -d "${MAKEOBJDIRPREFIX}" ] ; then
mkdir "${MAKEOBJDIRPREFIX}" || die "Could not create ${MAKEOBJDIRPREFIX}."
fi
CTARGET="${CHOST}" "$@"
# Restore the variables now.
for i in CFLAGS CXXFLAGS LDFLAGS LDADD mymakeopts ; do
ii="${i}_SAVE"
export ${i}="${!ii}"
done
}
freebsd_src_install() {
if version_is_at_least 11.0 ${RV} ; then
if ! use profile ; then
mymakeopts="${mymakeopts} WITHOUT_PROFILE= "
fi
# Disable the debugging information, use FEATURES=splitdebug instead.
mymakeopts="${mymakeopts} WITHOUT_DEBUG_FILES= "
# We don't support test yet.
mymakeopts="${mymakeopts} WITHOUT_TESTS= "
# Set the SRCTOP to detect the source directory.
mymakeopts="${mymakeopts} SRCTOP=${WORKDIR} "
# Set the common settings.
mymakeopts="${mymakeopts} WITHOUT_MANCOMPRESS= WITHOUT_INFOCOMPRESS= "
else
use profile || mymakeopts="${mymakeopts} NO_PROFILE= "
mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= "
fi
mymakeopts="${mymakeopts} NO_FSCHG="
[[ -z "${BMAKE}" ]] && BMAKE="$(freebsd_get_bmake)"
bsdmk_src_install "$@"
}

View File

@ -1,80 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: mono.eclass
# @MAINTAINER:
# dotnet@gentoo.org
# @BLURB: common settings and functions for mono and dotnet related packages
# @DESCRIPTION:
# The mono eclass contains common environment settings that are useful for
# dotnet packages. Currently, it provides no functions, just exports
# MONO_SHARED_DIR and sets LC_ALL in order to prevent errors during compilation
# of dotnet packages.
inherit multilib
# >=mono-0.92 versions using mcs -pkg:foo-sharp require shared memory, so we set the
# shared dir to ${T} so that ${T}/.wapi can be used during the install process.
export MONO_SHARED_DIR="${T}"
# Building mono, nant and many other dotnet packages is known to fail if LC_ALL
# variable is not set to C. To prevent this all mono related packages will be
# build with LC_ALL=C (see bugs #146424, #149817)
export LC_ALL=C
# Monodevelop-using applications need this to be set or they will try to create config
# files in the user's ~ dir.
export XDG_CONFIG_HOME="${T}"
# Fix bug 83020:
# "Access Violations Arise When Emerging Mono-Related Packages with MONO_AOT_CACHE"
unset MONO_AOT_CACHE
egacinstall() {
use !prefix && has "${EAPI:-0}" 0 1 2 && ED="${D}"
gacutil -i "${1}" \
-root "${ED}"/usr/$(get_libdir) \
-gacdir /usr/$(get_libdir) \
-package ${2:-${GACPN:-${PN}}} \
|| die "installing ${1} into the Global Assembly Cache failed"
}
mono_multilib_comply() {
use !prefix && has "${EAPI:-0}" 0 1 2 && ED="${D}"
local dir finddirs=() mv_command=${mv_command:-mv}
if [[ -d "${ED}/usr/lib" && "$(get_libdir)" != "lib" ]]
then
if ! [[ -d "${ED}"/usr/"$(get_libdir)" ]]
then
mkdir "${ED}"/usr/"$(get_libdir)" || die "Couldn't mkdir ${ED}/usr/$(get_libdir)"
fi
${mv_command} "${ED}"/usr/lib/* "${ED}"/usr/"$(get_libdir)"/ || die "Moving files into correct libdir failed"
rm -rf "${ED}"/usr/lib
for dir in "${ED}"/usr/"$(get_libdir)"/pkgconfig "${ED}"/usr/share/pkgconfig
do
if [[ -d "${dir}" && "$(find "${dir}" -name '*.pc')" != "" ]]
then
pushd "${dir}" &> /dev/null
sed -i -r -e 's:/(lib)([^a-zA-Z0-9]|$):/'"$(get_libdir)"'\2:g' \
*.pc \
|| die "Sedding some sense into pkgconfig files failed."
popd "${dir}" &> /dev/null
fi
done
if [[ -d "${ED}/usr/bin" ]]
then
for exe in "${ED}/usr/bin"/*
do
if [[ "$(file "${exe}")" == *"shell script text"* ]]
then
sed -r -i -e ":/lib(/|$): s:/lib(/|$):/$(get_libdir)\1:" \
"${exe}" || die "Sedding some sense into ${exe} failed"
fi
done
fi
fi
}

View File

@ -1,128 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: oasis.eclass
# @MAINTAINER:
# ml@gentoo.org
# @AUTHOR:
# Original Author: Alexis Ballier <aballier@gentoo.org>
# @SUPPORTED_EAPIS: 3 4 5 6 7
# @BLURB: Provides common ebuild phases for oasis-based packages.
# @DESCRIPTION:
# Provides common ebuild phases for oasis-based packages.
# Most of these packages will just have to inherit the eclass, set their
# dependencies and the DOCS variable for base.eclass to install it and be done.
#
# It inherits multilib, findlib, eutils and base eclasses.
# Ebuilds using oasis.eclass must be EAPI>=3.
# @ECLASS-VARIABLE: OASIS_BUILD_DOCS
# @DESCRIPTION:
# Will make oasis_src_compile build the documentation if this variable is
# defined and the doc useflag is enabled.
# The eclass takes care of setting doc in IUSE but the ebuild should take care
# of the extra dependencies it may need.
# Set before inheriting the eclass.
# @ECLASS-VARIABLE: OASIS_BUILD_TESTS
# @DESCRIPTION:
# Will make oasis_src_configure enable building the tests if the test useflag is
# enabled. oasis_src_test will then run them.
# Note that you sometimes need to enable this for src_test to be useful,
# sometimes not. It has to be enabled on a per-case basis.
# The eclass takes care of setting test in IUSE but the ebuild should take care
# of the extra dependencies it may need.
# Set before inheriting the eclass.
# @ECLASS-VARIABLE: OASIS_NO_DEBUG
# @DESCRIPTION:
# Disable debug useflag usage. Old oasis versions did not support it so we allow
# disabling it in those cases.
# The eclass takes care of setting debug in IUSE.
# Set before inheriting the eclass.
# @ECLASS-VARIABLE: OASIS_DOC_DIR
# @DESCRIPTION:
# Specify where to install documentation. Default is for ocamldoc HTML.
# Change it before inherit if this is not what you want.
# EPREFIX is automatically prepended.
: ${OASIS_DOC_DIR:="/usr/share/doc/${PF}/html"}
inherit multilib findlib eutils base
case ${EAPI:-0} in
0|1|2) die "You need at least EAPI-3 to use oasis.eclass";;
3|4) RDEPEND=">=dev-lang/ocaml-3.12[ocamlopt?]";;
*) RDEPEND=">=dev-lang/ocaml-3.12:=[ocamlopt?]";;
esac
IUSE="+ocamlopt"
[ -n "${OASIS_NO_DEBUG}" ] || IUSE="${IUSE} debug"
[ -n "${OASIS_BUILD_DOCS}" ] && IUSE="${IUSE} doc"
[ -n "${OASIS_BUILD_TESTS}" ] && IUSE="${IUSE} test"
DEPEND="${RDEPEND}
dev-ml/ocamlbuild"
# @FUNCTION: oasis_use_enable
# @USAGE: < useflag > < variable >
# @DESCRIPTION:
# A use_enable-like function for oasis configure variables.
# Outputs '--override variable (true|false)', whether useflag is enabled or
# not.
# Typical usage: $(oasis_use_enable ocamlopt is_native) as an oasis configure
# argument.
oasis_use_enable() {
echo "--override $2 $(usex $1 true false)"
}
# @FUNCTION: oasis_src_configure
# @DESCRIPTION:
# src_configure phase shared by oasis-based packages.
# Extra arguments may be passed via oasis_configure_opts.
oasis_src_configure() {
local confargs=""
[ -n "${OASIS_BUILD_TESTS}" ] && confargs="${confargs} $(use_enable test tests)"
[ -n "${OASIS_NO_DEBUG}" ] || confargs="${confargs} $(oasis_use_enable debug debug)"
${OASIS_SETUP_COMMAND:-ocaml setup.ml} -configure \
--prefix "${ED}/usr" \
--libdir "${ED}/usr/$(get_libdir)" \
--docdir "${ED}${OASIS_DOC_DIR}" \
$(oasis_use_enable ocamlopt is_native) \
${confargs} \
${oasis_configure_opts} \
|| die
}
# @FUNCTION: oasis_src_compile
# @DESCRIPTION:
# Builds an oasis-based package.
# Will build documentation if OASIS_BUILD_DOCS is defined and the doc useflag is
# enabled.
oasis_src_compile() {
${OASIS_SETUP_COMMAND:-ocaml setup.ml} -build || die
if [ -n "${OASIS_BUILD_DOCS}" ] && use doc; then
ocaml setup.ml -doc || die
fi
}
# @FUNCTION: oasis_src_test
# @DESCRIPTION:
# Runs the testsuite of an oasis-based package.
oasis_src_test() {
LD_LIBRARY_PATH="${S}/_build/lib" ${OASIS_SETUP_COMMAND:-ocaml setup.ml} -test || die
}
# @FUNCTION: oasis_src_install
# @DESCRIPTION:
# Installs an oasis-based package.
# It calls base_src_install_docs, so will install documentation declared in the
# DOCS variable.
oasis_src_install() {
findlib_src_preinst
${OASIS_SETUP_COMMAND:-ocaml setup.ml} -install || die
base_src_install_docs
}
EXPORT_FUNCTIONS src_configure src_compile src_test src_install

View File

@ -1,9 +1,10 @@
# Copyright 1999-2011 Gentoo Foundation # Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# @ECLASS: savedconfig.eclass # @ECLASS: savedconfig.eclass
# @MAINTAINER: # @MAINTAINER:
# base-system@gentoo.org # base-system@gentoo.org
# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: common API for saving/restoring complex configuration files # @BLURB: common API for saving/restoring complex configuration files
# @DESCRIPTION: # @DESCRIPTION:
# It is not uncommon to come across a package which has a very fine # It is not uncommon to come across a package which has a very fine
@ -13,26 +14,31 @@
# so users can modify these config files and the ebuild will take it # so users can modify these config files and the ebuild will take it
# into account as needed. # into account as needed.
# #
# @ROFF .nr step 1 1
# Typically you can create your own configuration files quickly by # Typically you can create your own configuration files quickly by
# doing: # doing:
# @ROFF .IP \n[step] 3 #
# Build the package with FEATURES=noclean USE=savedconfig. # 1. Build the package with FEATURES=noclean USE=savedconfig.
# @ROFF .IP \n+[step] #
# Go into the build dir and edit the relevant configuration system # 2. Go into the build dir and edit the relevant configuration system
# (e.g. `make menuconfig` or `nano config-header.h`). You can look # (e.g. `make menuconfig` or `nano config-header.h`). You can look
# at the files in /etc/portage/savedconfig/ to see what files get # at the files in /etc/portage/savedconfig/ to see what files get
# loaded/restored. # loaded/restored.
# @ROFF .IP \n+[step] #
# Copy the modified configuration files out of the workdir and to # 3. Copy the modified configuration files out of the workdir and to
# the paths in /etc/portage/savedconfig/. # the paths in /etc/portage/savedconfig/.
# @ROFF .IP \n+[step] #
# Emerge the package with just USE=savedconfig to get the custom build. # 4. Emerge the package with just USE=savedconfig to get the custom
# build.
inherit portability inherit portability
IUSE="savedconfig" IUSE="savedconfig"
case ${EAPI} in
[5-7]) ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
# @FUNCTION: save_config # @FUNCTION: save_config
# @USAGE: <config files to save> # @USAGE: <config files to save>
# @DESCRIPTION: # @DESCRIPTION:
@ -46,23 +52,21 @@ save_config() {
fi fi
[[ $# -eq 0 ]] && die "Usage: save_config <files>" [[ $# -eq 0 ]] && die "Usage: save_config <files>"
# Be lazy in our EAPI compat local configfile="/etc/portage/savedconfig/${CATEGORY}/${PF}"
: ${ED:=${D}}
local dest="/etc/portage/savedconfig/${CATEGORY}"
if [[ $# -eq 1 && -f $1 ]] ; then if [[ $# -eq 1 && -f $1 ]] ; then
# Just one file, so have the ${PF} be that config file # Just one file, so have the ${configfile} be that config file
dodir "${dest}" dodir "${configfile%/*}"
cp "$@" "${ED}/${dest}/${PF}" || die "failed to save $*" cp "$@" "${ED%/}/${configfile}" || die "failed to save $*"
else else
# A dir, or multiple files, so have the ${PF} be a dir # A dir, or multiple files, so have the ${configfile} be a dir
# with all the saved stuff below it # with all the saved stuff below it
dodir "${dest}/${PF}" dodir "${configfile}"
treecopy "$@" "${ED}/${dest}/${PF}" || die "failed to save $*" treecopy "$@" "${ED%/}/${configfile}" || die "failed to save $*"
fi fi
elog "Your configuration for ${CATEGORY}/${PF} has been saved in " elog "Your configuration for ${CATEGORY}/${PF} has been saved in "
elog "/etc/portage/savedconfig/${CATEGORY}/${PF} for your editing pleasure." elog "\"${configfile}\" for your editing pleasure."
elog "You can edit these files by hand and remerge this package with" elog "You can edit these files by hand and remerge this package with"
elog "USE=savedconfig to customise the configuration." elog "USE=savedconfig to customise the configuration."
elog "You can rename this file/directory to one of the following for" elog "You can rename this file/directory to one of the following for"
@ -74,7 +78,7 @@ save_config() {
# @FUNCTION: restore_config # @FUNCTION: restore_config
# @USAGE: <config files to restore> # @USAGE: <config files to restore>
# @DESCRIPTION: # @DESCRIPTION:
# Restores the configuation saved ebuild previously potentially with user edits. # Restores the package's configuration file probably with user edits.
# You can restore a single file or a whole bunch, just make sure you call # You can restore a single file or a whole bunch, just make sure you call
# restore_config with all of the files to restore at the same time. # restore_config with all of the files to restore at the same time.
# #
@ -98,41 +102,41 @@ restore_config() {
use savedconfig || return use savedconfig || return
local found check configfile local found check checked configfile
local base=${PORTAGE_CONFIGROOT}/etc/portage/savedconfig local base=${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig
for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do
configfile=${base}/${CTARGET}/${check} configfile=${base}/${CTARGET:+"${CTARGET}/"}${check}
[[ -r ${configfile} ]] || configfile=${base}/${CHOST}/${check} [[ -r ${configfile} ]] || configfile=${base}/${CHOST:+"${CHOST}/"}${check}
[[ -r ${configfile} ]] || configfile=${base}/${check} [[ -r ${configfile} ]] || configfile=${base}/${check}
einfo "Checking existence of ${configfile} ..." [[ "${checked}" == *"${configfile} "* ]] && continue
if [[ -r "${configfile}" ]]; then einfo "Checking existence of \"${configfile}\" ..."
einfo "found ${configfile}" if [[ -r "${configfile}" ]] ; then
found=${configfile}; einfo "Found \"${configfile}\""
break; found=${configfile}
break
fi fi
checked+="${configfile} "
done done
if [[ -f ${found} ]]; then if [[ -f ${found} ]]; then
elog "Building using saved configfile ${found}" elog "Building using saved configfile \"${found}\""
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
cp -pPR "${found}" "$1" || die "Failed to restore ${found} to $1" cp -pPR "${found}" "$1" || die "Failed to restore ${found} to $1"
else else
die "need to know the restoration filename" die "need to know the restoration filename"
fi fi
elif [[ -d ${found} ]]; then elif [[ -d ${found} ]]; then
elog "Building using saved config directory ${found}" elog "Building using saved config directory \"${found}\""
local dest=${PWD} local dest=${PWD}
pushd "${found}" > /dev/null pushd "${found}" > /dev/null
treecopy . "${dest}" || die "Failed to restore ${found} to $1" treecopy . "${dest}" || die "Failed to restore ${found} to $1"
popd > /dev/null popd > /dev/null
else else
# maybe the user is screwing around with perms they shouldnt #289168
if [[ ! -r ${base} ]] ; then
eerror "Unable to read ${base} -- please check its permissions."
die "Reading config files failed"
fi
ewarn "No saved config to restore - please remove USE=savedconfig or" ewarn "No saved config to restore - please remove USE=savedconfig or"
ewarn "provide a configuration file in ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${PN}" ewarn "provide a configuration file in ${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PN}"
ewarn "Your config file(s) will not be used this time" ewarn "and ensure the build process has permission to access it."
ewarn "Your config file(s) will not be used this time."
fi fi
} }
@ -143,10 +147,7 @@ savedconfig_pkg_postinst() {
# are worse :/. # are worse :/.
if use savedconfig ; then if use savedconfig ; then
# Be lazy in our EAPI compat find "${EROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PF}" \
: ${EROOT:=${ROOT}}
find "${EROOT}/etc/portage/savedconfig/${CATEGORY}/${PF}" \
-exec touch {} + 2>/dev/null -exec touch {} + 2>/dev/null
fi fi
} }

View File

@ -1,6 +1,12 @@
# Copyright 1999-2011 Gentoo Foundation # Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: vim-doc.eclass
# @MAINTAINER:
# vim@gentoo.org
# @SUPPORTED_EAPIS: 6 7
# @BLURB: Eclass for vim{,-plugin}.eclass to update documentation tags.
# @DESCRIPTION:
# This eclass is used by vim.eclass and vim-plugin.eclass to update # This eclass is used by vim.eclass and vim-plugin.eclass to update
# the documentation tags. This is necessary since vim doesn't look in # the documentation tags. This is necessary since vim doesn't look in
# /usr/share/vim/vimfiles/doc for documentation; it only uses the # /usr/share/vim/vimfiles/doc for documentation; it only uses the
@ -10,9 +16,15 @@
# DEPEND in vim-plugin or by whatever version of vim is being # DEPEND in vim-plugin or by whatever version of vim is being
# installed by the eclass. # installed by the eclass.
case ${EAPI:-0} in
[67]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_VIM_DOC_ECLASS} ]] ; then
_VIM_DOC_ECLASS=1
update_vim_helptags() { update_vim_helptags() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
local vimfiles vim d s local vimfiles vim d s
# This is where vim plugins are installed # This is where vim plugins are installed
@ -70,3 +82,5 @@ update_vim_helptags() {
[[ -n "${vim}" && -f "${vim}" ]] && rm "${vim}" [[ -n "${vim}" && -f "${vim}" ]] && rm "${vim}"
} }
fi

View File

@ -1,310 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# Copyright 2007-2011 Hans de Graaff <graaff@gentoo.org>
#
# Based on elisp-common.eclass:
# Copyright 2007 Christian Faulhammer <opfer@gentoo.org>
# Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org>
# Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org>
# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
# Copyright 2007 Ulrich Müller <ulm@gentoo.org>
#
# @ECLASS: xemacs-elisp-common.eclass
# @MAINTAINER:
# xemacs@gentoo.org
# @BLURB: XEmacs-related installation utilities
# @DESCRIPTION:
#
# Usually you want to use this eclass for (optional) XEmacs support of
# your package. This is NOT for GNU Emacs!
#
# Many of the steps here are sometimes done by the build system of your
# package (especially compilation), so this is mainly for standalone elisp
# files you gathered from somewhere else.
#
# When relying on the xemacs USE flag, you need to add
#
# xemacs? ( app-editors/xemacs )
#
# to your DEPEND/RDEPEND line and use the functions provided here to bring
# the files to the correct locations.
#
# @ROFF .SS
# src_compile() usage:
#
# An elisp file is compiled by the xemacs-elisp-compile() function
# defined here and simply takes the source files as arguments.
#
# xemacs-elisp-compile *.el
#
# In the case of interdependent elisp files, you can use the
# xemacs-elisp-comp() function which makes sure all files are
# loadable.
#
# xemacs-elisp-comp *.el
#
# Function xemacs-elisp-make-autoload-file() can be used to generate a
# file with autoload definitions for the lisp functions. It takes a
# list of directories (default: working directory) as its argument.
# Use of this function requires that the elisp source files contain
# magic ";;;###autoload" comments. See the XEmacs Lisp Reference Manual
# (node "Autoload") for a detailed explanation.
#
# @ROFF .SS
# src_install() usage:
#
# The resulting compiled files (.elc) should be put in a subdirectory
# of /usr/lib/xemacs/site-lisp/ which is named after the first
# argument of xemacs-elisp-install(). The following parameters are
# the files to be put in that directory. Usually the subdirectory
# should be ${PN}, but you can choose something else.
#
# xemacs-elisp-install ${PN} *.el *.elc
#
# To let the XEmacs support be activated by XEmacs on startup, you need
# to provide a site file (shipped in ${FILESDIR}) which contains the
# startup code (have a look in the documentation of your software).
# Normally this would look like this:
#
# (add-to-list 'load-path "@SITELISP@")
# (add-to-list 'auto-mode-alist '("\\.csv\\'" . csv-mode))
# (autoload 'csv-mode "csv-mode" "Major mode for csv files." t)
#
# If your XEmacs support files are installed in a subdirectory of
# /usr/share/xemacs/site-packages/ (which is strongly recommended), you need
# to extend XEmacs' load-path as shown in the first non-comment line.
# The xemacs-elisp-site-file-install() function of this eclass will replace
# "@SITELISP@" by the actual path.
#
# The next line tells XEmacs to load the mode opening a file ending
# with ".csv" and load functions depending on the context and needed
# features. Be careful though. Commands as "load-library" or "require"
# bloat the editor as they are loaded on every startup. When having
# many XEmacs support files, users may be annoyed by the start-up time.
# Also avoid keybindings as they might interfere with the user's
# settings. Give a hint in pkg_postinst(), which should be enough.
#
# The naming scheme for this site-init file matches the shell pattern
# "[1-8][0-9]*-gentoo*.el", where the two digits at the beginning define
# the loading order (numbers below 10 or above 89 are reserved for
# internal use). So if your initialisation depends on another XEmacs
# package, your site file's number must be higher! If there are no such
# interdependencies then the number should be 50. Otherwise, numbers
# divisible by 10 are preferred.
#
# Best practice is to define a SITEFILE variable in the global scope of
# your ebuild (e.g., right after S or RDEPEND):
#
# SITEFILE="50${PN}-gentoo.el"
#
# Which is then installed by
#
# xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
#
# in src_install(). Any characters after the "-gentoo" part and before
# the extension will be stripped from the destination file's name.
# For example, a file "50${PN}-gentoo-${PV}.el" will be installed as
# "50${PN}-gentoo.el". If your subdirectory is not named ${PN}, give
# the differing name as second argument.
# @ECLASS-VARIABLE: XEMACS_SITELISP
# @DESCRIPTION:
# Directory where packages install indivivual XEmacs Lisp files.
XEMACS_SITELISP=/usr/share/xemacs/site-lisp
# @ECLASS-VARIABLE: XEMACS_SITEPACKAGE
# @DESCRIPTION:
# Directory where packages install XEmacs Lisp packages.
XEMACS_SITEPACKAGE=/usr/share/xemacs/site-packages
# @ECLASS-VARIABLE: XEMACS
# @DESCRIPTION:
# Path of XEmacs executable.
XEMACS=/usr/bin/xemacs
# @ECLASS-VARIABLE: XEMACS_BATCH_CLEAN
# @DESCRIPTION:
# Invocation of XEMACS in batch mode.
XEMACS_BATCH_CLEAN="${XEMACS} --batch --no-site-file --no-init-file"
# @FUNCTION: xemacs-elisp-compile
# @USAGE: <list of elisp files>
# @DESCRIPTION:
# Byte-compile elisp files with xemacs. This function will die when
# there is a problem compiling the lisp files.
xemacs-elisp-compile () {
{
${XEMACS_BATCH_CLEAN} -f batch-byte-compile "$@"
xemacs-elisp-make-autoload-file "$@"
} || die "Compile lisp files failed"
}
xemacs-elisp-make-autoload-file () {
${XEMACS_BATCH_CLEAN} \
-eval "(setq autoload-package-name \"${PN}\")" \
-eval "(setq generated-autoload-file \"${S}/auto-autoloads.el\")" \
-l autoload -f batch-update-autoloads "$@"
}
# @FUNCTION: xemacs-elisp-install
# @USAGE: <subdirectory> <list of files>
# @DESCRIPTION:
# Install elisp source and byte-compiled files. All files are installed
# in site-packages in their own directory, indicated by the first
# argument to the function. This function will die if there is a problem
# installing the list files.
xemacs-elisp-install () {
local subdir="$1"
shift
( # use sub-shell to avoid possible environment polution
dodir "${XEMACS_SITEPACKAGE}"/lisp/"${subdir}"
insinto "${XEMACS_SITEPACKAGE}"/lisp/"${subdir}"
doins "$@"
) || die "Installing lisp files failed"
}
# @FUNCTION: xemacs-elisp-comp
# @USAGE: <list of elisp files>
# @DESCRIPTION:
# Byte-compile interdependent XEmacs lisp files.
# Originally taken from GNU autotools, but some configuration options
# removed as they don't make sense with the current status of XEmacs
# in Gentoo.
xemacs-elisp-comp() {
# Copyright 1995 Free Software Foundation, Inc.
# François Pinard <pinard@iro.umontreal.ca>, 1995.
# This script byte-compiles all `.el' files which are part of its
# arguments, using XEmacs, and put the resulting `.elc' files into
# the current directory, so disregarding the original directories used
# in `.el' arguments.
#
# This script manages in such a way that all XEmacs LISP files to
# be compiled are made visible between themselves, in the event
# they require or load-library one another.
test $# -gt 0 || return 1
einfo "Compiling XEmacs Elisp files ..."
tempdir=elc.$$
mkdir ${tempdir}
cp "$@" ${tempdir}
pushd ${tempdir}
echo "(add-to-list 'load-path \"../\")" > script
${XEMACS_BATCH_CLEAN} -l script -f batch-byte-compile *.el
local ret=$?
mv *.elc ..
popd
rm -fr ${tempdir}
return ${ret}
}
# @FUNCTION: xemacs-elisp-site-file-install
# @USAGE: <site-init file> [subdirectory]
# @DESCRIPTION:
# Install XEmacs site-init file in XEMACS_SITELISP directory.
# Automatically inserts a standard comment header with the name of the
# package (unless it is already present). Token @SITELISP@ is replaced
# by the path to the package's subdirectory in XEMACS_SITELISP.
xemacs-elisp-site-file-install() {
local sf="${1##*/}" my_pn="${2:-${PN}}" ret
local header=";;; ${PN} site-lisp configuration"
[[ ${sf} == [0-9][0-9]*-gentoo*.el ]] \
|| ewarn "xemacs-elisp-site-file-install: bad name of site-init file"
sf="${T}/${sf/%-gentoo*.el/-gentoo.el}"
ebegin "Installing site initialisation file for XEmacs"
[[ $1 = "${sf}" ]] || cp "$1" "${sf}"
sed -i -e "1{:x;/^\$/{n;bx;};/^;.*${PN}/I!s:^:${header}\n\n:;1s:^:\n:;}" \
-e "s:@SITELISP@:${EPREFIX}${XEMACS_SITELISP}/${my_pn}:g" "${sf}"
( # subshell to avoid pollution of calling environment
insinto "${XEMACS_SITELISP}/site-gentoo.d"
doins "${sf}"
)
ret=$?
rm -f "${sf}"
eend ${ret} "xemacs-elisp-site-file-install: doins failed"
}
# @FUNCTION: xemacs-elisp-site-regen
# @DESCRIPTION:
# Regenerate the site-gentoo.el file, based on packages' site
# initialisation files in the /usr/share/xemacs/site-lisp/site-gentoo.d/
# directory.
xemacs-elisp-site-regen() {
local sitelisp=${ROOT}${EPREFIX}${XEMACS_SITELISP}
local sf i line null="" page=$'\f'
local -a sflist
if [ ! -d "${sitelisp}" ]; then
eerror "xemacs-elisp-site-regen: Directory ${sitelisp} does not exist"
return 1
fi
if [ ! -d "${T}" ]; then
eerror "xemacs-elisp-site-regen: Temporary directory ${T} does not exist"
return 1
fi
einfon "Regenerating site-gentoo.el for XEmacs (${EBUILD_PHASE}) ..."
for sf in "${sitelisp}"/site-gentoo.d/[0-9][0-9]*.el
do
[ -r "${sf}" ] || continue
# sort files by their basename. straight insertion sort.
for ((i=${#sflist[@]}; i>0; i--)); do
[[ ${sf##*/} < ${sflist[i-1]##*/} ]] || break
sflist[i]=${sflist[i-1]}
done
sflist[i]=${sf}
done
cat <<-EOF >"${T}"/site-gentoo.el
;;; site-gentoo.el --- site initialisation for Gentoo-installed packages
;;; Commentary:
;; Automatically generated by xemacs-elisp-common.eclass
;; DO NOT EDIT THIS FILE
;;; Code:
EOF
# Use sed instead of cat here, since files may miss a trailing newline.
sed '$q' "${sflist[@]}" </dev/null >>"${T}"/site-gentoo.el
cat <<-EOF >>"${T}"/site-gentoo.el
${page}
(provide 'site-gentoo)
;; Local ${null}Variables:
;; no-byte-compile: t
;; buffer-read-only: t
;; End:
;;; site-gentoo.el ends here
EOF
if cmp -s "${sitelisp}"/site-gentoo.el "${T}"/site-gentoo.el; then
# This prevents outputting unnecessary text when there
# was actually no change.
# A case is a remerge where we have doubled output.
rm -f "${T}"/site-gentoo.el
echo " no changes."
else
mv "${T}"/site-gentoo.el "${sitelisp}"/site-gentoo.el
echo
case ${#sflist[@]} in
0) ewarn "... Huh? No site initialisation files found." ;;
1) einfo "... ${#sflist[@]} site initialisation file included." ;;
*) einfo "... ${#sflist[@]} site initialisation files included." ;;
esac
fi
return 0
}

View File

@ -1,54 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# Copyright 2007-2011 Hans de Graaff <graaff@gentoo.org>
#
# Based on elisp.eclass:
# Copyright 2007 Christian Faulhammer <opfer@gentoo.org>
# Copyright 2002-2003 Matthew Kennedy <mkennedy@gentoo.org>
# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
#
# @ECLASS: xemacs-elisp.eclass
# @MAINTAINER:
# xemacs@gentoo.org
# @BLURB: Eclass for XEmacs Lisp packages
# @DESCRIPTION:
# Emacs support for other than pure elisp packages is handled by
# xemacs-elisp-common.eclass where you won't have a dependency on XEmacs
# itself. All elisp-* functions are documented there.
# @ECLASS-VARIABLE: SIMPLE_ELISP
# @DEFAULT_UNSET
# @DESCRIPTION:
# Setting SIMPLE_ELISP=t in an ebuild means, that the package's source
# is a single (in whatever way) compressed elisp file with the file name
# ${PN}-${PV}. This eclass will then redefine ${S}, and move
# ${PN}-${PV}.el to ${PN}.el in src_unpack().
inherit xemacs-elisp-common
if [ "${SIMPLE_ELISP}" = 't' ]; then
S="${WORKDIR}/"
fi
DEPEND="app-editors/xemacs"
IUSE=""
xemacs-elisp_src_unpack() {
unpack ${A}
if [ "${SIMPLE_ELISP}" = 't' ]
then
cd "${S}" && mv ${P}.el ${PN}.el
fi
}
xemacs-elisp_src_compile() {
xemacs-elisp-compile *.el
}
xemacs-elisp_src_install () {
xemacs-elisp-install "${PN}" *.el *.elc
}
EXPORT_FUNCTIONS src_unpack src_compile src_install