Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xonotic: fix a couple of bugs #90019

Closed
wants to merge 1 commit into from
Closed

xonotic: fix a couple of bugs #90019

wants to merge 1 commit into from

Conversation

fps
Copy link
Contributor

@fps fps commented Jun 10, 2020

  • Build all three binaries (sdl, glx, server)
  • build player UID infrastructure
  • locate and add more libraries looked up at runtime:
    • fix font (uses the xonolonium font now) (libfreetype)
    • add libtheora/enc/dev libvorbis/enc/file
  • copy public key over to installation directory, so player UIDs work

this looks to me now like a mostly functioning version of xonotic. The build is linux specific though

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

- Build all three binaries (sdl, glx, server)
- build player UID infrastructure
- locate and add more libraries looked up at runtime:
  - fix font (uses the xonolonium font now) (libfreetype)
  - add libtheora/enc/dev libvorbis/enc/file 
- copy public key over to installation directory, so player UIDs work

this looks to me now like a mostly functioning version of xonotic. The build is linux specific though
@Kloenk
Copy link
Member

Kloenk commented Jun 10, 2020

I don't see the reason to revert to one package, instead of the 3, which saves a lot of hydra storage.

CC @petabyteboy

@fps
Copy link
Contributor Author

fps commented Jun 10, 2020

My aim here was to get a working xonotic package for myself. I originally had a comment in the PR stating that I do not expect this to be merged in this form - it somehow got lost during my fumbling with PR (I don't do that too often ;)). But maybe the maintainers of the original package can take inspiration from the changes and use it to fix the one in nixpkgs.

@Kloenk
Copy link
Member

Kloenk commented Jun 10, 2020

Which branch are you using? Unstable has a reworked xonotic (different than 20.03). The xonotic from unstable/master is working on my side. What is you problem with xonotic?

@fps
Copy link
Contributor Author

fps commented Jun 10, 2020

I used the default.nix from master. The biggest issues:

  • Player UID tracking (for keeping player stats and records in defrag) not working
  • Xolonium font missing

It's obvious from the package in master that especially player UIDs are not working because source/d0_blind_id is not built and linked, nor is the public key copied over to the installation path.

Also the xolonium font can't work since the freetype shared library path is not patchElf'ed in.

@Kloenk
Copy link
Member

Kloenk commented Jun 10, 2020

Freetype is not marked missing via ldd. Will it help to supply it as build input, or is there some type of compile flag to include it?

How to build source/d0_blind_id? is the key available in the source so we can just copy it?

I would like to stay with a build from source, and also don't include the xonotic data in the cache because it would get massive.

@fps
Copy link
Contributor Author

fps commented Jun 10, 2020

Oh and i just confirmed that

cl_capturevideo 1

works now to capture videos during the game.. Which doesn't work in the original derivation either because libvorbis/theora/ogg are not linked against and patchElf'ed in (they are looked up at runtime).

@fps
Copy link
Contributor Author

fps commented Jun 10, 2020

Freetype is not marked missing via ldd. Will it help to supply it as build input, or is there some type of compile flag to include it?

Yeah, xonotic is somewhat special in that it looks up quite a few libraries at runtime and not at linktime. You need to actually play the game to notice the missing libraries ;) freetype as well as quite a few others need to be available as buildInput AND additionally pathElf'ed in as --needed.

How to build source/d0_blind_id? is the key available in the source so we can just copy it?

d0_blind_id gets built normally by the shipped Makefile.

The public key is copied in the installPhase in my PR.

I would like to stay with a build from source, and also don't include the xonotic data in the cache because it would get massive.

The derivation in my PR is a build from source. I'm using the Makefile shipped with the release zip (which ships the source as well). try with

nix-build -E 'with import <nixpkgs> {}; pkgs.callPackage ./default.nix {}'

I understand your point now about the storage space in the cache if the data is included. I will look and transfer my changes over to the original package later today then.

@Kloenk
Copy link
Member

Kloenk commented Jun 10, 2020

If I see it correctly we can build the key with this command (from the download root):

( cd source/d0_blind_id && ./configure --enable-static --disable-shared $(RIJNDAELDETECT_CONFIGURE) )
make -C source/d0_blind_id

This could help as to still have the three different xonotic versions. Also for download time I would prefer to stick to the source zip, as it's much smaller.

@fps
Copy link
Contributor Author

fps commented Jun 10, 2020

Yeah, that command builds the d0_blind_id library which is needed for player UIDs to work. Additionally the public key key_0.d0pk needs to be copied over to the right location during install.

There is also the quakeC (gmqcc) compiler shipped with the source which needs to be built, too, for the quakeC code to be built from source. For that to succeed the shebang in source/qcsrc/tools/qcc.sh needs to be patched and the PATH set during the buildPhase.

Like I said. I can take the time later tonight to move all the fixes over to the original xonotic derivation.

@fps
Copy link
Contributor Author

fps commented Jun 13, 2020

I will open a new PR with the updated expression

@fps fps closed this Jun 13, 2020
@fps
Copy link
Contributor Author

fps commented Jun 16, 2020

#90282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants