Stab at re-adding games/nethack/3.6's -qt flavor

2021-04-19 Thread Peter Piwowarski
games/nethack had its -qt flavor removed some time back when Qt3 went
away; upstream has however ported the Qt window port to Qt4/Qt5 in
3.6.x. This is a rough stab at trying to add a -qt flavor back for
version 3.6 only, built against Qt5. Some notes:

* Paradoxically, this involves removing both Qt-specific patches that
  are still floating around. patch-win_Qt_qt_win.cpp applies, so far as
  I can tell, to the old Qt3 code, and is no longer pertinent (and in
  fact the patch was going to break with 3.7), and the local copy of
  qt_xpms.h differs from upstream's only in a way that breaks the build
  (it's missing one pixmap).
* I've added a README explaining both how to switch between interfaces
  and noting a few options upstream documentation recommends setting for
  use with Qt. If desired I can generate another diff without this.

Index: Makefile
===
RCS file: /cvs/ports/games/nethack/3.6/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- Makefile16 Feb 2021 08:45:02 -  1.10
+++ Makefile20 Apr 2021 01:32:41 -
@@ -9,7 +9,7 @@ PKGNAME =   ${DISTNAME}
 CATEGORIES =   games
 MASTER_SITES = https://www.nethack.org/download/$V/
 DISTFILES =nethack-${V:S/.//g}-src.tgz
-REVISION = 0
+REVISION = 1
 
 HOMEPAGE = http://nethack.org/
 
@@ -18,11 +18,17 @@ WANTLIB +=  c curses
 
 COMPILER = base-clang ports-gcc base-gcc
 
-FLAVORS = no_x11
+FLAVORS = no_x11 qt
 FLAVOR ?=
 
 .if ${FLAVOR} == "no_x11"
 CONFIG =   simple-config
+.elif ${FLAVOR} == "qt"
+CONFIG =   qt-config
+MODULES += x11/qt5
+WANTLIB += ${COMPILER_LIBCXX} GL Qt5Gui Qt5Widgets Qt5Multimedia
+WANTLIB += Qt5Core Qt5Network m
+LIB_DEPENDS += x11/qt5/qtmultimedia
 .else
 CONFIG =   x-config
 WANTLIB += X11 Xaw Xext Xmu Xt
@@ -46,9 +52,6 @@ MAKE_ENV = GAMEDIR=${GAMEDIR} FILESDIR=$
 SUBST_VARS += GAMEDIR V GAMEGRP BASEV
 
 NO_TEST =  Yes
-
-post-patch:
-   @cp ${FILESDIR}/qt_xpms.h ${WRKSRC}/include/qt_xpms.h
 
 pre-configure:
ln -s ${FILESDIR}/openbsd ${WRKSRC}/sys/unix/hints/openbsd
Index: files/qt-config
===
RCS file: /cvs/ports/games/nethack/3.6/files/qt-config,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 qt-config
--- files/qt-config 25 Apr 2018 16:56:32 -  1.1.1.1
+++ files/qt-config 20 Apr 2021 01:32:41 -
@@ -1,11 +1,12 @@
 # $OpenBSD: qt-config,v 1.1.1.1 2018/04/25 16:56:32 espie Exp $
 
 VARDATND = $(XFILES)
-CFLAGS+=-DQT_GRAPHICS -I$(MODQT_INCDIR) -pthread
-LFLAGS =-pthread -L$(MODQT_LIBDIR) -L$(X11BASE)/lib -L$(LOCALBASE)/lib
+CFLAGS += -DQT_GRAPHICS -I$(X11BASE)/include -I$(MODQT_INCDIR) -pthread
+LFLAGS += -pthread -L$(MODQT_LIBDIR) -L$(X11BASE)/lib
 
-WINSRC = $(WINTTYSRC) $(WINQTSRC)
-WINOBJ = $(WINTTYOBJ) $(WINQTOBJ)
-WINLIB = $(WINTTYLIB) -lqt-mt -lSM
-QTDIR  = $(LOCALBASE)
+WINSRC += $(WINQT4SRC)
+WINOBJ += $(WINQT4OBJ)
+WINLIB += $(WINQT5LIB) -lGL -lQt5Gui -lQt5Widgets -lQt5Multimedia
+QTDIR  = $(MODQT_QTDIR)
 LINKCMD = c++
+MOC = $(MODQT_MOC)
Index: files/qt_xpms.h
===
RCS file: files/qt_xpms.h
diff -N files/qt_xpms.h
--- files/qt_xpms.h 25 Apr 2018 16:56:32 -  1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,1408 +0,0 @@
-/* clang-format off */
-/* XPM */
-static const char *blind_xpm[] = {
-/* width height ncolors chars_per_pixel */
-"40 40 5 1",
-/* colors */
-"  c #00",
-". c None",
-"X c #909090",
-"o c #606060",
-"O c #303030",
-/* pixels */
-"",
-"",
-"",
-"",
-"",
-"",
-"",
-"",
-"",
-"",
-"",
-"",
-"X...",
-"o...",
-"o...",
-"o...",
-"o...",
-"..o..o..",
-"..X   O..X   O..",
-"...   o...   o..",
-"...o  o  ...",
-"OX.OX...",
-".O  X...O  X",
-"..o   OX.o   OX.",
-"",
-"",
-"",
-"",
-"",
-"",

Re: unbreak games/supertux [Was: Re: games/supertux startup error]

2021-04-19 Thread Nam Nguyen
Nam Nguyen writes:

> Here is a diff for unbreaking games/supertux, which segfaults on
> startup. I opened an issue explaining the bug here:
> https://github.com/SuperTux/supertux/issues/1726

Here is a fresh diff for games/supertux 0.6.2, released on May 14,
2020.

Changelogs:
https://github.com/SuperTux/supertux/releases/tag/v0.6.2
https://github.com/SuperTux/supertux/releases/tag/v0.6.1

This diff:
- updates to 0.6.2
- backports proper fix for out-of-bounds memory read. see:
  
https://github.com/SuperTux/supertux/commit/e1b89118f370f8a2ab8703ae98f5e3e9c3f4387d
  
https://github.com/SuperTux/supertux/commit/1241e3361dd8443306fe37eae7de6badaf8c3aef
- does not use fixed tux-statue.png
  
https://github.com/SuperTux/supertux/commit/20eae9e21f42c46e8c336dd8394cbf86249405a0

>
> I bisected and found a commit from 2.0.10 that caused this segfault:
> https://github.com/libsdl-org/SDL/commit/670f3d3327912b299e8e5ea9de4f01bd833414cc
>
> It reads out of bounds memory due to usage of SIMD functions since SDL
> 2.0.10. My workaround is to make the resolution larger for the affected
> image. I get the same backtrace on startup.
>
> Tests and feedback are welcome. OK? I would like to get this in to
> unbreak games/supertux, but it is almost ports lock.

To display FPS in the terminal:
$ LIBGL_SHOW_FPS=1 supertux2

I found some quirks while testing:
- level music will eventually stop looping. restarting level in the menu
  fixes this.
- performance stays at 60 FPS most of the time
- ps4 controller works with right analog stick used to pan the camera
  (equivalent to home/end/pgdn/pgup)
- Performance randomly drops sometimes to 40 fps after I get killed or
  switch window focus. It eventually recovers. Fullscreen seems to give
  more stable framerate. This is likely due to other processes running, as
  noticed in top(1).

This is for after ports-unlock. As suggested by sthen@ I would like to
commit to -stable at that time.

I received OK pascal@ for previous workaround diff:
Pascal Stumpf writes:

> This is working for me.  OK.

Feedback and tests are welcome. Previously, Marcus MERIGHI and pascal@
tested the workaround diff. OK?

Index: Makefile
===
RCS file: /cvs/ports/games/supertux/Makefile,v
retrieving revision 1.23
diff -u -p -u -p -r1.23 Makefile
--- Makefile25 Feb 2021 22:26:02 -  1.23
+++ Makefile20 Apr 2021 00:46:35 -
@@ -2,10 +2,9 @@
 
 COMMENT =  jump 'n' run game
 
-V =0.6.0
+V =0.6.2
 DISTNAME = SuperTux-v${V}-Source
 PKGNAME =  supertux-$V
-REVISION = 2
 
 CATEGORIES =   games
 
Index: distinfo
===
RCS file: /cvs/ports/games/supertux/distinfo,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 distinfo
--- distinfo4 Feb 2019 10:02:07 -   1.4
+++ distinfo20 Apr 2021 00:46:35 -
@@ -1,2 +1,2 @@
-SHA256 (SuperTux-v0.6.0-Source.tar.gz) = 
xMPl+m+Q6HuMWtayKheempg5v5l+fyGeIrvNHJciOsA=
-SIZE (SuperTux-v0.6.0-Source.tar.gz) = 131203604
+SHA256 (SuperTux-v0.6.2-Source.tar.gz) = 
JqnlbqLShBSISfMjkXfXd92ltnWhCrLXbuZYVMkf9Zg=
+SIZE (SuperTux-v0.6.2-Source.tar.gz) = 174295862
Index: patches/patch-CMakeLists_txt
===
RCS file: /cvs/ports/games/supertux/patches/patch-CMakeLists_txt,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt4 Feb 2019 10:02:07 -   1.4
+++ patches/patch-CMakeLists_txt20 Apr 2021 00:46:35 -
@@ -11,7 +11,7 @@ Index: CMakeLists.txt
  
  set(BUILD_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/data")
  set(BUILD_CONFIG_DATA_DIR "${CMAKE_BINARY_DIR}/data")
-@@ -249,7 +249,8 @@ if(NOT USE_SYSTEM_PHYSFS)
+@@ -256,7 +256,8 @@ if(NOT USE_SYSTEM_PHYSFS)
  -DLIB_SUFFIX=${LIB_SUFFIX}
  -DPHYSFS_BUILD_SHARED=${PHYSFS_BUILD_SHARED}
  -DPHYSFS_BUILD_STATIC=${PHYSFS_BUILD_STATIC}
@@ -21,7 +21,7 @@ Index: CMakeLists.txt
  
if(WIN32)
  add_library(physfs_lib SHARED IMPORTED)
-@@ -392,7 +393,9 @@ ExternalProject_Add(squirrel
+@@ -404,7 +405,9 @@ ExternalProject_Add(squirrel
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_INSTALL_PREFIX=${SQUIRREL_PREFIX}
@@ -32,7 +32,7 @@ Index: CMakeLists.txt
  
  if(WIN32)
add_library(squirrel_lib SHARED IMPORTED)
-@@ -435,7 +438,8 @@ ExternalProject_Add(tinygettext
+@@ -454,7 +457,8 @@ ExternalProject_Add(tinygettext
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DSDL2_LIBRARIES=${SDL2_LIBRARIES}
-DSDL2_INCLUDE_DIRS=${SDL2_INCLUDE_DIRS}
@@ -42,7 +42,7 @@ Index: CMakeLists.txt
  
  add_library(tinygettext_lib STATIC IMPORTED)
  set_target_properties(tinygettext_lib PROPERTIES IMPORTED_LOCATION 

CVS: cvs.openbsd.org: ports

2021-04-19 Thread Landry Breuil
CVSROOT:/cvs
Module name:ports
Changes by: lan...@cvs.openbsd.org  2021/04/19 08:28:00

Modified files:
mail/mozilla-thunderbird: Tag: OPENBSD_6_8 Makefile distinfo 

Log message:
mail/mozilla-thunderbird: MFC update to 78.10.0

See https://www.thunderbird.net/en-US/thunderbird/78.10.0/releasenotes/
Fixes https://www.mozilla.org/en-US/security/advisories/mfsa2021-14/



CVS: cvs.openbsd.org: ports

2021-04-19 Thread Landry Breuil
CVSROOT:/cvs
Module name:ports
Changes by: lan...@cvs.openbsd.org  2021/04/19 08:27:01

Modified files:
mail/mozilla-thunderbird: Makefile distinfo 
mail/thunderbird-i18n: Makefile.inc distinfo 

Log message:
mail/mozilla-thunderbird: update to 78.10.0

See https://www.thunderbird.net/en-US/thunderbird/78.10.0/releasenotes/
Fixes https://www.mozilla.org/en-US/security/advisories/mfsa2021-14/

discussed with/ok naddy@ sthen@



Re: CVS: cvs.openbsd.org: ports

2021-04-19 Thread Landry Breuil
On Mon, Apr 19, 2021 at 02:20:50AM -0600, Landry Breuil wrote:
> CVSROOT:  /cvs
> Module name:  ports
> Changes by:   lan...@cvs.openbsd.org  2021/04/19 02:20:50
> 
> Modified files:
>   www/mozilla-firefox: Makefile distinfo 
>   www/mozilla-firefox/patches: patch-dom_ipc_ContentChild_cpp 
>patch-mozglue_misc_Uptime_cpp 
>
> patch-toolkit_system_gnome_nsGIOService_cpp 
>patch-xpcom_io_nsLocalFileUnix_cpp 
>   www/mozilla-firefox/pkg: PLIST 
>   www/firefox-i18n: Makefile.inc distinfo 
> 
> Log message:
> www/mozilla-firefox: update to 88.0
> 
> See https://www.mozilla.org/en-US/firefox/88.0/releasenotes/
> Fixes https://www.mozilla.org/en-US/security/advisories/mfsa2021-14/ (not 
> there yet)

should have been https://www.mozilla.org/en-US/security/advisories/mfsa2021-16/
https://www.mozilla.org/en-US/security/advisories/mfsa2021-14/ is for 
thunderbird 78.10.0.



CVS: cvs.openbsd.org: ports

2021-04-19 Thread Landry Breuil
CVSROOT:/cvs
Module name:ports
Changes by: lan...@cvs.openbsd.org  2021/04/19 02:23:10

Modified files:
www/firefox-esr: Tag: OPENBSD_6_8 Makefile distinfo 

Log message:
www/firefox-esr: MFC update to 78.10.0

See https://www.mozilla.org/en-US/firefox/78.10.0/releasenotes/
Fixes https://www.mozilla.org/en-US/security/advisories/mfsa2021-15/ (not there 
yet)



CVS: cvs.openbsd.org: ports

2021-04-19 Thread Landry Breuil
CVSROOT:/cvs
Module name:ports
Changes by: lan...@cvs.openbsd.org  2021/04/19 02:21:59

Modified files:
www/firefox-esr: Makefile distinfo 
www/firefox-esr-i18n: Makefile.inc distinfo 

Log message:
www/firefox-esr: update to 78.10.0

See https://www.mozilla.org/en-US/firefox/78.10.0/releasenotes/
Fixes https://www.mozilla.org/en-US/security/advisories/mfsa2021-15/ (not there 
yet)

discussed with/ok naddy@ sthen@



CVS: cvs.openbsd.org: ports

2021-04-19 Thread Landry Breuil
CVSROOT:/cvs
Module name:ports
Changes by: lan...@cvs.openbsd.org  2021/04/19 02:20:50

Modified files:
www/mozilla-firefox: Makefile distinfo 
www/mozilla-firefox/patches: patch-dom_ipc_ContentChild_cpp 
 patch-mozglue_misc_Uptime_cpp 
 
patch-toolkit_system_gnome_nsGIOService_cpp 
 patch-xpcom_io_nsLocalFileUnix_cpp 
www/mozilla-firefox/pkg: PLIST 
www/firefox-i18n: Makefile.inc distinfo 

Log message:
www/mozilla-firefox: update to 88.0

See https://www.mozilla.org/en-US/firefox/88.0/releasenotes/
Fixes https://www.mozilla.org/en-US/security/advisories/mfsa2021-14/ (not there 
yet)

- update patch-mozglue_misc_Uptime_cpp to what was commited upstream
- add link to upstream commit in patch-xpcom_io_nsLocalFileUnix_cpp, merged in 
89

discussed with/ok naddy@ sthen@