From 7d6c5562aa66e8bdbd7ccd67de5206035f3a155a Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Wed, 6 Mar 2024 22:18:51 +0100 Subject: [PATCH] chore(doc): update readme --- README.md | 53 +++++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index fab1809..8e06d9f 100644 --- a/README.md +++ b/README.md @@ -1,63 +1,52 @@ # COSMIC Settings -The settings application for the [COSMIC desktop environment](https://github.com/pop-os/cosmic-epoch). Developed with [libcosmic](https://github.com/pop-os/libcosmic), using the [iced](https://iced.rs/) GUI library. +The settings application for the [COSMIC desktop environment][cosmic-epoch]. -## Build & Install +## Translators -To compile, a stable Rust compiler and [just](https://github.com/casey/just) are required. +Translation files may be found in the [i18n directory](./i18n). New translations may copy the [English (en) localization](./i18n/en) of the project and rename `en` to the desired [ISO 639-1 language code][iso-codes]. Translations may be submitted through GitHub as an issue or pull request. Submissions by email or other means are also acceptable; with the preferred name and email to associate with the changes. -- cargo -- just -- mold +## Build -Some C libraries are also required for font support at the moment. +### Dependencies +- rust (>= 1.71.0) +- [just][just] - cmake - libexpat1-dev - libfontconfig-dev - libfreetype-dev - pkg-config -Then it can be compiled and installed like so. +### Install + +COSMIC uses [just][just] as its preferred build tool. ```sh just sudo just install ``` -## Packagers +### Packaging -If packaging for a Linux distribution, vendor dependencies locally with the `vendor` rule, and build with the vendored sources using the `build-vendored` rule. +If packaging for a Linux distribution, vendor dependencies locally with the `vendor` rule, and build with the vendored sources using the `build-vendored` rule. When installing files, use the `rootdir` and `prefix` variables to change installation paths. ```sh just vendor just build-vendored -``` - -When installing files, use the `rootdir` and `prefix` variables to change installation paths. - -```sh just rootdir=debian/cosmic-settings prefix=/usr install ``` -## Translators - -Translation files may be found in the [i18n directory](./i18n). New translations may copy the [English (en) localization](./i18n/en) of the project and rename `en` to the desired [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). Translations may be submitted through GitHub as an issue or pull request. Submissions by email or other means are also acceptable; with the preferred name and email to associate with the changes. +It is recommended to build a source tarball with the vendored dependencies, which can typically be done by running `just vendor` on the host system before it enters the build environment. Reference [debian/rules](./debian/rules) to see how we generate debian packages with `sbuild`. ## Developers +Developers should install [rustup][rustup] and configure their editor to use [rust-analyzer][rust-analyzer]. Run `just check` to ensure that the changes you make are free of linter warnings. You may configure your editor to run `just check-json` as the rust-analyzer check command. + +To improve compilation times, disable LTO in the release profile, install the [mold][mold] linker, and configure [sccache][sccache] for use with Rust. The [mold][mold] linker will only improve link times if LTO is disabled. + Run the cosmic-settings binary with `just run` so that logs will be emitted to stderr, and crashes will generate detailed backtraces. Applications shouldn't crash, so when writing code, avoid use of `unwrap()` and `expect()`. Instead, log errors with `tracing::error!()` or `tracing::warn!()`. -This project is split across the following workspace members: - -- [app](./app/): cosmic-settings GUI frontend and binary -- [page](./page/): library for creating and handling settings pages -- [pages](./pages/): libraries for page-specific logic - -When creating a new page, UI-specific code will go directly into **app**, and page-specific logic will go into a crate under the **pages** directory. This is mainly to isolate page-specific crate dependencies and logic from the UI; so that the source code specific to the UI is easier to maintain and refactor. - -Eventually, pages may be separated into plugins, and this will help with that migration. - ## License Licensed under the [GNU Public License 3.0](https://choosealicense.com/licenses/gpl-3.0). @@ -69,3 +58,11 @@ Any contribution intentionally submitted for inclusion in the work by you shall ``` // SPDX-License-Identifier: GPL-3.0-only ``` + +[cosmic-epoch]: https://github.com/pop-os/cosmic-epoch +[iso-codes]: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes +[just]: https://github.com/casey/just +[rustup]: https://rustup.rs/ +[rust-analyzer]: https://rust-analyzer.github.io/ +[mold]: https://github.com/rui314/mold +[sccache]: https://github.com/mozilla/sccache \ No newline at end of file