diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/archivers')
-rw-r--r-- | nixpkgs/pkgs/tools/archivers/afio/default.nix | 12 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/archivers/p7zip/default.nix | 26 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/archivers/unar/default.nix | 59 |
3 files changed, 61 insertions, 36 deletions
diff --git a/nixpkgs/pkgs/tools/archivers/afio/default.nix b/nixpkgs/pkgs/tools/archivers/afio/default.nix index e2fe3d90ee6c..3b4eb6a5ea56 100644 --- a/nixpkgs/pkgs/tools/archivers/afio/default.nix +++ b/nixpkgs/pkgs/tools/archivers/afio/default.nix @@ -1,12 +1,14 @@ -{ stdenv, fetchurl } : +{ stdenv, fetchFromGitHub } : stdenv.mkDerivation rec { version = "2.5.2"; pname = "afio"; - src = fetchurl { - url = "http://members.chello.nl/~k.holtman/${pname}-${version}.tgz"; - sha256 = "1fa29wlqv76hzf8bxp1qpza1r23pm2f3m7rcf0jpwm6z150s2k66"; + src = fetchFromGitHub { + owner = "kholtman"; + repo = "afio"; + rev = "v${version}"; + sha256 = "1vbxl66r5rp5a1qssjrkfsjqjjgld1cq57c871gd0m4qiq9rmcfy"; }; /* @@ -18,7 +20,7 @@ stdenv.mkDerivation rec { installFlags = [ "DESTDIR=$(out)" ]; meta = { - homepage = "http://members.chello.nl/~k.holtman/afio.html"; + homepage = "https://github.com/kholtman/afio"; description = "Fault tolerant cpio archiver targeting backups"; platforms = stdenv.lib.platforms.all; /* diff --git a/nixpkgs/pkgs/tools/archivers/p7zip/default.nix b/nixpkgs/pkgs/tools/archivers/p7zip/default.nix index f44791ce021b..d6ad699eaa8d 100644 --- a/nixpkgs/pkgs/tools/archivers/p7zip/default.nix +++ b/nixpkgs/pkgs/tools/archivers/p7zip/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, fetchpatch, lib, enableUnfree ? false }: stdenv.mkDerivation rec { pname = "p7zip"; @@ -12,6 +12,16 @@ stdenv.mkDerivation rec { patches = [ ./12-CVE-2016-9296.patch ./13-CVE-2017-17969.patch + (fetchpatch { + name = "3-CVE-2018-5996.patch"; + url = "https://raw.githubusercontent.com/termux/termux-packages/master/packages/p7zip/3-CVE-2018-5996.patch"; + sha256 = "1zivvkazmza0653i498ccp3zbpbpc7dvxl3zxwllbx41b6n589yp"; + }) + (fetchpatch { + name = "4-CVE-2018-10115.patch"; + url = "https://raw.githubusercontent.com/termux/termux-packages/master/packages/p7zip/4-CVE-2018-10115.patch"; + sha256 = "1cr7q8gnrk9yp6dcvxaqi1yhdbgp964nkv65ls41mw1kdfm44zn6"; + }) ]; # Default makefile is full of impurities on Darwin. The patch doesn't hurt Linux so I'm leaving it unconditional @@ -24,6 +34,11 @@ stdenv.mkDerivation rec { substituteInPlace makefile.machine \ --replace 'CC=gcc' 'CC=${stdenv.cc.targetPrefix}gcc' \ --replace 'CXX=g++' 'CXX=${stdenv.cc.targetPrefix}g++' + '' + lib.optionalString (!enableUnfree) '' + # Remove non-free RAR source code + # (see DOC/License.txt, https://fedoraproject.org/wiki/Licensing:Unrar) + rm -r CPP/7zip/Compress/Rar* + find . -name makefile'*' -exec sed -i '/Rar/d' {} + ''; preConfigure = '' @@ -42,9 +57,14 @@ stdenv.mkDerivation rec { meta = { homepage = "http://p7zip.sourceforge.net/"; description = "A port of the 7-zip archiver"; - # license = stdenv.lib.licenses.lgpl21Plus; + "unRAR restriction" platforms = stdenv.lib.platforms.unix; maintainers = [ stdenv.lib.maintainers.raskin ]; - license = stdenv.lib.licenses.lgpl2Plus; + knownVulnerabilities = [ + # p7zip is abandoned, according to this thread on its forums: + # https://sourceforge.net/p/p7zip/discussion/383043/thread/fa143cf2/#1817 + "p7zip is abandoned and may not receive important security fixes" + ]; + # RAR code is under non-free UnRAR license, but we remove it + license = if enableUnfree then lib.licenses.unfree else lib.licenses.lgpl2Plus; }; } diff --git a/nixpkgs/pkgs/tools/archivers/unar/default.nix b/nixpkgs/pkgs/tools/archivers/unar/default.nix index 259238cdec5e..9fdbada9ab8d 100644 --- a/nixpkgs/pkgs/tools/archivers/unar/default.nix +++ b/nixpkgs/pkgs/tools/archivers/unar/default.nix @@ -1,52 +1,54 @@ -{ stdenv, fetchurl, gnustep, unzip, bzip2, zlib, icu, openssl }: +{ stdenv, fetchFromGitHub, installShellFiles, gnustep, bzip2, zlib, icu, openssl, wavpack }: -let +stdenv.mkDerivation rec { pname = "unar"; + version = "1.10.7"; -in stdenv.mkDerivation rec { - name = "${pname}-${version}"; - version = "1.10.1"; - - src = fetchurl { - url = "http://unarchiver.c3.cx/downloads/${pname}${version}_src.zip"; - sha256 = "0aq9zlar5vzr5qxphws8dm7ax60bsfsw77f4ciwa5dq5lla715j0"; + src = fetchFromGitHub { + owner = "MacPaw"; + # the unar repo contains a shallow clone of both XADMaster and universal-detector + repo = "unar"; + rev = "v${version}"; + sha256 = "0p846q1l66k3rnd512sncp26zpv411b8ahi145sghfcsz9w8abc4"; }; - buildInputs = [ gnustep.base bzip2 icu openssl zlib ]; - - nativeBuildInputs = [ gnustep.make unzip ]; - - enableParallelBuilding = true; - postPatch = '' for f in Makefile.linux ../UniversalDetector/Makefile.linux ; do substituteInPlace $f \ - --replace "CC = gcc" "CC=cc" \ - --replace "CXX = g++" "CXX=c++" \ - --replace "OBJCC = gcc" "OBJCC=cc" \ - --replace "OBJCXX = g++" "OBJCXX=c++" + --replace "= gcc" "=cc" \ + --replace "= g++" "=c++" done + + # we need to build inside this directory as well, so we have to make it writeable + chmod +w ../UniversalDetector -R ''; + buildInputs = [ gnustep.base bzip2 icu openssl wavpack zlib ]; + + nativeBuildInputs = [ gnustep.make installShellFiles ]; + + enableParallelBuilding = true; + + dontConfigure = true; + makefile = "Makefile.linux"; - sourceRoot = "./The Unarchiver/XADMaster"; + sourceRoot = "./source/XADMaster"; installPhase = '' runHook preInstall - install -Dm755 -t $out/bin lsar unar - install -Dm644 -t $out/share/man/man1 ../Extra/{lsar,unar}.1 - - mkdir -p $out/etc/bash_completion.d - cp ../Extra/lsar.bash_completion $out/etc/bash_completion.d/lsar - cp ../Extra/unar.bash_completion $out/etc/bash_completion.d/unar + install -Dm555 -t $out/bin lsar unar + for f in lsar unar; do + installManPage ./Extra/$f.? + installShellCompletion --bash --name $f ./Extra/$f.bash_completion + done runHook postInstall ''; meta = with stdenv.lib; { - homepage = "http://unarchiver.c3.cx/unarchiver"; + homepage = "https://theunarchiver.com"; description = "An archive unpacker program"; longDescription = '' The Unarchiver is an archive unpacker program with support for the popular \ @@ -55,7 +57,8 @@ in stdenv.mkDerivation rec { Compact Pro, Packit, cpio, compress (.Z), ARJ, ARC, PAK, ACE, ZOO, LZH, \ ADF, DMS, LZX, PowerPacker, LBR, Squeeze, Crunch, and other old formats. ''; - license = with licenses; [ lgpl21Plus ]; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ peterhoeg ]; platforms = with platforms; linux; }; } |