www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - std.sevenzip - Do you need it?

reply "data man" <datamanrb gmail.com> writes:
Right now I'm working on std.sevenzip (7-zip by Igor Pavlov).

The main features of 7-Zip:
- High compression ratio in 7z format with LZMA and LZMA2 
compression
- Supported formats:
   - Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
   - Unpacking only: ARJ, CAB, CHM, CPIO, CramFS, DEB, DMG, FAT, 
HFS, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, RAR, RPM, SquashFS, 
UDF, VHD, WIM, XAR and Z.
   - For ZIP and GZIP formats, 7-Zip provides a compression ratio 
that is 2-10 % better than the ratio provided by PKZip and WinZip
- Strong AES-256 encryption in 7z and ZIP formats

Why are there - everybody knows it :-)

My question is: how best to do - one big module std.sevenzip or 
divided into sub-modules:

std.sevenzip.aes
std.sevenzip.lzma
std.sevenzip.lzma2
std.sevenzip.ppmd
std.sevenzip.sha256
std.sevenzip.xz
...etc.

Or there is the issue of the license? 
(http://7-zip.org/license.txt)
Jan 30 2015
next sibling parent reply Max Klyga <max.klyga gmail.com> writes:
On 2015-01-30 16:01:27 +0000, data man said:

 Right now I'm working on std.sevenzip (7-zip by Igor Pavlov).
 
 The main features of 7-Zip:
 - High compression ratio in 7z format with LZMA and LZMA2 compression
 - Supported formats:
    - Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
    - Unpacking only: ARJ, CAB, CHM, CPIO, CramFS, DEB, DMG, FAT, HFS, 
 ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, RAR, RPM, SquashFS, UDF, VHD, 
 WIM, XAR and Z.
    - For ZIP and GZIP formats, 7-Zip provides a compression ratio that 
 is 2-10 % better than the ratio provided by PKZip and WinZip
 - Strong AES-256 encryption in 7z and ZIP formats
 
 Why are there - everybody knows it :-)
 
 My question is: how best to do - one big module std.sevenzip or divided 
 into sub-modules:
 
 std.sevenzip.aes
 std.sevenzip.lzma
 std.sevenzip.lzma2
 std.sevenzip.ppmd
 std.sevenzip.sha256
 std.sevenzip.xz
 ...etc.
 
 Or there is the issue of the license? (http://7-zip.org/license.txt)
Is this a port or binding for some existing library? Also all phobos submissions must be Boost licenced. If this is a binding or code cannot be relicenced this might better be suited for inclusion in DUB registry
Jan 30 2015
next sibling parent reply FG <home fgda.pl> writes:
On 2015-01-30 at 19:12, Max Klyga wrote:
 Is this a port or binding for some existing library?
 Also all phobos submissions must be Boost licenced.

 If this is a binding or code cannot be relicenced this might better be suited
for inclusion in DUB registry
I wonder if it would be possible to get special license terms for the use of 7zip in Phobos. LGPL is not compatible with the Boost License. Suppose that you write a closed-source application. Apart from having to inform about the use of an LGPL library in the application, LGPL requires that you allow the user to relink the application with a modified version of the library. That pretty much implies that the application has to be dynamically linked, because if it can't, things become quite problematic. Therefore, sadly, code from 7zip is unlikely to get into the standard library.
Jan 30 2015
parent reply "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
On Fri, Jan 30, 2015 at 08:30:02PM +0100, FG via Digitalmars-d wrote:
 On 2015-01-30 at 19:12, Max Klyga wrote:
Is this a port or binding for some existing library?
Also all phobos submissions must be Boost licenced.

If this is a binding or code cannot be relicenced this might better
be suited for inclusion in DUB registry
I wonder if it would be possible to get special license terms for the use of 7zip in Phobos. LGPL is not compatible with the Boost License. Suppose that you write a closed-source application. Apart from having to inform about the use of an LGPL library in the application, LGPL requires that you allow the user to relink the application with a modified version of the library. That pretty much implies that the application has to be dynamically linked, because if it can't, things become quite problematic. Therefore, sadly, code from 7zip is unlikely to get into the standard library.
OTOH, wouldn't a clean-room reimplementation of it be permissible? (And perhaps even desirable, since it can then take advantage of D instead of just wrapping around C/C++ code?) T -- Political correctness: socially-sanctioned hypocrisy.
Jan 30 2015
parent reply FG <home fgda.pl> writes:
On 2015-01-30 at 20:39, H. S. Teoh via Digitalmars-d wrote:
 OTOH, wouldn't a clean-room reimplementation of it be permissible? (And
 perhaps even desirable, since it can then take advantage of D instead of
 just wrapping around C/C++ code?)
Maybe clean-room won't be necessary. We were looking in the wrong place. There is http://www.7-zip.org/sdk.html - which is in public domain, and contains LZMA, LZMA2, and XZ compression and decompression algorithms in C, plus a C/C++ minimal utility for handling 7z files. It probably doesn't handle encryption and definitely doesn't cover other archive formats supported by 7-zip (the application). Well, screw RAR, because no-one is allowed to write a compressor anyway, but add support for TAR and perhaps BZIP2 and we should be quite happy. And, if someone was willing to implement DEFLATE, even using zlib wouldn't be required any more (which some don't like, as mentioned below). :) On 2015-01-30 at 21:34, Brad Anderson wrote:
 As other said, the license is an issue but even if it weren't people are
pretty opposed to including third party libraries in Phobos these days. The
inclusion of zlib and (especially) curl are often considered a mistake.

 I'm mostly of the opinion that we should be relying less on Phobos and more on
dub going forward. sevenzip would be a great addition to the dub registry.
Jan 30 2015
parent "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= writes:
On Friday, 30 January 2015 at 20:44:52 UTC, FG wrote:
 and we should be quite happy. And, if someone was willing to 
 implement DEFLATE, even using zlib wouldn't be required any 
 more (which some don't like, as mentioned below). :)
Haven't used it, but public domain deflate: https://code.google.com/p/miniz/ Just search for "public domain compression" and you'll find starting points: https://www.google.no/?q=public%20domain%20compression
Jan 30 2015
prev sibling parent "data man" <datamanrb gmail.com> writes:
On Friday, 30 January 2015 at 18:12:43 UTC, Max Klyga wrote:

 Is this a port or binding for some existing library?
Statically linked.
Jan 31 2015
prev sibling next sibling parent reply "Brad Anderson" <eco gnuk.net> writes:
On Friday, 30 January 2015 at 16:01:29 UTC, data man wrote:
 [snip]
 Or there is the issue of the license? 
 (http://7-zip.org/license.txt)
As other said, the license is an issue but even if it weren't people are pretty opposed to including third party libraries in Phobos these days. The inclusion of zlib and (especially) curl are often considered a mistake. I'm mostly of the opinion that we should be relying less on Phobos and more on dub going forward. sevenzip would be a great addition to the dub registry.
Jan 30 2015
parent reply "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"Brad Anderson"  wrote in message 
news:vqkaztokcfgdbykbilxc forum.dlang.org...

 I'm mostly of the opinion that we should be relying less on Phobos and 
 more on dub going forward. sevenzip would be a great addition to the dub 
 registry.
Yes please.
Jan 30 2015
parent "MrSmith" <mrsmith33 yandex.ru> writes:
On Saturday, 31 January 2015 at 04:30:06 UTC, Daniel Murphy wrote:
 "Brad Anderson"  wrote in message 
 news:vqkaztokcfgdbykbilxc forum.dlang.org...

 I'm mostly of the opinion that we should be relying less on 
 Phobos and more on dub going forward. sevenzip would be a 
 great addition to the dub registry.
Yes please.
+1
Jan 31 2015
prev sibling next sibling parent ketmar <ketmar ketmar.no-ip.org> writes:
On Fri, 30 Jan 2015 16:01:27 +0000, data man wrote:

 Right now I'm working on std.sevenzip (7-zip by Igor Pavlov).
is it bindings or complete port?
 My question is: how best to do - one big module std.sevenzip or divided
 into sub-modules:
submodules. don't aim Phobos inclusion from the start. choose your own namespace and=20 work with it. then release the thing, than have two years of discussion,=20 and only then you maybe get to `std.experimental`. ;-)=
Jan 30 2015
prev sibling next sibling parent reply "data man" <datamanrb gmail.com> writes:
Thanks for the feedback!
And DUB supports the compilation of external С-code?
Jan 31 2015
parent Jacob Carlborg <doob me.com> writes:
On 2015-01-31 13:02, data man wrote:
 Thanks for the feedback!
 And DUB supports the compilation of external С-code?
No, but you can execute shell commands before building the D code. There are four settings [1] that could be of interest: * preGenerateCommands * postGenerateCommands * preBuildCommands * postBuildCommands [1] http://code.dlang.org/package-format#build-settings -- /Jacob Carlborg
Jan 31 2015
prev sibling parent "Suliman" <evermind live.ru> writes:
Is there any progress? I need 7zip lib for my project.
Mar 25 2015