atsb / Doom64EX-Plus

An improved modern version of Doom64EX.
GNU General Public License v2.0
139 stars 18 forks source link

Documentation on compile-time macro -DDOOM_UNIX_INSTALL #281

Closed coreybruce closed 1 month ago

coreybruce commented 1 month ago

Hello there I just wanted to ask for some help/documentation and understanding on the compile-time macro -DDOOM_UNIX_INSTALL so the binary can be a system package and will look at ~/.local/share/doom64ex-plus if the wad doesn't exist in the folder it's in or /usr/local/share/doom64ex-plus for example as I believe this should be documented on the readme when compiling on Linux.

atsb commented 1 month ago

It is documented:

GNU/Linux / BSD

GNU/Linux and BSD supports system installations using the compile-time macro -DDOOM_UNIX_INSTALL this will force the software to look for all IWAD and supporting files inside ~/.local/share/doom64ex-plus

compile-time macro -DDOOM_UNIX_SYSTEM_DATADIR=\"/some/system/path\" allows to specify the system folder where the software will look for all IWAD and supporting files. Packagers should set DOOM_UNIX_SYSTEM_DATADIR to a proper folder for the distro and package files doom64ex-plus.wad and doomsnd.sf2 into that folder.

Is this not clear enough?

coreybruce commented 1 month ago

No sorry I don't fully understand sorry which is why I was asking for a bit of clarity when it comes to compiling with a little bit more description on the building process, could you give me a example of how to do it? :smiley:

This is not completed, why was this closed?

atsb commented 1 month ago

I didn't close it.

atsb commented 1 month ago

I will add more clarity

coreybruce commented 1 month ago

Oh maybe I did by mistake, woops

That would be great thank you but could you also explain the process while I'm here

coreybruce commented 1 month ago

Hey there is there any update on the clarity of documentation? could I get a example of the building process please?

atsb commented 1 month ago

I do this in my spare time.. it will be done when I have time.

atsb commented 1 month ago

I've documented it as much as I can for non-technical users. I cannot do more than this. Compilation and packaging is intended for developers, so I've summarised and clarified as much as I am able to do.

coreybruce commented 1 month ago

Well I am a developer, a package maintainer and compile binaries and maintain multiple projects. I just haven't had to go beyond make, cmake or cargo and I just didn't understand what the exact argument was or how to use it,

I think it would be way easier if did this by default instead of needing to do whole separate and more complicated building options when it could just check if /usr/share/games/doom64ex-plus\ exists and if it doesn't check the folder it's running in, if a developer wanted to change the path then they can do so in the make file. with CFLAGS += -DDOOM_UNIX_SYSTEM_DATADIR=\"/usr/share/games/doom64ex-plus\"

That's my suggestion :smiley:

Also I added CFLAGS += -DDOOM_UNIX_SYSTEM_DATADIR=\"/usr/share/games/doom64ex-plus\" to the make file and put the DOOM64.WADand put the files and the game wad in the folder and tested the~/.local/share/doom64ex-plus``` folder and it couldn't find it

Z_Init: Init Zone Memory Allocator
CON_Init: Init Game Console
G_Init: Setting up game input and commands
M_LoadDefaults: Loading game configuration
I_Init: Setting up machine state.
glFinish: Called for: AMD
D_Init: Init DOOM parameters
W_Init: Init WADfiles.
Error - W_Init: IWAD not found

********* ERROR *********
W_Init: IWAD not found% 
atsb commented 1 month ago

I'll take a look, I don't normally use them as my main machine is a mac and I don't need it there.

atsb commented 1 month ago

For inside a makefile the syntax would be:

DOOM_UNIX_SYSTEM_DATADIR=/usr/share/games/doom64ex-plus

-D is only needed for bash and the shell build scripts.

coreybruce commented 1 month ago

Hmm ok I tried that and it still doing the same thing and it's trying to create a config in the wrong location

Z_Init: Init Zone Memory Allocator
CON_Init: Init Game Console
G_Init: Setting up game input and commands
M_LoadDefaults: Loading game configuration
Error - G_ExecuteFile: Unable to create /usr/share/games/doom64ex-plus/config.cfg

********* ERROR *********
G_ExecuteFile: Unable to create /usr/share/games/doom64ex-plus/config.cfg% 

Here is my makefile

CC=gcc

libs := sdl3 libpng gl glu fluidsynth

CFLAGS += $(foreach lib,$(libs),$(shell pkg-config --cflags $(lib)))
LDFLAGS := -lm $(foreach lib,$(libs),$(shell pkg-config --libs $(lib)))
DOOM_UNIX_SYSTEM_DATADIR=/usr/share/games/doom64ex-plus

OBJDIR=src/engine
OUTPUT=DOOM64EX-Plus

OBJS_SRC = i_system.o am_draw.o am_map.o info.o md5.o tables.o con_console.o con_cvar.o d_devstat.o d_main.o d_net.o f_finale.o in_stuff.o g_actions.o g_demo.o g_game.o g_settings.o wi_stuff.o m_cheat.o m_menu.o m_misc.o m_fixed.o m_keys.o m_password.o m_random.o m_shift.o net_client.o net_common.o net_dedicated.o net_io.o net_loop.o net_packet.o net_query.o net_server.o net_structure.o dgl.o gl_draw.o gl_main.o gl_texture.o sc_main.o p_ceilng.o p_doors.o p_enemy.o p_user.o p_floor.o p_inter.o p_lights.o p_macros.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o r_clipper.o r_drawlist.o r_lights.o r_main.o r_scene.o r_bsp.o r_sky.o r_things.o r_wipe.o s_sound.o st_stuff.o i_audio.o i_main.o i_png.o i_video.o w_file.o w_merge.o w_wad.o z_zone.o i_sdlinput.o deh_io.o deh_ptr.o deh_ammo.o deh_doom.o deh_main.o deh_misc.o deh_frame.o deh_thing.o deh_weapon.o deh_mapping.o deh_str.o sha1.o i_xinput.o

OBJS := $(addprefix $(OBJDIR)/, $(OBJS_SRC))

all: $(OUTPUT)

$(OUTPUT): $(OBJS)
    $(CC) $^ $(LDFLAGS) -o $@

clean:
    rm -f $(OUTPUT) $(OUTPUT).gdb $(OUTPUT).map $(OBJS)