diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/archivers')
17 files changed, 167 insertions, 56 deletions
diff --git a/nixpkgs/pkgs/tools/archivers/7zz/default.nix b/nixpkgs/pkgs/tools/archivers/7zz/default.nix index c4ccae0272eb..150230f775a4 100644 --- a/nixpkgs/pkgs/tools/archivers/7zz/default.nix +++ b/nixpkgs/pkgs/tools/archivers/7zz/default.nix @@ -2,32 +2,37 @@ , lib , fetchurl + # Only used for Linux's x86/x86_64 , uasm -, useUasm ? stdenv.isx86_64 +, useUasm ? (stdenv.isLinux && stdenv.hostPlatform.isx86) # RAR code is under non-free unRAR license # see the meta.license section below for more details , enableUnfree ? false + + # For tests +, _7zz +, testers }: let - inherit (stdenv.hostPlatform) system; - platformSuffix = - if useUasm then - { - x86_64-linux = "_x64"; - }.${system} or (throw "`useUasm` is not supported for system ${system}") - else ""; + makefile = { + aarch64-darwin = "../../cmpl_mac_arm64.mak"; + x86_64-darwin = "../../cmpl_mac_x64.mak"; + aarch64-linux = "../../cmpl_gcc_arm64.mak"; + i686-linux = "../../cmpl_gcc_x86.mak"; + x86_64-linux = "../../cmpl_gcc_x64.mak"; + }.${stdenv.hostPlatform.system} or "../../cmpl_gcc.mak"; # generic build in stdenv.mkDerivation rec { pname = "7zz"; - version = "21.07"; + version = "22.01"; src = fetchurl { url = "https://7-zip.org/a/7z${lib.replaceStrings [ "." ] [ "" ] version}-src.tar.xz"; - sha256 = { - free = "sha256-SMM6kQ6AZ05s4miJjMoE4NnsXQ0tlkdWx0q2HKjhaM8="; - unfree = "sha256-IT1ZRAfLjvy6NmELFSykkh7aFBYzELQ5A9E+aDE+Hjk="; + hash = { + free = "sha256-mp3cFXOEiVptkUdD1+X8XxwoJhBGs+Ns5qk3HBByfLg="; + unfree = "sha256-OTCYcwxwBCOSr4CJF+dllF3CQ33ueq48/MSWbrkg+8U="; }.${if enableUnfree then "unfree" else "free"}; downloadToTemp = (!enableUnfree); # remove the unRAR related code from the src drv @@ -46,39 +51,52 @@ stdenv.mkDerivation rec { ''; }; - sourceRoot = "CPP/7zip/Bundles/Alone2"; + sourceRoot = "."; + + patches = [ ./fix-build-on-darwin.patch ]; + patchFlags = [ "-p0" ]; + + NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ + "-Wno-deprecated-copy-dtor" + ]; + + inherit makefile; makeFlags = - lib.optionals useUasm [ "MY_ASM=uasm" ] ++ + [ + "CC=${stdenv.cc.targetPrefix}cc" + "CXX=${stdenv.cc.targetPrefix}c++" + ] + ++ lib.optionals useUasm [ "MY_ASM=uasm" ] + # We need at minimum 10.13 here because of utimensat, however since + # we need a bump anyway, let's set the same minimum version as the one in + # aarch64-darwin so we don't need additional changes for it + ++ lib.optionals stdenv.isDarwin [ "MACOSX_DEPLOYMENT_TARGET=10.16" ] # it's the compression code with the restriction, see DOC/License.txt - lib.optionals (!enableUnfree) [ "DISABLE_RAR_COMPRESS=true" ]; - - makefile = "../../cmpl_gcc${platformSuffix}.mak"; + ++ lib.optionals (!enableUnfree) [ "DISABLE_RAR_COMPRESS=true" ]; nativeBuildInputs = lib.optionals useUasm [ uasm ]; enableParallelBuilding = true; + preBuild = "cd CPP/7zip/Bundles/Alone2"; + installPhase = '' runHook preInstall - install -Dm555 -t $out/bin b/g${platformSuffix}/7zz + install -Dm555 -t $out/bin b/*/7zz install -Dm444 -t $out/share/doc/${pname} ../../../../DOC/*.txt runHook postInstall ''; - doInstallCheck = true; - - installCheckPhase = '' - runHook preInstallCheck - - $out/bin/7zz --help | grep ${version} - - runHook postInstallCheck - ''; - - passthru.updateScript = ./update.sh; + passthru = { + updateScript = ./update.sh; + tests.version = testers.testVersion { + package = _7zz; + command = "7zz --help"; + }; + }; meta = with lib; { description = "Command line archiver utility"; @@ -91,7 +109,7 @@ stdenv.mkDerivation rec { # the unRAR compression code is disabled by default lib.optionals enableUnfree [ unfree ]; maintainers = with maintainers; [ anna328p peterhoeg jk ]; - platforms = platforms.linux; + platforms = platforms.unix; mainProgram = "7zz"; }; } diff --git a/nixpkgs/pkgs/tools/archivers/7zz/fix-build-on-darwin.patch b/nixpkgs/pkgs/tools/archivers/7zz/fix-build-on-darwin.patch new file mode 100644 index 000000000000..9d8ee7f9bc60 --- /dev/null +++ b/nixpkgs/pkgs/tools/archivers/7zz/fix-build-on-darwin.patch @@ -0,0 +1,24 @@ +diff -Naur CPP/7zip/Common/FileStreams.cpp CPP/7zip/Common/FileStreams.cpp +--- CPP/7zip/Common/FileStreams.cpp ++++ CPP/7zip/Common/FileStreams.cpp +@@ -12,7 +12,7 @@ + #include <pwd.h> + + // for major()/minor(): +-#if defined(__FreeBSD__) || defined(BSD) ++#if defined(__FreeBSD__) || defined(BSD) || defined(__APPLE__) + #include <sys/types.h> + #else + #include <sys/sysmacros.h> +diff -Naur CPP/7zip/UI/Common/UpdateCallback.cpp CPP/7zip/UI/Common/UpdateCallback.cpp +--- CPP/7zip/UI/Common/UpdateCallback.cpp ++++ CPP/7zip/UI/Common/UpdateCallback.cpp +@@ -9,7 +9,7 @@ + // #include <pwd.h> + + // for major()/minor(): +-#if defined(__FreeBSD__) || defined(BSD) ++#if defined(__FreeBSD__) || defined(BSD) || defined(__APPLE__) + #include <sys/types.h> + #else + #include <sys/sysmacros.h> diff --git a/nixpkgs/pkgs/tools/archivers/7zz/update.sh b/nixpkgs/pkgs/tools/archivers/7zz/update.sh index bbc9804799ab..1a6d38ea6097 100755 --- a/nixpkgs/pkgs/tools/archivers/7zz/update.sh +++ b/nixpkgs/pkgs/tools/archivers/7zz/update.sh @@ -1,13 +1,14 @@ #! /usr/bin/env nix-shell -#! nix-shell -i bash -p coreutils gnused curl jq +#! nix-shell -i bash -p coreutils gnused curl jq nix-prefetch set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" DRV_DIR="$PWD" OLD_VERSION="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)" - -NEW_VERSION="$(curl "https://sourceforge.net/projects/sevenzip/best_release.json" | jq '.platform_releases.linux.filename' -r | cut -d/ -f3)" +# The best_release.json is not always up-to-date +# In those cases you can force the version by calling `./update.sh <newer_version>` +NEW_VERSION="${1:-$(curl 'https://sourceforge.net/projects/sevenzip/best_release.json' | jq '.platform_releases.linux.filename' -r | cut -d/ -f3)}" echo "comparing versions $OLD_VERSION => $NEW_VERSION" if [[ "$OLD_VERSION" == "$NEW_VERSION" ]]; then diff --git a/nixpkgs/pkgs/tools/archivers/arc_unpacker/default.nix b/nixpkgs/pkgs/tools/archivers/arc_unpacker/default.nix index 7fbd93023970..561567f8b154 100644 --- a/nixpkgs/pkgs/tools/archivers/arc_unpacker/default.nix +++ b/nixpkgs/pkgs/tools/archivers/arc_unpacker/default.nix @@ -3,16 +3,13 @@ stdenv.mkDerivation rec { pname = "arc_unpacker"; - version = "unstable-2021-05-17"; + version = "unstable-2021-08-06"; src = fetchFromGitHub { owner = "vn-tools"; repo = "arc_unpacker"; - # Since the latest release (0.11) doesn't build, we've opened an upstream - # issue in https://github.com/vn-tools/arc_unpacker/issues/187 to ask if a - # a new release is upcoming - rev = "9c2781fcf3ead7641e873b65899f6abeeabb2fc8"; - sha256 = "1xxrc9nww0rla3yh10z6glv05ax4rynwwbd0cdvkp7gyqzrv97xp"; + rev = "456834ecf2e5686813802c37efd829310485c57d"; + hash = "sha256-STbdWH7Mr3gpOrZvujblYrIIKEWBHzy1/BaNuh4teI8="; }; nativeBuildInputs = [ cmake makeWrapper catch2 ]; diff --git a/nixpkgs/pkgs/tools/archivers/bomutils/default.nix b/nixpkgs/pkgs/tools/archivers/bomutils/default.nix index c4ff957135ff..90a97af03678 100644 --- a/nixpkgs/pkgs/tools/archivers/bomutils/default.nix +++ b/nixpkgs/pkgs/tools/archivers/bomutils/default.nix @@ -18,6 +18,11 @@ stdenv.mkDerivation rec { "CXX=${stdenv.cc.targetPrefix}c++" ]; + # fix + # src/lsbom.cpp:70:10: error: reference to 'data' is ambiguous + # which refers to std::data from C++17 + NIX_CFLAGS_COMPILE = [ "-std=c++14" ]; + meta = with lib; { homepage = "https://github.com/hogliux/bomutils"; description = "Open source tools to create bill-of-materials files used in macOS installers"; diff --git a/nixpkgs/pkgs/tools/archivers/fsarchiver/default.nix b/nixpkgs/pkgs/tools/archivers/fsarchiver/default.nix index 646f93b77cba..cfa3c3c51161 100644 --- a/nixpkgs/pkgs/tools/archivers/fsarchiver/default.nix +++ b/nixpkgs/pkgs/tools/archivers/fsarchiver/default.nix @@ -38,7 +38,7 @@ in stdenv.mkDerivation { ''; homepage = "https://www.fsarchiver.org/"; license = licenses.lgpl2; - maintainers = [ maintainers.etu ]; + maintainers = with maintainers; [ ]; platforms = platforms.linux; }; } diff --git a/nixpkgs/pkgs/tools/archivers/gbl/default.nix b/nixpkgs/pkgs/tools/archivers/gbl/default.nix new file mode 100644 index 000000000000..3cba21c188b6 --- /dev/null +++ b/nixpkgs/pkgs/tools/archivers/gbl/default.nix @@ -0,0 +1,51 @@ +{ lib +, stdenv +, fetchFromGitHub +, rustPlatform +, fetchpatch +, pkg-config +, openssl +, testers +, gbl +, Security +}: + +rustPlatform.buildRustPackage rec { + pname = "gbl"; + version = "0.3.1"; + + src = fetchFromGitHub { + owner = "dac-gmbh"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-Xzx14fvYWTZYM9Pnowf1M3D0PTPRLwsXHUj/PJskRWw="; + }; + + cargoPatches = [ + # Upstream does not include Cargo.lock, even though this is recommended for applications. + # This patch adds it. https://github.com/dac-gmbh/gbl/pull/62 + (fetchpatch { + url = "https://github.com/raboof/gbl/commit/99078da334c6e1ffd8189c691bbc711281fae5cc.patch"; + sha256 = "sha256-sAKkn4//8P87ZJ6NTHm2NUJH1sAFFwfrybv2QtQ3nnM="; + }) + ]; + + cargoSha256 = "sha256-RUZ6wswRtV8chq3+bY9LTRf6IYMbZ9/GPl2X5UcF7d8="; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ]; + + passthru.tests.version = + testers.testVersion { package = gbl; }; + + meta = with lib; { + description = "GBL Firmware file manipulation"; + longDescription = '' + Utility to read, create and manipulate `.gbl` firmware update + files targeting the Silicon Labs Gecko Bootloader. + ''; + homepage = "https://github.com/dac-gmbh/gbl"; + license = licenses.mit; + maintainers = [ maintainers.raboof ]; + }; +} diff --git a/nixpkgs/pkgs/tools/archivers/gnutar/default.nix b/nixpkgs/pkgs/tools/archivers/gnutar/default.nix index fcc92e673a55..9be1ea7f4d44 100644 --- a/nixpkgs/pkgs/tools/archivers/gnutar/default.nix +++ b/nixpkgs/pkgs/tools/archivers/gnutar/default.nix @@ -45,9 +45,7 @@ stdenv.mkDerivation rec { doInstallCheck = false; # fails meta = { - homepage = "https://www.gnu.org/software/tar/"; description = "GNU implementation of the `tar' archiver"; - longDescription = '' The Tar program provides the ability to create tar archives, as well as various other kinds of manipulation. For example, you @@ -62,10 +60,12 @@ stdenv.mkDerivation rec { pipes), it can even access remote devices or files (as archives). ''; + homepage = "https://www.gnu.org/software/tar/"; license = lib.licenses.gpl3Plus; maintainers = [ ]; + mainProgram = "tar"; platforms = lib.platforms.all; priority = 10; diff --git a/nixpkgs/pkgs/tools/archivers/p7zip/default.nix b/nixpkgs/pkgs/tools/archivers/p7zip/default.nix index 5e92553b636c..b38a9aa185a0 100644 --- a/nixpkgs/pkgs/tools/archivers/p7zip/default.nix +++ b/nixpkgs/pkgs/tools/archivers/p7zip/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { # > the license requires that you agree to these use restrictions, # > or you must remove the software (source and binary) from your hard disks # https://fedoraproject.org/wiki/Licensing:Unrar - extraPostFetch = lib.optionalString (!enableUnfree) '' + postFetch = lib.optionalString (!enableUnfree) '' rm -r $out/CPP/7zip/Compress/Rar* find $out -name makefile'*' -exec sed -i '/Rar/d' {} + ''; diff --git a/nixpkgs/pkgs/tools/archivers/quickbms/default.nix b/nixpkgs/pkgs/tools/archivers/quickbms/default.nix index 7846f18a1740..d2f39ac2cf18 100644 --- a/nixpkgs/pkgs/tools/archivers/quickbms/default.nix +++ b/nixpkgs/pkgs/tools/archivers/quickbms/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { description = "Universal script based file extractor and reimporter"; homepage = "https://aluigi.altervista.org/quickbms.htm"; license = licenses.gpl2Plus; - maintainers = with maintainers; [ samuelgrf ]; + maintainers = with maintainers; [ ]; platforms = platforms.linux; }; } diff --git a/nixpkgs/pkgs/tools/archivers/rar/default.nix b/nixpkgs/pkgs/tools/archivers/rar/default.nix index 6f47992b512c..7a5fd320c948 100644 --- a/nixpkgs/pkgs/tools/archivers/rar/default.nix +++ b/nixpkgs/pkgs/tools/archivers/rar/default.nix @@ -58,6 +58,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Utility for RAR archives"; homepage = "https://www.rarlab.com/"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; license = licenses.unfree; maintainers = with maintainers; [ thiagokokada ]; platforms = with platforms; linux ++ darwin; diff --git a/nixpkgs/pkgs/tools/archivers/runzip/default.nix b/nixpkgs/pkgs/tools/archivers/runzip/default.nix index c251cfe0dc30..fddf90a5d23c 100644 --- a/nixpkgs/pkgs/tools/archivers/runzip/default.nix +++ b/nixpkgs/pkgs/tools/archivers/runzip/default.nix @@ -1,11 +1,11 @@ -{ lib, stdenv, fetchFromGitHub, libzip, autoreconfHook }: +{ lib, stdenv, fetchFromGitHub, libzip, libiconv, autoreconfHook }: stdenv.mkDerivation rec { version = "1.4"; pname = "runzip"; nativeBuildInputs = [ autoreconfHook ]; - buildInputs = [ libzip ]; + buildInputs = [ libiconv libzip ]; src = fetchFromGitHub { owner = "vlm"; @@ -16,8 +16,8 @@ stdenv.mkDerivation rec { meta = { description = "A tool to convert filename encoding inside a ZIP archive"; - license = lib.licenses.bsd2 ; - maintainers = [lib.maintainers.raskin]; - platforms = lib.platforms.linux; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.raskin ]; + platforms = lib.platforms.unix; }; } diff --git a/nixpkgs/pkgs/tools/archivers/unrar/default.nix b/nixpkgs/pkgs/tools/archivers/unrar/default.nix index b988a135e454..16756bf91fbe 100644 --- a/nixpkgs/pkgs/tools/archivers/unrar/default.nix +++ b/nixpkgs/pkgs/tools/archivers/unrar/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "unrar"; - version = "6.1.6"; + version = "6.1.7"; src = fetchurl { url = "https://www.rarlab.com/rar/unrarsrc-${version}.tar.gz"; - sha256 = "sha256-Z/SriRwGIhjCut+qycjKtci/1eltq/ylbI+qPSCagB0="; + hash = "sha256-3nW2E2lYFz/fxTDTigFFtyNCzw04Qr97sSDTNmAtiO0="; }; postPatch = '' diff --git a/nixpkgs/pkgs/tools/archivers/unzip/default.nix b/nixpkgs/pkgs/tools/archivers/unzip/default.nix index 2f2581f04a59..6577d2ee0e64 100644 --- a/nixpkgs/pkgs/tools/archivers/unzip/default.nix +++ b/nixpkgs/pkgs/tools/archivers/unzip/default.nix @@ -42,6 +42,10 @@ stdenv.mkDerivation rec { name = "CVE-2019-13232-3.patch"; sha256 = "1jvs7dkdqs97qnsqc6hk088alhv8j4c638k65dbib9chh40jd7pf"; }) + (fetchurl { + url = "https://sources.debian.org/data/main/u/unzip/6.0-26/debian/patches/06-initialize-the-symlink-flag.patch"; + sha256 = "1h00djdvgjhwfb60wl4qrxbyfsbbnn1qw6l2hkldnif4m8f8r1zj"; + }) ] ++ lib.optional enableNLS (fetchurl { url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/unzip/files/unzip-6.0-natspec.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d"; @@ -60,7 +64,10 @@ stdenv.mkDerivation rec { "generic" "D_USE_BZ2=-DUSE_BZIP2" "L_BZ2=-lbz2" - ]; + ] + # `lchmod` is not available on Linux, so we remove it to fix "not supported" errors (when the zip file contains symlinks). + # Alpine (musl) and Debian (glibc) also add this flag. + ++ lib.optionals stdenv.isLinux [ "LOCAL_UNZIP=-DNO_LCHMOD" ]; preConfigure = '' sed -i -e 's@CF="-O3 -Wall -I. -DASM_CRC $(LOC)"@CF="-O3 -Wall -I. -DASM_CRC -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(LOC)"@' unix/Makefile diff --git a/nixpkgs/pkgs/tools/archivers/unzip/setup-hook.sh b/nixpkgs/pkgs/tools/archivers/unzip/setup-hook.sh index 4055d2fab512..99c63f68e940 100644 --- a/nixpkgs/pkgs/tools/archivers/unzip/setup-hook.sh +++ b/nixpkgs/pkgs/tools/archivers/unzip/setup-hook.sh @@ -1,5 +1,11 @@ unpackCmdHooks+=(_tryUnzip) _tryUnzip() { if ! [[ "$curSrc" =~ \.zip$ ]]; then return 1; fi - unzip -qq "$curSrc" + + # UTF-8 locale is needed for unzip on glibc to handle UTF-8 symbols: + # https://github.com/NixOS/nixpkgs/issues/176225#issuecomment-1146617263 + # Otherwise unzip unpacks escaped file names as if '-U' options was in effect. + # + # Pick en_US.UTF-8 as most possible to be present on glibc, musl and darwin. + LANG=en_US.UTF-8 unzip -qq "$curSrc" } diff --git a/nixpkgs/pkgs/tools/archivers/wimlib/default.nix b/nixpkgs/pkgs/tools/archivers/wimlib/default.nix index bb8c6b8952fd..79840f9588ad 100644 --- a/nixpkgs/pkgs/tools/archivers/wimlib/default.nix +++ b/nixpkgs/pkgs/tools/archivers/wimlib/default.nix @@ -19,20 +19,20 @@ stdenv.mkDerivation rec { sha256 = "sha256-MvzJ6bFEt8sdtMhuEEyngoPNwiXhP+grJzZgWGrv4yM="; }; - preBuild = '' + preBuild = lib.optionalString (!stdenv.isDarwin) '' substituteInPlace programs/mkwinpeimg.in \ --replace '/usr/lib/syslinux' "${syslinux}/share/syslinux" ''; postInstall = let - path = lib.makeBinPath [ cabextract cdrkit mtools ntfs3g syslinux ]; + path = lib.makeBinPath ([ cabextract mtools ntfs3g ] ++ lib.optionals (!stdenv.isDarwin) [ cdrkit syslinux ]); in '' for prog in $out/bin/*; do wrapProgram $prog --prefix PATH : ${path} done ''; - doCheck = true; + doCheck = (!stdenv.isDarwin); preCheck = '' patchShebangs tests diff --git a/nixpkgs/pkgs/tools/archivers/xarchiver/default.nix b/nixpkgs/pkgs/tools/archivers/xarchiver/default.nix index 57d35633128d..5bd20055ce83 100644 --- a/nixpkgs/pkgs/tools/archivers/xarchiver/default.nix +++ b/nixpkgs/pkgs/tools/archivers/xarchiver/default.nix @@ -21,6 +21,7 @@ stdenv.mkDerivation rec { ''; meta = { + broken = stdenv.isDarwin; description = "GTK frontend to 7z,zip,rar,tar,bzip2, gzip,arj, lha, rpm and deb (open and extract only)"; homepage = "https://github.com/ib/xarchiver"; maintainers = [ lib.maintainers.domenkozar ]; |