public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: games-puzzle/xwelltris/, games-puzzle/xwelltris/files/
@ 2021-05-02 20:19 Sergei Trofimovich
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Trofimovich @ 2021-05-02 20:19 UTC (permalink / raw
  To: gentoo-commits

commit:     d4639706abcb52d2cc0f90a1eb73adfb0a9cea11
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun May  2 20:19:30 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun May  2 20:19:36 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4639706

games-puzzle/xwelltris: tweak for gcc-11

Reported-by: Agostino Sarubbo
Closes: https://bugs.gentoo.org/739318
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 games-puzzle/xwelltris/files/xwelltris-1.0.1-gcc-11.patch | 11 +++++++++++
 games-puzzle/xwelltris/xwelltris-1.0.1.ebuild             |  1 +
 2 files changed, 12 insertions(+)

diff --git a/games-puzzle/xwelltris/files/xwelltris-1.0.1-gcc-11.patch b/games-puzzle/xwelltris/files/xwelltris-1.0.1-gcc-11.patch
new file mode 100644
index 00000000000..0398bfec435
--- /dev/null
+++ b/games-puzzle/xwelltris/files/xwelltris-1.0.1-gcc-11.patch
@@ -0,0 +1,11 @@
+--- a/src/sdl/sdlwelldrawing.cxx
++++ b/src/sdl/sdlwelldrawing.cxx
+@@ -72,7 +72,7 @@ void SDLWellDrawingEngine::init(int inum_fields, int idx, int idy,
+ 
+ 	fields[i]=SDL_DisplayFormat(surface);
+ 	SDL_FreeSurface(surface);
+-	if(fields[i]>0)
++	if(fields[i])
+ 	    clear_field(i);
+     }
+     bg_color=colors[BackColor];

diff --git a/games-puzzle/xwelltris/xwelltris-1.0.1.ebuild b/games-puzzle/xwelltris/xwelltris-1.0.1.ebuild
index 36c39e67014..11369637b0b 100644
--- a/games-puzzle/xwelltris/xwelltris-1.0.1.ebuild
+++ b/games-puzzle/xwelltris/xwelltris-1.0.1.ebuild
@@ -25,6 +25,7 @@ RDEPEND="
 PATCHES=(
 	# Look in ${EPREFIX}/var/lib/xwelltris for score file
 	"${FILESDIR}"/${PN}-1.0.1-scorefile-dir.patch
+	"${FILESDIR}"/${PN}-1.0.1-gcc-11.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: games-puzzle/xwelltris/, games-puzzle/xwelltris/files/
@ 2023-03-05  3:16 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-03-05  3:16 UTC (permalink / raw
  To: gentoo-commits

commit:     43bc66db6bf0b4875b15e669d81e3da27f18e204
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  5 01:55:32 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar  5 02:59:37 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43bc66db

games-puzzle/xwelltris: fix configure w/ clang 16, C++17, autoconf-2.72

Closes: https://bugs.gentoo.org/874567
Closes: https://bugs.gentoo.org/899014
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../xwelltris/files/xwelltris-1.0.1-c++17.patch    | 106 +++++++++++++++++++++
 .../xwelltris-1.0.1-configure-autoconf-2.72.patch  | 106 +++++++++++++++++++++
 ...s-1.0.1-r1.ebuild => xwelltris-1.0.1-r2.ebuild} |  11 ++-
 3 files changed, 220 insertions(+), 3 deletions(-)

diff --git a/games-puzzle/xwelltris/files/xwelltris-1.0.1-c++17.patch b/games-puzzle/xwelltris/files/xwelltris-1.0.1-c++17.patch
new file mode 100644
index 000000000000..2c62d4752975
--- /dev/null
+++ b/games-puzzle/xwelltris/files/xwelltris-1.0.1-c++17.patch
@@ -0,0 +1,106 @@
+--- a/src/image/convert.cxx
++++ b/src/image/convert.cxx
+@@ -273,9 +273,9 @@ static void slow_fill_histogram (byte* pic24,int numpixels)
+ 
+ static boxptr find_biggest_color_pop (boxptr boxlist, int numboxes)
+ {
+-  register boxptr boxp;
+-  register int i;
+-  register long maxc = 0;
++  boxptr boxp;
++  int i;
++  long maxc = 0;
+   boxptr which = NULL;
+   
+   for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
+@@ -290,9 +290,9 @@ static boxptr find_biggest_color_pop (boxptr boxlist, int numboxes)
+ 
+ static boxptr find_biggest_volume (boxptr boxlist, int numboxes)
+ {
+-  register boxptr boxp;
+-  register int i;
+-  register INT32 maxv = 0;
++  boxptr boxp;
++  int i;
++  INT32 maxv = 0;
+   boxptr which = NULL;
+   
+   for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
+@@ -407,7 +407,7 @@ static int median_cut (boxptr boxlist, int numboxes, int desired_colors)
+ {
+   int n,lb;
+   int c0,c1,c2,cmax;
+-  register boxptr b1,b2;
++  boxptr b1,b2;
+ 
+   while (numboxes < desired_colors) {
+     /* Select box to split.
+@@ -642,12 +642,12 @@ static void find_best_colors (int minc0,int minc1,int minc2,int numcolors,
+ {
+   int ic0, ic1, ic2;
+   int i, icolor;
+-  register INT32 * bptr;        /* pointer into bestdist[] array */
++  INT32 * bptr;        /* pointer into bestdist[] array */
+   JSAMPLE * cptr;                /* pointer into bestcolor[] array */
+   INT32 dist0, dist1;                /* initial distance values */
+-  register INT32 dist2;                /* current distance in inner loop */
++  INT32 dist2;                /* current distance in inner loop */
+   INT32 xx0, xx1;                /* distance increments */
+-  register INT32 xx2;
++  INT32 xx2;
+   INT32 inc0, inc1, inc2;        /* initial values for increments */
+   /* This array holds the distance to the nearest-so-far color for each cell */
+   INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
+@@ -710,8 +710,8 @@ static void fill_inverse_cmap (int c0, int c1, int c2)
+   hist2d * histogram = sl_histogram;
+   int minc0, minc1, minc2;        /* lower left corner of update box */
+   int ic0, ic1, ic2;
+-  register JSAMPLE * cptr;        /* pointer into bestcolor[] array */
+-  register histptr cachep;        /* pointer into main cache array */
++  JSAMPLE * cptr;        /* pointer into bestcolor[] array */
++  histptr cachep;        /* pointer into main cache array */
+   /* This array lists the candidate colormap indexes. */
+   JSAMPLE colorlist[MAXNUMCOLORS];
+   int numcolors;                /* number of candidate colors */
+@@ -749,10 +749,10 @@ static void fill_inverse_cmap (int c0, int c1, int c2)
+ 
+ static void slow_map_pixels (byte *pic24,int width,int height, byte* pic8)
+ {
+-  register LOCFSERROR cur0, cur1, cur2;        /* current error or pixel value */
++  LOCFSERROR cur0, cur1, cur2;        /* current error or pixel value */
+   LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */
+   LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */
+-  register FSERRPTR errorptr;        /* => fserrors[] at column before current */
++  FSERRPTR errorptr;        /* => fserrors[] at column before current */
+   JSAMPROW inptr;                /* => current input pixel */
+   JSAMPROW outptr;                /* => current output pixel */
+   histptr cachep;
+@@ -814,7 +814,7 @@ static void slow_map_pixels (byte *pic24,int width,int height, byte* pic8)
+       if (*cachep == 0)
+         fill_inverse_cmap(cur0>>C0_SHIFT, cur1>>C1_SHIFT, cur2>>C2_SHIFT);
+       /* Now emit the colormap index for this cell */
+-      { register int pixcode = *cachep - 1;
++      { int pixcode = *cachep - 1;
+         *outptr = (JSAMPLE) pixcode;
+         /* Compute representation error for this pixel */
+         cur0 -= (int) colormap0[pixcode];
+@@ -825,7 +825,7 @@ static void slow_map_pixels (byte *pic24,int width,int height, byte* pic8)
+        * Add these into the running sums, and simultaneously shift the
+        * next-line error sums left by 1 column.
+        */
+-      { register LOCFSERROR bnexterr, delta;
++      { LOCFSERROR bnexterr, delta;
+ 
+         bnexterr = cur0;        /* Process component 0 */
+         delta = cur0 * 2;
+--- a/src/image/sublib/IMG_gif.c
++++ b/src/image/sublib/IMG_gif.c
+@@ -406,7 +406,7 @@ LWZReadByte(SDL_RWops *src, int flag, int input_code_size)
+     static int clear_code, end_code;
+     static int table[2][(1 << MAX_LWZ_BITS)];
+     static int stack[(1 << (MAX_LWZ_BITS)) * 2], *sp;
+-    register int i;
++    int i;
+ 
+     if (flag) {
+ 	set_code_size = input_code_size;

diff --git a/games-puzzle/xwelltris/files/xwelltris-1.0.1-configure-autoconf-2.72.patch b/games-puzzle/xwelltris/files/xwelltris-1.0.1-configure-autoconf-2.72.patch
new file mode 100644
index 000000000000..bfcfd9ddd3c3
--- /dev/null
+++ b/games-puzzle/xwelltris/files/xwelltris-1.0.1-configure-autoconf-2.72.patch
@@ -0,0 +1,106 @@
+Drop incorrectly quoted chunks which aren't relevant for remotely modern
+systems. Breaks with autoconf-2.72/9999.
+--- a/configure.in
++++ b/configure.in
+@@ -48,24 +48,6 @@ dnl On SCO Unix, there are ELF and COFF binaries.  We want elf to
+ dnl provide for dlopen() and friends.  With help from Tamas Laufer!
+ dnl ****************************************************************
+ 
+-case "$ARCH" in
+-    *sco*|*SCO*)
+-        AC_MSG_CHECKING("SCO-Unix.  See if we need -belf")
+-        old_cflags="$CFLAGS"
+-        CFLAGS="$CFLAGS -belf"
+-        AC_TRY_COMPILE(
+-        [
+-        ],
+-        [
+-        ],
+-        CMFLAGS="$CMFLAGS -belf"
+-        AC_MSG_RESULT(yes),
+-        AC_MSG_RESULT(no)
+-        CFLAGS="$old_cflags")
+-        ;;
+-esac
+-
+-
+ dnl Checks for header files.
+ AC_HEADER_DIRENT
+ AC_HEADER_STDC
+@@ -105,23 +87,22 @@ fi
+ 
+ 
+ AC_ARG_WITH(sdl, [  --with-sdl              Turn on SDL support instead of X11],
+-              sdl_support=yes,
+-              sdl_support=no)
++              [sdl_support=yes],
++              [sdl_support=no])
+ 
+-if test "x$sdl_support" = "xyes"; then
++AS_IF([test "x$sdl_support" = "xyes"], [
+     echo "SDL is ENABLED *******************"
+     IFACEOBJS='$(SDLOBJS)'
+     IFACELIBS='`sdl-config --libs` -lSDL_image'
+     IFACEINC='`sdl-config --cflags` -I./sdl'
+-else
++], [
+     echo "X11 is ENABLED *******************"
+     AC_PATH_X
+     AC_PATH_XTRA
+     IFACEOBJS='$(X11OBJS) $(X11IMAGE)'
+     IFACELIBS='$(XLIBS)'
+     IFACEINC='$(XINC) -I./x11'
+-fi
+-
++])
+ 
+ out_lib=${LIBS}
+ 
+@@ -169,47 +150,6 @@ MCOMMON=./src/Make.common
+ AC_SUBST_FILE(MCOMMON)
+ 
+ 
+-dnl Some specific OS stuff
+-
+-case "$ARCH" in
+-  *hppa*|*hpux*)
+-        # do nothing
+-        ;;
+-  *solaris*)
+-        if test "$GCC" = "yes"; then
+-		AC_MSG_CHECKING("whether we need -fpermissive")
+-		old_cflags="$CFLAGS"
+-		CFLAGS="-fpermissive $CFLAGS"
+-		AC_TRY_RUN(
+-		main()
+-		{ exit(0);
+-		},
+-	        if grep 'option `-fpermissive'"'" config.log >/dev/null; then
+-	           AC_MSG_RESULT(no)
+-	           CFLAGS="$old_cflags"
+-	        else
+-	           CFLAGS="$old_cflags -fpermissive"
+-	           AC_MSG_RESULT(yes)
+-	        fi,
+-	        AC_MSG_RESULT(no)
+-	        CFLAGS="$old_cflags",
+-	        AC_MSG_RESULT(no)
+-	        CFLAGS="$old_cflags")
+-        fi
+-        ;;
+-  *aix*)
+-        # do nothing
+-        ;;
+-  *darwin*)
+-        # do nothing
+-	;;
+-  *)
+-        # do nothing
+-        ;;
+-esac
+-
+-
+-
+ AC_CONFIG_HEADER(src/include/config.h)
+ AC_OUTPUT( \
+     src/Make.common \

diff --git a/games-puzzle/xwelltris/xwelltris-1.0.1-r1.ebuild b/games-puzzle/xwelltris/xwelltris-1.0.1-r2.ebuild
similarity index 84%
rename from games-puzzle/xwelltris/xwelltris-1.0.1-r1.ebuild
rename to games-puzzle/xwelltris/xwelltris-1.0.1-r2.ebuild
index 6d69ef032900..8f50a97e4b6a 100644
--- a/games-puzzle/xwelltris/xwelltris-1.0.1-r1.ebuild
+++ b/games-puzzle/xwelltris/xwelltris-1.0.1-r2.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-inherit toolchain-funcs prefix
+inherit autotools toolchain-funcs prefix
 
 DESCRIPTION="2.5D tetris like game"
 HOMEPAGE="http://xnc.jinr.ru/xwelltris/"
@@ -26,6 +26,8 @@ PATCHES=(
 	# Look in ${EPREFIX}/var/lib/xwelltris for score file
 	"${FILESDIR}"/${PN}-1.0.1-scorefile-dir.patch
 	"${FILESDIR}"/${PN}-1.0.1-gcc-11.patch
+	"${FILESDIR}"/${PN}-1.0.1-c++17.patch
+	"${FILESDIR}"/${PN}-1.0.1-configure-autoconf-2.72.patch
 )
 
 src_prepare() {
@@ -41,6 +43,9 @@ src_prepare() {
 
 	# Ensure we look in ${EPREFIX}/var/lib/${PN} for score file
 	eprefixify src/commonfuncs.cxx
+
+	# Needed for autotools-2.72 patch + clang 16 (bug #899014)
+	eautoreconf
 }
 
 src_configure() {


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: games-puzzle/xwelltris/, games-puzzle/xwelltris/files/
@ 2021-04-04  6:33 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2021-04-04  6:33 UTC (permalink / raw
  To: gentoo-commits

commit:     85eba6f45253bfbb0e3797e2c4c71f5a4162a088
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  4 04:52:04 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr  4 06:32:43 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85eba6f4

games-puzzle/xwelltris: port to EAPI 7, games.eclass--

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/xwelltris-1.0.1-scorefile-dir.patch      | 16 +++++++
 games-puzzle/xwelltris/xwelltris-1.0.1.ebuild      | 52 ++++++++++++++++------
 2 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/games-puzzle/xwelltris/files/xwelltris-1.0.1-scorefile-dir.patch b/games-puzzle/xwelltris/files/xwelltris-1.0.1-scorefile-dir.patch
new file mode 100644
index 00000000000..67f832ae372
--- /dev/null
+++ b/games-puzzle/xwelltris/files/xwelltris-1.0.1-scorefile-dir.patch
@@ -0,0 +1,16 @@
+--- a/src/commonfuncs.cxx
++++ b/src/commonfuncs.cxx
+@@ -41,7 +41,12 @@ bool find_full_path_for_file(char* name, char* ret_full_pathname, FMode mode)
+ 
+   do 
+   {    
+-    sprintf(ret_full_pathname,"%s/%s",GLOBAL_SEARCH,name); //First check in GLOBAL_SEARCH dir
++    sprintf(ret_full_pathname,"%s/%s","@GENTOO_PORTAGE_EPREFIX@/var/lib/xwelltris",name); // First check in /var/lib/xwelltris
++    fd=open(ret_full_pathname,fmode);
++    if(fd>0)
++      break;
++
++    sprintf(ret_full_pathname,"%s/%s",GLOBAL_SEARCH,name); // Then in GLOBAL_SEARCH dir
+     fd=open(ret_full_pathname,fmode);
+     if(fd>0)
+       break;

diff --git a/games-puzzle/xwelltris/xwelltris-1.0.1.ebuild b/games-puzzle/xwelltris/xwelltris-1.0.1.ebuild
index eb2e02cbf21..36c39e67014 100644
--- a/games-puzzle/xwelltris/xwelltris-1.0.1.ebuild
+++ b/games-puzzle/xwelltris/xwelltris-1.0.1.ebuild
@@ -1,8 +1,9 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
-inherit games
+EAPI=7
+
+inherit toolchain-funcs prefix
 
 DESCRIPTION="2.5D tetris like game"
 HOMEPAGE="http://xnc.jinr.ru/xwelltris/"
@@ -11,24 +12,41 @@ SRC_URI="http://xnc.jinr.ru/xwelltris/src/${P}.src.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE=""
 
-DEPEND="media-libs/libsdl[video]
-	media-libs/sdl-image[gif]"
-RDEPEND=${DEPEND}
+DEPEND="
+	media-libs/libsdl[video]
+	media-libs/sdl-image[gif]
+"
+RDEPEND="
+	${DEPEND}
+	acct-group/gamestat
+"
+
+PATCHES=(
+	# Look in ${EPREFIX}/var/lib/xwelltris for score file
+	"${FILESDIR}"/${PN}-1.0.1-scorefile-dir.patch
+)
 
 src_prepare() {
+	default
+
 	sed -i \
 		-e '/INSTALL_PROGRAM/s/-s //' \
 		src/Make.common.in || die
+
 	sed -i \
-		-e "/GLOBAL_SEARCH/s:\".*\":\"${GAMES_DATADIR}/${PN}\":" \
+		-e "/GLOBAL_SEARCH/s:\".*\":\"/usr/share/${PN}\":" \
 		src/include/globals.h.in || die
+
+	# Ensure we look in ${EPREFIX}/var/lib/${PN} for score file
+	eprefixify src/commonfuncs.cxx
 }
 
 src_configure() {
+	tc-export CC CXX
+
 	# configure/build process is pretty messed up
-	egamesconf --with-sdl
+	econf --with-sdl
 }
 
 src_compile() {
@@ -36,11 +54,19 @@ src_compile() {
 }
 
 src_install() {
-	dodir "${GAMES_BINDIR}" "${GAMES_DATADIR}/${PN}" /usr/share/man
+	dodir /usr/bin /usr/share/${PN} /var/lib/${PN} /usr/share/man
+
 	emake install \
-		INSTDIR="${D}/${GAMES_BINDIR}" \
-		INSTLIB="${D}/${GAMES_DATADIR}/${PN}" \
+		INSTDIR="${D}/usr/bin" \
+		INSTLIB="${D}/usr/share/${PN}" \
 		INSTMAN=/usr/share/man
+
 	dodoc AUTHORS Changelog README*
-	prepgamesdirs
+
+	# Move score file to our location
+	mv "${ED}"/usr/share/${PN}/welltris.scores "${ED}"/var/lib/${PN}/welltris.scores || die
+
+	fowners root:gamestat /var/lib/${PN}/welltris.scores
+	fperms 660 /var/lib/${PN}/welltris.scores
+	fperms g+s /usr/bin/${PN}
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-05  3:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-02 20:19 [gentoo-commits] repo/gentoo:master commit in: games-puzzle/xwelltris/, games-puzzle/xwelltris/files/ Sergei Trofimovich
  -- strict thread matches above, loose matches on Subject: below --
2023-03-05  3:16 Sam James
2021-04-04  6:33 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox