diff options
Diffstat (limited to 'games-rpg')
-rw-r--r-- | games-rpg/open-adventure/metadata.xml | 4 | ||||
-rw-r--r-- | games-rpg/open-adventure/open-adventure-1.16.ebuild | 25 |
2 files changed, 28 insertions, 1 deletions
diff --git a/games-rpg/open-adventure/metadata.xml b/games-rpg/open-adventure/metadata.xml index a4448d805..31d3db323 100644 --- a/games-rpg/open-adventure/metadata.xml +++ b/games-rpg/open-adventure/metadata.xml @@ -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> diff --git a/games-rpg/open-adventure/open-adventure-1.16.ebuild b/games-rpg/open-adventure/open-adventure-1.16.ebuild index 051da13c6..2fde826c4 100644 --- a/games-rpg/open-adventure/open-adventure-1.16.ebuild +++ b/games-rpg/open-adventure/open-adventure-1.16.ebuild @@ -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 } |