libretro-core.eclass
Description
The libretro eclass is designed to streamline the construction of ebuilds for Libretro core ebuilds.
Libretro cores can be found under https://github.com/libretro/
They all use the same basic make based build system, are located in the same github account, and do not release named or numbered versions (so ebuild versions for git commits are keys). This eclass covers those commonalities reducing much duplication between the ebuilds.
Example
EAPI=7
LIBRETRO_CORE_NAME="2048"
LIBRETRO_COMMIT_SHA="45655d3662e4cbcd8afb28e2ee3f5494a75888de"
KEYWORDS="~amd64 ~x86"
inherit libretro-core
DESCRIPTION="Port of 2048 puzzle game to the libretro API"
LICENSE="Unlicense"
SLOT="0"
Functions
- libretro-core_src_unpack
-
The libretro-core src_unpack function which is exported.
This function retrieves the remote Libretro core info files.
- libretro-core_src_prepare
-
The libretro-core src_prepare function which is exported.
This function prepares the source by making custom modifications.
- libretro-core_src_compile
-
The libretro-core src_compile function which is exported.
This function compiles the shared library for this Libretro core.
- libretro-core_src_install
-
The libretro-core src_install function which is exported.
This function installs the shared library for this Libretro core.
Variables
- LIBRETRO_CORE_NAME (REQUIRED)
-
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 with the "libretro-" prefix excluded and hyphens replaced with underscores (e.g. genesis_plus_gx for libretro-genesis-plus-gx)
- LIBRETRO_COMMIT_SHA (SET BEFORE INHERIT)
-
Commit SHA used for SRC_URI will die if not set in <9999 ebuilds. Needs to be set before inherit.
- LIBRETRO_REPO_NAME ?= "libretro/libretro-${LIBRETRO_CORE_NAME}" (REQUIRED) (SET BEFORE INHERIT)
-
Contains the real repo name of the core formatted as "repouser/reponame". Needs to be set before inherit. Otherwise defaults to "libretro/${PN}"
Function Variables
- myemakeargs
-
Optional emake arguments as a bash array. Should be defined before calling src_compile.
src_compile() { local myemakeargs=( $(usex neon "HAVE_NEON=1" "") ) libretro-core_src_compile }
- LIBRETRO_CORE_LIB_FILE
-
Absolute path of this Libretro core's shared library. src_install.
src_install() { local LIBRETRO_CORE_LIB_FILE="${S}/somecore_libretro.so" libretro-core_src_install }
Reporting Bugs
Please report bugs via https://bugs.gentoo.org/