dwm-6.1-r1.ebuild 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit savedconfig toolchain-funcs
  5. DESCRIPTION="a dynamic window manager for X11"
  6. HOMEPAGE="http://dwm.suckless.org/"
  7. SRC_URI="http://dl.suckless.org/${PN}/${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-fbsd"
  11. IUSE="xinerama"
  12. RDEPEND="
  13. media-libs/fontconfig
  14. x11-libs/libX11
  15. x11-libs/libXft
  16. xinerama? ( x11-libs/libXinerama )
  17. "
  18. DEPEND="
  19. ${RDEPEND}
  20. xinerama? ( x11-proto/xineramaproto )
  21. "
  22. src_prepare() {
  23. default
  24. sed -i \
  25. -e "s/CFLAGS = -std=c99 -pedantic -Wall -Os/CFLAGS += -std=c99 -pedantic -Wall/" \
  26. -e "/^LDFLAGS/{s|=|+=|g;s|-s ||g}" \
  27. -e "s/#XINERAMALIBS =/XINERAMALIBS ?=/" \
  28. -e "s/#XINERAMAFLAGS =/XINERAMAFLAGS ?=/" \
  29. -e "s@/usr/X11R6/include@${EPREFIX}/usr/include/X11@" \
  30. -e "s@/usr/X11R6/lib@${EPREFIX}/usr/lib@" \
  31. -e "s@-I/usr/include@@" -e "s@-L/usr/lib@@" \
  32. -e "s/\/freetype2/\ -I\/usr\/include\/freetype2/" \
  33. config.mk || die
  34. sed -i \
  35. -e '/@echo CC/d' \
  36. -e 's|@${CC}|$(CC)|g' \
  37. Makefile || die
  38. restore_config config.h
  39. }
  40. src_compile() {
  41. if use xinerama; then
  42. emake CC=$(tc-getCC) dwm
  43. else
  44. emake CC=$(tc-getCC) XINERAMAFLAGS="" XINERAMALIBS="" dwm
  45. fi
  46. }
  47. src_install() {
  48. emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
  49. exeinto /etc/X11/Sessions
  50. newexe "${FILESDIR}"/dwm-session2 dwm
  51. insinto /usr/share/xsessions
  52. doins "${FILESDIR}"/dwm.desktop
  53. dodoc README
  54. save_config config.h
  55. }