Skip to content

Commit

Permalink
Add LZ4 Support (#4)
Browse files Browse the repository at this point in the history
* External LZ4

* LZ4 compiles on mac systems

* Add LZ4 support

* Remove .vscode

* Remove other unnecessary files
  • Loading branch information
Avarel authored Jul 18, 2023
1 parent 3254cff commit 596dbdc
Show file tree
Hide file tree
Showing 21 changed files with 1,890 additions and 116 deletions.
223 changes: 136 additions & 87 deletions Cargo.lock

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ license = "MIT"

[workspace]
members = [
"libs/egui_dock"
"libs/egui_dock",
"libs/lz4_flex"
]

[features]
Expand All @@ -20,15 +21,16 @@ psd = ["dep:psd"]
[dependencies]
# Procreate support
zip = { version = "0.6", default-features = false, features = ["deflate"] }
lz4_flex = "0.10.0"
lz4 = "1.24.0"
# lz4_flex = "0.11.0"
lz4_flex = { path = "libs/lz4_flex" }
# lz4 = "1.24.0"
minilzo-rs = "0.6.0"
plist = "1.3"
thiserror = "1.0"
regex = "1.6"
image = { version = "0.24", default-features = false, features = ["png", "jpeg", "tga", "tiff", "webp", "bmp"] }
once_cell = "1"
memmap2 = "0.5"
memmap2 = "0.7"
rayon = "1"
# PSD support
psd = { version = "0.3", optional = true }
Expand Down Expand Up @@ -59,6 +61,9 @@ codegen-units = 1
[target.'cfg(windows)'.build-dependencies]
winres = "0.1"

[build-dependencies]
cc = "1.0"

[package.metadata.bundle]
name = "Silicate"
identifier = "io.antran.silicate"
Expand Down
Binary file added demo_files/Reference_Blend_File 2.procreate
Binary file not shown.
File renamed without changes.
6 changes: 6 additions & 0 deletions libs/lz4_flex/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/target
benchmarks/target
Cargo.lock
my-prof.profile
Session.vim
/benchmarks/bench_files
22 changes: 22 additions & 0 deletions libs/lz4_flex/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
authors = ["Pascal Seitz <pascal.seitz@gmail.com>", "Arthur Silva <arthurprs@gmail.com>", "ticki <Ticki@users.noreply.github.com>"]
description = "Fastest LZ4 implementation in Rust, no unsafe by default."
edition = "2021"
keywords = ["compression", "lz4", "compress", "decompression", "decompress"]
name = "lz4_flex"
homepage = "https://github.com/pseitz/lz4_flex"
repository = "https://github.com/pseitz/lz4_flex"
readme = "README.md"
license = "MIT"
version = "0.11.1"
include = ["src/*.rs", "src/frame/**/*", "src/block/**/*", "README.md"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["std"]
std = []

[dependencies]
20 changes: 20 additions & 0 deletions libs/lz4_flex/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2020 Pascal Seitz

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7 changes: 7 additions & 0 deletions libs/lz4_flex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Apple LZ4 Decompressor

This is a decompressor for LZ4 compressed data that uses the Apple header format. The libary is stripped down to only support decompression and modified to only work with Apple's noncompliant implementation.

## Attribution
* [`lz4_flex`](https://github.com/PSeitz/lz4_flex) from Pascal Seitz.
* [Apple documentation](https://developer.apple.com/documentation/compression/compression_algorithm/compression_lz4) on the LZ4 format.
77 changes: 77 additions & 0 deletions libs/lz4_flex/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# configuration file for git-cliff
# see https://github.com/orhun/git-cliff#configuration-file

[changelog]
# changelog header
header = """
"""
# template for the changelog body
# https://tera.netlify.app/docs/#introduction
body = """
{% if version %}\
{{ version | trim_start_matches(pat="v") }} ({{ timestamp | date(format="%Y-%m-%d") }})
==================
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | split(pat="\n") | first | trim | upper_first }}(@{{ commit.author.name }})\n{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
"""

postprocessors = [
{ pattern = 'Pascal Seitz', replace = "PSeitz"}, # replace with github user
{ pattern = '', replace = ""}, # replace with github user
]

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = false
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "[#${2}](https://github.com/PSeitz/lz4_flex/issues/${2})"}, # replace issue numbers
]

# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^doc", group = "Documentation"},
{ message = "^perf", group = "Performance"},
{ message = "^refactor", group = "Refactor"},
{ message = "^style", group = "Styling"},
{ message = "^test", group = "Testing"},
{ message = "^chore\\(release\\): prepare for", skip = true},
{ message = "^chore", group = "Miscellaneous Tasks"},
{ body = ".*security", group = "Security"},
{ message = ".*", group = "Other", default_scope = "other"},
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# glob pattern for matching git tags
tag_pattern = "v[0-9]*"
# regex for skipping tags
skip_tags = "v0.1.0-beta.1"
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
# limit the number of commits included in the changelog.
# limit_commits = 42
Loading

0 comments on commit 596dbdc

Please sign in to comment.