nixpkgs/pkgs/development/libraries/libarchive/default.nix
Franz Pletz 844748a9c9 libarchive: 3.1.2 -> 3.2.1 (security)
Fixes at least:

  * CVE-2016-4300
  * CVE-2016-4302
  * CVE-2016-4809
  * CVE-2016-5844
2016-07-10 10:50:38 +02:00

42 lines
1.3 KiB
Nix

{ fetchurl, stdenv, acl, openssl, libxml2, attr, zlib, bzip2, e2fsprogs, xz, lzo
, sharutils }:
stdenv.mkDerivation rec {
name = "libarchive-${version}";
version = "3.2.1";
src = fetchurl {
url = "${meta.homepage}/downloads/${name}.tar.gz";
sha256 = "1lngng84k1kkljl74q0cdqc3s82vn2kimfm02dgm4d6m7x71mvkj";
};
buildInputs = [ sharutils libxml2 zlib bzip2 openssl xz lzo ] ++
stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ];
# Without this, pkgconfig-based dependencies are unhappy
propagatedBuildInputs = stdenv.lib.optionals stdenv.isLinux [ attr acl ];
preBuild = if stdenv.isCygwin then ''
echo "#include <windows.h>" >> config.h
'' else null;
preFixup = ''
sed -i $out/lib/libarchive.la \
-e 's|-lcrypto|-L${openssl.out}/lib -lcrypto|' \
-e 's|-llzo2|-L${lzo}/lib -llzo2|'
'';
meta = {
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, ..
'';
homepage = http://libarchive.org;
license = stdenv.lib.licenses.bsd3;
platforms = with stdenv.lib.platforms; all;
maintainers = with stdenv.lib.maintainers; [ jcumming ];
};
}