-
Notifications
You must be signed in to change notification settings - Fork 23
/
Justfile
55 lines (44 loc) · 1.61 KB
/
Justfile
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
rootdir := ''
etcdir := rootdir + '/etc'
prefix := rootdir + '/usr'
clean := '0'
debug := '0'
vendor := '0'
cargo-target-dir := env('CARGO_TARGET_DIR', 'target')
target := if debug == '1' { 'debug' } else { 'release' }
vendor_args := if vendor == '1' { '--frozen --offline' } else { '' }
debug_args := if debug == '1' { '' } else { '--release' }
cargo_args := vendor_args + ' ' + debug_args
xdp_cosmic := '/usr/libexec/xdg-desktop-portal-cosmic'
orca := '/usr/bin/orca'
cosmic_dconf_profile := '/usr/share/dconf/profile/cosmic'
bindir := prefix + '/bin'
systemddir := prefix + '/lib/systemd/user'
sessiondir := prefix + '/share/wayland-sessions'
applicationdir := prefix + '/share/applications'
all: _extract_vendor build
build:
XDP_COSMIC={{xdp_cosmic}} ORCA={{orca}} cargo build {{cargo_args}}
# Installs files into the system
install:
# main binary
install -Dm0755 {{cargo-target-dir}}/release/cosmic-session {{bindir}}/cosmic-session
# session start script
install -Dm0755 data/start-cosmic {{bindir}}/start-cosmic
sed -i "s|DCONF_PROFILE=cosmic|DCONF_PROFILE={{cosmic_dconf_profile}}|" {{bindir}}/start-cosmic
# systemd target
install -Dm0644 data/cosmic-session.target {{systemddir}}/cosmic-session.target
# session
install -Dm0644 data/cosmic.desktop {{sessiondir}}/cosmic.desktop
# mimeapps
install -Dm0644 data/cosmic-mimeapps.list {{applicationdir}}/cosmic-mimeapps.list
clean_vendor:
rm -rf vendor vendor.tar .cargo/config
clean: clean_vendor
cargo clean
# Extracts vendored dependencies if vendor=1
_extract_vendor:
#!/usr/bin/env sh
if test {{vendor}} = 1; then
rm -rf vendor; tar pxf vendor.tar
fi