-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: libretro-core.eclass
# @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: