games-rpg/open-adventure: expose compilation flags

Signed-off-by: Nicola Smaniotto <smaniotto.nicola@gmail.com>
This commit is contained in:
Nicola Smaniotto committed 2023-11-27 19:11:25 +01:00
1 parent 654f7c0919
commit 019f1a2752
2 files changed
+28 -1

No files matched your search

+4
View File
@@ -5,6 +5,10 @@
<email>smaniotto.nicola@gmail.com</email>
<name>Nicola Smaniotto</name>
</maintainer>
<use>
<flag name="autosave">Build with auto-save/resume enabled</flag>
<flag name="nosave">Build with save/resume disabled</flag>
</use>
<upstream>
<remote-id type="gitlab">esr/open-adventure</remote-id>
</upstream>
@@ -4,7 +4,7 @@
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
inherit desktop python-any-r1
inherit desktop flag-o-matic python-any-r1
DESCRIPTION="Forward-port of the Crowther/Woods Adventure 2.5"
HOMEPAGE="http://www.catb.org/~esr/open-adventure/"
@@ -13,6 +13,14 @@ SRC_URI="https://gitlab.com/esr/${PN}/-/archive/${PV}/${P}.tar.bz2"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="autosave nosave test"
# autosave and nosave are mutually exclusive
# tests require that they are both disabled
REQUIRED_USE="
?? ( autosave nosave )
test? ( !autosave !nosave )
"
RESTRICT="!test? ( test )"
DEPEND="dev-libs/libedit"
RDEPEND="${DEPEND}"
@@ -26,7 +34,22 @@ python_check_deps() {
python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]"
}
src_prepare() {
eapply_user
# Add missing semicolon
sed -e 's/rspeak(SAVERESUME_DISABLED)/rspeak(SAVERESUME_DISABLED);/' \
-i saveresume.c
}
src_compile() {
if use autosave; then
append-cflags "-DADVENT_AUTOSAVE"
fi
if use nosave; then
append-cflags "-DADVENT_NOSAVE"
fi
emake advent advent.6
}