Skip to content

Commit

Permalink
bump deps, build on latest nightly toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
shevernitskiy committed May 13, 2024
1 parent ecee7a2 commit 670eeb5
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 50 deletions.
57 changes: 30 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ retour = { version = "0.3.1", features = ["static-detour"] }
log = "0.4.21"
simple-logging = "2.0.2"
regex = "1.10.4"
toml = "0.8.8"
toml = "0.8.12"
backtrace = "0.3.71"
chrono = "0.4.38"
serde_derive = "1.0.164"
serde = "1.0.185"
serde_derive = "1.0.201"
serde = "1.0.201"
static_init = "1.0.3"
dlopen2 = "0.7.0"
anyhow = "1.0.82"
anyhow = "1.0.83"
device_query = "2.0.0"

[target.'cfg(target_os = "windows")'.dependencies]
Expand Down
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,55 @@ The recommended way of installation is using of the [installer](https://github.c

For installation of rust and cargo [see the link](https://doc.rust-lang.org/cargo/getting-started/installation.html).

> [!NOTE]
> [!NOTE]
> The use of system `rustc` and `cargo` often leads to build errors.
On Linux, after the installation use the following command:

```
source "$HOME/.cargo/env"
```

There's no `source` command on Windows, just install `rustup`, it will add cargo to the environment variables (follow the instructions at the link at the beginning of this section).

Then install `nightly-2022-11-06` toolchain using `rustup`:
Then install latest `nightly` toolchain using `rustup`:

```shell
rustup install nightly-2022-11-06
rustup install nightly
```

### Build

```shell
cargo +nightly-2022-11-06 build --release
cargo build --release
```

### Prepare the game

Copy:
* `target/release/libdfint_hook.so` to `libdfhooks.so` in the game's directory on Linux
* or `target/release/dfint_hook.dll` to `dfhooks.dll` on Windows
* [font](https://github.com/dfint/update-data/tree/main/store/fonts) to `data/art/curses_640x300.png`
* [encoding](https://github.com/dfint/update-data/tree/main/store/encodings) to `dfint-data/encoding.toml`
* [offsets](https://github.com/dfint/update-data/tree/main/store/offsets) to `dfint-data/offsets.toml`
* [dictionary](https://github.com/dfint/autobuild/tree/main/translation_build/csv/) to `dfint-data/dictionary.csv`
* [config](https://github.com/dfint/update-data/blob/main/store/config.toml) to `dfint-data/config.toml`

- `target/release/libdfint_hook.so` to `libdfhooks.so` in the game's directory on Linux
- or `target/release/dfint_hook.dll` to `dfhooks.dll` on Windows
- [font](https://github.com/dfint/update-data/tree/main/store/fonts) to `data/art/curses_640x300.png`
- [encoding](https://github.com/dfint/update-data/tree/main/store/encodings) to `dfint-data/encoding.toml`
- [offsets](https://github.com/dfint/update-data/tree/main/store/offsets) to `dfint-data/offsets.toml`
- [dictionary](https://github.com/dfint/autobuild/tree/main/translation_build/csv/) to `dfint-data/dictionary.csv`
- [config](https://github.com/dfint/update-data/blob/main/store/config.toml) to `dfint-data/config.toml`

### Launch

Run (on Linux)

```shell
./dwarfort
```

or (on Windows)

```shell
Dwarf Fortress.exe
```

or just double click the executable file of the game (or run it from the steam client, for example).

By default, the log is written to the file: `dfint-data/dfint-log.log`
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly"
3 changes: 3 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::{
#[static_init::dynamic]
pub static CONFIG: Config = Config::new();

#[allow(dead_code)]
pub struct Config {
pub metadata: ConfigMetadata,
pub settings: Settings,
Expand Down Expand Up @@ -55,6 +56,7 @@ pub struct OffsetsMetadata {
pub checksum: u32,
}

#[allow(dead_code)]
#[derive(Deserialize)]
pub struct OffsetsValues {
pub string_copy_n: Option<usize>,
Expand All @@ -72,6 +74,7 @@ pub struct OffsetsValues {
pub utf_input: Option<usize>,
}

#[allow(dead_code)]
#[derive(Deserialize)]
pub struct SymbolsValues {
pub addst: Option<Vec<String>>,
Expand Down
12 changes: 6 additions & 6 deletions src/macro/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"
proc-macro = true

[dependencies]
quote = "1.0.20"
syn = { version = "*", features = [
quote = "1.0.36"
syn = { version = "2.0.63", features = [
"full",
"parsing",
"printing",
Expand Down

0 comments on commit 670eeb5

Please sign in to comment.