misc/swayidle/swayidle.sh

Fri, 15 Nov 2019 20:05:00 +0100

author
David Demelier <markand@malikania.fr>
date
Fri, 15 Nov 2019 20:05:00 +0100
changeset 1207
c9592a9a949b
parent 1195
6f99a368f617
child 1216
6710613b88b9
permissions
-rw-r--r--

python/python2: add DEPRECATED tag

1194
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #!/bin/sh
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 #
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 #
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 # Permission to use, copy, modify, and/or distribute this software for any
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # purpose with or without fee is hereby granted, provided that the above
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # copyright notice and this permission notice appear in all copies.
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 #
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 #
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
17
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
18 PKGNAME=swayidle
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 PKGVERSION=1.5
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 PKGREVISION=1
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 PKGLICENSE="MIT"
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 PKGSUMMARY="idle management daemon for Wayland"
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 PKGWWW="https://github.com/swaywm/swayidle"
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 PKGDOWNLOAD="https://github.com/swaywm/swayidle/archive/$PKGVERSION.tar.gz"
1195
6f99a368f617 text/scdoc: initial import, closes #2426
David Demelier <markand@malikania.fr>
parents: 1194
diff changeset
25 PKGDEPENDS="meson:build scdoc:build wayland wayland-protocols:build"
1194
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 PKGOPTIONS="ELOGIND"
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
27
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 : ${CC:=clang}
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 : ${CFLAGS:=-O2}
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 : ${LDFLAGS:=}
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 : ${ELOGIND:=yes}
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
32
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 if [ "$ELOGIND" = "yes" ]; then
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 PKGDEPENDS="elogind $PKGDEPENDS"
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 with_elogind="-D logind=enabled -D logind-provider=elogind"
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 else
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 with_elogind="-D logind=disabled"
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
38 fi
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
39
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 build()
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 {
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 rm -rf $PKGNAME-$PKGVERSION
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 tar -xvf $PKGVERSION.tar.gz
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 cd $PKGNAME-$PKGVERSION
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
45
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 CC="$CC" \
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
47 CFLAGS="$CFLAGS" \
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 LDFLAGS="$LDFLAGS" \
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
49 meson . build \
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 --prefix / \
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
51 --buildtype release \
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 $with_elogind
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 ninja -C build
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
54 DESTDIR=$DESTDIR ninja -C build install
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
55
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
56 cd ..
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
57 rm -rf $PKGNAME-$PKGVERSION
e4d19663ae34 misc/swayidle: initial import, closes #2425
David Demelier <markand@malikania.fr>
parents:
diff changeset
58 }

mercurial