Re: [update] games/hyperrogue 11.3o -> 12.0b

2021-06-29 Thread Charlene Wendling
On Tue, 29 Jun 2021 17:28:19 +
Brian Callahan  wrote:

> Hi Charlene --
> 
> On 06/29/2021 12:42 PM, Charlene Wendling wrote:
> > Hi,
> > 
> > I heard that a new Hyperrogue version came out, so i wanted to see
> > if segfaults at build time on macppc were fixed. They're not, sadly.
> > 
> 
> Thank you for doing the heavy lifting on this.
> One small nit, NO_TEST=Yes seems to be needed.

Oh, you're right, i'm always confused with that one.

Here is a fixed diff below if more people want to try.
 
> OK for me with that.
> 
> ~Brian
> 


Index: Makefile
===
RCS file: /cvs/ports/games/hyperrogue/Makefile,v
retrieving revision 1.16
diff -u -p -u -p -r1.16 Makefile
--- Makefile28 Jun 2020 02:37:25 -  1.16
+++ Makefile29 Jun 2021 19:24:58 -
@@ -1,6 +1,6 @@
 # $OpenBSD: Makefile,v 1.16 2020/06/28 02:37:25 bcallah Exp $
 
-V =11.3o
+V =12.0b
 COMMENT =  roguelike game in a non-Euclidean world
 CATEGORIES =   games x11
 
@@ -20,26 +20,41 @@ WANTLIB += c m png z
 # C++11
 COMPILER = base-clang ports-gcc
 
-BUILD_DEPENDS =${MODGNU_AUTOCONF_DEPENDS} \
-   ${MODGNU_AUTOMAKE_DEPENDS}
-
 LIB_DEPENDS =  devel/sdl-gfx \
devel/sdl-mixer \
devel/sdl-ttf \
graphics/glew \
graphics/png
 
-CONFIGURE_STYLE =  autoreconf
-CONFIGURE_ENV =CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include 
-I${X11BASE}/include" \
-   LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib -L${X11BASE}/lib"
-
-MAKE_FLAGS =   CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS} -std=c++11"
-
-AUTOCONF_VERSION = 2.69
-AUTOMAKE_VERSION = 1.16
-
-# Correct version number
-pre-configure:
-   sed -i 's,10.4i,${V},g' ${WRKSRC}/configure.ac
+CXXFLAGS +=-I${LOCALBASE}/include -I${X11BASE}/include \
+   -DHYPERPATH="\\\"${LOCALBASE}/share/hyperrogue/\\\""
+LDFLAGS += -L${LOCALBASE}/lib -L${X11BASE}/lib
+
+MAKE_ENV +=CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
+   LDFLAGS="${LDFLAGS}" CXX="${CXX}" \
+   HYPERROGUE_USE_GLEW=1 \
+   HYPERROGUE_USE_PNG=1
+
+USE_GMAKE =Yes
+NO_TEST =  Yes
+ALL_TARGET =   hyperrogue
+
+# There is no install target
+do-install:
+   ${INSTALL_PROGRAM} ${WRKSRC}/hyperrogue ${PREFIX}/bin
+
+   ${INSTALL_DATA_DIR} ${PREFIX}/share/hyperrogue
+   ${INSTALL_DATA_DIR} ${PREFIX}/share/hyperrogue/sounds
+   ${INSTALL_DATA_DIR} ${PREFIX}/share/hyperrogue/music
+
+   ${INSTALL_DATA} ${WRKSRC}/*.ttf \
+   ${WRKSRC}/*.dat \
+   ${WRKSRC}/hyperrogue-music.txt \
+   ${PREFIX}/share/hyperrogue
+   ${INSTALL_DATA} ${WRKSRC}/sounds/* ${PREFIX}/share/hyperrogue/sounds
+   ${INSTALL_DATA} ${WRKSRC}/music/* ${PREFIX}/share/hyperrogue/music
+
+   ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/hyperrogue
+   ${INSTALL_DATA} ${WRKSRC}/README.md ${PREFIX}/share/doc/hyperrogue
 
 .include 
Index: distinfo
===
RCS file: /cvs/ports/games/hyperrogue/distinfo,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 distinfo
--- distinfo28 Jun 2020 02:37:25 -  1.13
+++ distinfo29 Jun 2021 19:24:58 -
@@ -1,2 +1,2 @@
-SHA256 (hyperrogue-11.3o.tar.gz) = y8luUVxGjuvwGEzu1SRLUoZLv5sOhEaUAaNime0kdQs=
-SIZE (hyperrogue-11.3o.tar.gz) = 69246164
+SHA256 (hyperrogue-12.0b.tar.gz) = v6el52DKYSfIwlOlUdpEoW+PQXabJF3B4YRVARavV5w=
+SIZE (hyperrogue-12.0b.tar.gz) = 79894443
Index: patches/patch-Makefile
===
RCS file: patches/patch-Makefile
diff -N patches/patch-Makefile
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-Makefile  29 Jun 2021 19:24:58 -
@@ -0,0 +1,94 @@
+$OpenBSD$
+
+Remove hardcoded optimisation flags and -Werror, add a consistent
+flag set for clang and ports-gcc
+
+Index: Makefile
+--- Makefile.orig
 Makefile
+@@ -42,7 +42,6 @@ endif
+ ## Begin customization points for each OS and TOOLCHAIN we support.
+ 
+ 
+-ifeq (${OS},linux)
+   CXXFLAGS_EARLY += -DLINUX
+   EXE_EXTENSION :=
+   LDFLAGS_GL := -lGL
+@@ -51,7 +50,6 @@ ifeq (${OS},linux)
+   LDFLAGS_SDL := -lSDL -lSDL_gfx -lSDL_mixer -lSDL_ttf -lpthread -lz
+   OBJ_EXTENSION := .o
+   hyper_RES :=
+-endif
+ 
+ ifeq (${OS},mingw)
+   CXXFLAGS_EARLY += -DWINDOWS -mwindows -D_A_VOLID=8
+@@ -79,28 +77,11 @@ ifeq (${OS},osx)
+   hyper_RES :=
+ endif
+ 
+-ifeq (${TOOLCHAIN},clang)
+-  CXXFLAGS_STD = -std=c++11
+-  CXXFLAGS_EARLY += -march=native -fPIC
+-  CXXFLAGS_EARLY += -W -Wall -Wextra -Werror -pedantic
+-  CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough 
-Wno-maybe-uninitialized -Wno-unknown-warning-option
+-endif
++CXXFLAGS_STD = -std=c++11
++CXXFLAGS_EARLY += -fPIC
++CXXFLAGS_EARLY += -W -Wall -Wextra -pedantic
++CXXFLAGS_EARLY += -Wno-unused-parameter -

Re: [update] games/hyperrogue 11.3o -> 12.0b

2021-06-29 Thread Brian Callahan

Hi Charlene --

On 06/29/2021 12:42 PM, Charlene Wendling wrote:

Hi,

I heard that a new Hyperrogue version came out, so i wanted to see if
segfaults at build time on macppc were fixed. They're not, sadly.



Thank you for doing the heavy lifting on this.
One small nit, NO_TEST=Yes seems to be needed.

OK for me with that.

~Brian



[update] games/hyperrogue 11.3o -> 12.0b

2021-06-29 Thread Charlene Wendling
Hi,

I heard that a new Hyperrogue version came out, so i wanted to see if
segfaults at build time on macppc were fixed. They're not, sadly.

The changelog is very long to read [0]. What impacts us the most is that
upstream changed their build system to a simple Makefile, but this
makes things harder for us. It also requires GNU make now.

Most of the port changes come straight from FreeBSD, adapted for our
infrastructure.

Port changes:

- Drop all autotools things, and move CONFIGURE_* to MAKE_*. I 
  preferred to put CXXFLAGS and LDFLAGS out of MAKE_ENV, mostly
  because CXXFLAGS is now too long to fit nicely.  
- Add HYPERPATH to CXXFLAGS, so resources are properly found.
- Bring back GLEW and PNG support, they're off by default.
- Add a patch from FreeBSD [1] to remove all hardcoded optimisations.
  They're shipping 12.0a so i had to remove more of them. Also
  add a consistent flags set for clang and ports-gcc.
- The Makefile has no install target, so i've made our own. PLIST
  diff seems happy with it, so this looks correct to me. Maybe
  there is a less naive way to do so :)

Testing: 

On amd64, it builds and works fine with amdgpu (RX560).

On macppc, langen still segfaults. Upstream's Makefile allows easily to
build it with custom CXXFLAGS, so i tried -O{0,1} to no avail.

Comments/feedback are welcome,

Charlène.


[0]
https://github.com/zenorogue/hyperrogue/blob/master/changelog.txt#L3997
[1]
https://github.com/freebsd/freebsd-ports/blob/main/games/hyperrogue/files/patch-Makefile



Index: Makefile
===
RCS file: /cvs/ports/games/hyperrogue/Makefile,v
retrieving revision 1.16
diff -u -p -u -p -r1.16 Makefile
--- Makefile28 Jun 2020 02:37:25 -  1.16
+++ Makefile29 Jun 2021 16:28:21 -
@@ -1,6 +1,6 @@
 # $OpenBSD: Makefile,v 1.16 2020/06/28 02:37:25 bcallah Exp $
 
-V =11.3o
+V =12.0b
 COMMENT =  roguelike game in a non-Euclidean world
 CATEGORIES =   games x11
 
@@ -20,26 +20,40 @@ WANTLIB += c m png z
 # C++11
 COMPILER = base-clang ports-gcc
 
-BUILD_DEPENDS =${MODGNU_AUTOCONF_DEPENDS} \
-   ${MODGNU_AUTOMAKE_DEPENDS}
-
 LIB_DEPENDS =  devel/sdl-gfx \
devel/sdl-mixer \
devel/sdl-ttf \
graphics/glew \
graphics/png
 
-CONFIGURE_STYLE =  autoreconf
-CONFIGURE_ENV =CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include 
-I${X11BASE}/include" \
-   LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib -L${X11BASE}/lib"
-
-MAKE_FLAGS =   CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS} -std=c++11"
-
-AUTOCONF_VERSION = 2.69
-AUTOMAKE_VERSION = 1.16
-
-# Correct version number
-pre-configure:
-   sed -i 's,10.4i,${V},g' ${WRKSRC}/configure.ac
+CXXFLAGS +=-I${LOCALBASE}/include -I${X11BASE}/include \
+   -DHYPERPATH="\\\"${LOCALBASE}/share/hyperrogue/\\\""
+LDFLAGS += -L${LOCALBASE}/lib -L${X11BASE}/lib
+
+MAKE_ENV +=CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
+   LDFLAGS="${LDFLAGS}" CXX="${CXX}" \
+   HYPERROGUE_USE_GLEW=1 \
+   HYPERROGUE_USE_PNG=1
+
+USE_GMAKE =Yes
+ALL_TARGET =   hyperrogue
+
+# There is no install target
+do-install:
+   ${INSTALL_PROGRAM} ${WRKSRC}/hyperrogue ${PREFIX}/bin
+
+   ${INSTALL_DATA_DIR} ${PREFIX}/share/hyperrogue
+   ${INSTALL_DATA_DIR} ${PREFIX}/share/hyperrogue/sounds
+   ${INSTALL_DATA_DIR} ${PREFIX}/share/hyperrogue/music
+
+   ${INSTALL_DATA} ${WRKSRC}/*.ttf \
+   ${WRKSRC}/*.dat \
+   ${WRKSRC}/hyperrogue-music.txt \
+   ${PREFIX}/share/hyperrogue
+   ${INSTALL_DATA} ${WRKSRC}/sounds/* ${PREFIX}/share/hyperrogue/sounds
+   ${INSTALL_DATA} ${WRKSRC}/music/* ${PREFIX}/share/hyperrogue/music
+
+   ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/hyperrogue
+   ${INSTALL_DATA} ${WRKSRC}/README.md ${PREFIX}/share/doc/hyperrogue
 
 .include 
Index: distinfo
===
RCS file: /cvs/ports/games/hyperrogue/distinfo,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 distinfo
--- distinfo28 Jun 2020 02:37:25 -  1.13
+++ distinfo29 Jun 2021 16:28:21 -
@@ -1,2 +1,2 @@
-SHA256 (hyperrogue-11.3o.tar.gz) = y8luUVxGjuvwGEzu1SRLUoZLv5sOhEaUAaNime0kdQs=
-SIZE (hyperrogue-11.3o.tar.gz) = 69246164
+SHA256 (hyperrogue-12.0b.tar.gz) = v6el52DKYSfIwlOlUdpEoW+PQXabJF3B4YRVARavV5w=
+SIZE (hyperrogue-12.0b.tar.gz) = 79894443
Index: patches/patch-Makefile
===
RCS file: patches/patch-Makefile
diff -N patches/patch-Makefile
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-Makefile  29 Jun 2021 16:28:21 -
@@ -0,0 +1,94 @@
+$OpenBSD$
+
+Remove hardcoded optimisation flags and -Werror, add a consistent
+flag set for clang and ports-gcc
+
+Index: Makefile
+--- Make