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 --- Makefile 28 Jun 2020 02:37:25 -0000 1.16 +++ Makefile 29 Jun 2021 16:28:21 -0000 @@ -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 <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/games/hyperrogue/distinfo,v retrieving revision 1.13 diff -u -p -u -p -r1.13 distinfo --- distinfo 28 Jun 2020 02:37:25 -0000 1.13 +++ distinfo 29 Jun 2021 16:28:21 -0000 @@ -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 -0000 +++ patches/patch-Makefile 29 Jun 2021 16:28:21 -0000 @@ -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 -Wno-implicit-fallthrough -Wno-maybe-uninitialized -Wno-unknown-warning-option + +-ifeq (${TOOLCHAIN},gcc) +- 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 +-endif +- +-ifeq (${TOOLCHAIN},mingw) +- CXXFLAGS_STD = -std=c++11 +- CXXFLAGS_EARLY += -march=native +- CXXFLAGS_EARLY += -W -Wall -Wextra -Werror +- CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized +-endif +- +- + ## We have now finished OS-specific and TOOLCHAIN-specific computations. + ## Begin customization points for user-specifiable HYPERROGUE_USE_XXX macros. + +@@ -138,19 +119,19 @@ override CXXFLAGS := $(CXXFLAGS_STD) $(CXXFLAGS_EARLY) + override LDFLAGS := $(LDFLAGS_EARLY) $(LDFLAGS) ${EXTRA_LDFLAGS} + + hyperrogue$(EXE_EXTENSION): $(hyper_OBJS) $(hyper_RES) +- $(CXX) $(CXXFLAGS) $(hyper_OBJS) $(hyper_RES) $(LDFLAGS) $(hyper_LDFLAGS) -o $@ ++ $(CXX) $(hyper_OBJS) $(hyper_RES) $(LDFLAGS) $(hyper_LDFLAGS) -o $@ + + hyper$(OBJ_EXTENSION): *.cpp language-data.cpp autohdr.h +- $(CXX) -O2 $(CXXFLAGS) $(hyper_CXXFLAGS) -c hyper.cpp -o $@ ++ $(CXX) $(CXXFLAGS) $(hyper_CXXFLAGS) -c hyper.cpp -o $@ + + hyper.res: hyper.rc hr-icon.ico + windres hyper.rc -O coff -o hyper.res + + langen$(EXE_EXTENSION): langen.cpp language-??.cpp language-ptbr.cpp +- $(CXX) -O0 $(CXXFLAGS) $(langen_CXXFLAGS) langen.cpp $(LDFLAGS) -o $@ ++ $(CXX) $(CXXFLAGS) $(langen_CXXFLAGS) langen.cpp $(LDFLAGS) -o $@ + + makeh$(EXE_EXTENSION): makeh.cpp +- $(CXX) -O2 makeh.cpp -o $@ ++ $(CXX) $(CXXFLAGS) makeh.cpp $(LDFLAGS) -o $@ + + autohdr.h: makeh$(EXE_EXTENSION) language-data.cpp *.cpp + ./makeh classes.cpp locations.cpp colors.cpp hyperpoint.cpp geometry.cpp goldberg.cpp init.cpp floorshapes.cpp cell.cpp multi.cpp shmup.cpp pattern2.cpp mapeditor.cpp graph.cpp textures.cpp hprint.cpp language.cpp util.cpp complex.cpp *.cpp > autohdr.h +@@ -159,10 +140,10 @@ language-data.cpp: langen$(EXE_EXTENSION) + ./langen > language-data.cpp + + savepng$(OBJ_EXTENSION): savepng.cpp +- $(CXX) -O2 $(CXXFLAGS) -c savepng.cpp -o $@ ++ $(CXX) $(CXXFLAGS) -c savepng.cpp -o $@ + + mymake$(EXE_EXTENSION): mymake.cpp +- $(CXX) -O2 $(CXXFLAGS) mymake.cpp -pthread -o $@ ++ $(CXX) $(CXXFLAGS) mymake.cpp -pthread -o $@ + + emscripten: hyper.html + Index: patches/patch-Makefile_am =================================================================== RCS file: patches/patch-Makefile_am diff -N patches/patch-Makefile_am --- patches/patch-Makefile_am 28 Jun 2020 02:37:25 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,25 +0,0 @@ -$OpenBSD: patch-Makefile_am,v 1.3 2020/06/28 02:37:25 bcallah Exp $ - -Remove hardcoded optimizations. - -Index: Makefile.am ---- Makefile.am.orig -+++ Makefile.am -@@ -2,7 +2,7 @@ bin_PROGRAMS = hyperrogue - hyperroguedir = $(datadir)/hyperrogue - hyperrogue_SOURCES = hyper.cpp savepng.cpp - hyperrogue_CPPFLAGS = -DFONTDESTDIR=\"$(pkgdatadir)/DejaVuSans-Bold.ttf\" -DMUSICDESTDIR=\"$(pkgdatadir)/hyperrogue-music.txt\" -DSOUNDDESTDIR=\"$(pkgdatadir)/sounds/\" -DRESOURCEDESTDIR=\"$(pkgdatadir)/\" --hyperrogue_CXXFLAGS = -O2 -std=c++11 ${AM_CXXFLAGS} -+hyperrogue_CXXFLAGS = -std=c++11 ${AM_CXXFLAGS} - dist_hyperrogue_DATA = hyperrogue-music.txt DejaVuSans-Bold.ttf solv-geodesics.dat shyp-geodesics.dat ssol-geodesics.dat honeycomb-rules-435.dat honeycomb-rules-534.dat honeycomb-rules-535.dat - - # docdir -@@ -18,7 +18,7 @@ dist_sounds_DATA = sounds/* - - noinst_PROGRAMS = langen makeh - langen_SOURCES = langen.cpp --langen_CXXFLAGS = -O0 -std=c++11 ${AM_CXXFLAGS} -+langen_CXXFLAGS = -std=c++11 ${AM_CXXFLAGS} - makeh_SOURCES = makeh.cpp - BUILT_SOURCES = language-data.cpp autohdr.h - Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/games/hyperrogue/pkg/PLIST,v retrieving revision 1.4 diff -u -p -u -p -r1.4 PLIST --- pkg/PLIST 28 Jun 2020 02:37:25 -0000 1.4 +++ pkg/PLIST 29 Jun 2021 16:28:21 -0000 @@ -4,11 +4,19 @@ share/doc/hyperrogue/ share/doc/hyperrogue/README.md share/hyperrogue/ share/hyperrogue/DejaVuSans-Bold.ttf +share/hyperrogue/honeycomb-rules-344.dat +share/hyperrogue/honeycomb-rules-353.dat +share/hyperrogue/honeycomb-rules-354.dat +share/hyperrogue/honeycomb-rules-355.dat share/hyperrogue/honeycomb-rules-435.dat +share/hyperrogue/honeycomb-rules-436.dat share/hyperrogue/honeycomb-rules-534.dat share/hyperrogue/honeycomb-rules-535.dat +share/hyperrogue/honeycomb-rules-536.dat share/hyperrogue/hyperrogue-music.txt share/hyperrogue/music/ +share/hyperrogue/music/hr-domina-hunting.ogg +share/hyperrogue/music/hr-domina-mountain.ogg share/hyperrogue/music/hr-savino-caribbean.ogg share/hyperrogue/music/hr-savino-ivory.ogg share/hyperrogue/music/hr-savino-ocean.ogg @@ -27,12 +35,14 @@ share/hyperrogue/music/hr3-rlyeh.ogg share/hyperrogue/shyp-geodesics.dat share/hyperrogue/solv-geodesics.dat share/hyperrogue/sounds/ +share/hyperrogue/sounds/apple.ogg share/hyperrogue/sounds/bull.ogg share/hyperrogue/sounds/click.ogg share/hyperrogue/sounds/closegate.ogg share/hyperrogue/sounds/credits.txt share/hyperrogue/sounds/die-bomberbird.ogg share/hyperrogue/sounds/die-fairy.ogg +share/hyperrogue/sounds/die-kraken.ogg share/hyperrogue/sounds/die-prince.ogg share/hyperrogue/sounds/die-princess.ogg share/hyperrogue/sounds/die-troll.ogg @@ -40,6 +50,7 @@ share/hyperrogue/sounds/die-vinebeast.og share/hyperrogue/sounds/die-vinespirit.ogg share/hyperrogue/sounds/dzia-prince.ogg share/hyperrogue/sounds/dzia-princess.ogg +share/hyperrogue/sounds/elementalgem.ogg share/hyperrogue/sounds/explosion.ogg share/hyperrogue/sounds/fire.ogg share/hyperrogue/sounds/heal-prince.ogg @@ -57,6 +68,7 @@ share/hyperrogue/sounds/hit-rose.ogg share/hyperrogue/sounds/hit-sword1.ogg share/hyperrogue/sounds/hit-sword2.ogg share/hyperrogue/sounds/hit-sword3.ogg +share/hyperrogue/sounds/levelup.ogg share/hyperrogue/sounds/message-roar.ogg share/hyperrogue/sounds/message-troll.ogg share/hyperrogue/sounds/mousesqueak.ogg @@ -85,6 +97,9 @@ share/hyperrogue/sounds/seen-dragon.ogg share/hyperrogue/sounds/seen-eagle.ogg share/hyperrogue/sounds/seen-earth.ogg share/hyperrogue/sounds/seen-fairy.ogg +share/hyperrogue/sounds/seen-frog1.ogg +share/hyperrogue/sounds/seen-frog2.ogg +share/hyperrogue/sounds/seen-frog3.ogg share/hyperrogue/sounds/seen-gardener.ogg share/hyperrogue/sounds/seen-ghost.ogg share/hyperrogue/sounds/seen-kraken.ogg