From 79275629fc3b587f7e9a57a24575fbb91a9d920f Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 28 Jul 2020 19:31:14 -0700 Subject: [PATCH] Qt tinkering After installing qt511-qtbase and qt511-qtmultimedia from macports on my OSX 10.11 system (there is a qt513 but it requires OSX 10.12), I can build the Qt interface with hints/macosx10.10-qt by overriding QTDIR. It doesn't actually need the extra CFLAGS, and without those I wonder whether the multimedia package is needed either, but I've left them in. I have changed them to not be passed to the C sources though, just the C++ ones. I haven't tried combining with X11 or adding curses. --- sys/unix/Makefile.src | 4 ++-- sys/unix/hints/macosx10.10-qt | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 6b1da0794..60283236f 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -1,5 +1,5 @@ # NetHack Makefile. -# NetHack 3.6 Makefile.src $NHDT-Date: 1588776919 2020/05/06 14:55:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.97 $ +# NetHack 3.6 Makefile.src $NHDT-Date: 1595989869 2020/07/29 02:31:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.104 $ # Copyright (c) 2018 by Pasi Kallinen # NetHack may be freely redistributed. See license for details. @@ -179,7 +179,7 @@ LIBS += -lm # The Qt and Be window systems are written in C++, while the rest of # NetHack is standard C. If using Qt, uncomment the LINK line here to get # the C++ libraries linked in. -CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include +CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include $(QTCXXFLAGS) CXX ?= g++ MOC ?= moc #LINK=g++ diff --git a/sys/unix/hints/macosx10.10-qt b/sys/unix/hints/macosx10.10-qt index 759703a5b..bb3773336 100644 --- a/sys/unix/hints/macosx10.10-qt +++ b/sys/unix/hints/macosx10.10-qt @@ -1,5 +1,5 @@ # -# NetHack 3.6 macosx10.11 $NHDT-Date: 1595085485 2020/07/18 15:18:05 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.58 $ +# NetHack 3.6 macosx10.11 $NHDT-Date: 1595989870 2020/07/29 02:31:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.59 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. # NetHack may be freely redistributed. See license for details. # @@ -31,7 +31,10 @@ WANT_DEFAULT=Qt # A) set QTDIR either here or in the environment to point to the Qt5 # library installation root. (Qt2 or Qt3 will not work.) ifdef WANT_WIN_QT +# Qt installed via homebrew QTDIR=$(shell brew --prefix)/opt/qt +# Qt installed via macports (qt511 package; 5.13 requires OSX 10.12 or later) +#QTDIR=/opt/local/libexec/qt5 endif # WANT_WIN_QT # 2. Is this a build for a binary that will be shared among different users @@ -121,8 +124,8 @@ endif # WANT_WIN_X11 ifdef WANT_WIN_QT CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS -CFLAGS += -Wno-deprecated-declarations -CFLAGS += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags) +QTCXXFLAGS += -Wno-deprecated-declarations +QTCXXFLAGS += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags) WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs) LINK=$(CXX) WINSRC += $(WINQTSRC)