dev-python/pytest: arm64 stable (bug #723996)
[gentoo.git] / x11-wm / subtle / subtle-0.11.3244.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5 USE_RUBY="ruby24 ruby25 ruby26"
6
7 inherit ruby-ng toolchain-funcs
8
9 if [[ ${PV} == "9999" ]]; then
10         EHG_REPO_URI="https://hg.subforge.org/subtle"
11         EHG_CHECKOUT_DIR=${S}/all
12         inherit mercurial
13 else
14         SRC_URI="https://dev.gentoo.org/~radhermit/dist/${P}.tar.gz"
15         KEYWORDS="~amd64 ~x86"
16 fi
17
18 DESCRIPTION="A manual tiling window manager"
19 HOMEPAGE="https://subforge.org/projects/subtle/wiki"
20
21 LICENSE="GPL-2"
22 SLOT="0"
23 IUSE="debug doc +xft xinerama xpm +xrandr +xtest"
24 RESTRICT="!test? ( test )"
25
26 RDEPEND="x11-libs/libX11
27         xft? ( x11-libs/libXft )
28         xinerama? ( x11-libs/libXinerama )
29         xpm? ( x11-libs/libXpm )
30         xtest? ( x11-libs/libXtst )
31         xrandr? ( x11-libs/libXrandr )"
32 DEPEND="${RDEPEND}"
33 BDEPEND="virtual/pkgconfig"
34
35 ruby_add_rdepend "dev-ruby/archive-tar-minitar"
36 ruby_add_bdepend "dev-ruby/rake doc? ( dev-ruby/rdoc )"
37
38 all_ruby_unpack() {
39         if [[ ${PV} == "9999" ]]; then
40                 mercurial_src_unpack
41         else
42                 default
43         fi
44 }
45
46 each_ruby_configure() {
47         local myconf
48         use debug && myconf+=" debug=yes" || myconf+=" debug=no"
49         use xft && myconf+=" xft=yes" || myconf+=" xft=no"
50         use xinerama && myconf+=" xinerama=yes" || myconf+=" xinerama=no"
51         use xpm && myconf+=" xpm=yes" || myconf+=" xpm=no"
52         use xtest && myconf+=" xtest=yes" || myconf+=" xtest=no"
53         use xrandr && myconf+=" xrandr=yes" || myconf+=" xrandr=no"
54
55         ${RUBY} -S rake -v CC="$(tc-getCC)" destdir="${D}" ${myconf} config || die
56 }
57
58 each_ruby_compile() {
59         ${RUBY} -S rake -v build || die
60 }
61
62 all_ruby_compile() {
63         use doc && { rake rdoc || die ; }
64 }
65
66 each_ruby_install() {
67         ${RUBY} -S rake -v install || die
68 }
69
70 all_ruby_install() {
71         dodir /etc/X11/Sessions
72         cat <<-EOF > "${D}/etc/X11/Sessions/${PN}"
73                 #!/bin/sh
74                 exec /usr/bin/subtle
75         EOF
76         fperms a+x /etc/X11/Sessions/${PN}
77
78         insinto /usr/share/xsessions
79         doins data/${PN}.desktop
80
81         dodoc AUTHORS NEWS
82
83         use doc && dodoc -r html
84 }
85
86 pkg_postinst() {
87         elog "Note that surserver will currently not work since dev-ruby/datamapper"
88         elog "is not in the tree."
89 }