summaryrefslogtreecommitdiff
path: root/eclass/netsurf.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
commit3cf7c3ef441822c889356fd1812ebf2944a59851 (patch)
treec513fe68548b40365c1c2ebfe35c58ad431cdd77 /eclass/netsurf.eclass
parent05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff)
gentoo resync : 25.08.2020
Diffstat (limited to 'eclass/netsurf.eclass')
-rw-r--r--eclass/netsurf.eclass177
1 files changed, 20 insertions, 157 deletions
diff --git a/eclass/netsurf.eclass b/eclass/netsurf.eclass
index 3d371811752b..065ed1e568f3 100644
--- a/eclass/netsurf.eclass
+++ b/eclass/netsurf.eclass
@@ -1,179 +1,42 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-# @DEAD
# @ECLASS: netsurf.eclass
# @MAINTAINER:
# maintainer-needed@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 7
# @BLURB: Handle buildsystem of www.netsurf-browser.org components
# @DESCRIPTION:
-# Handle unpacking and usage of separate buildsystem tarball and manage
-# multilib build, static-libs generation and debug building.
-#
-# Supports PATCHES and DOCS as in base.eclass
+# Handle settings build environment for netsurf build system
-case ${EAPI:-0} in
- 0|1|2|3|4) die "this eclass doesn't support EAPI<5" ;;
- *) ;;
+case "${EAPI:-0}" in
+ 7) ;;
+ *) die "EAPI=${EAPI} is not supported" ;;
esac
-inherit eutils toolchain-funcs multilib-minimal
+inherit toolchain-funcs
-EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install
-
-# @ECLASS-VARIABLE: NETSURF_BUILDSYSTEM
-# @DESCRIPTION:
-# Select version of buildsystem tarball to be used along the component
-# defaults to buildsystem-1.0
-NETSURF_BUILDSYSTEM="${NETSURF_BUILDSYSTEM:-buildsystem-1.0}"
-
-# @ECLASS-VARIABLE: NETSURF_BUILDSYSTEM_SRC_URI
-# @DESCRIPTION:
-# Download link for NETSURF_BUILDSYSTEM, add to SRC_URI iff set explicitly.
-NETSURF_BUILDSYSTEM_SRC_URI="http://download.netsurf-browser.org/libs/releases/${NETSURF_BUILDSYSTEM}.tar.gz -> netsurf-${NETSURF_BUILDSYSTEM}.tar.gz"
-
-# @ECLASS-VARIABLE: NETSURF_COMPONENT_TYPE
-# @DESCRIPTION:
-# Passed to buildsystem as COMPONENT_TYPE, valid values are
-# lib-shared, lib-static and binary. Defaults to "lib-static lib-shared"
-NETSURF_COMPONENT_TYPE="${NETSURF_COMPONENT_TYPE:-lib-static lib-shared}"
-
-# @ECLASS-VARIABLE: SRC_URI
-# @DESCRIPTION:
-# Defaults to http://download.netsurf-browser.org/libs/releases/${P}-src.tar.gz
-# and NETSURF_BUILDSYSTEM_SRC_URI.
-if [ -z "${SRC_URI}" ] ; then
- SRC_URI="http://download.netsurf-browser.org/libs/releases/${P}-src.tar.gz
- ${NETSURF_BUILDSYSTEM_SRC_URI}"
-fi
-
-IUSE="debug"
-if has lib-static ${NETSURF_COMPONENT_TYPE} ; then
- IUSE+=" static-libs"
-fi
-
-DEPEND="virtual/pkgconfig"
-
-# @FUNCTION: netsurf_src_prepare
-# @DESCRIPTION:
-# Apply and PATCHES and multilib_copy_sources for in-source build.
-netsurf_src_prepare() {
- [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
- debug-print "$FUNCNAME: applying user patches"
- epatch_user
-
- multilib_copy_sources
-}
-
-# @ECLASS-VARIABLE: netsurf_makeconf
+# @FUNCTION: netsurf_define_makeconf
+# @USAGE:
# @DESCRIPTION:
-# Configuration variable bash array to be passed to emake calls.
-# Defined at netsurf_src_configure and can be altered afterwards.
-
-# @FUNCTION: netsurf_src_configure
-# @DESCRIPTION:
-# Setup netsurf_makeconf and run multilib-minimal_src_configure.
-# A default multilib_src_configure is provided by this eclass.
-netsurf_src_configure() {
- netsurf_makeconf=(
- NSSHARED=${WORKDIR}/${NETSURF_BUILDSYSTEM}
+# This function sets NETSURF_MAKECONF as needed by netsurf build system
+netsurf_define_makeconf() {
+ NETSURF_MAKECONF=(
+ PREFIX="${EPREFIX}/usr"
+ NSSHARED="${EPREFIX}/usr/share/netsurf-buildsystem"
+ LIBDIR="$(get_libdir)"
Q=
+ CC="$(tc-getCC)"
+ LD="$(tc-getLD)"
HOST_CC="\$(CC)"
+ BUILD_CC="$(tc-getBUILD_CC)"
+ CXX="$(tc-getCXX)"
+ BUILD_CXX="$(tc-getBUILD_CXX)"
CCOPT=
CCNOOPT=
CCDBG=
LDDBG=
AR="$(tc-getAR)"
- BUILD=$(usex debug debug release)
- PREFIX="${EROOT}"usr
+ WARNFLAGS=
)
-
- multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
- sed -e "/^INSTALL_ITEMS/s: /lib: /$(get_libdir):g" \
- -i Makefile || die
- if [ -f ${PN}.pc.in ] ; then
- sed -e "/^libdir/s:/lib:/$(get_libdir):g" \
- -i ${PN}.pc.in || die
- fi
- sed -e 's:/bin/which:which:' \
- -i ../${NETSURF_BUILDSYSTEM}/makefiles/Makefile.tools || die
-}
-
-# @FUNCTION: netsurf_make
-# @DESCRIPTION:
-# Calls emake with netsurf_makeconf and toolchain CC/LD
-# as arguments for every NETSURF_COMPONENT_TYPE if activated.
-netsurf_make() {
- for COMPONENT_TYPE in ${NETSURF_COMPONENT_TYPE} ; do
- if [ "${COMPONENT_TYPE}" == "lib-static" ] ; then
- if ! use static-libs ; then
- continue
- fi
- fi
- emake CC="$(tc-getCC)" LD="$(tc-getLD)" "${netsurf_makeconf[@]}" \
- COMPONENT_TYPE=${COMPONENT_TYPE} LIBDIR="$(get_libdir)" "$@"
- done
-}
-
-# @FUNCTION: netsurf_src_compile
-# @DESCRIPTION:
-# Calls multilib-minimal_src_compile and netsurf_make doc if USE=doc.
-# A default multilib_src_compile is provided by this eclass.
-netsurf_src_compile() {
- local problems=$(egrep -Hn -- ' (-O.?|-g)( |$)' \
- $(find . -type f -name 'Makefile*'))
- if [ -n "${problems}" ] ; then
- elog "found bad flags:
-${problems}"
- fi
-
- multilib-minimal_src_compile "$@"
-
- if has doc ${USE} ; then
- netsurf_make "$@" docs
- fi
-}
-
-multilib_src_compile() {
- netsurf_make "$@"
-}
-
-# @FUNCTION: netsurf_src_test
-# @DESCRIPTION:
-# Calls multilib-minimal_src_test.
-# A default multilib_src_test is provided by this eclass.
-netsurf_src_test() {
- multilib-minimal_src_test "$@"
-}
-
-multilib_src_test() {
- netsurf_make test "$@"
-}
-
-# @FUNCTION: netsurf_src_install
-# @DESCRIPTION:
-# Calls multilib-minimal_src_install.
-# A default multilib_src_test is provided by this eclass.
-# A default multilib_src_install is provided by this eclass.
-netsurf_src_install() {
- multilib-minimal_src_install "$@"
-}
-
-multilib_src_install() {
- #DEFAULT_ABI may not be the last.
- #install to clean dir, rename binaries, move everything back
- if [ "${ABI}" == "${DEFAULT_ABI}" ] ; then
- netsurf_make DESTDIR="${D}" install "$@"
- else
- netsurf_make DESTDIR="${D}"${ABI} install "$@"
- if [ "${ABI}" != "${DEFAULT_ABI}" ] ; then
- find "${D}"${ABI}/usr/bin -type f -exec mv {} {}.${ABI} \;
- fi
- mv "${D}"${ABI}/* "${D}" || die
- rmdir "${D}"${ABI} || die
- fi
}