Add debian packaging
This commit is contained in:
parent
7d4d25ef85
commit
c0d2f235e4
9 changed files with 133 additions and 2 deletions
66
justfile
Normal file
66
justfile
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
name := 'cosmic-edit'
|
||||
export APPID := 'com.system76.CosmicEdit'
|
||||
|
||||
rootdir := ''
|
||||
prefix := '/usr'
|
||||
|
||||
base-dir := absolute_path(clean(rootdir / prefix))
|
||||
|
||||
export INSTALL_DIR := base-dir / 'share'
|
||||
|
||||
bin-src := 'target' / 'release' / name
|
||||
bin-dst := base-dir / 'bin' / name
|
||||
|
||||
# Default recipe which runs `just build-release`
|
||||
default: build-release
|
||||
|
||||
# Runs `cargo clean`
|
||||
clean:
|
||||
cargo clean
|
||||
|
||||
# `cargo clean` and removes vendored dependencies
|
||||
clean-dist: clean
|
||||
rm -rf .cargo vendor vendor.tar
|
||||
|
||||
# Compiles with debug profile
|
||||
build-debug *args:
|
||||
cargo build {{args}}
|
||||
|
||||
# Compiles with release profile
|
||||
build-release *args: (build-debug '--release' args)
|
||||
|
||||
# Compiles release profile with vendored dependencies
|
||||
build-vendored *args: vendor-extract (build-release '--frozen --offline' args)
|
||||
|
||||
# Runs a clippy check
|
||||
check *args:
|
||||
cargo clippy --all-features {{args}} -- -W clippy::pedantic
|
||||
|
||||
# Runs a clippy check with JSON message format
|
||||
check-json: (check '--message-format=json')
|
||||
|
||||
# Run with debug logs
|
||||
run *args:
|
||||
env RUST_LOG=debug RUST_BACKTRACE=full cargo run --release {{args}}
|
||||
|
||||
# Installs files
|
||||
install:
|
||||
install -Dm0755 {{bin-src}} {{bin-dst}}
|
||||
|
||||
# Uninstalls installed files
|
||||
uninstall:
|
||||
rm {{bin-dst}}
|
||||
|
||||
# Vendor dependencies locally
|
||||
vendor:
|
||||
mkdir -p .cargo
|
||||
cargo vendor --sync Cargo.toml \
|
||||
| head -n -1 > .cargo/config
|
||||
echo 'directory = "vendor"' >> .cargo/config
|
||||
tar pcf vendor.tar vendor
|
||||
rm -rf vendor
|
||||
|
||||
# Extracts vendored dependencies
|
||||
vendor-extract:
|
||||
rm -rf vendor
|
||||
tar pxf vendor.tar
|
||||
Loading…
Add table
Add a link
Reference in a new issue