-
Notifications
You must be signed in to change notification settings - Fork 54
/
justfile
118 lines (101 loc) · 4.78 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
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
import 'scripts/cargo.just'
# Project metadata
name := 'cosmic-settings'
appid := 'com.system76.CosmicSettings'
# File paths
rootdir := ''
prefix := '/usr'
appdir := clean(rootdir / prefix) / 'share' / 'applications'
default-schema-target := clean(rootdir / prefix) / 'share' / 'cosmic'
bin-src := cargo-target-dir / 'release' / name
bin-dest := clean(rootdir / prefix) / 'bin' / name
iconsdir := clean(rootdir / prefix) / 'share' / 'icons' / 'hicolor'
metainfo := appid + '.metainfo.xml'
metainfo-src := 'resources' / metainfo
metainfo-dst := clean(rootdir / prefix) / 'share' / 'metainfo' / metainfo
polkit-rules-src := 'resources' / 'polkit-1' / 'rules.d' / 'cosmic-settings.rules'
polkit-rules-dst := clean(rootdir / prefix) / 'share' / 'polkit-1' / 'rules.d' / 'cosmic-settings.rules'
# Desktop entries
entry-settings := appid + '.desktop'
entry-about := appid + '.About.desktop'
entry-appear := appid + '.Appearance.desktop'
entry-date-time := appid + '.DateTime.desktop'
entry-desktop := appid + '.Desktop.desktop'
entry-displays := appid + '.Displays.desktop'
entry-firmware := appid + '.Firmware.desktop'
entry-keyboard := appid + '.Keyboard.desktop'
entry-mouse := appid + '.Mouse.desktop'
entry-notifications := appid + '.Notifications.desktop'
entry-region-language := appid + '.RegionLanguage.desktop'
entry-sound := appid + '.Sound.desktop'
entry-touchpad := appid + '.Touchpad.desktop'
entry-users := appid + '.Users.desktop'
entry-wallpaper := appid + '.Wallpaper.desktop'
entry-workspaces := appid + '.Workspaces.desktop'
# Build recipes
[private]
default: build-release
[private]
install-desktop-entries:
install -Dm0644 'resources/{{entry-settings}}' '{{appdir}}/{{entry-settings}}'
install -Dm0644 'resources/{{entry-about}}' '{{appdir}}/{{entry-about}}'
install -Dm0644 'resources/{{entry-appear}}' '{{appdir}}/{{entry-appear}}'
install -Dm0644 'resources/{{entry-date-time}}' '{{appdir}}/{{entry-date-time}}'
install -Dm0644 'resources/{{entry-desktop}}' '{{appdir}}/{{entry-desktop}}'
install -Dm0644 'resources/{{entry-displays}}' '{{appdir}}/{{entry-displays}}'
install -Dm0644 'resources/{{entry-firmware}}' '{{appdir}}/{{entry-firmware}}'
install -Dm0644 'resources/{{entry-keyboard}}' '{{appdir}}/{{entry-keyboard}}'
install -Dm0644 'resources/{{entry-mouse}}' '{{appdir}}/{{entry-mouse}}'
install -Dm0644 'resources/{{entry-notifications}}' '{{appdir}}/{{entry-notifications}}'
install -Dm0644 'resources/{{entry-region-language}}' '{{appdir}}/{{entry-region-language}}'
install -Dm0644 'resources/{{entry-sound}}' '{{appdir}}/{{entry-sound}}'
install -Dm0644 'resources/{{entry-touchpad}}' '{{appdir}}/{{entry-touchpad}}'
install -Dm0644 'resources/{{entry-users}}' '{{appdir}}/{{entry-users}}'
install -Dm0644 'resources/{{entry-wallpaper}}' '{{appdir}}/{{entry-wallpaper}}'
install -Dm0644 'resources/{{entry-workspaces}}' '{{appdir}}/{{entry-workspaces}}'
# Install everything
install: install-desktop-entries (install-bin bin-src bin-dest) (install-file metainfo-src metainfo-dst) (install-file polkit-rules-src polkit-rules-dst)
find 'resources'/'default_schema' -type f -exec echo {} \; | rev | cut -d'/' -f-3 | rev | xargs -d '\n' -I {} install -Dm0644 'resources'/'default_schema'/{} {{default-schema-target}}/{}
find 'resources'/'icons' -type f -exec echo {} \; | rev | cut -d'/' -f-3 | rev | xargs -d '\n' -I {} install -Dm0644 'resources'/'icons'/{} {{iconsdir}}/{}
[private]
install-cmd options src dest:
install {{options}} {{src}} {{dest}}
[private]
install-bin src dest: (install-cmd '-Dm0755' src dest)
[private]
install-file src dest: (install-cmd '-Dm0644' src dest)
# Uninstalls everything (requires same arguments as given to install)
uninstall:
rm -rf {{bin-dest}} \
'{{appdir}}/{{entry-settings}}' \
'{{appdir}}/{{entry-about}}' \
'{{appdir}}/{{entry-appear}}' \
'{{appdir}}/{{entry-date-time}}' \
'{{appdir}}/{{entry-desktop}}' \
'{{appdir}}/{{entry-displays}}' \
'{{appdir}}/{{entry-firmware}}' \
'{{appdir}}/{{entry-keyboard}}' \
'{{appdir}}/{{entry-mouse}}' \
'{{appdir}}/{{entry-notifications}}' \
'{{appdir}}/{{entry-region-language}}' \
'{{appdir}}/{{entry-sound}}' \
'{{appdir}}/{{entry-touchpad}}' \
'{{appdir}}/{{entry-users}}' \
'{{appdir}}/{{entry-wallpaper}}' \
'{{appdir}}/{{entry-workspaces}}'
find 'resources'/'default_schema' -type f -exec echo {} \; | rev | cut -d'/' -f-3 | rev | xargs -d '\n' -I {} rm -rf {{default-schema-target}}/{}
find 'resources'/'icons' -type f -exec echo {} \; | rev | cut -d'/' -f-3 | rev | xargs -d '\n' -I {} rm {{iconsdir}}/{}
# Dependencies
cmd-depends := "
cargo
cmake
"
lib-depends := "
expat
fontconfig
freetype2
libinput
libudev
wayland-client=1.20
xkbcommon
"