forked from pop-os/cosmic-session
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
52 lines (41 loc) · 1.42 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
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'
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}} 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
# 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