[package]
name = "msg_tool"
version = "0.4.0-alpha.3"
edition = "2024"
repository = "https://github.com/lifegpc/msg-tool"
description = "A command-line tool for exporting, importing, packing, and unpacking script files."
license = "GPL-3.0-or-later"
exclude = [".github", "*.py", "AGENTS.md"]

[dependencies]
adler = { version = "1", optional = true }
aes = { version = "0.9", optional = true }
anyhow = "1"
argon2 = { version = "0.5", optional = true }
base64 = { version = "0.22", optional = true }
blake2 = { version = "0.10", optional = true }
block_compression = { version = "0.9", optional = true, default-features = false, features = ["bc7"] }
byteorder = { version = "1.5", default-features = false, optional = true}
bytes = { version = "1.11", optional = true }
cbc = { version = "0.2", optional = true }
chacha20 = { version = "0.10", optional = true }
chrono = { version = "0.4", optional = true, features = ["serde"] }
clap = { version = "4.5", features = ["derive"] }
crc32fast = { version = "1.5", optional = true }
crossbeam = { version = "0.8", optional = true }
csv = "1.3"
ctrlc = "3.4"
digest-io = { version = "0.1", optional = true }
emote-psb = { version = "0.5", optional = true , features = ["serde"] }
encoding = "0.2"
fancy-regex = { version = "0.18", optional = true }
fastcdc = { version = "4.0", optional = true }
flate2 = { version = "1.1", optional = true }
hex = { version = "0.4", optional = true }
include-flate = { version = "0.3", optional = true }
int-enum = { version = "1.2", optional = true }
jieba-rs = { version = "0.10", optional = true }
json = { version = "0.12", optional = true }
jpegxl-sys = { package = "msg-tool-jpegxl-sys", version = "0.11", optional = true, features = ["vendored"] }
lazy_static = "1.5.0"
libflac-sys = { version = "0.3", optional = true }
libsteamless = { version = "0.1", optional = true }
libtlg-rs = { version = "0.2", optional = true, features = ["encode"] }
lz4 = { version = "1.28", optional = true }
markup5ever = { version = "0.38", optional = true }
md5 = { version = "0.8", optional = true }
memchr = { version = "2.7", optional = true }
mozjpeg = { version = "0.10", optional = true }
msg_tool_macro = { version = "0.4.0-alpha.1" }
msg_tool_xp3data = { version = "0.4.0-alpha.3", optional = true }
num_cpus = "1.17"
overf = "0.1"
parse-size = { version = "1.1", optional = true }
pelite = { version = "0.10", optional = true }
png = { version = "0.18", optional = true }
qoi = { version = "0.4", optional = true }
rand = { version = "0.10", optional = true }
rust-ini = { version = "0.21", optional = true }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml_ng = "0.10"
sha1 = { version = "0.11", optional = true }
sha2 = { version = "0.11", optional = true }
sha3 = { version = "0.12", optional = true }
shake = { version = "0.1", optional = true }
siphasher = { version = "1.0", optional = true }
stylua = { version = "2.1", optional = true, default-features = false}
tendril = { version = "0.5", optional = true }
tjs2dec = { version = "0.4", optional = true }
unicode-segmentation = "1.12"
url = { version = "2.5", optional = true }
utf16string = "0.2"
webp = { version = "0.3", default-features = false, optional = true }
xml5ever = { version = "0.38", optional = true }
xxhash-rust = { version = "0.8", optional = true }
zopfli = { version = "0.8", optional = true }
zstd = { version = "0.13", optional = true }

[features]
default = ["all-fmt", "image-jpg", "image-jxl", "image-webp", "audio-flac", "jieba"]
# Zig can not build libjxl
zig = ["all-fmt", "image-jpg", "image-webp", "audio-flac", "jieba"]
all-fmt = ["all-script", "all-img", "all-arc", "all-audio"]
all-script = ["artemis", "artemis-panmimisoft", "bgi", "cat-system", "circus", "entis-gls", "escude", "ex-hibit", "favorite", "hexen-haus", "kirikiri", "musica", "qlie", "silky", "softpal", "will-plus", "yaneurao", "yaneurao-itufuru", "yuris"]
all-img = ["bgi-img", "cat-system-img", "circus-img", "emote-img", "hexen-haus-img", "kirikiri-img", "qlie-img", "softpal-img", "will-plus-img", "yuris-img"]
all-arc = ["artemis-arc", "bgi-arc", "cat-system-arc", "circus-arc", "escude-arc", "ex-hibit-arc", "hexen-haus-arc", "kirikiri-arc", "musica-arc", "qlie-arc", "softpal-arc", "yuris-arc"]
all-audio = ["bgi-audio", "circus-audio"]
artemis = ["dep:stylua", "utils-escape"]
artemis-panmimisoft = ["artemis", "dep:rust-ini"]
artemis-arc = ["artemis", "dep:digest-io", "msg_tool_macro/artemis-arc", "dep:sha1"]
bgi = ["fancy-regex"]
bgi-arc = ["bgi", "dep:rand", "utils-bit-stream"]
bgi-audio = ["bgi"]
bgi-img = ["bgi", "image", "dep:rand", "utils-bit-stream"]
cat-system = ["fancy-regex", "flate2", "dep:int-enum"]
cat-system-arc = ["cat-system", "dep:pelite", "utils-blowfish", "utils-crc32"]
cat-system-img = ["cat-system", "flate2", "image", "mozjpeg", "utils-bit-stream"]
circus = []
circus-arc = ["circus"]
circus-audio = ["circus", "flate2", "dep:int-enum", "lossless-audio"]
circus-img = ["circus", "image", "flate2", "zstd"]
emote-img = ["dep:base64", "dep:block_compression", "emote-psb", "image", "json", "dep:libtlg-rs", "dep:url", "utils-psd"]
entis-gls = ["xml5ever", "dep:int-enum"]
escude = ["dep:int-enum"]
escude-arc = ["escude", "dep:rand", "utils-bit-stream"]
ex-hibit = []
ex-hibit-arc = ["ex-hibit"]
favorite = ["utils-str"]
hexen-haus = ["dep:memchr", "utils-str"]
hexen-haus-arc = ["hexen-haus"]
hexen-haus-img = ["hexen-haus", "image"]
kirikiri = ["emote-psb", "fancy-regex", "flate2", "json", "dep:lz4", "utils-escape"]
kirikiri-arc = ["kirikiri", "dep:adler", "dep:aes", "dep:argon2", "dep:base64", "dep:blake2", "dep:bytes", "dep:cbc", "dep:chacha20", "chacha20/legacy", "chacha20/xchacha", "dep:fastcdc", "flate2", "dep:hex", "dep:int-enum", "dep:libsteamless", "dep:md5", "dep:memchr", "msg_tool_macro/kirikiri-arc", "dep:msg_tool_xp3data", "dep:parse-size", "dep:pelite", "serde/rc", "dep:sha2", "dep:sha3", "dep:shake", "dep:siphasher", "dep:tjs2dec", "utils-case-insensitive-string", "utils-lzss", "utils-serde-base64bytes", "utils-simple-pack", "zopfli", "zstd"]
kirikiri-img = ["kirikiri", "image", "dep:libtlg-rs"]
musica = []
musica-arc = ["musica", "dep:crc32fast", "flate2", "dep:include-flate", "utils-blowfish", "utils-rc4", "utils-serde-base64bytes", "utils-xored-stream"]
qlie = []
qlie-arc = ["qlie", "utils-mmx", "dep:pelite", "dep:rand"]
qlie-img = ["qlie", "image", "utils-psd"]
silky = []
softpal = ["dep:int-enum"]
softpal-arc = ["softpal"]
softpal-img = ["softpal", "image"]
will-plus = ["utils-str"]
will-plus-img = ["will-plus", "image"]
yaneurao = []
yaneurao-itufuru = ["yaneurao", "utils-xored-stream"]
yuris = ["dep:chrono", "dep:hex", "utils-serde-base64bytes", "utils-xored-stream"]
yuris-arc = ["yuris", "dep:adler", "dep:crc32fast", "flate2", "dep:int-enum", "dep:pelite", "utils-murmur2", "dep:xxhash-rust", "xxhash-rust/xxh32", "zopfli"]
yuris-img = ["yuris", "image", "qoi", "webp"]
# basic feature
image = ["dep:png"]
image-jpg = ["mozjpeg"]
image-jxl = ["image", "dep:jpegxl-sys"]
image-webp = ["webp"]
lossless-audio = ["utils-pcm"]
audio-flac = ["dep:libflac-sys", "utils-pcm"]
unstable = ["msg_tool_macro/unstable", "msg_tool_xp3data?/unstable"]
jieba = ["dep:jieba-rs"]
emote-psb = ["dep:emote-psb", "dep:adler", "dep:lz4"]
xml5ever = ["dep:xml5ever", "dep:markup5ever", "dep:tendril", "dep:crossbeam"]
# utils feature
utils-bit-stream = []
utils-blowfish = ["dep:byteorder"]
utils-case-insensitive-string = []
utils-crc32 = []
utils-escape = ["fancy-regex"]
utils-lzss = []
utils-mmx = []
utils-murmur2 = []
utils-pcm = []
utils-psd = ["image", "flate2", "utils-bit-stream"]
utils-rc4 = []
utils-serde-base64bytes = ["dep:base64"]
utils-simple-pack = ["zstd"]
utils-str = []
utils-xored-stream = []
private = ["dep:serde", "dep:toml"]

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_Globalization", "Win32_System_Diagnostics_Debug"] }

[build-dependencies]
parse-size = "1.1"
serde = { version = "1", features = ["derive"], optional = true }
toml = { version = "1.1", optional = true }
