commit:     ad15f92151f402b95fc352d61b55d037efe2d5bb
Author:     Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 23:34:01 2022 +0000
Commit:     Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
CommitDate: Mon May 23 00:04:25 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad15f921

games-roguelike/stone-soup: add USE=advpng

... as a .png compression option.  Patches makes the advpng/pngcrush
decision deterministic not automagic.

Also split DEPEND/BDEPEND

Signed-off-by: Erik Mackdanz <stasibear <AT> gentoo.org>
Closes: https://bugs.gentoo.org/843413
Package-Manager: Portage-3.0.30, Repoman-3.0.3

 games-roguelike/stone-soup/files/make-advpng.patch | 21 ++++++++++
 .../{make.patch => make-no-png-dep-fix.patch}      |  0
 games-roguelike/stone-soup/files/make.patch        | 45 +++++++++++++++++-----
 games-roguelike/stone-soup/metadata.xml            |  6 ++-
 .../stone-soup/stone-soup-0.25.1-r102.ebuild       |  2 +-
 ...1-r102.ebuild => stone-soup-0.25.1-r103.ebuild} | 23 ++++++++---
 .../stone-soup/stone-soup-0.26.1-r1.ebuild         |  2 +-
 ....26.1-r1.ebuild => stone-soup-0.26.1-r2.ebuild} | 23 ++++++++---
 ...p-0.27.1.ebuild => stone-soup-0.27.1-r1.ebuild} | 23 ++++++++---
 .../stone-soup/stone-soup-0.27.1.ebuild            |  2 +-
 ...p-0.28.0.ebuild => stone-soup-0.28.0-r1.ebuild} | 23 ++++++++---
 .../stone-soup/stone-soup-0.28.0.ebuild            |  2 +-
 12 files changed, 136 insertions(+), 36 deletions(-)

diff --git a/games-roguelike/stone-soup/files/make-advpng.patch 
b/games-roguelike/stone-soup/files/make-advpng.patch
new file mode 100644
index 000000000000..683e478212b4
--- /dev/null
+++ b/games-roguelike/stone-soup/files/make-advpng.patch
@@ -0,0 +1,21 @@
+--- a/Makefile 2022-05-22 11:54:15.819138403 -0500
++++ b/Makefile 2022-05-22 11:56:24.475145274 -0500
+@@ -1080,8 +1080,7 @@
+ 
+ ifdef TILES_ANY
+ ifndef NO_OPTIMIZE
+-      PNGCRUSH = pngcrush -q -m 113
+-      PNGCRUSH_LABEL = PNGCRUSH
++    USE_ADVPNG = y
+ endif
+ endif
+ 
+@@ -1727,7 +1726,8 @@
+ $(TILEDEFSRCS) $(TILEDEFHDRS) $(ORIGTILEFILES): build-rltiles
+ 
+ dat/tiles/%.png: $(RLTILES)/%.png
+       $(QUIET_PNGCRUSH)$(PNGCRUSH) $< $@
++      $(QUIET_ADVPNG)$(ADVPNG) $@
+ 
+ clean-rltiles:
+       $(RM) $(DESTTILEFILES)

diff --git a/games-roguelike/stone-soup/files/make.patch 
b/games-roguelike/stone-soup/files/make-no-png-dep-fix.patch
similarity index 100%
copy from games-roguelike/stone-soup/files/make.patch
copy to games-roguelike/stone-soup/files/make-no-png-dep-fix.patch

diff --git a/games-roguelike/stone-soup/files/make.patch 
b/games-roguelike/stone-soup/files/make.patch
index b43c9c41e8c8..e0d086520099 100644
--- a/games-roguelike/stone-soup/files/make.patch
+++ b/games-roguelike/stone-soup/files/make.patch
@@ -1,5 +1,5 @@
---- a/Makefile 2021-08-02 13:54:26.603900984 -0500
-+++ b/Makefile 2021-08-02 13:57:26.018910565 -0500
+--- a/Makefile 2022-05-22 11:25:51.733047395 -0500
++++ b/Makefile 2022-05-22 11:42:54.240102003 -0500
 @@ -186,7 +186,7 @@
  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
  uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
@@ -9,7 +9,7 @@
  ARCH := $(HOST)
  
  ifdef CROSSHOST
-@@ -457,15 +457,7 @@
+@@ -451,15 +451,7 @@
  GCC_VER_SUFFIX:=-$(GCC_VER)
  endif
  
@@ -25,7 +25,7 @@
  
  ifneq ($(FORCE_CC),)
  GCC := $(FORCE_CC)
-@@ -765,7 +757,6 @@
+@@ -759,7 +751,6 @@
        FULLDEBUG=YesPlease
        DEBUG=YesPlease
        NO_OPTIMIZE=YesPlease
@@ -33,7 +33,7 @@
  endif
  
  # Debug-Lite
-@@ -773,7 +764,6 @@
+@@ -767,7 +758,6 @@
  ifneq (,$(filter debug-lite,$(MAKECMDGOALS)))
        DEBUG=YesPlease
        NO_OPTIMIZE=YesPlease
@@ -41,7 +41,7 @@
  endif
  
  # Profile
-@@ -781,12 +771,10 @@
+@@ -775,12 +765,10 @@
  ifneq (,$(filter profile,$(MAKECMDGOALS)))
        FULLDEBUG=YesPlease
        DEBUG=YesPlease
@@ -54,7 +54,7 @@
  endif
  
  ifdef HURRY
-@@ -938,7 +926,7 @@
+@@ -932,7 +920,7 @@
      INSTALL_FONTS += "$(PROPORTIONAL_FONT)"
    endif
  else
@@ -63,7 +63,7 @@
    ifneq (,$(SYS_PROPORTIONAL_FONT))
      ifeq (,$(COPY_FONTS))
        DEFINES += -DPROPORTIONAL_FONT=\"$(SYS_PROPORTIONAL_FONT)\"
-@@ -958,7 +946,7 @@
+@@ -952,7 +940,7 @@
      INSTALL_FONTS += "$(MONOSPACED_FONT)"
    endif
  else
@@ -72,7 +72,22 @@
    ifneq (,$(SYS_MONOSPACED_FONT))
      ifeq (,$(COPY_FONTS))
        DEFINES += -DMONOSPACED_FONT=\"$(SYS_MONOSPACED_FONT)\"
-@@ -1187,9 +1175,8 @@
+@@ -1092,14 +1080,8 @@
+ 
+ ifdef TILES_ANY
+ ifndef NO_OPTIMIZE
+-  ifneq (,$(shell which advpng))
+-    USE_ADVPNG = y
+-  else
+-    ifneq (,$(shell which pngcrush))
+       PNGCRUSH = pngcrush -q -m 113
+       PNGCRUSH_LABEL = PNGCRUSH
+-    endif
+-  endif
+ endif
+ endif
+ 
+@@ -1181,9 +1163,8 @@
  
  LANGUAGES = $(filter-out en, $(notdir $(wildcard dat/descript/??)))
  SRC_PKG_BASE  := stone_soup
@@ -83,7 +98,7 @@
  WINARCH := $(shell $(GXX) -dumpmachine | grep -q x64_64 && echo win64 || echo 
win32)
  
  export SRC_VERSION
-@@ -1523,7 +1510,7 @@
+@@ -1511,7 +1492,7 @@
  endif
  endif
  
@@ -92,3 +107,13 @@
        [ -d $(prefix_fp)/$(bin_prefix) ] || mkdir -p $(prefix_fp)/$(bin_prefix)
        $(COPY) $(GAME) $(prefix_fp)/$(bin_prefix)/
        $(STRIP) $(prefix_fp)/$(bin_prefix)/$(GAME)
+@@ -1747,9 +1728,6 @@
+ 
+ dat/tiles/%.png: $(RLTILES)/%.png
+       $(QUIET_PNGCRUSH)$(PNGCRUSH) $< $@
+-ifdef USE_ADVPNG
+-      $(QUIET_ADVPNG)$(ADVPNG) $@
+-endif
+ 
+ clean-rltiles:
+       $(RM) $(DESTTILEFILES)

diff --git a/games-roguelike/stone-soup/metadata.xml 
b/games-roguelike/stone-soup/metadata.xml
index 3d2030e7ea4d..1893130c23a1 100644
--- a/games-roguelike/stone-soup/metadata.xml
+++ b/games-roguelike/stone-soup/metadata.xml
@@ -15,12 +15,14 @@
                <remote-id type="sourceforge">crawl-ref</remote-id>
        </upstream>
        <use>
-               <flag name="tiles">Enable for graphical (tiled) build.
-                       (can be enabled on top of ncurses)
+               <flag name="advpng">Use alternate png optimization.
                </flag>
                <flag name="ncurses">Enable for console (uses ncurses) based 
build.
                        (can be enabled on top of tiles)
                </flag>
+               <flag name="tiles">Enable for graphical (tiled) build.
+                       (can be enabled on top of ncurses)
+               </flag>
        </use>
        <longdescription lang="en">
                Dungeon Crawl Stone Soup is a free roguelike game of exploration

diff --git a/games-roguelike/stone-soup/stone-soup-0.25.1-r102.ebuild 
b/games-roguelike/stone-soup/stone-soup-0.25.1-r102.ebuild
index c78e6a378ad4..caf09a0a1313 100644
--- a/games-roguelike/stone-soup/stone-soup-0.25.1-r102.ebuild
+++ b/games-roguelike/stone-soup/stone-soup-0.25.1-r102.ebuild
@@ -63,7 +63,7 @@ DEPEND="${RDEPEND}
 
 S=${WORKDIR}/${MY_P}/source
 PATCHES=(
-       "${FILESDIR}"/make.patch
+       "${FILESDIR}"/make-no-png-dep-fix.patch
        "${FILESDIR}"/rltiles-make.patch
 )
 

diff --git a/games-roguelike/stone-soup/stone-soup-0.25.1-r102.ebuild 
b/games-roguelike/stone-soup/stone-soup-0.25.1-r103.ebuild
similarity index 95%
copy from games-roguelike/stone-soup/stone-soup-0.25.1-r102.ebuild
copy to games-roguelike/stone-soup/stone-soup-0.25.1-r103.ebuild
index c78e6a378ad4..67a30f696915 100644
--- a/games-roguelike/stone-soup/stone-soup-0.25.1-r102.ebuild
+++ b/games-roguelike/stone-soup/stone-soup-0.25.1-r103.ebuild
@@ -23,8 +23,8 @@ SRC_URI="
 # Public Domain|CC0: most of tiles
 # MIT: json.cc/json.h, some .js files in webserver/static/scripts/contrib/
 LICENSE="GPL-2 BSD BSD-2 public-domain CC0-1.0 MIT"
-KEYWORDS="amd64 x86"
-IUSE="debug ncurses sound test +tiles"
+KEYWORDS="~amd64 ~x86"
+IUSE="advpng debug ncurses sound test +tiles"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
@@ -47,15 +47,24 @@ RDEPEND="
                virtual/opengl
        )"
 DEPEND="${RDEPEND}
+       test? ( dev-cpp/catch:0 )
+       tiles? (
+               sys-libs/ncurses:0
+       )
+       "
+BDEPEND="
        app-arch/unzip
        dev-lang/perl
        ${PYTHON_DEPS}
        $(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]')
        sys-devel/flex
-       test? ( dev-cpp/catch:0 )
        tiles? (
-               media-gfx/pngcrush
-               sys-libs/ncurses:0
+               advpng? (
+                       app-arch/advancecomp
+               )
+               !advpng? (
+                       media-gfx/pngcrush
+               )
        )
        virtual/pkgconfig
        virtual/yacc
@@ -90,6 +99,10 @@ src_prepare() {
        default
        python_fix_shebang "${S}/util/species-gen.py"
 
+       if use advpng; then
+               eapply "${FILESDIR}/make-advpng.patch"
+       fi
+
        sed -i -e "s/GAME = crawl$/GAME = crawl-${SLOT}/" "${S}/Makefile" \
                || die "Couldn't append slot to executable name"
 

diff --git a/games-roguelike/stone-soup/stone-soup-0.26.1-r1.ebuild 
b/games-roguelike/stone-soup/stone-soup-0.26.1-r1.ebuild
index 5d766d8353bb..21a11669794b 100644
--- a/games-roguelike/stone-soup/stone-soup-0.26.1-r1.ebuild
+++ b/games-roguelike/stone-soup/stone-soup-0.26.1-r1.ebuild
@@ -63,7 +63,7 @@ DEPEND="${RDEPEND}
 
 S=${WORKDIR}/${MY_P}/source
 PATCHES=(
-       "${FILESDIR}"/make.patch
+       "${FILESDIR}"/make-no-png-dep-fix.patch
        "${FILESDIR}"/rltiles-make.patch
 )
 

diff --git a/games-roguelike/stone-soup/stone-soup-0.26.1-r1.ebuild 
b/games-roguelike/stone-soup/stone-soup-0.26.1-r2.ebuild
similarity index 95%
copy from games-roguelike/stone-soup/stone-soup-0.26.1-r1.ebuild
copy to games-roguelike/stone-soup/stone-soup-0.26.1-r2.ebuild
index 5d766d8353bb..0d4c15a1cafe 100644
--- a/games-roguelike/stone-soup/stone-soup-0.26.1-r1.ebuild
+++ b/games-roguelike/stone-soup/stone-soup-0.26.1-r2.ebuild
@@ -23,8 +23,8 @@ SRC_URI="
 # Public Domain|CC0: most of tiles
 # MIT: json.cc/json.h, some .js files in webserver/static/scripts/contrib/
 LICENSE="GPL-2 BSD BSD-2 public-domain CC0-1.0 MIT"
-KEYWORDS="amd64 x86"
-IUSE="debug ncurses sound test +tiles"
+KEYWORDS="~amd64 ~x86"
+IUSE="advpng debug ncurses sound test +tiles"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
@@ -47,15 +47,24 @@ RDEPEND="
                virtual/opengl
        )"
 DEPEND="${RDEPEND}
+       test? ( dev-cpp/catch:0 )
+       tiles? (
+               sys-libs/ncurses:0
+       )
+       "
+BDEPEND="
        app-arch/unzip
        dev-lang/perl
        ${PYTHON_DEPS}
        $(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]')
        sys-devel/flex
-       test? ( dev-cpp/catch:0 )
        tiles? (
-               media-gfx/pngcrush
-               sys-libs/ncurses:0
+               advpng? (
+                       app-arch/advancecomp
+               )
+               !advpng? (
+                       media-gfx/pngcrush
+               )
        )
        virtual/pkgconfig
        virtual/yacc
@@ -90,6 +99,10 @@ src_prepare() {
        default
        python_fix_shebang "${S}/util/species-gen.py"
 
+       if use advpng; then
+               eapply "${FILESDIR}/make-advpng.patch"
+       fi
+
        sed -i -e "s/GAME = crawl$/GAME = crawl-${SLOT}/" "${S}/Makefile" \
                || die "Couldn't append slot to executable name"
 

diff --git a/games-roguelike/stone-soup/stone-soup-0.27.1.ebuild 
b/games-roguelike/stone-soup/stone-soup-0.27.1-r1.ebuild
similarity index 95%
copy from games-roguelike/stone-soup/stone-soup-0.27.1.ebuild
copy to games-roguelike/stone-soup/stone-soup-0.27.1-r1.ebuild
index 5edf90bf5aa1..b4a89576bda6 100644
--- a/games-roguelike/stone-soup/stone-soup-0.27.1.ebuild
+++ b/games-roguelike/stone-soup/stone-soup-0.27.1-r1.ebuild
@@ -23,8 +23,8 @@ SRC_URI="
 # Public Domain|CC0: most of tiles
 # MIT: json.cc/json.h, some .js files in webserver/static/scripts/contrib/
 LICENSE="GPL-2 BSD BSD-2 public-domain CC0-1.0 MIT"
-KEYWORDS="amd64 x86"
-IUSE="debug ncurses sound test +tiles"
+KEYWORDS="~amd64 ~x86"
+IUSE="advpng debug ncurses sound test +tiles"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
@@ -47,15 +47,24 @@ RDEPEND="
                virtual/opengl
        )"
 DEPEND="${RDEPEND}
+       test? ( dev-cpp/catch:0 )
+       tiles? (
+               sys-libs/ncurses:0
+       )
+       "
+BDEPEND="
        app-arch/unzip
        dev-lang/perl
        ${PYTHON_DEPS}
        $(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]')
        sys-devel/flex
-       test? ( dev-cpp/catch:0 )
        tiles? (
-               media-gfx/pngcrush
-               sys-libs/ncurses:0
+               advpng? (
+                       app-arch/advancecomp
+               )
+               !advpng? (
+                       media-gfx/pngcrush
+               )
        )
        virtual/pkgconfig
        virtual/yacc
@@ -90,6 +99,10 @@ src_prepare() {
        default
        python_fix_shebang "${S}/util/species-gen.py"
 
+       if use advpng; then
+               eapply "${FILESDIR}/make-advpng.patch"
+       fi
+
        sed -i -e "s/GAME = crawl$/GAME = crawl-${SLOT}/" "${S}/Makefile" \
                || die "Couldn't append slot to executable name"
 

diff --git a/games-roguelike/stone-soup/stone-soup-0.27.1.ebuild 
b/games-roguelike/stone-soup/stone-soup-0.27.1.ebuild
index 5edf90bf5aa1..8c7c910c42ba 100644
--- a/games-roguelike/stone-soup/stone-soup-0.27.1.ebuild
+++ b/games-roguelike/stone-soup/stone-soup-0.27.1.ebuild
@@ -63,7 +63,7 @@ DEPEND="${RDEPEND}
 
 S=${WORKDIR}/${MY_P}/source
 PATCHES=(
-       "${FILESDIR}"/make.patch
+       "${FILESDIR}"/make-no-png-dep-fix.patch
        "${FILESDIR}"/rltiles-make.patch
 )
 

diff --git a/games-roguelike/stone-soup/stone-soup-0.28.0.ebuild 
b/games-roguelike/stone-soup/stone-soup-0.28.0-r1.ebuild
similarity index 95%
copy from games-roguelike/stone-soup/stone-soup-0.28.0.ebuild
copy to games-roguelike/stone-soup/stone-soup-0.28.0-r1.ebuild
index f02ffe30abd0..c75e955a01e0 100644
--- a/games-roguelike/stone-soup/stone-soup-0.28.0.ebuild
+++ b/games-roguelike/stone-soup/stone-soup-0.28.0-r1.ebuild
@@ -37,8 +37,8 @@ fi
 # Public Domain|CC0: most of tiles
 # MIT: json.cc/json.h, some .js files in webserver/static/scripts/contrib/
 LICENSE="GPL-2 BSD BSD-2 public-domain CC0-1.0 MIT"
-KEYWORDS="amd64 x86"
-IUSE="debug ncurses sound test +tiles"
+KEYWORDS="~amd64 ~x86"
+IUSE="advpng debug ncurses sound test +tiles"
 RESTRICT="!test? ( test )"
 
 S=${WORKDIR}/${MY_P}/source
@@ -62,15 +62,24 @@ RDEPEND="
                virtual/opengl
        )"
 DEPEND="${RDEPEND}
+       test? ( dev-cpp/catch:0 )
+       tiles? (
+               sys-libs/ncurses:0
+       )
+       "
+BDEPEND="
        app-arch/unzip
        dev-lang/perl
        ${PYTHON_DEPS}
        $(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]')
        sys-devel/flex
-       test? ( dev-cpp/catch:0 )
        tiles? (
-               media-gfx/pngcrush
-               sys-libs/ncurses:0
+               advpng? (
+                       app-arch/advancecomp
+               )
+               !advpng? (
+                       media-gfx/pngcrush
+               )
        )
        virtual/pkgconfig
        virtual/yacc
@@ -104,6 +113,10 @@ src_prepare() {
        default
        python_fix_shebang "${S}/util/species-gen.py"
 
+       if use advpng; then
+               eapply "${FILESDIR}/make-advpng.patch"
+       fi
+
        sed -i -e "s/GAME = crawl$/GAME = crawl-${SLOT}/" "${S}/Makefile" \
                || die "Couldn't append slot to executable name"
 

diff --git a/games-roguelike/stone-soup/stone-soup-0.28.0.ebuild 
b/games-roguelike/stone-soup/stone-soup-0.28.0.ebuild
index f02ffe30abd0..9922b64db97c 100644
--- a/games-roguelike/stone-soup/stone-soup-0.28.0.ebuild
+++ b/games-roguelike/stone-soup/stone-soup-0.28.0.ebuild
@@ -77,7 +77,7 @@ DEPEND="${RDEPEND}
        "
 
 PATCHES=(
-       "${FILESDIR}"/make.patch
+       "${FILESDIR}"/make-no-png-dep-fix.patch
        "${FILESDIR}"/rltiles-make.patch
 )
 

Reply via email to