Re: [Vala] Binding 7zip library ?



On Mon, 2013-08-26 at 11:27 +0200, raum no-log org wrote:
Hello,

I've downloaded and build 7Zip library and I've these files compiled
(under Windows using MingW32, with prefix /opt) :

/src/lib7zip-1.6.5/Lib7Zip/lib7zip.a
/src/lib7zip-1.6.5/Lib7Zip/lib7zip.dll
/src/lib7zip-1.6.5/Lib7Zip/lib7zip.h

"make install" command didn't copy these files under /opt/bin,
/opt/include, /opt/library

The 7zip SDK really designed to be embedded within your project, not
used as a shared library.

I've copied manually in the correct directory but tests programs output :
# test7zip.exe
initialize fail!

So I think I've made a mistake somewhere... But how to test it with a vala
test program ? I need to build a vapi file ? something like that ?

Yes, you would need to create VAPI.  I looked at the 7zip SDK API quite
recently and I don't think creating a VAPI would be an easy task.  The
API is a bit of a mess.

I'm not sure what your use case is.  If you need to read and write *.7z
files you might want to look at libarchive—I'm not sure whether they
support 7zip or not, but if they do then it would be a much easier way
to go since it already has a VAPI.

If you just want to compress stuff you might want to take a look at a
project I've been working on called Squash [1], which does have Vala
bindings.  It is an abstraction layer for compression libraries (not
archivers—that's what libarchive is for), and it supports most of the
algorithms 7zip uses.

I do plan to write a Squash plugin for the 7zip SDK eventually [2], and
if you really need PPMD, BCJ, or BCJ2 (Squash already supports LZMA,
LZMA2, bzip2, and DEFLATE) I can take a look at that sooner rather than
later, but keep in mind that it will not support *.7z archives.

Also, if you're not tied to 7zip, you may want to look at FreeArc [3].
I don't remember if they have an API you could use or not, but the PPM
compression is better, and the other algorithms are great [4].  Or, if
all you care about is compression ratio, ZPAQ [5] (for which there is a
Squash plugin) is amazing.


-Evan

[1] http://quixdb.github.io/squash/
[2] https://github.com/quixdb/squash/issues/31
[3] http://freearc.org/
[4] http://compressionratings.com/i_freearc.html
[5] http://mattmahoney.net/dc/zpaq.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]