gf2-9999.ebuild 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Copyright 2023-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit edo toolchain-funcs
  5. if [ "${PV}" = 9999 ]; then
  6. inherit git-r3
  7. EGIT_REPO_URI="https://github.com/nakst/gf.git"
  8. else
  9. case "${PV}" in
  10. 2023.12.06) COMMIT="82889c4de974db4508e669c8d909c33be20bf798" ;;
  11. *) die "unknown commit for version: ${PV}" ;;
  12. esac
  13. SRC_URI="https://github.com/nakst/gf/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
  14. KEYWORDS="~amd64"
  15. S="${WORKDIR}/gf-${COMMIT}"
  16. fi
  17. DESCRIPTION="GDB frontend for Linux"
  18. HOMEPAGE="https://github.com/nakst/gf"
  19. LICENSE="MIT"
  20. SLOT="0"
  21. IUSE="+extensions cpu_flags_x86_sse2"
  22. DEPEND="
  23. media-libs/freetype
  24. x11-libs/libX11
  25. "
  26. RDEPEND="${DEPEND}"
  27. BDEPEND="virtual/pkgconfig"
  28. get_pkgconf() {
  29. local pkgconf="$(tc-getPKG_CONFIG)"
  30. local pkg="${1:?}"
  31. edo "${pkgconf}" --cflags --libs "${pkg}" || die
  32. }
  33. src_compile() {
  34. tc-export_build_env
  35. local cflags=(
  36. ${BUILD_CFLAGS}
  37. )
  38. local libs=(
  39. -lpthread
  40. $(get_pkgconf x11)
  41. $(get_pkgconf freetype2)
  42. ${BUILD_LDFLAGS}
  43. )
  44. local defines=(
  45. -DUI_FREETYPE
  46. $(usex cpu_flags_x86_sse2 -DUI_SSE2 '')
  47. ${BUILD_CPPFLAGS}
  48. )
  49. use extensions && ln -vs extensions_v5/extensions.cpp
  50. edo "$(tc-getCXX)" "${defines[@]}" "${cflags[@]}" "${libs[@]}" "${PN}.cpp" -o "${PN}"
  51. }
  52. src_install() {
  53. local DOCS=(README.md)
  54. use extensions && DOCS+=(
  55. extensions_v5/gf_profiling.c
  56. extensions_v5/*.txt
  57. )
  58. dobin "${PN}"
  59. einstalldocs
  60. }
  61. pkg_postinst() {
  62. use extensions && {
  63. local docs="${EROOT}/usr/share/doc/${PF}/"
  64. einfo "see '${docs}' for more info about extensions"
  65. }
  66. }