2016-01-24 05:04:30 +01:00
|
|
|
# Created by: asami
|
|
|
|
|
|
|
|
PORTNAME= nethack36
|
2020-04-04 10:01:14 +02:00
|
|
|
PORTVERSION= 3.6.6
|
2020-05-16 22:50:32 +02:00
|
|
|
PORTREVISION= 1
|
2016-01-24 05:04:30 +01:00
|
|
|
CATEGORIES= games
|
2019-09-22 00:00:47 +02:00
|
|
|
MASTER_SITES= https://nethack.org/download/${PORTVERSION}/
|
2016-01-24 05:04:30 +01:00
|
|
|
DISTNAME= ${TRUEPORTNAME}-${PORTVERSION:S/.//g}-src
|
|
|
|
|
|
|
|
MAINTAINER= glewis@FreeBSD.org
|
|
|
|
COMMENT= Dungeon explorin', slashin', hackin' game
|
|
|
|
|
|
|
|
LICENSE= nethack
|
|
|
|
LICENSE_NAME= NETHACK GENERAL PUBLIC LICENSE
|
|
|
|
LICENSE_FILE= ${WRKSRC}/dat/license
|
|
|
|
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
|
|
|
|
|
2019-10-01 15:58:46 +02:00
|
|
|
USES= alias compiler:c11 gmake ncurses tar:tgz
|
2019-09-22 00:05:10 +02:00
|
|
|
|
2019-12-30 19:16:59 +01:00
|
|
|
WRKSRC= ${WRKDIR}/NetHack-NetHack-${PORTVERSION}_Released
|
2016-01-24 05:04:30 +01:00
|
|
|
|
|
|
|
MAKE_ENV= GRAPHICS="${GRAPHICS}"
|
|
|
|
PLIST_SUB= HACKNAME="${HACKNAME}" \
|
|
|
|
HACKEXT="${HACKEXT}"
|
|
|
|
TRUEPORTNAME= nethack
|
|
|
|
|
|
|
|
# Configure these variables as you want them to be.
|
|
|
|
HACKEXT?= 36
|
|
|
|
HACKNAME?= ${TRUEPORTNAME}${HACKEXT}
|
|
|
|
HACKDIR?= share/${HACKNAME}
|
|
|
|
HACKLINK= ${TRUEPORTNAME}
|
|
|
|
|
|
|
|
DATADIR= ${PREFIX}/${HACKDIR}
|
|
|
|
DOCSDIR= ${PREFIX}/share/doc/${HACKNAME}
|
|
|
|
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
|
|
|
|
|
|
|
|
.if !defined(PKGNAMESUFFIX)
|
2019-11-05 23:16:14 +01:00
|
|
|
USES+= xorg
|
2019-03-13 04:22:29 +01:00
|
|
|
USE_XORG= xaw xpm xmu xext xt x11 sm ice
|
2016-01-24 05:04:30 +01:00
|
|
|
CFLAGS+= -DX11_GRAPHICS -DUSE_TILES
|
|
|
|
GRAPHICS= X11_GRAPHICS
|
|
|
|
.else
|
|
|
|
.if ${PKGNAMESUFFIX} == "-nox11"
|
|
|
|
GRAPHICS= # none
|
|
|
|
.endif
|
|
|
|
.endif
|
2020-05-16 22:50:32 +02:00
|
|
|
CFLAGS+= -DNOMAIL -DCURSES_GRAPHICS
|
2016-01-24 05:04:30 +01:00
|
|
|
|
|
|
|
OPTIONS_DEFINE= DOCS
|
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
.if !exists(${PREFIX}/bin/${HACKLINK}) && ${HACKNAME} != ${HACKLINK}
|
|
|
|
PLIST_SUB+= HACKLINK=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= HACKLINK="@comment "
|
|
|
|
.endif
|
|
|
|
|
|
|
|
post-patch:
|
|
|
|
@${REINPLACE_CMD} -e \
|
|
|
|
's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/include/config.h
|
|
|
|
@${REINPLACE_CMD} -e \
|
|
|
|
's|<malloc.h>|<stdlib.h>|g' ${WRKSRC}/win/Qt/qt_win.cpp
|
2020-04-04 10:01:14 +02:00
|
|
|
.for f in sys/unix/Makefile.doc sys/unix/Makefile.src sys/unix/Makefile.top
|
2016-01-24 05:04:30 +01:00
|
|
|
@${REINPLACE_CMD} -e 's|%%HACKNAME%%|${HACKNAME}|g' \
|
|
|
|
-e 's|%%HACKDIR%%|${PREFIX}/${HACKDIR}|g' \
|
|
|
|
-e 's|%%HACKEXT%%|${HACKEXT}|g' \
|
|
|
|
${WRKSRC}/${f}
|
|
|
|
.endfor
|
|
|
|
.for f in dgn_comp.6 dlb.6 lev_comp.6 nethack.6 recover.6
|
|
|
|
@${REINPLACE_CMD} -e 's|%%HACKNAME%%|${HACKNAME}|g' \
|
|
|
|
-e 's|%%HACKDIR%%|${PREFIX}/${HACKDIR}|g' \
|
|
|
|
-e 's|%%HACKEXT%%|${HACKEXT}|g' \
|
|
|
|
${WRKSRC}/doc/${f}
|
|
|
|
.endfor
|
|
|
|
.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
|
|
|
|
|
|
|
|
do-configure:
|
|
|
|
@cd ${WRKSRC}/sys/unix; ${SH} setup.sh
|
|
|
|
|
|
|
|
pre-install:
|
|
|
|
@${CAT} ${FILESDIR}/pkg-deinstall.in | ${SED} \
|
|
|
|
-e 's|%%HACKDIR%%|${HACKDIR}|g' > ${PKGDEINSTALL}
|
|
|
|
|
|
|
|
post-install:
|
|
|
|
.if !exists(${PREFIX}/bin/${HACKLINK}) && ${HACKNAME} != ${HACKLINK}
|
|
|
|
@${LN} -s -f ${PREFIX}/bin/${HACKNAME} ${STAGEDIR}${PREFIX}/bin/${HACKLINK}
|
|
|
|
.endif
|
|
|
|
@cd ${WRKSRC}/doc; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} manpages
|
|
|
|
@${MKDIR} ${STAGEDIR}${DATADIR}/save
|
2019-09-22 00:00:47 +02:00
|
|
|
@${CP} ${WRKSRC}/sys/unix/sysconf ${STAGEDIR}/${DATADIR}/sysconf
|
|
|
|
# Make sysconf a sample to prevent it being removed if altered
|
|
|
|
@${CP} ${STAGEDIR}/${DATADIR}/sysconf ${STAGEDIR}/${DATADIR}/sysconf.sample
|
|
|
|
# Make "sample" files from records to prevent them being removed
|
|
|
|
# if they have been altered
|
|
|
|
@${CP} ${STAGEDIR}/${DATADIR}/logfile ${STAGEDIR}/${DATADIR}/logfile.sample
|
|
|
|
@${CP} ${STAGEDIR}/${DATADIR}/record ${STAGEDIR}/${DATADIR}/record.sample
|
|
|
|
@${CP} ${STAGEDIR}/${DATADIR}/xlogfile ${STAGEDIR}/${DATADIR}/xlogfile.sample
|
2016-01-24 05:04:30 +01:00
|
|
|
.if ${PORT_OPTIONS:MDOCS}
|
|
|
|
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/doc/Guidebook.txt ${STAGEDIR}${DOCSDIR}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|