media-sound/spct: add 1.1.7

This is a bit of an overhaul to the ebuild, done because upstream added
a shared/static library version of the application.

With the changes here, prefix builds, multilib builds, and cross builds
should all work correctly (and I've tested to make sure they do).

Support is included for the binary itself, with the shared library gated
behind a USE flag.

Signed-off-by: Vivian Heisz (vhz) <demize@unstable.systems>
This commit is contained in:
Vivian Heisz (vhz)
2025-07-11 21:47:09 -04:00
parent fd0cd655e6
commit fa3e56c1ba
3 changed files with 66 additions and 1 deletions

View File

@@ -1 +1,2 @@
DIST spct-1.1.3.tar.gz 652776 BLAKE2B 7bd4da790c3afbc7bbc31b7f9c457b07a83034518375626265fe6da0fd13441bdf96fbb14b8b5b28ca92d78d993a1eaff8dc23bbe2f2ad7234c1c34369333d68 SHA512 58df651f0613d4cc61bb70236a97d711b9f99024ccbc8db7d89dc8459cdf0fc256491ff41abb87935e7cf808c5933933683fc69d59a181fc8bd684824cbfac1d
DIST spct-1.1.7.tar.gz 653891 BLAKE2B 500347fa1c0738dc2b2440e7d212b6558bf82ca6a83275b4c76b6ead3a623805337fbde66a2c1ca6829f1c6f9a25331ee5c0cdb418a142f692fad624bec5d1db SHA512 d26fb611da309325aec3d7d5d2c64105b0f441249d796fc255a7f07b04bc479cd115cf579be682b4d54238a45d3aa619524d2c2afd07c5b35292f66137786358

View File

@@ -2,7 +2,7 @@
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<name>demize</name>
<name>Vivian Heisz (vhz)</name>
<email>demize@unstable.systems</email>
</maintainer>
<upstream>
@@ -13,4 +13,7 @@
<remote-id type="codeberg">jneen/spct</remote-id>
<bugs-to>https://codeberg.org/jneen/spct/issues/new</bugs-to>
</upstream>
<use>
<flag name="libspct">Build spct as a shared library (libspct) for use in other applications.</flag>
</use>
</pkgmetadata>

View File

@@ -0,0 +1,61 @@
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit toolchain-funcs multilib-build
DESCRIPTION="CLI program for playing back and rendering SPC files."
HOMEPAGE="https://codeberg.org/jneen/spct"
SRC_URI="https://codeberg.org/jneen/spct/archive/v${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}"
LICENSE="GPL-3"
SLOT="0/$(ver_cut 1)"
KEYWORDS="~amd64 ~arm64"
IUSE="libspct"
DEPEND="
media-libs/game-music-emu[${MULTILIB_USEDEP}]
sys-libs/ncurses:=[${MULTILIB_USEDEP}]
"
BDEPEND="virtual/pkgconfig"
RDEPEND="
${DEPEND}
"
src_compile() {
# We use multilib-build directly here because the existing build system is designed with cross-compiles in mind
# We also specify the platform and arch manually, since otherwise those are determined by `uname` on CHOST
spct_compile() {
tc-export CXX
if multilib_is_native_abi; then
# only build the binary on the native ABI
emake VERSION="${PV}" PLATFORM="linux" ARCH="$(tc-arch)" LIBGME_NO_VENDOR=1 bin
fi
if use libspct; then
emake VERSION="${PV}" PLATFORM="linux" ARCH="$(tc-arch)" LIBGME_NO_VENDOR=1 lib
fi
}
multilib_foreach_abi spct_compile
}
src_install() {
spct_install() {
if multilib_is_native_abi; then
# only install the binary on the native ABI
emake PREFIX="${ED}/usr" LIBDIR="${ED}/usr/$(get_libdir)" VERSION="${PV}" PLATFORM="linux" \
ARCH="$(tc-arch)" LIBGME_NO_VENDOR=1 install-bin
fi
if use libspct; then
emake PREFIX="${ED}/usr" LIBDIR="${ED}/usr/$(get_libdir)" VERSION="${PV}" PLATFORM="linux" \
ARCH="$(tc-arch)" LIBGME_NO_VENDOR=1 install-lib
fi
}
multilib_foreach_abi spct_install
dodoc README.md
}