lol
1{ stdenv, fetchurl, autoreconfHook, acl }:
2
3stdenv.mkDerivation rec {
4 name = "gnutar-${version}";
5 version = "1.29";
6
7 src = fetchurl {
8 url = "mirror://gnu/tar/tar-${version}.tar.xz";
9 sha256 = "097hx7sbzp8qirl4m930lw84kn0wmxhmq7v1qpra3mrg0b8cyba0";
10 };
11
12 patches = [ ./CVE-2016-6321.patch ];
13
14 # avoid retaining reference to CF during stdenv bootstrap
15 configureFlags = stdenv.lib.optionals stdenv.isDarwin [
16 "gt_cv_func_CFPreferencesCopyAppValue=no"
17 "gt_cv_func_CFLocaleCopyCurrent=no"
18 ];
19
20 # gnutar tries to call into gettext between `fork` and `exec`,
21 # which is not safe on darwin.
22 # see http://article.gmane.org/gmane.os.macosx.fink.devel/21882
23 postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
24 substituteInPlace src/system.c --replace '_(' 'N_('
25 '';
26
27 outputs = [ "out" "info" ];
28
29 buildInputs = [ ]
30 ++ stdenv.lib.optional stdenv.isLinux acl
31 ++ stdenv.lib.optional stdenv.isDarwin autoreconfHook;
32
33 # May have some issues with root compilation because the bootstrap tool
34 # cannot be used as a login shell for now.
35 FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux" || stdenv.isSunOS) "1";
36
37 preConfigure = if stdenv.isCygwin then ''
38 sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'
39 '' else null;
40
41 meta = {
42 homepage = http://www.gnu.org/software/tar/;
43 description = "GNU implementation of the `tar' archiver";
44
45 longDescription = ''
46 The Tar program provides the ability to create tar archives, as
47 well as various other kinds of manipulation. For example, you
48 can use Tar on previously created archives to extract files, to
49 store additional files, or to update or list files which were
50 already stored.
51
52 Initially, tar archives were used to store files conveniently on
53 magnetic tape. The name "Tar" comes from this use; it stands
54 for tape archiver. Despite the utility's name, Tar can direct
55 its output to available devices, files, or other programs (using
56 pipes), it can even access remote devices or files (as
57 archives).
58 '';
59
60 license = stdenv.lib.licenses.gpl3Plus;
61
62 maintainers = [ ];
63 platforms = stdenv.lib.platforms.all;
64 };
65}