diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/archivers')
6 files changed, 154 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/tools/archivers/gnutar/default.nix b/nixpkgs/pkgs/tools/archivers/gnutar/default.nix index 9be1ea7f4d44..331d977147b2 100644 --- a/nixpkgs/pkgs/tools/archivers/gnutar/default.nix +++ b/nixpkgs/pkgs/tools/archivers/gnutar/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, autoreconfHook, acl }: +{ lib, stdenv, fetchurl, autoreconfHook, acl, libintl }: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or @@ -7,11 +7,11 @@ stdenv.mkDerivation rec { pname = "gnutar"; - version = "1.34"; + version = "1.35"; src = fetchurl { url = "mirror://gnu/tar/tar-${version}.tar.xz"; - sha256 = "sha256-Y769JoecXh7qQ1Lw0DyZH5Zq6z3es8dEXJAlaNVBHSg="; + sha256 = "sha256-TWL/NzQux67XSFNTI5MMfPlKz3HDWRiCsmp+pQ8+3BY="; }; # avoid retaining reference to CF during stdenv bootstrap @@ -31,7 +31,12 @@ stdenv.mkDerivation rec { outputs = [ "out" "info" ]; nativeBuildInputs = lib.optional stdenv.isDarwin autoreconfHook; - buildInputs = lib.optional stdenv.isLinux acl; + # Add libintl on Darwin specifically as it fails to link (or skip) + # NLS on it's own: + # "_libintl_textdomain", referenced from: + # _main in tar.o + # ld: symbol(s) not found for architecture x86_64 + buildInputs = lib.optional stdenv.isLinux acl ++ lib.optional stdenv.isDarwin libintl; # May have some issues with root compilation because the bootstrap tool # cannot be used as a login shell for now. diff --git a/nixpkgs/pkgs/tools/archivers/peazip/default.nix b/nixpkgs/pkgs/tools/archivers/peazip/default.nix new file mode 100644 index 000000000000..3dd74e1e7298 --- /dev/null +++ b/nixpkgs/pkgs/tools/archivers/peazip/default.nix @@ -0,0 +1,98 @@ +{ stdenv +, lib +, fetchFromGitHub +, wrapQtAppsHook +, fpc +, lazarus +, xorg +, libqt5pas +, _7zz +, archiver +, brotli +, upx +, zpaq +, zstd +}: + +stdenv.mkDerivation rec { + pname = "peazip"; + version = "9.9.0"; + + src = fetchFromGitHub { + owner = "peazip"; + repo = pname; + rev = version; + hash = "sha256-1UavigwVp/Gna2BOUECQrn/VQjov8wDw5EdPWX3mpvM="; + }; + sourceRoot = "${src.name}/peazip-sources"; + + nativeBuildInputs = [ + wrapQtAppsHook + lazarus + fpc + ]; + + buildInputs = [ + xorg.libX11 + libqt5pas + ]; + + NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; + + buildPhase = '' + export HOME=$(mktemp -d) + cd dev + lazbuild --lazarusdir=${lazarus}/share/lazarus --widgetset=qt5 --build-all project_pea.lpi && [ -f pea ] + lazbuild --lazarusdir=${lazarus}/share/lazarus --widgetset=qt5 --build-all project_peach.lpi && [ -f peazip ] + cd .. + ''; + + installPhase = '' + runHook preInstall + + # Executables + ## Main programs + install -D dev/{pea,peazip} -t $out/lib/peazip + mkdir -p $out/bin + ln -s $out/lib/peazip/{pea,peazip} $out/bin/ + + ## Symlink the available compression algorithm programs. + mkdir -p $out/lib/peazip/res/bin/7z + ln -s ${_7zz}/bin/7zz $out/lib/peazip/res/bin/7z/7z + mkdir -p $out/lib/peazip/res/bin/arc + ln -s ${archiver}/bin/arc $out/lib/peazip/res/bin/arc/ + mkdir -p $out/lib/peazip/res/bin/brotli + ln -s ${brotli}/bin/brotli $out/lib/peazip/res/bin/brotli/ + mkdir -p $out/lib/peazip/res/bin/upx + ln -s ${upx}/bin/upx $out/lib/peazip/res/bin/upx/ + mkdir -p $out/lib/peazip/res/bin/zpaq + ln -s ${zpaq}/bin/zpaq $out/lib/peazip/res/bin/zpaq/ + mkdir -p $out/lib/peazip/res/bin/zstd + ln -s ${zstd}/bin/zstd $out/lib/peazip/res/bin/zstd/ + + mkdir -p $out/share/peazip + ln -s $out/share/peazip $out/lib/peazip/res/share + cp -r res/share/{icons,lang,themes,presets} $out/share/peazip/ + install -D res/share/batch/freedesktop_integration/peazip.png -t "$out/share/icons/hicolor/256x256/apps" + install -D res/share/icons/peazip_{7z,rar,zip}.png -t "$out/share/icons/hicolor/256x256/mimetypes" + install -D res/share/batch/freedesktop_integration/peazip_{add,extract}.png -t "$out/share/icons/hicolor/256x256/actions" + install -D res/share/batch/freedesktop_integration/*.desktop -t "$out/share/applications" + + runHook postInstall + ''; + + meta = with lib; { + description = "Cross-platform file and archive manager"; + longDescription = '' + Free Zip / Unzip software and Rar file extractor. Cross-platform file and archive manager. + + Features volume spanning, compression, authenticated encryption. + + Supports 7Z, 7-Zip sfx, ACE, ARJ, Brotli, BZ2, CAB, CHM, CPIO, DEB, GZ, ISO, JAR, LHA/LZH, NSIS, OOo, PEA, RAR, RPM, split, TAR, Z, ZIP, ZIPX, Zstandard. + ''; + license = licenses.gpl3Only; + homepage = "https://peazip.github.io"; + platforms = platforms.linux; + maintainers = with maintainers; [ annaaurora ]; + }; +} diff --git a/nixpkgs/pkgs/tools/archivers/unar/default.nix b/nixpkgs/pkgs/tools/archivers/unar/default.nix index 550e14355992..2fdaf2def590 100644 --- a/nixpkgs/pkgs/tools/archivers/unar/default.nix +++ b/nixpkgs/pkgs/tools/archivers/unar/default.nix @@ -67,7 +67,7 @@ stdenv.mkDerivation rec { dontConfigure = true; - sourceRoot = "./source/XADMaster"; + sourceRoot = "./${src.name}/XADMaster"; installPhase = '' runHook preInstall diff --git a/nixpkgs/pkgs/tools/archivers/zip/default.nix b/nixpkgs/pkgs/tools/archivers/zip/default.nix index 82329537251e..1ac615a3d90f 100644 --- a/nixpkgs/pkgs/tools/archivers/zip/default.nix +++ b/nixpkgs/pkgs/tools/archivers/zip/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { ]; sha256 = "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"; }; - patchPhase = '' + prePatch = '' substituteInPlace unix/Makefile --replace 'CC = cc' "" ''; @@ -26,7 +26,14 @@ stdenv.mkDerivation rec { "INSTALL=cp" ]; - patches = lib.optionals (enableNLS && !stdenv.isCygwin) [ ./natspec-gentoo.patch.bz2 ]; + patches = [ + # Trying to use `memset` without declaring it is flagged as an error with clang 16, causing + # the `configure` script to incorrectly define `ZMEM`. That causes the build to fail due to + # incompatible redeclarations of `memset`, `memcpy`, and `memcmp` in `zip.h`. + ./fix-memset-detection.patch + # Implicit declaration of `closedir` and `opendir` cause dirent detection to fail with clang 16. + ./fix-implicit-declarations.patch + ] ++ lib.optionals (enableNLS && !stdenv.isCygwin) [ ./natspec-gentoo.patch.bz2 ]; buildInputs = lib.optional enableNLS libnatspec ++ lib.optional stdenv.isCygwin libiconv; @@ -37,5 +44,6 @@ stdenv.mkDerivation rec { license = licenses.bsdOriginal; platforms = platforms.all; maintainers = [ ]; + mainProgram = "zip"; }; } diff --git a/nixpkgs/pkgs/tools/archivers/zip/fix-implicit-declarations.patch b/nixpkgs/pkgs/tools/archivers/zip/fix-implicit-declarations.patch new file mode 100644 index 000000000000..df19bf1722f9 --- /dev/null +++ b/nixpkgs/pkgs/tools/archivers/zip/fix-implicit-declarations.patch @@ -0,0 +1,21 @@ +--- a/unix/configure 2009-04-16 15:25:12.000000000 -0400 ++++ b/unix/configure 2023-05-30 15:18:33.670321348 -0400 +@@ -408,7 +408,7 @@ + echo Check for errno declaration + cat > conftest.c << _EOF_ + #include <errno.h> +-main() ++int main() + { + errno = 0; + return 0; +@@ -419,6 +419,8 @@ + + echo Check for directory libraries + cat > conftest.c << _EOF_ ++#include <sys/types.h> ++#include <dirent.h> + int main() { return closedir(opendir(".")); } + _EOF_ + + diff --git a/nixpkgs/pkgs/tools/archivers/zip/fix-memset-detection.patch b/nixpkgs/pkgs/tools/archivers/zip/fix-memset-detection.patch new file mode 100644 index 000000000000..55bda33a2573 --- /dev/null +++ b/nixpkgs/pkgs/tools/archivers/zip/fix-memset-detection.patch @@ -0,0 +1,15 @@ +diff -ur a/unix/configure b/unix/configure +--- a/unix/configure 2008-06-19 21:32:20.000000000 -0600 ++++ b/unix/configure 2023-07-11 10:02:57.809867694 -0600 +@@ -519,7 +519,10 @@ + + + echo Check for memset +-echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c ++cat > conftest.c << _EOF_ ++#include <string.h> ++int main(){ char k; memset(&k,0,0); return 0; } ++_EOF_ + $CC -o conftest conftest.c >/dev/null 2>/dev/null + [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM" + |