-
-
Notifications
You must be signed in to change notification settings - Fork 63
/
Makefile
254 lines (232 loc) · 10.9 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2010 Joanna Rutkowska <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#
VERSION := $(file <version)
LIBDIR ?= /usr/lib64
USRLIBDIR ?= /usr/lib
SYSLIBDIR ?= /lib
XINITRCDIR ?= /etc/X11/xinit/xinitrc.d
LIMITSDIR ?= /etc/security/limits.d
UNITDIR ?= $(SYSLIBDIR)/systemd/system
USERUNITDIR ?= $(SYSLIBDIR)/systemd/user
USERPRESETDIR ?= $(SYSLIBDIR)/systemd/user-preset
UDEVRULESDIR ?= $(SYSLIBDIR)/udev/rules.d
DATADIR ?= /usr/share
PIPEWIRE_MODULES ?= $(LIBDIR)/pipewire-0.3
ifneq (,$(filter-out selinux install-selinux,$(MAKECMDGOALS)))
PA_VER_FULL ?= $(shell pkg-config --modversion libpulse | cut -d "-" -f 1 || echo 0.0)
PA_MODULE_DIR ?= $(shell pkg-config --variable=modlibexecdir libpulse)
endif
USER_DROPIN_DIR ?= /usr/lib/systemd/user
.PHONY: help
help:
@echo "Qubes GUI main Makefile:" ;\
echo; \
echo "make clean <--- clean all the binary files";\
exit 0;
.PHONY: appvm
appvm: gui-agent/qubes-gui gui-agent/qubes-gui-runuser \
xf86-input-mfndev/src/.libs/qubes_drv.so \
xf86-video-dummy/src/.libs/dummyqbs_drv.so pulse/module-vchan-sink.so \
xf86-qubes-common/libxf86-qubes-common.so pipewire/qubes-pw-module.so
selinux_policies ::= qubes-gui-agent.pp
selinux: selinux/$(selinux_policies)
selinux/$(selinux_policies):
$(MAKE) -C selinux -f /usr/share/selinux/devel/Makefile
.PHONY: install-selinux
install-selinux:
install -D -t $(DESTDIR)/usr/share/selinux/packages selinux/$(selinux_policies)
gui-agent/qubes-gui gui-agent/qubes-gui-runuser:
$(MAKE) -C gui-agent
xf86-input-mfndev/src/.libs/qubes_drv.so: xf86-qubes-common/libxf86-qubes-common.so
(cd xf86-input-mfndev && ./autogen.sh && ./configure)
$(MAKE) -C xf86-input-mfndev
xf86-video-dummy/src/.libs/dummyqbs_drv.so: xf86-qubes-common/libxf86-qubes-common.so
(cd xf86-video-dummy && ./autogen.sh)
$(MAKE) -C xf86-video-dummy
.PHONY: pulse/module-vchan-sink.so
pulse/module-vchan-sink.so:
rm -f pulse/pulsecore
ln -sf pulsecore-$(PA_VER_FULL) pulse/pulsecore
$(MAKE) -C pulse module-vchan-sink.so
pipewire/qubes-pw-module.so:
$(MAKE) -C pipewire qubes-pw-module.so
xf86-qubes-common/libxf86-qubes-common.so:
$(MAKE) -C xf86-qubes-common libxf86-qubes-common.so
.PHONY: tar
tar:
git archive --format=tar --prefix=qubes-gui/ HEAD -o qubes-gui.tar
.PHONY: clean
clean:
(cd gui-agent && $(MAKE) clean)
$(MAKE) -C pulse clean
$(MAKE) -C xf86-qubes-common clean
(cd xf86-input-mfndev; if [ -e Makefile ] ; then \
$(MAKE) distclean; fi; ./bootstrap --clean || echo )
rm -rf debian/changelog.*
rm -rf pkgs
.PHONY: install
install: install-rh-agent install-pulseaudio install-pipewire
.PHONY: install-rh-agent
install-rh-agent: appvm install-common install-systemd
install -m 0644 -D appvm-scripts/etc/sysconfig/desktop \
$(DESTDIR)/etc/sysconfig/desktop
install -D appvm-scripts/etc/X11/xinit/xinitrc.d/20qt-x11-no-mitshm.sh \
$(DESTDIR)$(XINITRCDIR)/20qt-x11-no-mitshm.sh
install -D appvm-scripts/etc/X11/xinit/xinitrc.d/20qt-gnome-desktop-session-id.sh \
$(DESTDIR)$(XINITRCDIR)/20qt-gnome-desktop-session-id.sh
install -D appvm-scripts/etc/X11/xinit/xinitrc.d/50guivm-windows-prefix.sh \
$(DESTDIR)$(XINITRCDIR)/50guivm-windows-prefix.sh
install -D appvm-scripts/etc/X11/xinit/xinitrc.d/60xfce-desktop.sh \
$(DESTDIR)$(XINITRCDIR)/60xfce-desktop.sh
.PHONY: install-debian
install-debian: appvm install-common install-pulseaudio install-systemd install-pipewire
install -d $(DESTDIR)/etc/X11/Xsession.d
install -m 0644 appvm-scripts/etc/X11/Xsession.d/* $(DESTDIR)/etc/X11/Xsession.d/
install -d $(DESTDIR)/etc/xdg
install -m 0644 appvm-scripts/etc/xdg-debian/* $(DESTDIR)/etc/xdg
.PHONY: install-pulseaudio
install-pulseaudio:
install -D pulse/start-pulseaudio-with-vchan \
$(DESTDIR)/usr/bin/start-pulseaudio-with-vchan
install -m 0644 -D pulse/qubes-default.pa \
$(DESTDIR)/etc/pulse/qubes-default.pa
install -D pulse/module-vchan-sink.so \
$(DESTDIR)$(PA_MODULE_DIR)/module-vchan-sink.so
install -m 0644 -D appvm-scripts/etc/tmpfiles.d/qubes-pulseaudio.conf \
$(DESTDIR)$(USRLIBDIR)/tmpfiles.d/qubes-pulseaudio.conf
install -m 0644 -D appvm-scripts/etc/xdgautostart/qubes-pulseaudio.desktop \
$(DESTDIR)/etc/xdg/autostart/qubes-pulseaudio.desktop
install -d $(DESTDIR)$(USER_DROPIN_DIR)/pulseaudio.service.d
install -m 0644 pulse/pulseaudio.service.d/*.conf \
$(DESTDIR)$(USER_DROPIN_DIR)/pulseaudio.service.d
install -D -m 0644 pulse/75-pulseaudio-qubes.preset \
$(DESTDIR)$(USER_DROPIN_DIR)-preset/75-pulseaudio-qubes.preset
.PHONY: install-pipewire
install-pipewire:
install -m 0755 -D pipewire/qubes-pw-module.so \
$(DESTDIR)$(PIPEWIRE_MODULES)/libpipewire-module-qubes.so
install -m 0644 -D pipewire/30_qubes.conf \
$(DESTDIR)$(DATADIR)/pipewire/pipewire.conf.d/30_qubes.conf
install -m 0644 -D pipewire/COPYING \
$(DESTDIR)$(DATADIR)/licenses/pipewire-qubes/COPYING
install -m 0644 -D appvm-scripts/lib/systemd/user-preset/74-qubes-vm.preset \
$(DESTDIR)$(USERPRESETDIR)/74-qubes-vm.preset
install -d $(DESTDIR)/etc/qubes/post-install.d
install -m 0755 appvm-scripts/etc/qubes/post-install.d/20-qubes-pipewire.sh \
$(DESTDIR)/etc/qubes/post-install.d/20-qubes-pipewire.sh
install -d $(DESTDIR)$(USERUNITDIR)/pipewire.service.d
install -m 0644 appvm-scripts/lib/systemd/user/pipewire.service.d/30_qubes.conf \
$(DESTDIR)$(USERUNITDIR)/pipewire.service.d/30_qubes.conf
.PHONY: install-systemd
install-systemd:
install -m 0644 -D appvm-scripts/qubes-gui-agent.service \
$(DESTDIR)$(UNITDIR)/qubes-gui-agent.service
.PHONY: install-common
install-common:
install -D gui-agent/qubes-gui $(DESTDIR)/usr/bin/qubes-gui
install -D gui-agent/qubes-gui-runuser $(DESTDIR)/usr/bin/qubes-gui-runuser
install -d $(DESTDIR)/etc/qubes/post-install.d
install -m 0755 appvm-scripts/etc/qubes/post-install.d/20-qubes-guivm-gui-agent.sh \
$(DESTDIR)/etc/qubes/post-install.d/20-qubes-guivm-gui-agent.sh
install -D appvm-scripts/usrbin/qubes-session \
$(DESTDIR)/usr/bin/qubes-session
install -D appvm-scripts/usrbin/qubes-run-xorg \
$(DESTDIR)/usr/bin/qubes-run-xorg
install -D appvm-scripts/usrbin/qubes-run-xephyr \
$(DESTDIR)/usr/bin/qubes-run-xephyr
install -D appvm-scripts/usrbin/qubes-start-xephyr \
$(DESTDIR)/usr/bin/qubes-start-xephyr
install -D appvm-scripts/usrbin/qubes-run-x11vnc \
$(DESTDIR)/usr/bin/qubes-run-x11vnc
install -D appvm-scripts/usrbin/qubes-change-keyboard-layout \
$(DESTDIR)/usr/bin/qubes-change-keyboard-layout
install -D appvm-scripts/usrbin/qubes-set-monitor-layout \
$(DESTDIR)/usr/bin/qubes-set-monitor-layout
install -D xf86-qubes-common/libxf86-qubes-common.so \
$(DESTDIR)$(LIBDIR)/libxf86-qubes-common.so
install -D xf86-input-mfndev/src/.libs/qubes_drv.so \
$(DESTDIR)$(LIBDIR)/xorg/modules/drivers/qubes_drv.so
install -D xf86-video-dummy/src/.libs/dummyqbs_drv.so \
$(DESTDIR)$(LIBDIR)/xorg/modules/drivers/dummyqbs_drv.so
install -m 0644 -D appvm-scripts/etc/X11/xorg-qubes.conf.template \
$(DESTDIR)/etc/X11/xorg-qubes.conf.template
install -m 0644 -D appvm-scripts/etc/X11/xorg-qubes-x11vnc.conf.template \
$(DESTDIR)/etc/X11/xorg-qubes-x11vnc.conf.template
install -m 0644 -D appvm-scripts/etc/systemd/system/lightdm.service.d/qubes-guivm-vnc.conf \
$(DESTDIR)$(UNITDIR)/lightdm.service.d/qubes-guivm-vnc.conf
install -m 0644 -D appvm-scripts/etc/profile.d/qubes-gui.sh \
$(DESTDIR)/etc/profile.d/qubes-gui.sh
install -m 0644 -D appvm-scripts/etc/profile.d/qubes-gui.csh \
$(DESTDIR)/etc/profile.d/qubes-gui.csh
install -m 0644 -D appvm-scripts/etc/securitylimits.d/90-qubes-gui.conf \
$(DESTDIR)$(LIMITSDIR)/90-qubes-gui.conf
ifneq ($(shell lsb_release -is), Ubuntu)
install -m 0644 -D appvm-scripts/etc/xdg/Trolltech.conf \
$(DESTDIR)/etc/xdg/Trolltech.conf
endif
install -m 0644 -D appvm-scripts/qubes-gui-vm.gschema.override \
$(DESTDIR)$(DATADIR)/glib-2.0/schemas/20_qubes-gui-vm.gschema.override
install -d $(DESTDIR)/etc/qubes-rpc
ln -sf ../../usr/bin/qubes-set-monitor-layout \
$(DESTDIR)/etc/qubes-rpc/qubes.SetMonitorLayout
ln -sf ../../usr/bin/qubes-start-xephyr \
$(DESTDIR)/etc/qubes-rpc/qubes.GuiVMSession
install -D window-icon-updater/icon-sender \
$(DESTDIR)/usr/lib/qubes/icon-sender
install -m 0644 -D window-icon-updater/qubes-icon-sender.desktop \
$(DESTDIR)/etc/xdg/autostart/qubes-icon-sender.desktop
install -m 0644 -D appvm-scripts/etc/xdgautostart/qubes-qrexec-fork-server.desktop \
$(DESTDIR)/etc/xdg/autostart/qubes-qrexec-fork-server.desktop
install -m 0644 -D appvm-scripts/etc/xdgautostart/qubes-keymap.desktop \
$(DESTDIR)/etc/xdg/autostart/qubes-keymap.desktop
install -m 0644 -D appvm-scripts/etc/xdgautostart/qubes-gtk4-workarounds.desktop \
$(DESTDIR)/etc/xdg/autostart/qubes-gtk4-workarounds.desktop
install -D -m 0644 appvm-scripts/usr/lib/sysctl.d/30-qubes-gui-agent.conf \
$(DESTDIR)/usr/lib/sysctl.d/30-qubes-gui-agent.conf
install -D -m 0644 appvm-scripts/lib/udev/rules.d/70-master-of-seat.rules \
$(DESTDIR)/$(UDEVRULESDIR)/70-master-of-seat.rules
install -D -m 0644 appvm-scripts/lib/udev/rules.d/90-qubes-virtual-input-device.rules \
$(DESTDIR)/$(UDEVRULESDIR)/90-qubes-virtual-input-device.rules
install -D appvm-scripts/usr/lib/qubes/qubes-gui-agent-pre.sh \
$(DESTDIR)/usr/lib/qubes/qubes-gui-agent-pre.sh
install -D appvm-scripts/usr/lib/qubes/qubes-keymap.sh \
$(DESTDIR)/usr/lib/qubes/qubes-keymap.sh
install -D appvm-scripts/usr/lib/qubes/qubes-xorg-wrapper \
$(DESTDIR)/usr/lib/qubes/qubes-xorg-wrapper
install -D appvm-scripts/usr/lib/qubes/gtk4-workarounds.sh \
$(DESTDIR)/usr/lib/qubes/gtk4-workarounds.sh
ifeq ($(shell lsb_release -is), Debian)
install -D -m 0644 appvm-scripts/etc/pam.d/qubes-gui-agent.debian \
$(DESTDIR)/etc/pam.d/qubes-gui-agent
else ifeq ($(shell lsb_release -is), Ubuntu)
install -D -m 0644 appvm-scripts/etc/pam.d/qubes-gui-agent.debian \
$(DESTDIR)/etc/pam.d/qubes-gui-agent
else ifeq ($(shell lsb_release -is), Arch)
install -D -m 0644 appvm-scripts/etc/pam.d/qubes-gui-agent.archlinux \
$(DESTDIR)/etc/pam.d/qubes-gui-agent
else ifeq ($(shell lsb_release -is), Gentoo)
install -D -m 0644 appvm-scripts/etc/pam.d/qubes-gui-agent.gentoo \
$(DESTDIR)/etc/pam.d/qubes-gui-agent
else
install -D -m 0644 appvm-scripts/etc/pam.d/qubes-gui-agent \
$(DESTDIR)/etc/pam.d/qubes-gui-agent
endif
install -d $(DESTDIR)/var/log/qubes