An open API service indexing awesome lists of open source software.

https://github.com/jirutka/brieflz.lua

Lua binding for BriefLZ compression library
https://github.com/jirutka/brieflz.lua

brieflz compression lua lua-binding

Last synced: 6 months ago
JSON representation

Lua binding for BriefLZ compression library

Awesome Lists containing this project

README

          

= BriefLZ for Lua
Jakub Jirutka
// custom
:name: brieflz
:repo-name: brieflz.lua
:gh-name: jirutka/{repo-name}
:gh-branch: master
:appveyor-id: jwnh6vo4hpqcb2a5
:ldoc-url: https://jirutka.github.io/{repo-name}/ldoc/

ifdef::env-github[]
image:https://travis-ci.org/{gh-name}.svg?branch={gh-branch}["Build Status", link="https://travis-ci.org/{gh-name}"]
image:https://ci.appveyor.com/api/projects/status/{appveyor-id}/branch/{gh-branch}?svg=true["Windows Build Status", link="https://ci.appveyor.com/project/jirutka/brieflz-lua"]
image:https://img.shields.io/badge/ldoc-docs-blue.svg["LDoc", link="{ldoc-url}"]
endif::env-github[]

This is a Lua binding for https://github.com/jibsen/brieflz[BriefLZ] – a small and fast open source implementation of a Lempel-Ziv style compression algorithm by Joergen Ibsen.

== Installation

You can install BriefLZ using https://luarocks.org[LuaRocks] (the Lua package manager):

[source, subs="+attributes"]
luarocks install {name}

or to get the latest development version:

[source, subs="+attributes"]
luarocks install --server=http://luarocks.org/dev {name}

Tip: If you want to bootstrap development environment for running tests, read the next section.

[NOTE]
====
If you have an old gcc version you may encounter error:

....
vendor/brieflz/src/brieflz.c: In function ‘blz_pack’:
vendor/brieflz/src/brieflz.c:466:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (unsigned long i = 0; i < LOOKUP_SIZE; ++i) {
^
....

In that case you have to explicitly enable C99 mode when installing {name}:

[source, subs="+attributes"]
luarocks install CFLAGS="-std=c99 -Os -fPIC" {name}
====

== Set up development environment

. Clone this repository:
[source, sh, subs="+attributes"]
git clone https://github.com/{gh-name}.git
cd {repo-name}

. Install Lua and modules for running tests into directory `.venv`:

./script/bootstrap

. Start hacking!

//^

* Build native extension:

./script/build

* Run tests and linter:

./script/test

== License

This project is licensed under https://opensource.org/licenses/Zlib/[zlib License].
For the full text of the license, see the link:LICENSE[LICENSE] file.