media-libs/dr_mp3: new package, add 0.6.37

Signed-off-by: Lucio Sauer <watermanpaint@posteo.net>
This commit is contained in:
Lucio Sauer
2023-09-04 00:23:38 +02:00
parent 69ef987042
commit 72b0f9c3ea
4 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
DIST dr_mp3-0.6.37.gh.tar.gz 518399 BLAKE2B f2e78096f23332d4ef3ec0336230a9dcf4800356418607dcda5b8025e284feac6532c589ed5a916525396159dac5a79c343f90deec6337376bc9fdfbd93d0675 SHA512 01328904666c11416c361315d693411ea8f53b883f5acb8e6233b121abaab08cc3e4ba2c5d2a3b2a39fbcd0f868647f7f892d8ef6cd7be8ef683bb0497dd7114
DIST dr_mp3-0.6.37.h 181793 BLAKE2B 982668ac1e9d4dbfd9acea11c8967fd6600cee801457655ccbda1ca8a02393797e777b61f7d1d4d7aae6bf1c19263208c442df7be431f56b9fc509f57fae4845 SHA512 77df59c31aa45ccf62e880b6f4a9daad809f2eae728e1f8754e27639e20b47712a896ec345823b87b95d434eb3670adad1bb22252a85f377f26ffea842d16468

View File

@@ -0,0 +1,73 @@
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit toolchain-funcs
DESCRIPTION="Single-header MP3 audio decoder library"
HOMEPAGE="https://github.com/mackron/dr_libs/"
COMMIT="1b0bc87c6b9b04052e6ef0117396dab8482c250e"
SRC_URI="!test? ( https://raw.githubusercontent.com/mackron/dr_libs/${COMMIT}/dr_mp3.h -> ${P}.h )
test? ( https://github.com/mackron/dr_libs/archive/${COMMIT}.tar.gz -> ${P}.gh.tar.gz )"
LICENSE="|| ( MIT-0 public-domain )"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
S="${WORKDIR}/dr_libs-${COMMIT}"
# Unfortunately, the only other test is interactive.
TESTCASES=(
dr_mp3_test_0.c
)
src_unpack() {
default
unpack "${FILESDIR}"/${P}-docs.tar.xz
}
src_prepare() {
if use test; then
# Remove some unused parts of the source tree that could contribute different
# (but acceptable) license terms if they were used—just to prove that we do not
# use them.
rm -rv old || die
fi
default
}
src_compile() {
if use test; then
local MY_{CC,BUILD}
MY_CC=$(tc-getCC)
pushd tests > /dev/null || die
for tcase in ${TESTCASES[@]}; do
einfo "Compiling test case ${tcase}."
MY_BUILD="${MY_CC} mp3/${tcase} -o bin/${tcase} ${CFLAGS} ${CPPFLAGS}"
${MY_BUILD} || die "Build failed: ${MY_BUILD}"
done
popd || die
fi
}
src_test() {
pushd tests > /dev/null || die
for tcase in ${TESTCASES[@]}; do
einfo "Running test case ${tcase}."
./bin/${tcase} || die "Test case ${tcase} failed."
done
popd || die
}
src_install() {
einstalldocs
if use test; then
doheader dr_mp3.h
else
newheader "${DISTDIR}"/${P}.h dr_mp3.h
fi
}

Binary file not shown.

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>watermanpaint@posteo.net</email>
<name>Lucio Sauer</name>
</maintainer>
<upstream>
<remote-id type="github">mackron/dr_libs</remote-id>
</upstream>
</pkgmetadata>