-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCargo.toml
293 lines (261 loc) · 13.2 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# Workspace package definition
# ----------------------------------------------------------------------------------------------------------------------
[workspace.package]
version = "0.2.0"
edition = "2021"
authors = ["Daniel Balsom"]
keywords = ["emulation", "ibm", "floppy", "disk"]
repository = "https://github.com/dbalsom/fluxfox"
license = "MIT"
# Package definition
# ----------------------------------------------------------------------------------------------------------------------
[package]
name = "fluxfox"
description = "A library crate for working with floppy disk images for the IBM PC and compatibles."
version.workspace = true
edition.workspace = true
authors.workspace = true
readme = "README.md"
keywords.workspace = true
repository.workspace = true
license.workspace = true
# Workspace definition
# ----------------------------------------------------------------------------------------------------------------------
[workspace]
members = [
"examples/async",
"examples/serde_demo",
"examples/imginfo",
"examples/imgdump",
"examples/imgviz",
"crates/png2disk",
"crates/ffedit",
"crates/fluxfox_cli",
"crates/ff_egui_app",
"crates/ff_egui_lib",
"crates/fluxfox_svg",
"examples/fat",
"crates/fluxfox_svg"
]
# Required dependencies
# ----------------------------------------------------------------------------------------------------------------------
[dependencies]
# bit-vec provides the BitVec type which is the fundamental data structure BitStream tracks are built on.
# It has no extra dependencies.
bit-vec.workspace = true
# bitflags simplifies binary flag handling.
bitflags.workspace = true
# binrw is a powerful crate for reading and writing binary data - it powers all of fluxfox's disk image parsers.
binrw.workspace = true
# bytemuck is a safe wrapper around transumte for working with slices at different alignments. it can significantly
# improve performance when parsing data from byte slices.
bytemuck = { workspace = true, features = ["derive"] }
# log is a logging facade
log.workspace = true
# envlogger is a logger backend for control over logging levels via the RUST_LOG environment variable
env_logger = "0.11"
# regular expressions are used for file matching - notably expanding a raw kryoflux stream filename into a file set
regex.workspace = true
# thiserror simplifies error handling for library crates.
thiserror.workspace = true
# sha1_smol is used for hashing track data to detect duplicate tracks
sha1_smol = "1.0"
# dyn-clone is used to clone trait objects
dyn-clone.workspace = true
# strum is used to for useful macros, such as deriving iterators over enums
strum = { workspace = true, features = ["derive"] }
# Optional dependencies
# ---------------------------------------------------------------------------------------------------------------------
# rand is used for generating random numbers - primarily for genering random bits for fuzzy/weak bits
# if the 'rand' feature is not enabled we should fall back to using an internal, fast pseudo-random bit generation
# (not yet implemented, so this feature is actually required)
rand = { workspace = true, optional = true }
# Modular-bitfield is used by the IPF parser
modular-bitfield = { workspace=true, optional = true }
# Num-traits and num-derive are used by retrocompressor ('td0' feature) and visualizations ('viz' feature)
num-traits = { workspace = true, optional = true }
num-derive = { workspace = true, optional = true }
# tiny-skia is used by visualization functions ('viz' feature)
tiny-skia = { workspace = true, optional = true }
# flate2 is required for MFI decompression ('mfi' feature) and gzip decompression ('gzip' feature)
flate2 = { version = "1.0", optional = true }
# histogram is required for flux timing detection / PLL initialization
histogram = { version = "0.11", optional = true }
# plotly is used for plotting flux timings
plotly = { version = "0.12", optional = true }
# serde is used for serialization / deserialization of app state and disk images ('serde' feature)
serde = { workspace = true, optional = true }
# typetag is used for serialization / deserialization of dyn trait objects ('serde' feature)
typetag = { workspace = true, optional = true }
# rhai is used for scripting ('scripting' and 'rhai' features)
rhai = { version = "1.20", optional = true }
# svg is used by imgviz and fluxfox_svg
svg = { workspace = true, optional = true }
#wasm-bindgen-futures = { version = "0.4", optional = true }
# fluxfox_fat is used for reading FAT12/16/32 filesystems if 'fat' feature is enabled
# fluxfox_fat is a fork of rust-fatfs with a few fixes for reading older/odd boot sectors
[dependencies.fluxfox_fat]
git = "https://github.com/dbalsom/fluxfox_fat.git"
package = "fatfs"
branch = "bpb_fix"
default-features = false
features = ["std", "alloc", "log_level_debug"]
optional = true
# Native dependencies
# ----------------------------------------------------------------------------------------------------------------------
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
zip = { version = "2.1", default-features = false, features = ["bzip2", "deflate", "deflate64", "lzma", "time", "zstd"], optional = true }
tar = { version = "0.4", optional = true }
tokio = { version = "1", optional = true, features = ["full"] }
# Wasm32 dependencies
# ----------------------------------------------------------------------------------------------------------------------
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
zip = { version = "2.1", default-features = false, features = ["deflate", "deflate64", "lzma"], optional = true }
tar = { version = "0.4", optional = true }
# Version of time must match time depdendency of zip
#time = { version = "0.3", features = ["wasm-bindgen"], optional = true }
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
# Workspace dependencies - centralize version control for all crates
# ----------------------------------------------------------------------------------------------------------------------
[workspace.dependencies]
# fluxfox itself! We can control how other crates in this workspace resolve the main fluxfox crate here
fluxfox = { path = ".", default-features = false }
# Several crates use Serde. We can keep them all in sync here.
serde = { version = "1.0", features = ["derive"] }
# tiny-skia is used for rasterization of fluxfox visualizations
tiny-skia = "0.11"
# svg is used for creating SVG-format visualization output
svg = "0.18"
# log is a logging facade
log = "0.4"
# thiserror simplifies error handling for library crates.
thiserror = "2.0"
# binrw is a powerful crate for reading and writing binary data - it powers all of fluxfox's disk image parsers.
binrw = "0.14"
# bitflags simplifies binary flag handling.
bitflags = "2.6"
# bit-vec provides the BitVec type which is the fundamental data structure BitStream tracks are built on.
# It has no extra dependencies.
bit-vec = "0.8"
# dyn-clone is used to clone trait objects
dyn-clone = "1.0"
# bytemuck is a safe wrapper around transumte for working with slices at different alignments. it can significantly
# improve performance when parsing data from byte slices.
bytemuck = "1.7"
# regular expressions are used for file matching - notably expanding a raw kryoflux stream filename into a file set
regex = "1.11"
# strum is used to for useful macros, such as deriving iterators over enums
strum = { version = "0.26", features = ["derive"] }
# typetag is used for serialization / deserialization of dyn trait objects ('serde' feature)
typetag = "0.2"
# Num-traits and num-derive are used by retrocompressor ('td0' feature) and visualizations ('viz' feature)
num-traits = "0.2"
num-derive = "0.4"
# modular-bitfield implements enum-capable bitfields. Currently only used by the IPF parser
modular-bitfield = "0.11"
# rand is used for random number generation, primarily for generating random bits for fuzzy/weak bits
rand = "0.8"
# web-time is a wasm-compatible replacement for std::time
web-time = "1.1"
# Dev dependencies
# ----------------------------------------------------------------------------------------------------------------------
[dev-dependencies]
sha1 = "0.10"
hex = "0.4" # or the latest version
[features]
# core features should always be enabled first if default-features is false
core = ["rand"]
all_platforms = ["ibm_pc", "atari_st", "amiga", "macintosh", "apple_ii"]
default = ["core", "viz", "scripting", "rhai", "archives", "mfi", "fat", "flux", "all_platforms"]
# the rand feature enables use of the rand crate for random number generation.
# note: it is intended to be optional but the fallback is not yet implemented
rand = ["dep:rand"]
wasm = ["async", "wasm-bindgen", "wasm-bindgen-futures"]
serde = ["dep:serde", "dep:typetag", "bit-vec/serde_std", "bitflags/serde"]
tokio-async = ["async", "tokio"]
async = []
# ibm_pc feature enables IBM PC-specific disk image support (not fully factored out at the moment)
ibm_pc = ["td0"]
# amiga feature enables Amiga-specific disk image support. It will enable IPF and enable Amiga platform support
# in the IPF parser. Note - at least one of the 'atarist' or 'amiga' features must be enabled to enable IPF support!
amiga = ["adf", "ipf"]
# atarist feature enables Atari ST-specific disk image support. It will enable IPF and enable Atari platform support
# in the IPF parser.
atari_st = ["ipf", "st"]
# macintosh feature enables Macintosh-specific disk image support (primarily MOOF).
macintosh = ["moof"]
# appleii feature enables Apple II-specific disk image support (primarily WOZ).
apple_ii = ["woz"]
# viz feature enables visualization functions
viz = []
# tiny_skia feature enables direct rendering of visualizations with tiny-skia.
tiny_skia = ["dep:tiny-skia"]
# fat feature enables reading FAT12/16/32 filesystems. This will pull in fluxfox_fat dependency
fat = ["dep:fluxfox_fat"]
# flux feature enables reading flux images. This will pull in histogram dependency
flux = ["dep:histogram"]
# plotly feature enables export of flux timings to plotly (perhaps this should not be internal to fluxfox?)
plot = ["dep:plotly"]
# Scripting Features
# ----------------------------------------------------------------------------------------------------------------------
# The main scripting feature enables scripting support, regardless of engine
scripting = []
# Enable the Rhai scripting engine (currently the only supported scripting engine)
rhai = ["dep:rhai"]
# Archive File Features
# ----------------------------------------------------------------------------------------------------------------------
# meta-feature to enable all archive formats
archives = ["zip", "gzip", "tar"]
# zip feature enables reading zipped images, as well as reading/writing zip files from FileSystem interfaces
zip = ["dep:zip"]
# gzip feature enables reading gzipped images, as well as reading/writing gzip files from FileSystem interfaces
gzip = ["dep:flate2"]
# tar feature enables reading tarred image sets, as well as writing tar files from FileSystem interfaces
tar = ["dep:tar"]
# Disk Image File Format Features
# ----------------------------------------------------------------------------------------------------------------------
# mfi feature enables reading MFI images. This will pull in flate2 dependency for compression/decompression
mfi = ["dep:flate2", "flux"]
# moof feature enables reading MOOF images. No extra dependencies, but experimental.
moof = []
# woz feature enables reading WOZ images. No extra dependencies, but experimental.
woz = []
# td0 feature enables reading TD0 images. This will pull in num-traits and num-derive dependencies and LZW/LZHUF
# routines for compression/decompression
td0 = ["dep:num-traits", "dep:num-derive"]
# adf feature enables reading Amiga ADF images. This does not require an additional format parser, instead it is used to
# enable reading/writing StandardFormat::Amiga880k images in the `raw` parser and StandardSectorView, as well as
# advertising the ADF extension.
adf = []
# st feature enables reading Atari ST 'ST' images. Like ADF, this is just another form of raw sector image and will
# simply enable the raw parser to work with it and advertise the extension.
st = []
# ipf feature enables reading SPS IPF images. This will pull in modular-bitfield
ipf = ["dep:modular-bitfield"]
# Clippy lint control
# ----------------------------------------------------------------------------------------------------------------------
[lints.clippy]
# We will eventually take this advice, but not now
too-many-arguments = "allow"
# Sometimes adding + 0 helps line things up. There's no harm in it
identity_op = "allow"
# Build profiles
# ----------------------------------------------------------------------------------------------------------------------
[profile.release]
# Most aggressive LTO profile
lto = "thin"
[profile.release.package.ff_egui_app]
# Fast and small wasm
opt-level = 2
# Optimize all dependencies even in debug builds
[profile.dev.package."*"]
opt-level = 2
[patch.crates-io]
# If you want to use the bleeding edge version of egui and eframe:
# egui = { git = "https://github.com/emilk/egui", branch = "master" }
# eframe = { git = "https://github.com/emilk/egui", branch = "master" }
# If you fork https://github.com/emilk/egui you can test with:
# egui = { path = "../egui/crates/egui" }
# eframe = { path = "../egui/crates/eframe" }