1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
7 inherit multilib autotools python-r1 eutils
9 DESCRIPTION="A standards compliant, fast, light-weight, extensible window manager"
10 HOMEPAGE="http://openbox.org/"
11 if [[ ${PV} == *9999* ]]; then
13 EGIT_REPO_URI="git://git.openbox.org/dana/openbox"
15 https://dev.gentoo.org/~hwoarang/distfiles/surreal-gentoo.tar.gz )"
19 SRC_URI="http://openbox.org/dist/openbox/${P}.tar.gz
20 branding? ( https://dev.gentoo.org/~hwoarang/distfiles/surreal-gentoo.tar.gz )"
21 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~arm-linux ~x86-linux"
26 IUSE="branding debug imlib nls session startup-notification static-libs svg xdg"
27 REQUIRED_USE="xdg? ( ${PYTHON_REQUIRED_USE} )"
29 RDEPEND="dev-libs/glib:2
30 >=dev-libs/libxml2-2.0
31 >=media-libs/fontconfig-2
36 >=x11-libs/pango-1.8[X]
37 imlib? ( media-libs/imlib2 )
38 startup-notification? ( >=x11-libs/startup-notification-0.8 )
39 svg? ( gnome-base/librsvg:2 )
42 dev-python/pyxdg[${PYTHON_USEDEP}]
49 x11-proto/xf86vidmodeproto
50 x11-proto/xineramaproto"
53 if [[ ${PV} == *9999* ]]; then
61 use xdg && python_export_best
62 epatch "${FILESDIR}"/${PN}-3.5.2-gnome-session.patch
65 -e 's/-fno-strict-aliasing//' \
66 "${S}"/m4/openbox.m4 || die
73 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
75 $(use_enable static-libs static) \
77 $(use_enable imlib imlib2) \
78 $(use_enable svg librsvg) \
79 $(use_enable startup-notification) \
80 $(use_enable session session-management) \
85 dodir /etc/X11/Sessions
86 echo "/usr/bin/openbox-session" > "${ED}/etc/X11/Sessions/${PN}"
87 fperms a+x /etc/X11/Sessions/${PN}
88 emake DESTDIR="${D}" install
90 insinto /usr/share/themes
91 doins -r "${WORKDIR}"/Surreal_Gentoo
92 # make it the default theme
94 -e "/<theme>/{n; s@<name>.*</name>@<name>Surreal_Gentoo</name>@}" \
95 "${D}"/etc/xdg/openbox/rc.xml \
96 || die "failed to set Surreal Gentoo as the default theme"
98 use static-libs || prune_libtool_files --all
100 python_replicate_script "${ED}"/usr/libexec/openbox-xdg-autostart
102 rm "${ED}"/usr/libexec/openbox-xdg-autostart || die