feat(design-demo): debian packaging

This commit is contained in:
Michael Aaron Murphy 2023-09-13 15:19:58 +02:00 committed by Michael Murphy
parent 37d5dd8b65
commit 5cd9d74189
12 changed files with 164 additions and 4 deletions

9
just/packaging.just Normal file
View file

@ -0,0 +1,9 @@
[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)

39
just/rust.just Normal file
View file

@ -0,0 +1,39 @@
# Use mold linker if clang and mold exists.
clang-path := `which clang || true`
mold-path := `which mold || true`
linker-arg := if clang-path != '' {
if mold-path != '' {
'-C linker=' + clang-path + ' -C link-arg=--ld-path=' + mold-path + ' '
} else {
''
}
} else {
''
}
export RUSTFLAGS := linker-arg + env_var_or_default('RUSTFLAGS', '')
[private]
default: build-release
# Compile with release profile
build-release *args: (build '--release' args)
# Compile with a vendored tarball
build-vendored *args: vendor-extract (build-release '--offline --locked' args)
# Vendor Cargo dependencies locally
vendor *args:
rm -rf .cargo vendor vendor.tar
mkdir -p .cargo
cargo vendor {{args}} | head -n -1 > .cargo/config
echo 'directory = "vendor"' >> .cargo/config
tar pcf vendor.tar vendor
rm -rf vendor
# Extracts vendored dependencies
[private]
vendor-extract:
rm -rf vendor
tar pxf vendor.tar