diff --git a/Cargo.deps.online b/Cargo.deps.online deleted file mode 100644 index 54e8e17e..00000000 --- a/Cargo.deps.online +++ /dev/null @@ -1,4 +0,0 @@ -# Dependencies which are only used with online, crates.io builds. -[patch.crates-io] -# Dependency was yanked, but gio 0.7 needs it. -fragile = { git = "https://source.puri.sm/dorota.czaplejewicz/fragile.git", tag = "0.3.0" } diff --git a/Cargo.deps b/Cargo.toml similarity index 52% rename from Cargo.deps rename to Cargo.toml index 5bbaffc4..367a919e 100644 --- a/Cargo.deps +++ b/Cargo.toml @@ -1,11 +1,38 @@ -# Dependencies and tools which change based on build flags -# For the newer-than-Byzantium config +[package] +name = "rs" +version = "0.1.0" +edition = "2021" +[lib] +name = "rs" +path = "@path@/src/lib.rs" +crate-type = ["staticlib", "rlib"] + +# Cargo can't do autodiscovery if Cargo.toml is not in the root. +[[bin]] +name = "test_layout" +path = "@path@/src/bin/test_layout.rs" + +[[example]] +name = "test_layout" +path = "@path@/examples/test_layout.rs" + +[[example]] +name = "find_orphan_layouts" +path = "@path@/examples/find_orphan_layouts.rs" + +[features] +zbus_v1_5 = [] +clap_v4 = [] + +[dependencies] +maplit = "1.0.*" +serde = { version = "1.0.*", features = ["derive"] } +serde_yaml = "0.8.*" bitflags = "1.3.*" clap = { version = "4.4.*", features=["std"], default-features = false } zbus = "1.9.*" zvariant = "2.10.*" -# Newer versions seem to confuse the version of Cargo on Debian Bullseye zvariant_derive = "2.10.*" xkbcommon = { version = "0.5.*", features = ["wayland"] } diff --git a/Cargo.toml.in b/Cargo.toml.in deleted file mode 100644 index aee843c4..00000000 --- a/Cargo.toml.in +++ /dev/null @@ -1,33 +0,0 @@ -[package] -name = "rs" -version = "0.1.0" -edition = "2021" - -[lib] -name = "rs" -path = "@path@/src/lib.rs" -crate-type = ["staticlib", "rlib"] - -# Cargo can't do autodiscovery if Cargo.toml is not in the root. -[[bin]] -name = "test_layout" -path = "@path@/src/bin/test_layout.rs" - -[[example]] -name = "test_layout" -path = "@path@/examples/test_layout.rs" - -[[example]] -name = "find_orphan_layouts" -path = "@path@/examples/find_orphan_layouts.rs" - -[features] -zbus_v1_5 = [] -clap_v4 = [] - -# Dependencies which don't change based on build flags -[dependencies] -maplit = "1.0.*" -serde = { version = "1.0.*", features = ["derive"] } -serde_yaml = "0.8.*" -# Here is inserted the Cargo.deps file diff --git a/debian/rules b/debian/rules index 50041630..ad3bad43 100755 --- a/debian/rules +++ b/debian/rules @@ -29,7 +29,3 @@ export RUSTFLAGS = --remap-path-prefix=$(CURDIR)=/remap-pwd $(xgot) # The Debian version of linked-hash-map doesn't provide any hash, # causing Cargo to refuse to build with a crates.io copy -override_dh_auto_configure: - dh_auto_configure -- -Donline=false - -override_dh_autoreconf: diff --git a/meson.build b/meson.build index b938b1f4..b0774961 100644 --- a/meson.build +++ b/meson.build @@ -85,45 +85,15 @@ summary = [ ] message('\n'.join(summary)) -# Rust deps are changing, depending on compile flags. Cargo can't handle it alone. -# As a side effect, Cargo.toml never gets used. -cargo_toml_in = files('Cargo.toml.in') path_data = configuration_data() path_data.set('path', meson.source_root()) -cargo_toml_base = configure_file( - input: 'Cargo.toml.in', - output: 'Cargo.toml.base', +cargo_toml = configure_file( + input: 'Cargo.toml', + output: 'Cargo.toml', configuration: path_data, ) -cargo_patch = [] - cargo_build_flags += ['--features', 'zbus_v1_5,clap_v4'] -cargo_deps = files('Cargo.deps') -cargo_lock = files('Cargo.lock') - -if get_option('online') == true - cargo_patch = [files('Cargo.deps.online')] -endif - -cat = find_program('cat') -cargo_toml = custom_target( - 'Cargo.toml', - output: 'Cargo.toml', - command: [cat, cargo_toml_base, cargo_deps] + cargo_patch, - capture: true, -) - -cargo_deps = [cargo_toml] -if get_option('online') == true and get_option('reset_lock') == true - cargo_lock = custom_target( - 'Cargo.lock', - output: 'Cargo.lock', - command: [cat, cargo_lock], - capture: true, - ) - cargo_deps += [cargo_lock] -endif dep_cargo = find_program('cargo') cargo_script = find_program('cargo.sh') diff --git a/meson_options.txt b/meson_options.txt index 0082e386..0c333858 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -11,14 +11,6 @@ option('find_orphans', type: 'boolean', value: false, description: 'Check if all present layout files are included in resources.') -option('online', - type: 'boolean', value: true, - description: 'Pull packages from the internet while building, as opposed to a local registry.') - -option('reset_lock', - type: 'boolean', value: false, - description: 'Resets Cargo.lock to the one found in the source repo. Does not affect builds with online == false.') - option('strict', type: 'boolean', value: true, description: 'Turn more warnings into errors') diff --git a/src/meson.build b/src/meson.build index 5041f560..b4c3c94b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -52,7 +52,6 @@ deps = [ cc.find_library('rt'), cc.find_library('dl'), cc.find_library('pthread'), -# dependency('libxklavier'), # FIXME remove ] rslibs = custom_target( @@ -63,7 +62,6 @@ rslibs = custom_target( install: false, console: true, command: [cargo_build] + ['@OUTPUT@', '--lib'] + cargo_build_flags, - depends: cargo_deps, ) build_rstests = custom_target( @@ -78,7 +76,7 @@ build_rstests = custom_target( install: false, console: true, command: [cargo_script, 'test', '--no-run'] + cargo_build_flags, - depends: [rslibs, cargo_deps], # no point building tests if the code itself fails + depends: [rslibs], # no point building tests if the code itself fails ) test( @@ -86,9 +84,9 @@ test( cargo_script, args: ['test'] + cargo_build_flags, env: ['SOURCE_DIR=' + meson.source_root()], - # this is a whole Carg-based test suite, let it run for a while + # This is a whole Cargo-based test suite, let it run for a while timeout: 900, - depends: [build_rstests, cargo_deps], + depends: [build_rstests], ) libsqueekboard = static_library('libsqueekboard', diff --git a/tools/meson.build b/tools/meson.build index 2b427ae3..ec144ede 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -16,5 +16,4 @@ test_layout = custom_target('squeekboard-test-layout', + cargo_build_flags, install: true, install_dir: bindir, - depends: cargo_deps, )