x11-wm: Update Manifest hashes.
[gentoo.git] / x11-wm / openbox / openbox-3.6.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 PYTHON_COMPAT=( python2_7 )
7 inherit multilib autotools python-r1 eutils
8
9 DESCRIPTION="A standards compliant, fast, light-weight, extensible window manager"
10 HOMEPAGE="http://openbox.org/"
11 if [[ ${PV} == *9999* ]]; then
12         inherit git-2
13         EGIT_REPO_URI="git://git.openbox.org/dana/openbox"
14         SRC_URI="branding? (
15         https://dev.gentoo.org/~hwoarang/distfiles/surreal-gentoo.tar.gz )"
16         KEYWORDS=""
17
18 else
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"
22 fi
23
24 LICENSE="GPL-2"
25 SLOT="3"
26 IUSE="branding debug imlib nls session startup-notification static-libs svg xdg"
27 REQUIRED_USE="xdg? ( ${PYTHON_REQUIRED_USE} )"
28
29 RDEPEND="dev-libs/glib:2
30         >=dev-libs/libxml2-2.0
31         >=media-libs/fontconfig-2
32         x11-libs/libXft
33         x11-libs/libXinerama
34         x11-libs/libXrandr
35         x11-libs/libXt
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 )
40         xdg? (
41                 ${PYTHON_DEPS}
42                 dev-python/pyxdg[${PYTHON_USEDEP}]
43         )
44         "
45 DEPEND="${RDEPEND}
46         sys-devel/gettext
47         virtual/pkgconfig
48         x11-proto/xextproto
49         x11-proto/xf86vidmodeproto
50         x11-proto/xineramaproto"
51
52 src_unpack() {
53         if [[ ${PV} == *9999* ]]; then
54                 git-2_src_unpack
55         else
56                 unpack ${A}
57         fi
58 }
59
60 src_prepare() {
61         use xdg && python_export_best
62         epatch "${FILESDIR}"/${PN}-3.5.2-gnome-session.patch
63         sed -i \
64                 -e "s:-O0 -ggdb ::" \
65                 -e 's/-fno-strict-aliasing//' \
66                 "${S}"/m4/openbox.m4 || die
67         epatch_user
68         eautoreconf
69 }
70
71 src_configure() {
72         econf \
73                 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
74                 $(use_enable debug) \
75                 $(use_enable static-libs static) \
76                 $(use_enable nls) \
77                 $(use_enable imlib imlib2) \
78                 $(use_enable svg librsvg) \
79                 $(use_enable startup-notification) \
80                 $(use_enable session session-management) \
81                 --with-x
82 }
83
84 src_install() {
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
89         if use branding; then
90                 insinto /usr/share/themes
91                 doins -r "${WORKDIR}"/Surreal_Gentoo
92                 # make it the default theme
93                 sed -i \
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"
97         fi
98         use static-libs || prune_libtool_files --all
99         if use xdg ; then
100                 python_replicate_script "${ED}"/usr/libexec/openbox-xdg-autostart
101         else
102                 rm "${ED}"/usr/libexec/openbox-xdg-autostart || die
103         fi
104 }