Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Install the nethack util binaries and their documentation.
Browse files Browse the repository at this point in the history
Using those, we can define our own custom levels, e.g.

1. Use the tar-like tool dlb to extract nhdat.
2. Modify/add a .des files as per "5. Creating a new level" in
   https://nethackwiki.com/wiki/Beginner%27s_guide_to_NetHack_sources
3. Compile that file using lev_comp.
4. Re-assemble the new set of files using dlb.
  • Loading branch information
Heinrich Kuttler committed Sep 23, 2020
1 parent 7e27697 commit 68d3997
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set(PYTHON_SRC_PARENT
CACHE STRING "Directory containing the nle package files")

set(HACKDIR
"$ENV{HOME}/nethackdir"
"$ENV{HOME}/nethackdir.nle"
CACHE STRING "Configuration files for nethack")

message(STATUS "HACKDIR set to: ${HACKDIR}")
Expand All @@ -59,6 +59,7 @@ set(NLE_SRC ${nle_SOURCE_DIR}/src)
set(NLE_INC ${nle_SOURCE_DIR}/include)
set(NLE_DAT ${nle_SOURCE_DIR}/dat)
set(NLE_UTIL ${nle_SOURCE_DIR}/util)
set(NLE_DOC ${nle_SOURCE_DIR}/doc)

set(NLE_SRC_GEN ${nle_BINARY_DIR}/src)
set(NLE_INC_GEN ${nle_BINARY_DIR}/include)
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include version.txt

include CMakeLists.txt
recursive-include doc *
recursive-include dat *
recursive-include DEVEL *
recursive-include include *
Expand All @@ -16,4 +17,3 @@ exclude nle/dashboard
exclude nle/scripts/nh-clean-install.sh
exclude nle/scripts/run-clang-format.py
exclude nle/scripts/line-changed.sh

54 changes: 22 additions & 32 deletions dat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,30 @@ set(DATDLB

file(MAKE_DIRECTORY ${NLE_DAT_GEN})

foreach(
filename
${DATHELP}
${SPECIAL_LEVELS}
${QUEST_LEVELS}
bogusmon.txt
data.base
dungeon.def
engrave.txt
epitaph.txt
oracles.txt
quest.txt
rumors.fal
rumors.tru
tribute)
# Inputs to makedef and lev_comp (and transitive inputs to dgn_comp and dlb).
set(ALL_DAT_NOTGEN
${DATHELP}
${SPECIAL_LEVELS}
${QUEST_LEVELS}
bogusmon.txt
data.base
dungeon.def
engrave.txt
epitaph.txt
oracles.txt
quest.txt
rumors.fal
rumors.tru
tribute)

# makedef and friends like having their inputs in the same directory.
foreach(filename ${ALL_DAT_NOTGEN})
configure_file(${NLE_DAT}/${filename} ${filename} COPYONLY)
endforeach(filename)

# Dat files that are not inputs to any tools.
set(ALL_DAT_NOTGEN ${ALL_DAT_NOTGEN} license symbols)

# TODO(NN): try to glob .lev automatically
#
# NOTE: Using:
Expand Down Expand Up @@ -199,20 +205,6 @@ set(LEVS_GEN
wizard2.lev
wizard3.lev)

# NOTE: This is missing *.lev, which needs the special lev_comp below.
set(NLE_DAT_OUTPUT
bogusmon
epitaph
engrave
data
rumors
quest.dat
oracles
options
dungeon
dungeon.pdf
nhdat)

add_custom_command(
DEPENDS makedefs bogusmon.txt engrave.txt epitaph.txt
OUTPUT bogusmon epitaph engrave
Expand Down Expand Up @@ -270,10 +262,8 @@ add_custom_command(
set(ALL_DAT_GEN nhdat perm record logfile xlogfile sysconf)
list(TRANSFORM ALL_DAT_GEN PREPEND ${NLE_DAT_GEN}/)

set(ALL_DAT_NOTGEN license symbols)

add_custom_target(dat ALL DEPENDS ${ALL_DAT_GEN} ${ALL_DAT_NOTGEN})

install(FILES ${ALL_DAT_GEN} DESTINATION ${INSTDIR})
install(FILES ${ALL_DAT_NOTGEN} DESTINATION ${INSTDIR})
install(FILES ${ALL_DAT_NOTGEN} DESTINATION ${INSTDIR}/dat)
install(DIRECTORY DESTINATION ${INSTDIR}/save)
11 changes: 10 additions & 1 deletion util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,13 @@ add_custom_target(util DEPENDS ${MAKEDEFS_HEADERS} recover)
add_dependencies(lev_comp util)
add_dependencies(dgn_comp util)

install(TARGETS recover DESTINATION ${INSTDIR})
set(MAN_PAGES ${NLE_DOC}/makedefs.6 ${NLE_DOC}/dgn_comp.6 ${NLE_DOC}/lev_comp.6
${NLE_DOC}/dlb.6 ${NLE_DOC}/recover.6 ${NLE_DOC}/nethack.6)

set(TXT_DOCS
${NLE_DOC}/makedefs.txt ${NLE_DOC}/dgn_comp.txt ${NLE_DOC}/lev_comp.txt
${NLE_DOC}/dlb.txt ${NLE_DOC}/recover.txt ${NLE_DOC}/nethack.txt)

install(TARGETS makedefs dgn_comp lev_comp dlb recover DESTINATION ${INSTDIR})
install(FILES ${MAN_PAGES} DESTINATION ${INSTDIR}/man)
install(FILES ${TXT_DOCS} DESTINATION ${INSTDIR}/doc)

0 comments on commit 68d3997

Please sign in to comment.