logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

assaultcube-reloaded-2.18.2-r1.ebuild (2437B)


  1. # Copyright 2023 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit flag-o-matic
  5. DESCRIPTION="AssaultCube Reloaded"
  6. HOMEPAGE="https://acr.victorz.ca/"
  7. SRC_URI="
  8. https://github.com/acreloaded/acr/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
  9. https://github.com/acreloaded/acr/pull/201/commits/7dad5c8a1a66ade36ca9d8612b3f0b93f6c990a4.patch -> ${PN}-PR201-system-enet.patch
  10. "
  11. S="${WORKDIR}/acr-${PV}/source/src"
  12. LICENSE="ZLIB"
  13. SLOT="0"
  14. KEYWORDS="~amd64"
  15. IUSE="system-enet +X"
  16. DEPEND="
  17. media-libs/libsdl
  18. media-libs/sdl-image
  19. media-libs/openal
  20. media-libs/libvorbis
  21. net-misc/curl
  22. virtual/opengl
  23. X? ( x11-libs/libX11 )
  24. system-enet? ( net-libs/enet:= )
  25. "
  26. RDEPEND="${DEPEND}"
  27. src_prepare() {
  28. default
  29. # Remove windows and MacOS blobs
  30. rm -r "${WORKDIR}/acr-${PV}/source/lib" "${WORKDIR}/acr-${PV}/bin_win32" "${WORKDIR}/acr-${PV}/source/xcode/Frameworks" || die
  31. if use system-enet; then
  32. rm -r ../enet || die
  33. eapply -p3 "${DISTDIR}/${PN}-PR201-system-enet.patch"
  34. #sed -i \
  35. # -e 's;-L../enet/.libs ;;' \
  36. # -e 's;-I../enet/include;;' \
  37. # -e 's;client: libenet;client: ;' \
  38. # -e 's;server: libenet;server: ;' \
  39. # -e 's;master: libenet;master: ;' \
  40. # Makefile || die
  41. fi
  42. sed -i 's;-lGL;-lOpenGL;' Makefile || die
  43. # Pulls <execinfo.h> which is glibc-specific
  44. sed -i 's;#elif defined(linux) .*;#elif defined(__GLIBC__);' tools.cpp || die
  45. # Uses std::basic_string with no CPP includes
  46. sed -i '1a#include <string>' console.h || die
  47. # Breaks due to features like std::clamp added in C++17
  48. append-cxxflags -std=c++14
  49. # clipboard
  50. if use !X; then
  51. sed -i 's;-lX11;;' Makefile || die
  52. sed -i \
  53. -e '/^#if !defined(WIN32) && !defined(__APPLE__)$/,/#endif/d' \
  54. -e '/^void pasteconsole/,/^}$/d' \
  55. -e '/struct hline/ivoid pasteconsole(char *) { }\n' \
  56. console.cpp || die
  57. fi
  58. }
  59. src_install() {
  60. default
  61. newbin - ${PN}_client <<EOF
  62. #!/bin/sh
  63. cd "/usr/share/${PN}" || exit 1
  64. "/usr/libexec/${PN}/ac_client" \
  65. --home="\${XDG_CONFIG_HOME:-\$HOME/.config}/${PN}" \
  66. --init="\${XDG_CONFIG_HOME:-\$HOME/.config}/${PN}/init.cfg" \
  67. "\$@"
  68. EOF
  69. newbin - ${PN}_server <<EOF
  70. #!/bin/sh
  71. cd "/usr/share/${PN}" || exit 1
  72. "/usr/libexec/${PN}/ac_server" "\$@"
  73. EOF
  74. exeinto "/usr/libexec/${PN}"
  75. doexe ac_server ac_client
  76. cd "${WORKDIR}/acr-${PV}" || die
  77. insinto "/usr/share/${PN}"
  78. doins -r bot config packages acr/packages
  79. }