diff --git a/.gitignore b/.gitignore index ea8c4bf..699219b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,8 @@ -/target +/.cargo/ +/debian/*debhelper* +/debian/cosmic-greeter.substvars +/debian/cosmic-greeter/ +/debian/files +/target/ +/vendor.tar +/vendor/ diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..7c23fd0 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +cosmic-edit (0.1.0) jammy; urgency=medium + + * Initial release. + + -- Jeremy Soller Tue, 03 Oct 2023 07:37:28 -0600 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..548f8a9 --- /dev/null +++ b/debian/control @@ -0,0 +1,19 @@ +Source: cosmic-edit +Section: admin +Priority: optional +Maintainer: Jeremy Soller +Build-Depends: + debhelper-compat (=13), + just (>= 1.13.0), + libclang-dev, + libwayland-dev, + libxkbcommon-dev, + pkg-config, + rust-all, +Standards-Version: 4.6.2 +Homepage: https://github.com/pop-os/cosmic-edit + +Package: cosmic-edit +Architecture: amd64 arm64 +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Cosmic Text Editor diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ef7e2a5 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,7 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: cosmic-edit +Upstream-Contact: Jeremy Soller +Source: https://github.com/pop-os/cosmic-edit +Files: * +Copyright: System76 +License: GPL-3.0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..eb62ec5 --- /dev/null +++ b/debian/rules @@ -0,0 +1,22 @@ +#!/usr/bin/make -f + +export DESTDIR = debian/cosmic-edit +export VENDOR ?= 1 + +%: + dh $@ + +override_dh_auto_clean: + if ! ischroot && test "${VENDOR}" = "1"; then \ + mkdir -p .cargo; \ + cargo vendor | head -n -1 > .cargo/config; \ + echo 'directory = "vendor"' >> .cargo/config; \ + tar pcf vendor.tar vendor; \ + rm -rf vendor; \ + fi + +override_dh_auto_build: + just build-vendored + +override_dh_auto_install: + just rootdir=$(DESTDIR) install diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..5d4ff73 --- /dev/null +++ b/debian/source/options @@ -0,0 +1,4 @@ +tar-ignore=.github +tar-ignore=.vscode +tar-ignore=vendor +tar-ignore=target \ No newline at end of file diff --git a/justfile b/justfile new file mode 100644 index 0000000..b8092ff --- /dev/null +++ b/justfile @@ -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 diff --git a/src/main.rs b/src/main.rs index 42d7300..a68a908 100644 --- a/src/main.rs +++ b/src/main.rs @@ -269,7 +269,7 @@ impl cosmic::Application for App { type Message = Message; /// The unique application ID to supply to the window manager. - const APP_ID: &'static str = "com.system76.CosmicTextEditor"; + const APP_ID: &'static str = "com.system76.CosmicEdit"; fn core(&self) -> &Core { &self.core