diff --git a/Cargo.lock b/Cargo.lock index 0958d1c9..0eaa2159 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,7 +36,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -47,7 +47,7 @@ name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -56,25 +56,25 @@ version = "0.1.0" dependencies = [ "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", "xkbcommon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -86,7 +86,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -95,7 +95,7 @@ name = "syn" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -148,10 +148,10 @@ dependencies = [ "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" -"checksum proc-macro2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "175a40b9cf564ce9bf050654633dbf339978706b8ead1a907bb970b63185dd95" +"checksum proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e98a83a9f9b331f54b924e68a66acb1bb35cb01fb0a23645139967abefb697e8" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" -"checksum serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f" -"checksum serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "cb4dc18c61206b08dc98216c98faa0232f4337e1e1b8574551d5bad29ea1b425" +"checksum serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "9796c9b7ba2ffe7a9ce53c2287dfc48080f4b2b362fcc245a259b3a7201119dd" +"checksum serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "4b133a43a1ecd55d4086bd5b4dc6c1751c68b1bfbeba7a5040442022c7e7c02e" "checksum serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "38b08a9a90e5260fe01c6480ec7c811606df6d3a660415808c3c3fa8ed95b582" "checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" diff --git a/Cargo.toml b/Cargo.toml index be13ac0c..a6e06a31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "rs" version = "0.1.0" [dependencies] -bitflags = "1.1" +bitflags = "1.0" maplit = "1.0" serde = { version = "1.0", features = ["derive"] } serde_yaml = "0.8" diff --git a/HACKING.md b/HACKING.md new file mode 100644 index 00000000..a285488a --- /dev/null +++ b/HACKING.md @@ -0,0 +1,58 @@ +Hacking +======= + +This document describes the standards for modifying and maintaining the *squeekboard* project. + +Testing +------- + +Most common testing is done in CI. Occasionally, and for each release, do perform manual tests to make sure that + +- the application draws correctly +- it shows when relevant +- it changes layouts +- it changes levels + +Testing with an application: + +``` +python3 tests/entry.py +``` + +Testing visibility: + +``` +$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true +$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false +``` + +Testing layouts: + +``` +$ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'ua')]" +$ gsettings set org.gnome.desktop.input-sources current 1 +``` + +Maintenance +----------- + +Squeekboard uses Rust & Cargo for some of its dependencies. + +Use the `cargo.sh` script for maintaining the Cargo part of the build. The script takes the usual Cargo commands, after the first 2 positionsl arguments: source directory, and output artifact. So, `cargo test` becomes: + +``` +cd build_dir +sh /source_path/cargo.sh /source_path '' test +``` + +### Cargo dependencies + +Dependencies must be specified in `Cargo.toml` with 2 numbers: "major.minor". Since bugfix version number is meant to not affect the interface, this allows for safe updates. + +`Cargo.lock` is used for remembering the revisions of all Rust dependencies. It should be updated often, preferably with each bugfix revision, and in a commit on its own: + +``` +cd build_dir +sh /source_path/cargo.sh /source_path '' update +ninja test +``` diff --git a/README.md b/README.md index bb9a5c6b..afb92e21 100644 --- a/README.md +++ b/README.md @@ -53,33 +53,7 @@ $ cd ../build/ $ src/squeekboard ``` -### Maintenance +Developing +---------- -Use the `cargo.sh` script for maintaining the Cargo part of the build. The script takes the usual Cargo commands, after the first 2 positionsl arguments: source directory, and output artifact. So, `cargo test` becomes: - -``` -cd build_dir -/source_path/cargo.sh /source_path '' test -``` - -### Testing - -Testing with an application: - -``` -python3 tests/entry.py -``` - -Testing visibility: - -``` -$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true -$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false -``` - -Testing layouts: - -``` -$ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'ua')]" -$ gsettings set org.gnome.desktop.input-sources current 1 -``` +See `HACKING.md` diff --git a/debian/cargo/config b/debian/cargo/config new file mode 100644 index 00000000..6c73885a --- /dev/null +++ b/debian/cargo/config @@ -0,0 +1,12 @@ +# When modifying this file, consider instead +# to take advantage of the method that Cargo packagers use +# to set up all the necessary stuff automatically: +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907629#30 + +[source.crates-io] +registry = 'https://github.com/rust-lang/crates.io-index' +replace-with = 'vendored-sources' + +[source.vendored-sources] +directory = '/usr/share/cargo/registry' + diff --git a/debian/control b/debian/control index caa757a5..dfa1060c 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,11 @@ Build-Depends: libglib2.0-dev, libgtk-3-dev, libcroco3-dev, + librust-bitflags-1-dev (>= 1.0), + librust-maplit-1-dev (>= 1.0), + librust-serde-derive-1-dev (>= 1.0), + librust-serde-yaml-0.8-dev (>= 0.8), + librust-xkbcommon-0.4+wayland-dev (>= 0.4), libwayland-dev (>= 1.16), rustc, wayland-protocols (>= 1.14), diff --git a/debian/rules b/debian/rules index aeaf3378..a5c63017 100755 --- a/debian/rules +++ b/debian/rules @@ -1,9 +1,15 @@ #!/usr/bin/make -f -export CARGO_HOME=/tmp/cargo +export CARGO_HOME = $(CURDIR)/debian/cargo export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: dh $@ --builddirectory=_build --buildsystem=meson +# The Debian version of linked-hash-map doesn't provide any hash, +# causing Cargo to refuse to build with a crates.io copy +build: + rm Cargo.lock + dh $@ --builddirectory=_build --buildsystem=meson + override_dh_autoreconf: