Snappy bindings for Rust

Overview

Snappy

Build Status

[ Originally forked from https://github.com/thestinger/rust-snappy ]

Documentation

Usage

Add this to your Cargo.toml:

[dependencies]
snappy = "0.4"

and this to your crate root:

extern crate snappy;

Installing Snappy

  • The Snappy C++ library can be installed on Mac OS X using homebrew brew install snappy.
  • If that library is not installed in the usual path, you can export the LD_LIBRARY_PATH and LD_RUN_PATH environment variables before issueing cargo build.
  • Static linking can be requested by an export SNAPPY_SYS_STATIC=1 prior to cargo build.
  • As a fallback, this crate will try to compile the Snappy C++ library itself and statically link against it. (This behavior can be enforced by an export SNAPPY_SYS_STATIC_FROM_SOURCE=1 prior to cargo build.)

Building

The Snappy C++ library is also optionally bundled as a submodule. A

git submodule update --init

will fetch a copy of the library for local compilation. This can will then be used if the c++ library cannot be found on your system or if SNAPPY_SYS_STATIC_FROM_SOURCE is set to 1.

You might also like...
Like pigz, but rust - a cross platform, fast, compression and decompression tool.

🦀 crabz Like pigz, but rust. A cross platform, fast, compression and decompression tool. Synopsis This is currently a proof of concept CLI tool using

Ribzip2 - A bzip2 implementation in pure Rust.

ribzip2 - a comprehensible bzip2 implementation ribzip2 is command line utility providing bzip2 compression and decompression written in pure Rust. It

A reimplementation of the Zopfli compression tool in Rust.

Zopfli in Rust This is a reimplementation of the Zopfli compression tool in Rust. Carol Nichols started the Rust implementation as an experiment in in

A Rust application that compress files and folders

Quick Storer This is a Rust application that compress files and folders. Usage Download or build the binary and place it on your desktop, or any other

banzai: pure rust bzip2 encoder

banzai banzai is a bzip2 encoder with linear-time complexity, written entirely in safe Rust. It is currently alpha software, which means that it is no

An extremely fast alternative to zip which is written in rust.

Zap Compress and/or encrypt folders fast. Like, really fast. or as some say, blazingly fast. Installation To install Zap, run the following command fr

An extremely fast alternative to zip which is written in rust.

Zap Compress and/or encrypt folders fast. Like, really fast. or as some say, blazingly fast. Installation To install Zap, run the following command fr

Simple NoNG songs manager for GD, written in Rust.
Simple NoNG songs manager for GD, written in Rust.

nong-manager Simple NoNG songs manager for GD, written in Rust. Powered by Song File Hub (https://songfilehub.com/home) How to use Enter song ID that

Basic (and naïve) LZW and Huffman compression algorithms in Rust.

Naive implementation of the LZW and Huffman compression algorithms. To run, install the Rust toolchain. Cargo may be used to compile the source. Examp

Comments
  • Add uncompress_to

    Add uncompress_to

    • Upgrade libc dependency
    • Switch to Result instead of Option to force usage of the return types
    • Add uncompress_to to allow buffer reuse
    • Custom build.rs to support alternative snappy installations
    opened by xitep 5
  • Build snappy lib directly if not present on the host

    Build snappy lib directly if not present on the host

    • Includes the sources for the c++ lib as a submodule
    • Separates into snappy (higher-level functions) and snappy-sys (pure bindings)
    • Requires git submodule update --init prior to building/publishing
    • Requires publishing snappy and snappy-sys
    • Seems to work fine on debian wheezy and jessie
    • Would love this to be tested on mac os x
    opened by xitep 3
  • proposal: build from sources by default

    proposal: build from sources by default

    Snappy tries to link to system library by default. If it's not installed yet, it will fallback to compile from sources instead. This strategy works out of box and very convenient when there people wants to link the system library.

    However, because the version in submodule may not be the same as the installed one on host machine, so it doesn't produce consistent binary, compilation/tests may work on some machine but fail on others. Second, the linking policy in rust is static by default, which is different from this crate, it may be confusing for users.

    I propose to build the library from sources by default and no automatically fallback. So the problems described above will all be solved. For those really want to link to system library, environment variables can still work. This is a broken changes though. After #4 is merged, machine without cmake installed will fail.

    Any thoughts?

    opened by BusyJay 0
  • Adjust build

    Adjust build

    This pr updates snappy to the latest version and use cmake to build the native library. Using config/make only works on *nix system, and cmake is also recommended by the upstream.

    CMake is supported and autotools will soon be deprecated.

    Also can you turn on the issues tab? I want to raise an issue to discuss about whether to build and link to sources by default. But can't find any places to write it down.

    opened by BusyJay 1
Owner
Jeff Belgum
Jeff Belgum
libbz2 (bzip2 compression) bindings for Rust

bzip2 Documentation A streaming compression/decompression library for rust with bindings to libbz2. # Cargo.toml [dependencies] bzip2 = "0.4" License

Alex Crichton 67 Dec 27, 2022
DEFLATE, gzip, and zlib bindings for Rust

flate2 A streaming compression/decompression library DEFLATE-based streams in Rust. This crate by default uses the miniz_oxide crate, a port of miniz.

The Rust Programming Language 619 Jan 8, 2023
lzlib (lzip compression) bindings for Rust

lzip Documentation A streaming compression/decompression library for rust with bindings to lzlib. # Cargo.toml [dependencies] lzip = "0.1" License Lic

Firas Khalil Khana 8 Sep 20, 2022
A simple rust library to read and write Zip archives, which is also my pet project for learning Rust

rust-zip A simple rust library to read and write Zip archives, which is also my pet project for learning Rust. At the moment you can list the files in

Kang Seonghoon 2 Jan 5, 2022
A Brotli implementation in pure and safe Rust

Brotli-rs - Brotli decompression in pure, safe Rust Documentation Compression provides a <Read>-struct to wrap a Brotli-compressed stream. A consumer

Thomas Pickert 59 Oct 7, 2022
Brotli compressor and decompressor written in rust that optionally avoids the stdlib

rust-brotli What's new in 3.2 into_inner conversions for both Reader and Writer classes What's new in 3.0 A fully compatible FFI for drop-in compatibi

Dropbox 659 Dec 29, 2022
A Rust implementation of the Zopfli compression algorithm.

Zopfli in Rust This is a reimplementation of the Zopfli compression tool in Rust. I have totally ignored zopflipng. More info about why and how I did

Carol (Nichols || Goulding) 76 Oct 20, 2022
Tar file reading/writing for Rust

tar-rs Documentation A tar archive reading/writing library for Rust. # Cargo.toml [dependencies] tar = "0.4" Reading an archive extern crate tar; use

Alex Crichton 490 Dec 30, 2022
Zip implementation in Rust

zip-rs Documentation Info A zip library for rust which supports reading and writing of simple ZIP files. Supported compression formats: stored (i.e. n

null 549 Jan 4, 2023
Pure Rust bzip2 decoder

bzip2-rs Pure Rust 100% safe bzip2 decompressor. Features Default features: Rust >= 1.34.2 is supported rustc_1_37: bump MSRV to 1.37, enable more opt

Paolo Barbolini 36 Jan 6, 2023