2020-05-01 15:53:11 +02:00
|
|
|
# Copyright 1999-2020 Gentoo Authors
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI=7
|
|
|
|
|
|
|
|
inherit cmake-utils
|
|
|
|
|
|
|
|
DESCRIPTION="A Simple SDL2 / FFmpeg library for audio/video playback written in C99"
|
|
|
|
HOMEPAGE="https://github.com/katajakasa/SDL_kitchensink"
|
|
|
|
SRC_URI="https://github.com/katajakasa/SDL_kitchensink/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
|
|
|
|
|
|
|
LICENSE="MIT"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS="~amd64 ~arm ~ppc64 ~x86"
|
|
|
|
|
|
|
|
IUSE="static sanitize examples"
|
|
|
|
|
|
|
|
BDEPEND+="
|
|
|
|
examples? ( sys-apps/coreutils )
|
|
|
|
"
|
|
|
|
|
|
|
|
RDEPEND+="
|
2020-05-06 17:19:40 +02:00
|
|
|
sanitize? ( >=sys-devel/gcc-5.0.0[sanitize] )
|
2020-05-01 15:53:11 +02:00
|
|
|
media-libs/libsdl2
|
|
|
|
media-video/ffmpeg[libass]
|
|
|
|
"
|
|
|
|
|
|
|
|
#S="${S}/${PN}"
|
|
|
|
S="${WORKDIR}/SDL_kitchensink-${PV}"
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
cmake-utils_src_prepare
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
SANITIZE="OFF"
|
|
|
|
EXAMPLES="OFF"
|
2020-05-04 21:38:43 +02:00
|
|
|
STATIC="OFF"
|
2020-05-01 15:53:11 +02:00
|
|
|
if use sanitize; then SANITIZE="ON"; fi
|
|
|
|
if use examples; then EXAMPLES="ON"; fi
|
2020-05-04 21:38:43 +02:00
|
|
|
if use static; then STATIC="ON"; fi
|
2020-05-01 15:53:11 +02:00
|
|
|
local mycmakeargs=(
|
|
|
|
-DUSE_ASAN="${SANITIZE}"
|
|
|
|
-DBUILD_EXAMPLES="${EXAMPLES}"
|
2020-05-04 21:38:43 +02:00
|
|
|
-DBUILD_STATIC="${STATIC}"
|
2020-05-01 15:53:11 +02:00
|
|
|
)
|
|
|
|
cmake-utils_src_configure
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
cmake-utils_src_install
|
|
|
|
if use examples; then
|
|
|
|
for i in audio complex custom rwops simple; do
|
|
|
|
mv "${BUILD_DIR}"/${i} "${BUILD_DIR}"/SDL_kitchensink-${i}
|
|
|
|
dobin "${BUILD_DIR}"/SDL_kitchensink-${i}
|
2020-05-04 21:38:43 +02:00
|
|
|
elog "Installed ${i} example as SDL_kitchensink-${i}"
|
2020-05-01 15:53:11 +02:00
|
|
|
done
|
|
|
|
if use static; then
|
|
|
|
elog "Examples are linked against static SDL_kitchensink library."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|