mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-24 04:33:24 +00:00
d5fb42b34b
* Add WITH_HPMON support - colourises hitpoints as they decrease. * Address issue where uninstalling with existing save games in place (PREFIX/lib/nethack/save/*) would result in a "Could not remove PREFIX/lib/nethack" error. Now echoes some useful comments to the user when failing to rmdir PREFIX/lib/nethack/save, and using @dirrmtry on the PREFIX/lib/nethack directory. Also added: * Reference MASTER_SITE_LOCAL for hpmon.diff, in the case the main patch site isn't available. PR: ports/107941 Approved by: philip
105 lines
3.0 KiB
Makefile
105 lines
3.0 KiB
Makefile
# New ports collection makefile for: nethack
|
|
# Date created: 27 March 1995
|
|
# Whom: asami
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
PORTNAME= nethack
|
|
PORTVERSION= 3.4.3
|
|
PORTREVISION= 3
|
|
CATEGORIES?= games
|
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
|
MASTER_SITE_SUBDIR= ${PORTNAME}
|
|
DISTNAME= ${PORTNAME}-${PORTVERSION:S/.//g}-src
|
|
EXTRACT_SUFX= .tgz
|
|
|
|
MAINTAINER?= koitsu@FreeBSD.org
|
|
COMMENT?= A dungeon explorin', slashin', hackin' game
|
|
|
|
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
|
|
|
|
USE_GMAKE= yes
|
|
MAKE_ENV= CXX="${CXX}" GRAPHICS="${GRAPHICS}"
|
|
PLIST_SUB= HACKNAME="${HACKNAME}" \
|
|
HACKDIR="${HACKDIR}" \
|
|
HACKDOCSDIR="${HACKDOCSDIR}"
|
|
|
|
MAN6= dgn_comp.6 dlb.6 lev_comp.6 nethack.6 recover.6
|
|
|
|
# Configure these variables as you want them to be.
|
|
HACKNAME?= nethack
|
|
HACKDIR?= lib/${HACKNAME}
|
|
HACKDOCSDIR?= share/doc/${HACKNAME}
|
|
|
|
.if !defined(PKGNAMESUFFIX)
|
|
USE_XPM= yes
|
|
GRAPHICS= X11_GRAPHICS
|
|
.else
|
|
.if ${PKGNAMESUFFIX} == "-gnome"
|
|
CATEGORIES= games gnome
|
|
USE_GETOPT_LONG= yes
|
|
USE_GNOME= gnomelibs
|
|
MAKE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
|
|
GRAPHICS= GNOME_GRAPHICS
|
|
.elif ${PKGNAMESUFFIX} == "-nox11"
|
|
GRAPHICS= # none
|
|
.if defined(WITH_MENUCOLORS)
|
|
PATCHFILES+= nh343-menucolor_jilles.diff
|
|
PATCH_SITES+= http://www.stack.nl/~jilles/games/ \
|
|
${MASTER_SITE_LOCAL:S|%SUBDIR%|glewis|}
|
|
PATCH_DIST_STRIP= -p1
|
|
CFLAGS+= -DMENU_COLOR_REGEX_POSIX
|
|
.endif
|
|
.if defined(WITH_HPMON)
|
|
PATCHFILES+= hpmon.diff
|
|
PATCH_SITES+= http://www.netsonic.fi/~walker/nh/ \
|
|
${MASTER_SITE_LOCAL:S|%SUBDIR%|koitsu|}
|
|
PATCH_DIST_STRIP= -p1
|
|
CFLAGS+= -DHPMON
|
|
.endif
|
|
.elif ${PKGNAMESUFFIX} == "-qt"
|
|
USE_QT_VER= 3
|
|
MAKE_ENV+= QTCPPFLAGS="${QTCPPFLAGS} ${PTHREAD_CFLAGS}" \
|
|
QTCFGLIBS="${QTCFGLIBS} ${PTHREAD_LIBS}" \
|
|
MOC="${MOC}" LIBQT="-lqt-mt"
|
|
GRAPHICS= QT_GRAPHICS
|
|
.endif
|
|
.endif
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
pre-everything::
|
|
@if [ "${PKGBASE}" != "nethack" ]; then \
|
|
${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ; \
|
|
${ECHO_MSG} " You cannot install nethack and ${PKGBASE} in parallel " ; \
|
|
${ECHO_MSG} " But ${PKGBASE} reads your prior nethack scores " ; \
|
|
${ECHO_MSG} " Don't forget to backup your nethack libdir if it's " ; \
|
|
${ECHO_MSG} " important for you " ; \
|
|
${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ; \
|
|
fi
|
|
|
|
post-patch:
|
|
.for f in include/config.h sys/unix/Makefile.src sys/unix/Makefile.top
|
|
@${REINPLACE_CMD} -e 's|%%HACKNAME%%|${HACKNAME}|g;s|%%HACKDIR%%|${PREFIX}/${HACKDIR}|g' ${WRKSRC}/${f}
|
|
.endfor
|
|
@${REINPLACE_CMD} -e 's|<malloc.h>|<stdlib.h>|g' ${WRKSRC}/win/Qt/qt_win.cpp
|
|
.if defined(WITHOUT_SHELL)
|
|
@${REINPLACE_CMD} -e 's|#define SHELL|/* #define SHELL|' ${WRKSRC}/include/unixconf.h
|
|
.endif
|
|
.if defined(WITH_MAIL)
|
|
@${REINPLACE_CMD} -e 's|/\* #define MAIL \*/|#define MAIL|' ${WRKSRC}/include/unixconf.h
|
|
.endif
|
|
|
|
pre-configure:
|
|
@cd ${WRKSRC}/sys/unix; ${SH} setup.sh
|
|
|
|
post-install:
|
|
@cd ${WRKSRC}/doc; ${SETENV} ${MAKE_ENV} ${MAKE} manpages
|
|
.if !defined(NOPORTDOCS)
|
|
@${MKDIR} ${PREFIX}/${HACKDOCSDIR}
|
|
${INSTALL_DATA} ${WRKSRC}/doc/Guidebook.txt ${PREFIX}/${HACKDOCSDIR}
|
|
.endif
|
|
|
|
.include <bsd.port.post.mk>
|