aslstatus-9999.ebuild 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 2022-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit savedconfig
  5. DESCRIPTION="async suckless status monitor"
  6. HOMEPAGE="https://notabug.org/dm9pZCAq/aslstatus"
  7. if [ "${PV}" = 9999 ]; then
  8. inherit git-r3
  9. EGIT_REPO_URI="https://notabug.org/dm9pZCAq/${PN}.git"
  10. VERSION=git
  11. else
  12. SRC_URI="
  13. https://notabug.org/dm9pZCAq/${PN}/archive/${PV}.tar.gz
  14. -> ${P}.tar.gz
  15. "
  16. KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
  17. S="${WORKDIR}/${PN}"
  18. VERSION="${PV}"
  19. fi
  20. LICENSE="MIT"
  21. SLOT="0"
  22. IUSE="+X +xkb +alsa pulseaudio"
  23. REQUIRED_USE="xkb? ( X )"
  24. DEPEND="
  25. X? ( x11-libs/libxcb[xkb?] )
  26. alsa? ( media-libs/alsa-lib )
  27. pulseaudio? ( media-libs/libpulse )
  28. "
  29. RDEPEND="${DEPEND}"
  30. BDEPEND="virtual/pkgconfig"
  31. src_prepare() {
  32. default
  33. restore_config {components_,}config.h
  34. }
  35. src_compile() {
  36. local audio=''
  37. if use pulseaudio; then
  38. audio=PULSE
  39. elif use alsa; then
  40. audio=ALSA
  41. fi
  42. emake VERSION="${VERSION}" \
  43. AUDIO="${audio}" \
  44. X="$(usex X 1 0)" \
  45. XKB="$(usex xkb 1 0)"
  46. }
  47. src_install() {
  48. local DOCS=( *.md )
  49. dobin "${PN}"
  50. doman "$([ "${PV}" = 9999 ] && printf %s 'man/')${PN}.1"
  51. save_config {components_,}config.h
  52. einstalldocs
  53. }