Merge pull request #130928 from SuperSandro2000/cleanup-compression

This commit is contained in:
Sandro 2021-07-22 02:26:35 +02:00 committed by GitHub
commit a55ab60d5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 176 additions and 180 deletions

View file

@ -1,4 +1,8 @@
{ lib, stdenv, fetchFromGitHub, cmake, fetchpatch
{ lib
, stdenv
, fetchFromGitHub
, cmake
, fetchpatch
, staticOnly ? stdenv.hostPlatform.isStatic
}:
@ -11,7 +15,7 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "google";
repo = "brotli";
rev = "v" + version;
rev = "v${version}";
sha256 = "z6Dhrabav1MDQ4rAcXaDv0aN+qOoh9cvoXZqEWBB13c=";
};
@ -24,8 +28,7 @@ stdenv.mkDerivation rec {
sha256 = "sOeXNVsCaBSD9i82GRUDrkyreGeQ7qaJWjjy/uLL0/0=";
});
cmakeFlags = []
++ lib.optional staticOnly "-DBUILD_SHARED_LIBS=OFF";
cmakeFlags = lib.optional staticOnly "-DBUILD_SHARED_LIBS=OFF";
outputs = [ "out" "dev" "lib" ];
@ -36,13 +39,13 @@ stdenv.mkDerivation rec {
# This breaks on Darwin because our cmake hook tries to make a build folder
# and the wonderful bazel BUILD file is already there (yay case-insensitivity?)
prePatch = ''
rm BUILD
rm BUILD
# Upstream fixed this reference to runtime-path after the release
# and with this references g++ complains about invalid option -R
sed -i 's/ -R''${libdir}//' scripts/libbrotli*.pc.in
cat scripts/libbrotli*.pc.in
'';
# Upstream fixed this reference to runtime-path after the release
# and with this references g++ complains about invalid option -R
sed -i 's/ -R''${libdir}//' scripts/libbrotli*.pc.in
cat scripts/libbrotli*.pc.in
'';
# Don't bother with "man" output for now,
# it currently only makes the manpages hard to use.
@ -53,10 +56,8 @@ stdenv.mkDerivation rec {
'';
meta = with lib; {
inherit (src.meta) homepage;
homepage = "https://github.com/google/brotli";
description = "A generic-purpose lossless compression algorithm and tool";
longDescription =
'' Brotli is a generic-purpose lossless compression algorithm that
compresses data using a combination of a modern variant of the LZ77
@ -69,7 +70,6 @@ stdenv.mkDerivation rec {
in the following internet draft:
http://www.ietf.org/id/draft-alakuijala-brotli
'';
license = licenses.mit;
maintainers = with maintainers; [ freezeboy ];
platforms = platforms.all;

View file

@ -1,30 +1,31 @@
{ lib, stdenv, fetchurl, openmp ? null }:
{ lib, stdenv, fetchFromGitHub, openmp }:
stdenv.mkDerivation rec {
pname = "bsc";
version = "3.1.0";
src = fetchurl {
url = "https://github.com/IlyaGrebnov/libbsc/archive/${version}.tar.gz";
sha256 = "01yhizaf6qjv1plyrx0fcib264maa5qwvgfvvid9rzlzj9fxjib6";
src = fetchFromGitHub {
owner = "IlyaGrebnov";
repo = "libbsc";
rev = version;
sha256 = "0c0jmirh9y23kyi1jnrm13sa3xsjn54jazfr84ag45pai279fciz";
};
enableParallelBuilding = true;
buildInputs = lib.optional stdenv.isDarwin openmp;
prePatch = ''
postPatch = ''
substituteInPlace makefile \
--replace 'g++' '$(CXX)'
'';
preInstall = ''
makeFlagsArray+=("PREFIX=$out")
'';
makeFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
description = "High performance block-sorting data compression library";
homepage = "http://libbsc.com/";
maintainers = with maintainers; [ ];
# Later commits changed the licence to Apache2 (no release yet, though)
license = with licenses; [ lgpl3Plus ];
platforms = platforms.unix;

View file

@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
version = "4.3";
src = fetchurl {
url = "https://www.daemonology.net/bsdiff/${pname}-${version}.tar.gz";
url = "https://www.daemonology.net/bsdiff/${pname}-${version}.tar.gz";
sha256 = "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq";
};
@ -27,11 +27,11 @@ stdenv.mkDerivation rec {
cp bspatch.1 $out/share/man/man1
'';
meta = {
meta = with lib; {
description = "An efficient binary diff/patch tool";
homepage = "http://www.daemonology.net/bsdiff";
license = lib.licenses.bsd2;
platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.thoughtpolice ];
homepage = "https://www.daemonology.net/bsdiff/";
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = [ maintainers.thoughtpolice ];
};
}

View file

@ -1,28 +1,30 @@
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "dejsonlz4";
version = "1.1";
src = fetchFromGitHub {
owner = "avih";
repo = pname;
rev = "v${version}";
sha256 = "0ggs69qamaama5mid07mhp95m1x42wljdb953lrwfr7p8p6f8czh";
};
pname = "dejsonlz4";
version = "1.1";
buildPhase = ''
${stdenv.cc.targetPrefix}cc -o dejsonlz4 src/dejsonlz4.c src/lz4.c
'';
src = fetchFromGitHub {
owner = "avih";
repo = pname;
rev = "v${version}";
sha256 = "0ggs69qamaama5mid07mhp95m1x42wljdb953lrwfr7p8p6f8czh";
};
installPhase = ''
mkdir -p $out/bin/
cp dejsonlz4 $out/bin/
'';
buildPhase = ''
${stdenv.cc.targetPrefix}cc -o dejsonlz4 src/dejsonlz4.c src/lz4.c
'';
meta = with lib; {
description = "Decompress Mozilla Firefox bookmarks backup files";
homepage = "https://github.com/avih/dejsonlz4";
license = licenses.bsd2;
maintainers = with maintainers; [ mt-caret ];
platforms = platforms.all;
};
}
installPhase = ''
mkdir -p $out/bin/
cp dejsonlz4 $out/bin/
'';
meta = with lib; {
description = "Decompress Mozilla Firefox bookmarks backup files";
homepage = "https://github.com/avih/dejsonlz4";
license = licenses.bsd2;
maintainers = with maintainers; [ mt-caret ];
platforms = platforms.all;
};
}

View file

@ -1,10 +1,11 @@
{ lib, stdenv, fetchurl, zlib }:
stdenv.mkDerivation rec {
name = "gzrt-0.8";
pname = "gzrt";
version = "0.8";
src = fetchurl {
url = "https://www.urbanophile.com/arenn/coding/gzrt/${name}.tar.gz";
url = "https://www.urbanophile.com/arenn/coding/gzrt/gzrt-${version}.tar.gz";
sha256 = "1vhzazj47xfpbfhzkwalz27cc0n5gazddmj3kynhk0yxv99xrdxh";
};
@ -15,10 +16,11 @@ stdenv.mkDerivation rec {
cp gzrecover $out/bin
'';
meta = {
meta = with lib; {
homepage = "https://www.urbanophile.com/arenn/hacking/gzrt/";
description = "The gzip Recovery Toolkit";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
maintainers = with maintainers; [ ];
license = licenses.gpl2Plus;
platforms = platforms.unix;
};
}

View file

@ -1,25 +1,26 @@
{lib, stdenv, fetchurl}:
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation {
name = "kzipmix-20091108";
stdenv.mkDerivation rec {
pname = "kzipmix";
version = "20200115";
src = fetchurl {
url = "http://static.jonof.id.au/dl/kenutils/kzipmix-20091108-linux.tar.gz";
sha256 = "19gyn8pblffdz1bf3xkbpzx8a8wn3xb0v411pqzmz5g5l6pm5gph";
url = "http://static.jonof.id.au/dl/kenutils/kzipmix-${version}-linux.tar.gz";
sha256 = "sha256-ePgye0D6/ED53zx6xffLnYhkjed7SPU4BLOZQr9E3yA=";
};
installPhase = ''
mkdir -p $out/bin
cp kzip zipmix $out/bin
cp amd64/{kzip,zipmix} $out/bin
patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/bin/kzip
patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/bin/zipmix
'';
meta = {
meta = with lib; {
description = "A tool that aggressively optimizes the sizes of Zip archives";
license = lib.licenses.unfree;
license = licenses.unfree;
homepage = "http://advsys.net/ken/utils.htm";
maintainers = [ lib.maintainers.sander ];
maintainers = [ maintainers.sander ];
};
}

View file

@ -1,14 +1,14 @@
{ lib, stdenv, fetchFromGitHub, gnulib, perl, autoconf, automake }:
stdenv.mkDerivation rec {
pname = "lbzip2";
version = "2.5";
name = "lbzip2-${version}";
src = fetchFromGitHub {
owner = "kjn";
repo = "lbzip2";
sha256 = "1h321wva6fp6khz6x0i6rqb76xh327nw6v5jhgjpcckwdarj5jv8";
rev = "v${version}";
sha256 = "1h321wva6fp6khz6x0i6rqb76xh327nw6v5jhgjpcckwdarj5jv8";
};
buildInputs = [ gnulib perl ];

View file

@ -1,21 +1,24 @@
{lib, stdenv, fetchurl}:
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "lhasa";
version = "0.3.1";
stdenv.mkDerivation {
name = "lhasa-0.3.1";
src = fetchurl {
url = "https://soulsphere.org/projects/lhasa/lhasa-0.3.1.tar.gz";
url = "https://soulsphere.org/projects/lhasa/lhasa-${version}.tar.gz";
sha256 = "092zi9av18ma20c6h9448k0bapvx2plnp292741dvfd9hmgqxc1z";
};
meta = {
meta = with lib; {
description = "Free Software replacement for the Unix LHA tool";
longDescription = ''
Lhasa is a Free Software replacement for the Unix LHA tool, for
decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for
the tool is a library, so that it can be reused for other purposes.
'';
license = lib.licenses.isc;
license = licenses.isc;
homepage = "http://fragglet.github.io/lhasa";
maintainers = with lib; [ maintainers.sander ];
platforms = with lib.platforms; linux ++ darwin;
maintainers = [ maintainers.sander ];
platforms = platforms.unix;
};
}

View file

@ -1,8 +1,8 @@
{lib, stdenv, fetchurl, zlib, lzo, bzip2, lz4, nasm, perl}:
{ lib, stdenv, fetchurl, zlib, lzo, bzip2, lz4, nasm, perl }:
stdenv.mkDerivation rec {
version = "0.641";
pname = "lrzip";
version = "0.641";
src = fetchurl {
url = "http://ck.kolivas.org/apps/lrzip/${pname}-${version}.tar.xz";
@ -15,10 +15,11 @@ stdenv.mkDerivation rec {
"--disable-asm"
];
meta = {
meta = with lib; {
homepage = "http://ck.kolivas.org/apps/lrzip/";
description = "The CK LRZIP compression program (LZMA + RZIP)";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
maintainers = with maintainers; [ ];
license = licenses.gpl2Plus;
platforms = platforms.unix;
};
}

View file

@ -1,9 +1,11 @@
{lib, stdenv, fetchurl, lzo}:
{ lib, stdenv, fetchurl, lzo }:
stdenv.mkDerivation rec {
name = "lzop-1.04";
pname = "lzop";
version = "1.04";
src = fetchurl {
url = "https://www.lzop.org/download/${name}.tar.gz";
url = "https://www.lzop.org/download/lzop-${version}.tar.gz";
sha256 = "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky";
};
@ -12,6 +14,7 @@ stdenv.mkDerivation rec {
meta = with lib; {
homepage = "http://www.lzop.org";
description = "Fast file compressor";
maintainers = with maintainers; [ ];
license = licenses.gpl2;
platforms = platforms.unix;
};

View file

@ -1,36 +1,34 @@
{ lib, stdenv, fetchurl, zlib, util-linux }:
let name = "pigz";
version = "2.6";
in
stdenv.mkDerivation {
name = name + "-" + version;
stdenv.mkDerivation rec {
pname = "pigz";
version = "2.6";
src = fetchurl {
url = "https://www.zlib.net/${name}/${name}-${version}.tar.gz";
url = "https://www.zlib.net/${pname}/${pname}-${version}.tar.gz";
sha256 = "sha256-Lu17DXRJ0dcJA/KmLNYAXSYus6jJ6YaHvIy7WAnbKn0=";
};
enableParallelBuilding = true;
buildInputs = [zlib] ++ lib.optional stdenv.isLinux util-linux;
buildInputs = [ zlib ] ++ lib.optional stdenv.isLinux util-linux;
makeFlags = [ "CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" ];
doCheck = stdenv.isLinux;
checkTarget = "tests";
installPhase =
''
install -Dm755 pigz "$out/bin/pigz"
ln -s pigz "$out/bin/unpigz"
install -Dm755 pigz.1 "$out/share/man/man1/pigz.1"
ln -s pigz.1 "$out/share/man/man1/unpigz.1"
install -Dm755 pigz.pdf "$out/share/doc/pigz/pigz.pdf"
installPhase = ''
install -Dm755 pigz "$out/bin/pigz"
ln -s pigz "$out/bin/unpigz"
install -Dm755 pigz.1 "$out/share/man/man1/pigz.1"
ln -s pigz.1 "$out/share/man/man1/unpigz.1"
install -Dm755 pigz.pdf "$out/share/doc/pigz/pigz.pdf"
'';
meta = with lib; {
homepage = "http://www.zlib.net/pigz/";
homepage = "https://www.zlib.net/pigz/";
description = "A parallel implementation of gzip for multi-core machines";
maintainers = with maintainers; [ ];
license = licenses.zlib;
platforms = platforms.unix;
};

View file

@ -1,25 +1,42 @@
{
lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, pkg-config
, asciidoc, libxslt, libxml2, docbook_xml_dtd_45, docbook_xsl
, libarchive, xz
{ lib
, stdenv
, fetchFromGitHub
, autoconf
, automake
, libtool
, pkg-config
, asciidoc
, libxslt
, libxml2
, docbook_xml_dtd_45
, docbook_xsl
, libarchive
, xz
}:
stdenv.mkDerivation rec {
baseName = "pixz";
pname = "pixz";
version = "1.0.7";
name = "${baseName}-${version}";
nativeBuildInputs = [ pkg-config ];
buildInputs = [
autoconf automake libtool asciidoc libxslt libxml2
docbook_xml_dtd_45 docbook_xsl
libarchive xz
autoconf
automake
libtool
asciidoc
libxslt
libxml2
docbook_xml_dtd_45
docbook_xsl
libarchive
xz
];
preBuild = ''
echo "XML_CATALOG_FILES='$XML_CATALOG_FILES'"
'';
src = fetchFromGitHub {
owner = "vasi";
repo = baseName;
repo = pname;
rev = "v${version}";
sha256 = "163axxs22w7pghr786hda22mnlpvmi50hzhfr9axwyyjl9n41qs2";
};
@ -27,10 +44,10 @@ stdenv.mkDerivation rec {
./autogen.sh
'';
meta = {
meta = with lib; {
description = "A parallel compressor/decompressor for xz format";
license = lib.licenses.bsd2;
maintainers = [lib.maintainers.raskin];
platforms = lib.platforms.unix;
license = licenses.bsd2;
maintainers = [ maintainers.raskin ];
platforms = platforms.unix;
};
}

View file

@ -1,36 +0,0 @@
From b8f9827fc4de9296c7a6f5e6fdac46e070cd6cb4 Mon Sep 17 00:00:00 2001
From: Igor Pashev <pashev.igor@gmail.com>
Date: Sat, 1 Nov 2014 18:10:05 +0300
Subject: [PATCH] Fixed crash on Linux when stack size is unlimited
---
pxz.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pxz.c b/pxz.c
index 9cb843e..52713e2 100644
--- a/pxz.c
+++ b/pxz.c
@@ -65,7 +65,7 @@ FILE **ftemp;
char str[0x100];
char buf[BUFFSIZE];
char *xzcmd;
-size_t xzcmd_max;
+const size_t xzcmd_max = 10240;
unsigned opt_complevel = 6, opt_stdout, opt_keep, opt_threads, opt_verbose;
unsigned opt_force, opt_stdout;
@@ -243,9 +243,12 @@ int main( int argc, char **argv ) {
lzma_filter filters[LZMA_FILTERS_MAX + 1];
lzma_options_lzma lzma_options;
- xzcmd_max = sysconf(_SC_ARG_MAX);
page_size = sysconf(_SC_PAGE_SIZE);
xzcmd = malloc(xzcmd_max);
+ if (!xzcmd) {
+ fprintf(stderr, "Failed to allocate %lu bytes for xz command.\n", xzcmd_max);
+ return -1;
+ }
snprintf(xzcmd, xzcmd_max, XZ_BINARY);
parse_args(argc, argv);

View file

@ -1,21 +1,18 @@
{ lib, stdenv, fetchgit, xz }:
{ lib, stdenv, fetchFromGitHub, xz }:
let name = "pxz";
version = "4.999.9beta+git";
in
stdenv.mkDerivation {
name = name + "-" + version;
stdenv.mkDerivation rec {
pname = "pxz";
version = "4.999.9beta+git";
src = fetchgit {
url = "https://github.com/jnovy/pxz.git";
rev = "ae808463c2950edfdedb8fb49f95006db0a18667";
sha256 = "0na2kw8cf0qd8l1aywlv9m3xrxnqlcwxfdwp3f7x9vxwqx3k32kc";
src = fetchFromGitHub {
owner = "jnovy";
repo = "pxz";
rev = "124382a6d0832b13b7c091f72264f8f3f463070a";
sha256 = "15mmv832iqsqwigidvwnf0nyivxf0y8m22j2szy4h0xr76x4z21m";
};
buildInputs = [ xz ];
patches = [ ./_SC_ARG_MAX.patch ];
buildPhase = ''
gcc -o pxz pxz.c -llzma \
-fopenmp -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O2 \
@ -30,15 +27,18 @@ stdenv.mkDerivation {
cp pxz.1 $out/share/man/man1
'';
meta = {
meta = with lib; {
homepage = "https://jnovy.fedorapeople.org/pxz/";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [pashev];
description = ''Parallel XZ is a compression utility that takes advantage of
license = licenses.gpl2Plus;
maintainers = with maintainers; [ pashev ];
description = "compression utility that runs LZMA compression of different parts on multiple cores simultaneously";
longDescription = ''
Parallel XZ is a compression utility that takes advantage of
running LZMA compression of different parts of an input file on multiple
cores and processors simultaneously. Its primary goal is to utilize all
resources to speed up compression time with minimal possible influence
on compression ratio'';
platforms = with lib.platforms; linux;
on compression ratio
'';
platforms = with platforms; linux;
};
}

View file

@ -1,9 +1,11 @@
{lib, stdenv, fetchurl, fetchpatch, bzip2}:
{ lib, stdenv, fetchurl, fetchpatch, bzip2 }:
stdenv.mkDerivation rec {
pname = "rzip";
version = "2.1";
stdenv.mkDerivation {
name = "rzip-2.1";
src = fetchurl {
url = "mirror://samba/rzip/rzip-2.1.tar.gz";
url = "mirror://samba/rzip/rzip-${version}.tar.gz";
sha256 = "4bb96f4d58ccf16749ed3f836957ce97dbcff3e3ee5fd50266229a48f89815b7";
};
buildInputs = [ bzip2 ];
@ -16,10 +18,11 @@ stdenv.mkDerivation {
})
];
meta = {
meta = with lib; {
homepage = "https://rzip.samba.org/";
description = "Compression program";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
maintainers = with maintainers; [ ];
license = licenses.gpl2Plus;
platforms = platforms.unix;
};
}

View file

@ -1,20 +1,21 @@
{lib, stdenv, fetchurl}:
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
name = "zsync-0.6.2";
pname = "zsync";
version = "0.6.2";
src = fetchurl {
url = "http://zsync.moria.org.uk/download/${name}.tar.bz2";
url = "http://zsync.moria.org.uk/download/${pname}-${version}.tar.bz2";
sha256 = "1wjslvfy76szf0mgg2i9y9q30858xyjn6v2acc24zal76d1m778b";
};
makeFlags = [ "AR=${stdenv.cc.bintools.targetPrefix}ar" ];
meta = {
meta = with lib; {
homepage = "http://zsync.moria.org.uk/";
description = "File distribution system using the rsync algorithm";
license = lib.licenses.free;
maintainers = with lib.maintainers; [viric];
platforms = with lib.platforms; all;
license = licenses.free;
maintainers = with maintainers; [ viric ];
platforms = with platforms; all;
};
}