commit:     a075426e95a45f7cb03888bc57f26c2228115479
Author:     Stefan Strogin <stefan.strogin <AT> gmail <DOT> com>
AuthorDate: Mon Mar  4 18:32:49 2019 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sat Mar  9 22:16:12 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a075426e

games-roguelike/angband: rework USE flag logic

Add REQUIRED_USE "at least one of" X or ncurses, thanks to it we can
drop some tricky conditions in src_configure and RDEPEND.
Besides that angband simply cannot build with USE="-X -ncurses".

Add sound? ( sdl ) to REQUIRED_USE as SDL is needed for sound.
Add media-fonts/font-misc-misc to RDEPEND with USE=X.

Default USE flags in accordance with the upstream configure options:
set +X, +ncurses; disable sound.

Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Stefan Strogin <stefan.strogin <AT> gmail.com>
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 games-roguelike/angband/angband-4.1.3.ebuild | 38 +++++++++++++---------------
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/games-roguelike/angband/angband-4.1.3.ebuild 
b/games-roguelike/angband/angband-4.1.3.ebuild
index 34d75a13d94..830cddc683f 100644
--- a/games-roguelike/angband/angband-4.1.3.ebuild
+++ b/games-roguelike/angband/angband-4.1.3.ebuild
@@ -14,9 +14,15 @@ 
SRC_URI="https://rephial.org/downloads/${MAJOR_PV}/${P}.tar.gz";
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE="ncurses sdl +sound X"
+IUSE="+ncurses sdl sound +X"
 
-RDEPEND="!ncurses? ( !X? ( !sdl? ( sys-libs/ncurses:0=[unicode] ) ) )
+REQUIRED_USE="sound? ( sdl )
+       || ( X ncurses )"
+
+RDEPEND="X? (
+               media-fonts/font-misc-misc
+               x11-libs/libX11
+       )
        ncurses? ( sys-libs/ncurses:0=[unicode] )
        sdl? (
                media-libs/libsdl[video,X]
@@ -26,8 +32,7 @@ RDEPEND="!ncurses? ( !X? ( !sdl? ( 
sys-libs/ncurses:0=[unicode] ) ) )
                        media-libs/libsdl[sound]
                        media-libs/sdl-mixer[mp3]
                )
-       )
-       X? ( x11-libs/libX11 )"
+       )"
 DEPEND="${RDEPEND}
        dev-python/docutils
        virtual/pkgconfig"
@@ -54,23 +59,16 @@ src_prepare() {
 }
 
 src_configure() {
-       local myconf
-
-       if use sdl; then
-               myconf="$(use_enable sound sdl-mixer)"
-       else
-               myconf="--disable-sdl-mixer"
-       fi
+       local myconf=(
+               --bindir="${EPREFIX}"/usr/bin
+               --with-private-dirs
+               $(use_enable X x11)
+               $(use_enable sdl)
+               $(use_enable sound sdl-mixer)
+               $(use_enable ncurses curses)
+       )
 
-       econf \
-               --bindir="${EPREFIX}"/usr/bin \
-               --with-private-dirs \
-               $(use_enable X x11) \
-               $(use_enable sdl) \
-               $(use_enable ncurses curses) \
-               $(use !sdl && use !ncurses && use !X && \
-                       echo --enable-curses) \
-               ${myconf}
+       econf "${myconf[@]}"
 }
 
 src_install() {

Reply via email to