diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-09-06 10:28:05 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-09-06 10:28:05 +0100 |
commit | f1af93971b7490792d8541bc790e0d8c6d787059 (patch) | |
tree | a38046712bbc3a3844d77452d16c84e716caa3d4 /eclass/libretro-core.eclass | |
parent | fc637fb28da700da71ec2064d65ca5a7a31b9c6c (diff) |
gentoo resync : 06.08.2019
Diffstat (limited to 'eclass/libretro-core.eclass')
-rw-r--r-- | eclass/libretro-core.eclass | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/eclass/libretro-core.eclass b/eclass/libretro-core.eclass index 6825ef24ddab..61713a84b90a 100644 --- a/eclass/libretro-core.eclass +++ b/eclass/libretro-core.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 2018-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: libretro-core.eclass @@ -44,9 +44,13 @@ IUSE="debug" # @DESCRIPTION: # Name of this Libretro core. The libretro-core_src_install() phase function # will install the shared library "${S}/${LIBRETRO_CORE_NAME}_libretro.so" as a -# Libretro core. Defaults to the name of the current package excluding the -# "libretro-" prefix (e.g., "mgba" for the package "libretro-mgba"). -: ${LIBRETRO_CORE_NAME:=${PN#libretro-}} +# Libretro core. Defaults to the name of the current package with the +# "libretro-" prefix excluded and hyphens replaced with underscores +# (e.g. genesis_plus_gx for libretro-genesis-plus-gx) +if [[ -z "${LIBRETRO_CORE_NAME}" ]]; then + LIBRETRO_CORE_NAME=${PN#libretro-} + LIBRETRO_CORE_NAME=${LIBRETRO_CORE_NAME//-/_} +fi # @ECLASS-VARIABLE: LIBRETRO_COMMIT_SHA # @DESCRIPTION: @@ -72,12 +76,6 @@ else fi inherit flag-o-matic -# @ECLASS-VARIABLE: LIBRETRO_CORE_LIB_FILE -# @REQUIRED -# @DESCRIPTION: -# Absolute path of this Libretro core's shared library. -: ${LIBRETRO_CORE_LIB_FILE:="${S}/${LIBRETRO_CORE_NAME}_libretro.so"} - case "${EAPI:-0}" in 6|7) EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install @@ -130,6 +128,7 @@ libretro-core_src_prepare() { -e 's/\r$//g' \ -e "/flags.*=/s:-O[[:digit:]]:${CFLAGS}:g" \ -e "/CFLAGS.*=/s:-O[[:digit:]]:${CFLAGS}:g" \ + -e "/CXXFLAGS.*=/s:-O[[:digit:]]:${CXXFLAGS}:g" \ -e "/.*,--version-script=.*/s:$: ${LDFLAGS} ${LIBS}:g" \ -e "/\$(CC)/s:\(\$(SHARED)\):\1 ${LDFLAGS} ${LIBS}:" \ -e 's:\(\$(CC)\):\1 \$(CFLAGS):g' \ @@ -168,12 +167,27 @@ libretro-core_src_compile() { $([[ -f Makefile.libretro ]] && echo '-f Makefile.libretro') } +# @VARIABLE: LIBRETRO_CORE_LIB_FILE +# @DEFAULT_UNSET +# @DESCRIPTION: +# Absolute path of this Libretro core's shared library. +# src_install. +# @CODE +# src_install() { +# local LIBRETRO_CORE_LIB_FILE="${S}/somecore_libretro.so" +# +# libretro-core_src_install +# } +# @CODE + # @FUNCTION: libretro-core_src_install # @DESCRIPTION: # The libretro-core src_install function which is exported. # # This function installs the shared library for this Libretro core. libretro-core_src_install() { + local LIBRETRO_CORE_LIB_FILE=${LIBRETRO_CORE_LIB_FILE:-"${S}/${LIBRETRO_CORE_NAME}_libretro.so"} + # Absolute path of the directory containing Libretro shared libraries. local libretro_lib_dir="/usr/$(get_libdir)/libretro" # If this core's shared library exists, install that. |