OpenArena / engine

OpenArena modifications to the ioquake3 engine
http://openarena.ws
GNU General Public License v2.0
212 stars 50 forks source link

Makefile `copyFiles` target tries to install files that does not exists #83

Open drupol opened 10 months ago

drupol commented 10 months ago

Hello,

I'm trying to provide a package openarena for Nix and I'm trying to build it from the sources. The compilation works fine, but the process fails during the copyFiles target.

Here's the error log, when it fails:

openarena> install -s -m 0755 build/release-linux-x86_64/openarena.x86_64 /nix/store/d5qm21v2sqjhg5ykg090m85zpa5azgfv-openarena-0.8.8/bin/openarena.x86_64
openarena> install -s -m 0755 build/release-linux-x86_64/openarena_opengl1.x86_64 /nix/store/d5qm21v2sqjhg5ykg090m85zpa5azgfv-openarena-0.8.8/bin/openarena_opengl1.x86_64
openarena> install: cannot stat 'build/release-linux-x86_64/openarena_opengl1.x86_64': No such file or directory
openarena> make: *** [Makefile:2920: copyfiles] Error 1

Here's the relevant part of the Makefile:

ifneq ($(BUILD_CLIENT),0)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)$(FULLBINEXT)
  ifneq ($(USE_RENDERER_DLOPEN),0)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_opengl1_$(SHLIBNAME) $(COPYBINDIR)/renderer_opengl1_$(SHLIBNAME)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_software_$(SHLIBNAME) $(COPYBINDIR)/renderer_software_$(SHLIBNAME)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_openarena1_$(SHLIBNAME) $(COPYBINDIR)/renderer_openarena1_$(SHLIBNAME)
    ifneq ($(BUILD_RENDERER_OPENGL2),0)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_opengl2_$(SHLIBNAME) $(COPYBINDIR)/renderer_opengl2_$(SHLIBNAME)
    endif
  else
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)_opengl1$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)_opengl1$(FULLBINEXT)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)_software$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)_software$(FULLBINEXT)
    ifneq ($(BUILD_RENDERER_OPENGL2),0)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)_opengl2$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)_opengl2$(FULLBINEXT)
    endif
  endif
endif

Basically, it tries to install this file build/release-linux-x86_64/openarena_opengl1.x86_64 but this never gets compiled.

In comparison with ioq3, here's the relevant part of their Makefile:

ifneq ($(BUILD_CLIENT),0)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)$(FULLBINEXT)
  ifneq ($(USE_RENDERER_DLOPEN),0)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_opengl1_$(SHLIBNAME) $(COPYBINDIR)/renderer_opengl1_$(SHLIBNAME)
    ifneq ($(BUILD_RENDERER_OPENGL2),0)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_opengl2_$(SHLIBNAME) $(COPYBINDIR)/renderer_opengl2_$(SHLIBNAME)
    endif
  else
    ifneq ($(BUILD_RENDERER_OPENGL2),0)
    $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)_opengl2$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)_opengl2$(FULLBINEXT)
    endif
  endif
endif

I have no issue with ioq3 Makefile, compilation and installation works fine.

When comparing both files, I have the feeling that it's an erroneous copy paste that happened there. But I might be totally wrong. I opened a PR with a patch that fix the issue, let me know if this is OK.

The problematic changes (https://github.com/OpenArena/engine/commit/4e532eddcdb4c493602b9edafcbf8516e0a87c80#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R2772) has been introduced in commit 4e532eddcdb4c493602b9edafcbf8516e0a87c80 in PR https://github.com/OpenArena/engine/pull/23 from @sago007 (gently pinging the author here, maybe you might help).

Could you please let me know what I could do to fix the issue? This is actually preventing me from making a package for the Nix ecosystem.

Thanks in advance.

leilei- commented 10 months ago

OpenArena does not compile separate renderer modules. USE_RENDERER_DLOPEN=0 should omit them from copyfiles and compile renderer_oa into the client binary.

(btw oa does not support the opengl2 renderer module, so please don't force that)

drupol commented 10 months ago

Hi,

USE_RENDERED_DLOPEN is disabled by default.

Also, when reading the makefile, we can clearly see that it will still try to copy files.

Any other clue?