2015-09-24 04:49:03 +01:00
|
|
|
{ fetchurl, stdenv, acl, openssl, libxml2, attr, zlib, bzip2, e2fsprogs, xz, lzo
|
2012-04-19 22:40:07 +01:00
|
|
|
, sharutils }:
|
2009-04-22 00:18:09 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2013-06-29 16:10:14 +01:00
|
|
|
name = "libarchive-3.1.2";
|
2009-04-22 00:18:09 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-02-01 00:44:39 +00:00
|
|
|
urls = [
|
|
|
|
"http://pkgs.fedoraproject.org/repo/pkgs/libarchive/libarchive-3.1.2.tar.gz/efad5a503f66329bb9d2f4308b5de98a/${name}.tar.gz"
|
|
|
|
"${meta.homepage}/downloads/${name}.tar.gz"
|
|
|
|
];
|
2013-06-29 16:10:14 +01:00
|
|
|
sha256 = "0pixqnrcf35dnqgv0lp7qlcw7k13620qkhgxr288v7p4iz6ym1zb";
|
2009-04-22 00:18:09 +01:00
|
|
|
};
|
|
|
|
|
2014-04-21 16:56:39 +01:00
|
|
|
patches = [
|
|
|
|
./CVE-2013-0211.patch # https://github.com/libarchive/libarchive/commit/22531545
|
2015-06-16 17:34:18 +01:00
|
|
|
./CVE-2015-1197.patch # https://github.com/NixOS/nixpkgs/issues/6799
|
2015-09-09 09:03:35 +01:00
|
|
|
# ^ it's CVE-2015-2304 specific to libarchive
|
2014-04-21 16:56:39 +01:00
|
|
|
];
|
2014-02-06 19:59:04 +00:00
|
|
|
|
2015-09-24 04:49:03 +01:00
|
|
|
buildInputs = [ sharutils libxml2 zlib bzip2 openssl xz lzo ] ++
|
2012-04-19 22:40:07 +01:00
|
|
|
stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ];
|
2011-03-25 12:55:22 +00:00
|
|
|
|
2014-10-29 22:45:15 +00:00
|
|
|
preBuild = if stdenv.isCygwin then ''
|
|
|
|
echo "#include <windows.h>" >> config.h
|
|
|
|
'' else null;
|
|
|
|
|
2015-07-28 14:22:40 +01:00
|
|
|
preFixup = ''
|
2015-09-25 13:06:23 +01:00
|
|
|
sed -i $out/lib/libarchive.la \
|
|
|
|
-e 's|-lcrypto|-L${openssl}/lib -lcrypto|' \
|
|
|
|
-e 's|-llzo2|-L${lzo}/lib -llzo2|'
|
2015-07-28 14:22:40 +01:00
|
|
|
'';
|
|
|
|
|
2009-04-22 00:18:09 +01:00
|
|
|
meta = {
|
2012-10-21 06:17:14 +01: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
|
|
|
|
compressed with gzip, bzip2, lzma, xz, ..
|
|
|
|
'';
|
2013-06-29 16:10:14 +01:00
|
|
|
homepage = http://libarchive.org;
|
2012-10-21 06:17:14 +01:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
platforms = with stdenv.lib.platforms; all;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ jcumming ];
|
2009-04-22 00:18:09 +01:00
|
|
|
};
|
|
|
|
}
|