setup.exe: Support xz and lzma decompression via liblzma

Charles Wilson cygwin@cwilson.fastmail.fm
Thu Mar 11 04:41:00 GMT 2010


Ok, here's the long-awaited xz support for setup.exe. It links against
the mingw-liblzma-devel package, which provides the static liblzma.a for
native apps.

Sadly, when compiled for native win32, liblzma is firmly in the "msvc"
camp: no auto-import. Therefore, when mingw/msvc the header files by
default decorate all symbols with declspec(dllimport) -- to link
statically you have to #define LZMA_API_STATIC when compiling.  Also,
when you use libtool to link, -Wl,-static doesn't do what you think when
there is a .la file present.  libtool turns -llzma+liblzma.la into
/full/path/to/liblzma.dll.a -- so -Wl,-static has no effect on that
particular lib.  Instead, you have to tell *libtool* that you want to
link statically.  So, I added -DLZMA_API_STATIC to AM_CPPFLAGS and
-static-libtool-libs to setup_LDFLAGS for just these reasons.

As posted, compress_xz.cc has a small number of msg() calls, which send
information to OutputDebugString. Some of these might need to be changed
to note() [e.g. MessageBox] or maybe removed entirely.  Or left as is.
Opinions?


I've put a small (230k) test tree here:
http://cygwin.cwilson.fastmail.fm/ITP/test-tree.tar.bz2

test/release/
test/release/test-data/
test/release/test-data/setup.hint
test/release/test-data/test-data-0.1-2-src.tar.xz
test/release/test-data/test-data-0.1-2.tar.xz
test/release/test-data2/
test/release/test-data2/setup.hint
test/release/test-data2/test-data2-1.0-1-src.tar.lzma
test/release/test-data2/test-data2-1.0-1.tar.lzma
test/setup.ini

2010-03-10  Charles Wilson  <...>

	Support xz and lzma decompression via liblzma
	* Makefile.am: Add -DLZMA_API_STATIC to AM_CPPFLAGS,
	-lzma to setup_LDADD, and -static-libtool-libs to
	setup_LDFLAGS. Update setup_SOURCES.
 	* compress.cc: Update includes.
	(compress::decompress): Use compress_xz rather than
	compress_lzma; compress_xz supports both xz and lzma
	decompression.
	* compress_lzma.h: Removed.
	* compress_lzma.cc: Removed.
 	* lzma-sdk/LzmaDec.c: Removed.
 	* lzma-sdk/LzmaDec.h: Removed.
	* lzma-sdk/Types.h: Removed.
	* compress_xz.h: New.
	* compress_xz.cc: New.

Enjoy...

--
Chuck
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xz-support-changed-p0.patch
Type: text/x-patch
Size: 2881 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20100311/97b9d8d4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xz-support-new-files-p1.patch.bz2
Type: application/octet-stream
Size: 5038 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20100311/97b9d8d4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xz-support-removed-files-p1.patch.bz2
Type: application/octet-stream
Size: 11362 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20100311/97b9d8d4/attachment-0001.obj>


More information about the Cygwin-apps mailing list