Line 0
Link Here
|
0 |
- |
1 |
# Copyright 2019-2023 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
EAPI=8 |
5 |
|
6 |
inherit meson toolchain-funcs |
7 |
|
8 |
DESCRIPTION="compiz like 3D wayland compositor" |
9 |
HOMEPAGE="https://github.com/WayfireWM/wayfire" |
10 |
|
11 |
if [[ ${PV} == 9999 ]]; then |
12 |
inherit git-r3 |
13 |
EGIT_REPO_URI="https://github.com/WayfireWM/${PN}.git" |
14 |
else |
15 |
SRC_URI="https://github.com/WayfireWM/${PN}/releases/download/v${PV}/${P}.tar.xz" |
16 |
KEYWORDS="~amd64 ~arm64 ~riscv ~x86" |
17 |
fi |
18 |
|
19 |
LICENSE="MIT" |
20 |
SLOT="0" |
21 |
IUSE="debug +gles +system-wfconfig +system-wlroots X" |
22 |
|
23 |
DEPEND=" |
24 |
dev-libs/libinput:= |
25 |
dev-libs/wayland |
26 |
gui-libs/gtk-layer-shell |
27 |
media-libs/glm |
28 |
media-libs/mesa:=[gles2,wayland,X?] |
29 |
media-libs/libglvnd[X?] |
30 |
media-libs/libjpeg-turbo:= |
31 |
media-libs/libpng:= |
32 |
media-libs/freetype:=[X?] |
33 |
x11-libs/libdrm |
34 |
x11-libs/gtk+:3=[wayland,X?] |
35 |
x11-libs/cairo[X?,svg(+)] |
36 |
x11-libs/libxkbcommon[X?] |
37 |
x11-libs/pango |
38 |
x11-libs/pixman |
39 |
X? ( |
40 |
x11-base/xwayland |
41 |
x11-libs/libxcb |
42 |
) |
43 |
" |
44 |
|
45 |
if [[ ${PV} == 9999 ]] ; then |
46 |
DEPEND+=" |
47 |
system-wfconfig? ( ~gui-libs/wf-config-9999:= ) |
48 |
!system-wfconfig? ( !gui-libs/wf-config ) |
49 |
system-wlroots? ( ~gui-libs/wlroots-9999:=[drm(+),libinput(+),x11-backend,X?] ) |
50 |
!system-wlroots? ( !gui-libs/wlroots ) |
51 |
" |
52 |
else |
53 |
DEPEND+=" |
54 |
system-wfconfig? ( |
55 |
>=gui-libs/wf-config-0.7.1 |
56 |
<gui-libs/wf-config-0.8.0 |
57 |
) |
58 |
!system-wfconfig? ( !gui-libs/wf-config ) |
59 |
system-wlroots? ( |
60 |
>=gui-libs/wlroots-0.16.0:0/16[drm(+),libinput(+),x11-backend,X?] |
61 |
) |
62 |
!system-wlroots? ( !gui-libs/wlroots ) |
63 |
" |
64 |
fi |
65 |
|
66 |
RDEPEND=" |
67 |
${DEPEND} |
68 |
x11-misc/xkeyboard-config |
69 |
" |
70 |
|
71 |
BDEPEND=" |
72 |
dev-libs/wayland-protocols |
73 |
virtual/pkgconfig |
74 |
" |
75 |
|
76 |
if [[ ${PV} == 0.7.5 ]] ; then |
77 |
PATCHES=( |
78 |
"${FILESDIR}"/${PN}-0.7.5-gcc13.patch |
79 |
) |
80 |
fi |
81 |
|
82 |
src_configure() { |
83 |
# https://github.com/WayfireWM/wayfire/pull/1944 |
84 |
sed -ie "s/'--short', 'HEAD'], check: true/'--short', 'HEAD'], check: false/" \ |
85 |
"${WORKDIR}/${P}/meson.build" |
86 |
sed -ie "s/'--abbrev-ref', 'HEAD'], check: true/'--abbrev-ref', 'HEAD'], check: false/" \ |
87 |
"${WORKDIR}/${P}/meson.build" |
88 |
# |
89 |
sed -e "s:@EPREFIX@:${EPREFIX}:" \ |
90 |
"${FILESDIR}"/wayfire-session > "${T}"/wayfire-session || die |
91 |
sed -e "s:@EPREFIX@:${EPREFIX}:" \ |
92 |
"${FILESDIR}"/wayfire-session.desktop > "${T}"/wayfire-session.desktop || die |
93 |
|
94 |
# |
95 |
sed -ie "s|install_dir: 'man'|install_dir: 'share/man'|" \ |
96 |
"${WORKDIR}/${P}/man/meson.build" |
97 |
|
98 |
# |
99 |
local emesonargs=( |
100 |
$(meson_feature system-wfconfig use_system_wfconfig) |
101 |
$(meson_feature system-wlroots use_system_wlroots) |
102 |
$(meson_feature X xwayland) |
103 |
$(meson_use gles enable_gles32) |
104 |
$(usex debug --buildtype=debug "") |
105 |
$(usex debug -Db_sanitize=address,undefined "") |
106 |
) |
107 |
|
108 |
# Clang will fail to link without this |
109 |
tc-is-clang && emesonargs+=( $(usex debug -Db_lundef=false "") ) |
110 |
|
111 |
meson_src_configure |
112 |
} |
113 |
|
114 |
src_install() { |
115 |
meson_src_install |
116 |
dobin "${T}"/wayfire-session |
117 |
|
118 |
insinto "/usr/share/wayland-sessions/" |
119 |
insopts -m644 |
120 |
doins wayfire.desktop |
121 |
doins "${T}"/wayfire-session.desktop |
122 |
|
123 |
insinto "/usr/share/wayfire/" |
124 |
doins wayfire.ini |
125 |
} |
126 |
|
127 |
pkg_postinst() { |
128 |
if [ -z "${REPLACING_VERSIONS}" ]; then |
129 |
elog "Wayfire has been installed but the session cannot be used" |
130 |
elog "until you install a configuration file. The default config" |
131 |
elog "file is installed at \"/usr/share/wayfire/wayfire.ini\"" |
132 |
elog "To install the file execute" |
133 |
elog "\$ cp /usr/share/wayfire/wayfire.ini ~/.config/wayfire.ini" |
134 |
fi |
135 |
} |