dev-vcs/hg-git-0.9.0_rc1: version bump with mercurial 5.4 support
[gentoo.git] / gui-apps / swaylock / swaylock-1.4.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit fcaps meson
7
8 DESCRIPTION="Screen locker for Wayland"
9 HOMEPAGE="https://github.com/swaywm/swaylock"
10
11 if [[ ${PV} == 9999 ]]; then
12         inherit git-r3
13         EGIT_REPO_URI="https://github.com/swaywm/${PN}.git"
14 else
15         SRC_URI="https://github.com/swaywm/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
16         KEYWORDS="~amd64 ~arm64 ~x86"
17 fi
18
19 LICENSE="MIT"
20 SLOT="0"
21 IUSE="fish-completion +gdk-pixbuf +man +pam zsh-completion"
22
23 DEPEND="
24         dev-libs/wayland
25         x11-libs/cairo
26         x11-libs/libxkbcommon
27         gdk-pixbuf? ( x11-libs/gdk-pixbuf:2 )
28         pam? ( sys-libs/pam )
29 "
30 RDEPEND="
31         ${DEPEND}
32         !<=gui-wm/sway-1.0_beta2[swaylock]
33 "
34 BDEPEND="
35         >=dev-libs/wayland-protocols-1.14
36         virtual/pkgconfig
37         man? ( app-text/scdoc )
38 "
39
40 src_configure() {
41         local emesonargs=(
42                 -Dman-pages=$(usex man enabled disabled)
43                 -Dpam=$(usex pam enabled disabled)
44                 -Dgdk-pixbuf=$(usex gdk-pixbuf enabled disabled)
45                 $(meson_use fish-completion fish-completions)
46                 $(meson_use zsh-completion zsh-completions)
47                 "-Dbash-completions=true"
48                 "-Dwerror=false"
49         )
50         if [[ ${PV} != 9999 ]]; then
51                 emesonargs+=("-Dswaylock-version=${PV}")
52         fi
53
54         meson_src_configure
55 }
56
57 pkg_postinst() {
58         if ! use pam; then
59                 fcaps cap_sys_admin usr/bin/swaylock
60         fi
61 }