Add CMake for 5.0 - #1558
Add CMake for 5.0#1558mark-z-r wants to merge 26 commits into
Conversation
libm math functions are used by lua and NetHack and Lua both need to link to libdl.a.
Updates to NetHack 3.7 CMakeLists.txt
Be able to carry out uplifts during minor release lifetimes. Document a way to be able to uplift struct content without incrementing EDITLEVEL and breaking existing savefiles. Use the mechanics outlined to uplift the contents instead, where it is feasible to do so. The uplift is currently one-way only. An uplifted savefile cannot be used with an earlier build of NetHack , one built with a lower SAVEFILE_REVISION_LEVEL, than the one which wrote the savefile. The final byte (byte 79) of the 80 critical bytes in the savefile, of which 10 are reserved for future expansion and not currently used, will now be used for holding the savefile revision level (SAVEFILE_REVISION_LEVEL in include/patchlevel.h) at the time the savefile was written. That leaves 9 of the bytes available for future use.
The directories and permissions portion of the linux.500 and macOS.500
hints files and their included files has been consolidated to
dirs-perms.500.
The builder can edit that one file now, to identify
the folders that will be utilised as part of the build.
Alternatively, you can set those folders and permissions in a
make.perms file in the top of the NetHack folder tree and
they should take precedence over the ones in dirs-perms.500
because dirs-perms.500 uses '?=' variable assignment, which
means "set the value of the variable if no value has been set."
* NOTE: BUILD CHANGE *
This also makes WANT_SOURCE_INSTALL=1 the default over
WANT_SHARED_INSTALL=1, if neither is explicitly set.
The new default is the safer and less-impacting default,
but it will change where things get installed over earlier
Makefile builds. You can be explicit with WANT_SHARED_INSTALL=1
in your make command to get that..
These are the differences between the two:
make WANT_SHARED_INSTALL=1 Place the results of the install/update portion
of the build into a shared area on a multiuser
system.
make WANT_SOURCE_INSTALL=1 Place the results of the install/update portion
of the build into a subfolder of the source
tree, rather than in a system-wide shared area.
Also note that the macOS hints file behaves slightly differntly depending
on whether WANT_SOURCE_INSTALL=1 was set versus letting it be the default.
That's not new, it behaved that way before.
It was using dupstr(), so strutil had to be added to the project.
There is no unintentional spelling mistake. Close NetHack#1523
and split out the options into a seperate file modified: CMakeLists.txt new file: CMakeOptions.txt
the resultant binary don't work though lots done, probably should have split this up into more commits... important to note is that I changed report.c to not output a backtrace if NO_BACKTRACE if defined. NO_BACKTRACE gets defined if `backtrace()` is not defined. still missing a lot of features that the makefiles have, but it is hard dechipering the current build system... modified: CMakeLists.txt modified: CMakeOptions.txt new file: src/CMakeLists.txt modified: src/report.c new file: sys/CMakeLists.txt modified: util/CMakeLists.txt new file: win/CMakeLists.txt new file: win/curses/CMakeLists.txt new file: win/tty/CMakeLists.txt
modified: CMakeOptions.txt modified: src/CMakeLists.txt modified: sys/CMakeLists.txt new file: sys/share/CMakeLists.txt
just that. added some info on finding config values for cmake too
also added a hackdir option
nethack can run now. requires manual setup of data dirs, but it runs! next steps: data files (makedefs) and installs
|
Thank you for this! We're trying to get a proper build done and having CMake support makes everything better. What's left to do with the data dirs? |
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
|
I'm getting this error building from your branch: Looks like the |
|
I had to manually add a |
|
(That's done in the CMakeLists.txt in https://patch-diff.githubusercontent.com/raw/NetHack/NetHack/pull/662.diff ) |
|
I also had to manually pass a That lets me build successfully, however, I'm still missing an install target. This is the build log from our Chromebrew build: What's the suggested build command? We tend to just use a default of |
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
|
sorry for the slow updates! finals are over now, and I can get back to working on this, I may have some un-pushed commits, I'll check in around 6 hrs. I vaguely remember doing something with that file, although I don't remember what. UPDATE: looking at my last pushed commit, I am almost 100% sure I have un-pushed commits/edits |
I believe I also ended up doing that, but can't remember, also, although the commits say I got it building, I had to do a lot of manual work to get it running |
|
yes, there is not an install target yet, as although the main binary can compile, the other files necessary for the game are not yet handled. |
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
|
Okay, update, I've looked at the current state of things, and my biggest problem is the NETHACKDIR
Can u give me a rundown of directorys on chromebrew? I need to know what types of things I need to allow the user to specifiy |
|
We try to be fhs compliant, but also, due to our situation as an overlay for ChromeOS, all of our files are under |
|
Also, we are setting the nethackdir to {/usr/local} |
|
Well, 1. Chimera Linux does not attempt to follow FHS, but our layout is similar, and 2. Anything in the /var directory is forbidden from being present in a package. This is because it is not meant to be persistent across boots Ideally, the global record file would go in /etc/nethack, the read-only data would go in /usr/lib/nethack, and user specific data would go in the appropriate XDG_* directory |
|
As long as NETHACKDIR is available as a variable, or the NETHACKDIR defaults are sanely under PREFIX/lib in some manner, I don't have a problem with it. The NetHack maintainers may have thoughts on that though. I've put my package update on hold at chromebrew/chromebrew#17217 until you have that and a cmake install ready to go. Happy to test again if you want me to run this further through our automated build insfrastructure! |
|
I am closing this pr because I did not know enough about the build system, so I probably broke the makefile build system |
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
|
@mark-z-r Any further luck? |
commits from cmake 3.7 (scraped most, if not all, of the files from this)
My commits
I thought i would use the 3.7 attempt as a starting point, but so much has changed
since then that I decided to start over
What the PR plans to cover:
most of the options detailed in sys/unix/README.hints, some of them might be dummy(no longer planned)switches for now
I dont remeber why I decided to do this. (probably something to do with creating a chimera port)
I would like some confirmation that this pr will get accepted if it is up to snuff. or
in other words, I want to make sure that this PR will not get rejected just because CMake support
is unwanted