2016-08-19 03:56:39 +00:00
|
|
|
{
|
2018-06-03 17:59:43 +00:00
|
|
|
fetchurl, fetchpatch, stdenv, pkgconfig,
|
2016-08-19 03:56:39 +00:00
|
|
|
acl, attr, bzip2, e2fsprogs, libxml2, lzo, openssl, sharutils, xz, zlib,
|
|
|
|
|
2016-09-11 09:51:04 +00:00
|
|
|
# Optional but increases closure only negligibly.
|
|
|
|
xarSupport ? true,
|
2016-08-19 03:56:39 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert xarSupport -> libxml2 != null;
|
2009-04-21 23:18:09 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-07-09 22:26:41 +00:00
|
|
|
name = "libarchive-${version}";
|
2018-11-01 11:45:04 +00:00
|
|
|
version = "3.3.3";
|
2009-04-21 23:18:09 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-07-09 22:26:41 +00:00
|
|
|
url = "${meta.homepage}/downloads/${name}.tar.gz";
|
2018-11-01 11:45:04 +00:00
|
|
|
sha256 = "0bhfncid058p7n1n8v29l6wxm3mhdqfassscihbsxfwz3iwb2zms";
|
2009-04-21 23:18:09 +00:00
|
|
|
};
|
|
|
|
|
2019-03-10 08:52:14 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# details: https://github.com/libarchive/libarchive/pull/1105
|
|
|
|
name = "cve-2018-1000877.diff"; # CVE-2018-1000877..80
|
|
|
|
url = "https://github.com/libarchive/libarchive/pull/1105.diff";
|
|
|
|
sha256 = "0mxcawfdy9m40mykzwhkl39a6vnh4ypgy0ipcz74qm4bi72x0gyf";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
# details: https://github.com/libarchive/libarchive/pull/1120
|
|
|
|
name = "cve-2019-1000019_cve-2019-1000020.diff";
|
|
|
|
url = "https://github.com/libarchive/libarchive/pull/1120.diff";
|
|
|
|
sha256 = "1mgx92v8hm7hw9j34nbfriqfkxshh3cy25rhavr7kl7lz4x5a6g4";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2016-09-19 12:33:25 +00:00
|
|
|
outputs = [ "out" "lib" "dev" ];
|
|
|
|
|
2016-09-11 10:02:08 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2016-08-19 03:56:39 +00:00
|
|
|
buildInputs = [ sharutils zlib bzip2 openssl xz lzo ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ]
|
|
|
|
++ stdenv.lib.optional xarSupport libxml2;
|
2011-03-25 12:55:22 +00:00
|
|
|
|
2016-04-29 03:29:30 +00:00
|
|
|
# Without this, pkgconfig-based dependencies are unhappy
|
|
|
|
propagatedBuildInputs = stdenv.lib.optionals stdenv.isLinux [ attr acl ];
|
|
|
|
|
2016-08-19 03:56:39 +00:00
|
|
|
configureFlags = stdenv.lib.optional (!xarSupport) "--without-xml2";
|
|
|
|
|
2014-10-29 22:45:15 +00:00
|
|
|
preBuild = if stdenv.isCygwin then ''
|
|
|
|
echo "#include <windows.h>" >> config.h
|
|
|
|
'' else null;
|
|
|
|
|
2018-04-25 03:20:18 +00:00
|
|
|
doCheck = false; # fails
|
|
|
|
|
2015-07-28 13:22:40 +00:00
|
|
|
preFixup = ''
|
2016-09-19 12:33:25 +00:00
|
|
|
sed -i $lib/lib/libarchive.la \
|
2015-10-14 23:07:37 +00:00
|
|
|
-e 's|-lcrypto|-L${openssl.out}/lib -lcrypto|' \
|
2015-09-25 12:06:23 +00:00
|
|
|
-e 's|-llzo2|-L${lzo}/lib -llzo2|'
|
2015-07-28 13:22:40 +00:00
|
|
|
'';
|
|
|
|
|
2018-06-04 12:48:39 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2009-04-21 23:18:09 +00:00
|
|
|
meta = {
|
2012-10-21 05:17:14 +00: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 12:33:25 +00:00
|
|
|
compressed with gzip, bzip2, lzma, xz, ...
|
2012-10-21 05:17:14 +00:00
|
|
|
'';
|
2013-06-29 15:10:14 +00:00
|
|
|
homepage = http://libarchive.org;
|
2012-10-21 05:17:14 +00:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
platforms = with stdenv.lib.platforms; all;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ jcumming ];
|
2009-04-21 23:18:09 +00:00
|
|
|
};
|
|
|
|
}
|