-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
63 lines (53 loc) · 1.47 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
# set dotenv-filename := "install.env"
author := 'Lzu Tao'
version := '0.1'
sudo := 'false'
real_sudo := if sudo != 'false' { 'sudo' } else { '' }
profile := "dev"
dest_dir := ''
prefix := dest_dir / "usr"
libexec := prefix / "libexec"
datadir := prefix / "share"
ibus_componentdir := datadir / "ibus/component"
cargo_target_dir := `echo ${CARGO_TARGET_DIR:-target}`
bindir := if profile == 'dev' {
cargo_target_dir / 'debug'
} else {
cargo_target_dir / profile
}
export DATADIR := datadir
bin_name := "ibus-engine-gokien"
xml_name := "gokien.xml"
replace := "s!@AUTHOR@!" + author + "!;" \
+ "s!@VERSION@!" + version + "!;" \
+ "s!@LIBEXECDIR@!" + libexec + "!;" \
+ "s!@PKGDATADIR@!" + datadir + "!;"
alias c := check
alias b := build
alias r := run
check:
cargo check --package ibus-gokien
build:
cargo build --profile={{profile}} --package ibus-gokien
# use `just run debug` for debugging purpose
run $RUST_LOG='info':
#!/bin/bash
set -eux
export RUST_BACKTRACE=1
cargo run --profile={{profile}} --package ibus-gokien
[confirm]
xml:
sed "{{replace}}" {{xml_name}}.in > {{xml_name}}
ffi:
bash ./ribus/gen.sh
install : build
#!/bin/bash
set -eux
just xml || true
{{real_sudo}} install --strip -t {{libexec}} {{bindir}}/{{bin_name}}
{{real_sudo}} install -m 444 -t {{ibus_componentdir}} ./{{xml_name}}
uninstall :
#!/bin/bash
set -eux
{{real_sudo}} rm {{libexec}}/{{bin_name}}
{{real_sudo}} rm {{ibus_componentdir}}/{{xml_name}}