Guest User

zandronum alpha bin

a guest
Jan 30th, 2025
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. { stdenv
  2. , lib
  3. , fetchurl
  4. , autoPatchelfHook
  5. , makeWrapper
  6. , callPackage
  7. , soundfont-fluid
  8. , SDL_compat
  9. , libGL
  10. , libopus
  11. , glew
  12. , bzip2
  13. , zlib
  14. , libjpeg
  15. , fluidsynth
  16. , fmodex
  17. , openssl
  18. , gtk2
  19. , game-music-emu
  20. }:
  21.  
  22. let
  23. fmod = fmodex; # fmodex is on nixpkgs now
  24. sqlite = callPackage ./sqlite.nix { };
  25. clientLibPath = lib.makeLibraryPath [ fluidsynth fmod ];
  26. olibjpeg = (libjpeg.override { enableJpeg8 = true; });
  27.  
  28. in
  29. stdenv.mkDerivation rec {
  30. pname = "zandronum-alpha-bin";
  31. version = "3.2-241030-1744";
  32.  
  33. src = fetchurl {
  34. url = "https://zandronum.com/downloads/testing/3.2/ZandroDev${version}linux-x86_64.tar.bz2";
  35. hash = "sha256-e+Xy71FpAZ1pz4fQngD8Ra6Cjy0wW/xrt1V5ANG9QC4=";
  36. };
  37.  
  38. # Work around the "unpacker appears to have produced no directories"
  39. # case that happens when the archive doesn't have a subdirectory.
  40. setSourceRoot = "sourceRoot=`pwd`";
  41.  
  42. # I have no idea why would SDL and libjpeg be needed for the server part!
  43. # But they are.
  44. # RE: libjpeg idk, but SDL provides many low-level OS abstractions other than just video and audio, timing is probably the notable one
  45. buildInputs = [ openssl bzip2 zlib SDL_compat olibjpeg sqlite game-music-emu libGL libopus glew fmod fluidsynth gtk2 ];
  46.  
  47. nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
  48.  
  49. installPhase = ''
  50. mkdir -p $out/bin
  51. mkdir -p $out/lib/zandronum
  52. cp * \
  53. $out/lib/zandronum
  54. rm $out/lib/zandronum/env-vars
  55. ln -sr -f ${fmod}/lib/libfmodex-4.44.64.so $out/lib/zandronum/libfmodex64-4.44.64.so
  56.  
  57. makeWrapper $out/lib/zandronum/zandronum-server $out/bin/zandronum-alpha-server
  58. makeWrapper $out/lib/zandronum/zandronum $out/bin/zandronum-alpha
  59. wrapProgram $out/bin/zandronum-alpha-server \
  60. --set LC_ALL "C"
  61. wrapProgram $out/bin/zandronum-alpha \
  62. --set LC_ALL "C"
  63. '';
  64.  
  65. postFixup = ''
  66. patchelf --replace-needed libjpeg.so.8 libjpeg.so \
  67. --set-rpath $(patchelf --print-rpath $out/lib/zandronum/zandronum):$out/lib/zandronum:${clientLibPath} \
  68. $out/lib/zandronum/{zandronum,zandronum-server}
  69. '';
  70.  
  71. passthru = {
  72. inherit fmod sqlite;
  73. };
  74.  
  75. meta = with lib; {
  76. homepage = "https://zandronum.com/";
  77. description = "Multiplayer oriented port, based off Skulltag, for Doom and Doom II by id Software";
  78. license = licenses.unfreeRedistributable;
  79. platforms = platforms.linux;
  80. };
  81. }
  82.  
Advertisement
Add Comment
Please, Sign In to add comment