2016-08-19 05:56:39 +02:00
|
|
|
{
|
2016-09-11 12:02:08 +02:00
|
|
|
fetchurl, stdenv, pkgconfig,
|
2016-08-19 05:56:39 +02:00
|
|
|
acl, attr, bzip2, e2fsprogs, libxml2, lzo, openssl, sharutils, xz, zlib,
|
|
|
|
|
2016-09-11 11:51:04 +02:00
|
|
|
# Optional but increases closure only negligibly.
|
|
|
|
xarSupport ? true,
|
2016-08-19 05:56:39 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert xarSupport -> libxml2 != null;
|
2009-04-22 01:18:09 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-07-10 00:26:41 +02:00
|
|
|
name = "libarchive-${version}";
|
2016-11-24 01:17:03 +01:00
|
|
|
version = "3.2.2";
|
2009-04-22 01:18:09 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-07-10 00:26:41 +02:00
|
|
|
url = "${meta.homepage}/downloads/${name}.tar.gz";
|
2016-11-24 01:17:03 +01:00
|
|
|
sha256 = "03q6y428rg723c9fj1vidzjw46w1vf8z0h95lkvz1l9jw571j739";
|
2009-04-22 01:18:09 +02:00
|
|
|
};
|
|
|
|
|
2017-01-31 17:00:13 +01:00
|
|
|
patches = [
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://github.com/libarchive/libarchive/commit/98dcbbf0bf4854bf987557e55e55fff7abbf3ea9.patch";
|
|
|
|
sha256 = "1934krf5imc9rq1av6immpsfn77pglanhz1csq8j22h9ab87n5z6";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2016-09-19 14:33:25 +02:00
|
|
|
outputs = [ "out" "lib" "dev" ];
|
|
|
|
|
2016-09-11 12:02:08 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2016-08-19 05:56:39 +02:00
|
|
|
buildInputs = [ sharutils zlib bzip2 openssl xz lzo ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ]
|
|
|
|
++ stdenv.lib.optional xarSupport libxml2;
|
2011-03-25 13:55:22 +01:00
|
|
|
|
2016-04-29 05:29:30 +02:00
|
|
|
# Without this, pkgconfig-based dependencies are unhappy
|
|
|
|
propagatedBuildInputs = stdenv.lib.optionals stdenv.isLinux [ attr acl ];
|
|
|
|
|
2016-08-19 05:56:39 +02:00
|
|
|
configureFlags = stdenv.lib.optional (!xarSupport) "--without-xml2";
|
|
|
|
|
2014-10-29 23:45:15 +01:00
|
|
|
preBuild = if stdenv.isCygwin then ''
|
|
|
|
echo "#include <windows.h>" >> config.h
|
|
|
|
'' else null;
|
|
|
|
|
2015-07-28 15:22:40 +02:00
|
|
|
preFixup = ''
|
2016-09-19 14:33:25 +02:00
|
|
|
sed -i $lib/lib/libarchive.la \
|
2015-10-15 01:07:37 +02:00
|
|
|
-e 's|-lcrypto|-L${openssl.out}/lib -lcrypto|' \
|
2015-09-25 14:06:23 +02:00
|
|
|
-e 's|-llzo2|-L${lzo}/lib -llzo2|'
|
2015-07-28 15:22:40 +02:00
|
|
|
'';
|
|
|
|
|
2009-04-22 01:18:09 +02:00
|
|
|
meta = {
|
2012-10-21 07:17:14 +02:00
|
|
|
description = "Multi-format archive and compression library";
|
|
|
|
longDescription = ''
|
|
|
|
This library has code for detecting and reading many archive formats and
|
|
|
|
compressions formats including (but not limited to) tar, shar, cpio, zip, and
|
2016-09-19 14:33:25 +02:00
|
|
|
compressed with gzip, bzip2, lzma, xz, ...
|
2012-10-21 07:17:14 +02:00
|
|
|
'';
|
2013-06-29 17:10:14 +02:00
|
|
|
homepage = http://libarchive.org;
|
2012-10-21 07:17:14 +02:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
platforms = with stdenv.lib.platforms; all;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ jcumming ];
|
2009-04-22 01:18:09 +02:00
|
|
|
};
|
|
|
|
}
|