openbox-3.6.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit multilib autotools python-r1 eutils
  6. DESCRIPTION="A standards compliant, fast, light-weight, extensible window manager"
  7. HOMEPAGE="http://openbox.org/"
  8. if [[ ${PV} == *9999* ]]; then
  9. inherit git-2
  10. EGIT_REPO_URI="git://git.openbox.org/dana/openbox"
  11. SRC_URI="branding? (
  12. https://dev.gentoo.org/~hwoarang/distfiles/surreal-gentoo.tar.gz )"
  13. KEYWORDS=""
  14. else
  15. SRC_URI="http://openbox.org/dist/openbox/${P}.tar.gz
  16. branding? ( https://dev.gentoo.org/~hwoarang/distfiles/surreal-gentoo.tar.gz )"
  17. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~arm-linux ~x86-linux"
  18. fi
  19. LICENSE="GPL-2"
  20. SLOT="3"
  21. IUSE="branding debug imlib nls session startup-notification static-libs svg xdg"
  22. REQUIRED_USE="xdg? ( ${PYTHON_REQUIRED_USE} )"
  23. RDEPEND="dev-libs/glib:2
  24. >=dev-libs/libxml2-2.0
  25. >=media-libs/fontconfig-2
  26. x11-libs/libXft
  27. x11-libs/libXinerama
  28. x11-libs/libXrandr
  29. x11-libs/libXt
  30. >=x11-libs/pango-1.8[X]
  31. imlib? ( media-libs/imlib2 )
  32. startup-notification? ( >=x11-libs/startup-notification-0.8 )
  33. svg? ( gnome-base/librsvg:2 )
  34. xdg? (
  35. ${PYTHON_DEPS}
  36. dev-python/pyxdg[${PYTHON_USEDEP}]
  37. )
  38. "
  39. DEPEND="${RDEPEND}
  40. sys-devel/gettext
  41. virtual/pkgconfig
  42. x11-proto/xextproto
  43. x11-proto/xf86vidmodeproto
  44. x11-proto/xineramaproto"
  45. src_unpack() {
  46. if [[ ${PV} == *9999* ]]; then
  47. git-2_src_unpack
  48. else
  49. unpack ${A}
  50. fi
  51. }
  52. src_prepare() {
  53. use xdg && python_export_best
  54. epatch "${FILESDIR}"/${PN}-3.5.2-gnome-session.patch
  55. sed -i \
  56. -e "s:-O0 -ggdb ::" \
  57. -e 's/-fno-strict-aliasing//' \
  58. "${S}"/m4/openbox.m4 || die
  59. epatch_user
  60. eautoreconf
  61. }
  62. src_configure() {
  63. econf \
  64. --docdir="${EPREFIX}/usr/share/doc/${PF}" \
  65. $(use_enable debug) \
  66. $(use_enable static-libs static) \
  67. $(use_enable nls) \
  68. $(use_enable imlib imlib2) \
  69. $(use_enable svg librsvg) \
  70. $(use_enable startup-notification) \
  71. $(use_enable session session-management) \
  72. --with-x
  73. }
  74. src_install() {
  75. dodir /etc/X11/Sessions
  76. echo "/usr/bin/openbox-session" > "${ED}/etc/X11/Sessions/${PN}"
  77. fperms a+x /etc/X11/Sessions/${PN}
  78. emake DESTDIR="${D}" install
  79. if use branding; then
  80. insinto /usr/share/themes
  81. doins -r "${WORKDIR}"/Surreal_Gentoo
  82. # make it the default theme
  83. sed -i \
  84. -e "/<theme>/{n; s@<name>.*</name>@<name>Surreal_Gentoo</name>@}" \
  85. "${D}"/etc/xdg/openbox/rc.xml \
  86. || die "failed to set Surreal Gentoo as the default theme"
  87. fi
  88. use static-libs || prune_libtool_files --all
  89. if use xdg ; then
  90. python_replicate_script "${ED}"/usr/libexec/openbox-xdg-autostart
  91. else
  92. rm "${ED}"/usr/libexec/openbox-xdg-autostart || die
  93. fi
  94. }