# $NetBSD: Makefile.common,v 1.48 2023/09/03 12:12:03 rhialto Exp $ # # used by games/nethack/Makefile # used by games/nethack-lib/Makefile # used by games/nethack-x11/Makefile # used by games/nethack-tty/Makefile # # System-provided variables: # # GAMEPERM # The desired owner and the file mode of game executables. # NETHACK_BASEVER= 3.6.7 NETHACK_VERSION= ${NETHACK_BASEVER} NETHACK_DISTVER= ${NETHACK_BASEVER:S/.//g} NETHACK_DIR= nethackdir${NETHACK_SAVEVER:S/.//g} # The oldest compatible version of save files. Only change this when # the upstream breaks save file compatibility. NETHACK_SAVEVER= 3.6.0 DISTNAME= nethack-${NETHACK_DISTVER}-src PKGREVISION= 3 CATEGORIES= games MASTER_SITES= https://www.nethack.org/download/${NETHACK_BASEVER}/ EXTRACT_SUFX= .tgz MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= https://www.nethack.org/ LICENSE= nethack-license # sh: ../util/makedefs: permission denied MAKE_JOBS_SAFE= no .if !defined(META_PACKAGE) WRKSRC= ${WRKDIR}/NetHack-${NETHACK_BASEVER} HAS_CONFIGURE= yes CONFIGURE_SCRIPT= ./sys/unix/setup.sh USE_TOOLS+= gzip yacc lex awk USE_LANGUAGES+= c c++ # NetBSD's curses doesn't put the cursor where the game wants it # but leaves it in some random position. The playability of the game # depends on it, though. Therefore we prefer ncurses. PREFER.curses= pkgsrc .include "../../mk/curses.buildlink3.mk" # If we link ncurses, it has termcap/terminfo built in; # we should not link with the native version. . if "${CURSES_TYPE}" != "ncurses" . include "../../mk/termcap.buildlink3.mk" . endif OPSYSVARS+= NETHACK_OS NETHACK_OS.Linux= SYSV NETHACK_OS.*= BSD SUBST_CLASSES+= os SUBST_MESSAGE.os= Configuring for ${NETHACK_OS} SUBST_STAGE.os= pre-configure SUBST_FILES.os= include/unixconf.h SUBST_VARS.os= VARDIR NETHACK_OS SUBST_CLASSES+= configh SUBST_STAGE.configh= pre-configure SUBST_FILES.configh= include/config.h SUBST_VARS.configh= HACKDIR SUBST_SED.configh= -e "s|@GZIP_PROGRAM@|${GZIP_CMD:[1]}|g" USE_GAMESGROUP= yes NETHACK_USER= ${GAMES_USER} NETHACK_GROUP= ${GAMES_GROUP} BUILD_DEFS+= GAMES_USER GAMES_GROUP GAMEPERM= ${NETHACK_USER} ${NETHACK_GROUP} 2555 BUILD_DEFS+= VARBASE HACKDIR= ${PREFIX}/share/${NETHACK_DIR} VARDIR= ${VARBASE}/games/nethack${NETHACK_SAVEVER:S/.//g} MAKE_ENV+= HACKDIR=${HACKDIR} MAKE_ENV+= VARDIR=${VARDIR} MAKE_ENV+= INSTALL_DATA=${INSTALL_DATA:Q} MAKE_ENV+= INSTALL_SCRIPT=${INSTALL_SCRIPT:Q} MAKE_ENV+= INSTALL_PROGRAM=${INSTALL_PROGRAM:Q} . if "${CURSES_TYPE}" == "ncurses" WINTTYLIB= # no separate termcap/terminfo needed . else WINTTYLIB= -L${BUILDLINK_PREFIX.termcap}/lib \ ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.termcap}/lib \ ${BUILDLINK_LDADD.termcap} . endif MAKE_ENV+= WINTTYLIB=${WINTTYLIB:Q} WINCURSESLIB= -L${BUILDLINK_PREFIX.curses}/lib \ ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.curses}/lib \ ${BUILDLINK_LDADD.curses} MAKE_ENV+= WINCURSESLIB=${WINCURSESLIB:Q} CHECK_PORTABILITY_SKIP+= sys/unix/hints/macosx.sh post-extract: ${RUN}${CHMOD} 755 ${WRKSRC}/sys/unix/setup.sh # Substitute NETHACK_DIR in PLIST. PLIST_SUBST+= NETHACK_DIR=${NETHACK_DIR} PRINT_PLIST_AWK+= { gsub(/${NETHACK_DIR}/, "$${NETHACK_DIR}"); } .endif # !defined(META_PACKAGE)