2016-08-19 04:56:39 +01:00
|
|
|
{
|
2019-07-20 22:53:56 +01:00
|
|
|
fetchFromGitHub, stdenv, pkgconfig, autoreconfHook,
|
2016-08-19 04:56:39 +01:00
|
|
|
acl, attr, bzip2, e2fsprogs, libxml2, lzo, openssl, sharutils, xz, zlib,
|
|
|
|
|
2016-09-11 10:51:04 +01:00
|
|
|
# Optional but increases closure only negligibly.
|
|
|
|
xarSupport ? true,
|
2016-08-19 04:56:39 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert xarSupport -> libxml2 != null;
|
2009-04-22 00:18:09 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "libarchive";
|
2020-02-14 17:01:59 +00:00
|
|
|
version = "3.4.2";
|
2009-04-22 00:18:09 +01:00
|
|
|
|
2019-07-20 22:53:56 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libarchive";
|
|
|
|
repo = "libarchive";
|
|
|
|
rev = "v${version}";
|
2020-02-14 17:01:59 +00:00
|
|
|
sha256 = "0mjm77wbqs8sbn9j44lj39nwbg6anmgz6pkyfxsww54a4rs0p3iz";
|
2009-04-22 00:18:09 +01:00
|
|
|
};
|
|
|
|
|
2016-09-19 13:33:25 +01:00
|
|
|
outputs = [ "out" "lib" "dev" ];
|
|
|
|
|
2019-07-20 22:53:56 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig autoreconfHook ];
|
2016-08-19 04:56:39 +01: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 04:29:30 +01:00
|
|
|
# Without this, pkgconfig-based dependencies are unhappy
|
|
|
|
propagatedBuildInputs = stdenv.lib.optionals stdenv.isLinux [ attr acl ];
|
|
|
|
|
2016-08-19 04:56:39 +01: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 04:20:18 +01:00
|
|
|
doCheck = false; # fails
|
|
|
|
|
2015-07-28 14:22:40 +01:00
|
|
|
preFixup = ''
|
2016-09-19 13:33:25 +01:00
|
|
|
sed -i $lib/lib/libarchive.la \
|
2015-10-15 00:07:37 +01:00
|
|
|
-e 's|-lcrypto|-L${openssl.out}/lib -lcrypto|' \
|
2015-09-25 13:06:23 +01:00
|
|
|
-e 's|-llzo2|-L${lzo}/lib -llzo2|'
|
2015-07-28 14:22:40 +01:00
|
|
|
'';
|
|
|
|
|
2018-06-04 13:48:39 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
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
|
2016-09-19 13:33:25 +01:00
|
|
|
compressed with gzip, bzip2, lzma, xz, ...
|
2012-10-21 06:17:14 +01:00
|
|
|
'';
|
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
|
|
|
};
|
|
|
|
}
|