commit aee7a0f30cd5409357ecb57f6235498e51e2f414
Author: Arkadiusz Miƛkiewicz <[email protected]>
Date:   Fri Mar 29 23:49:19 2024 +0100

    Revert "Up to 5.6.0 (patches dropped as new defaults make sense)"
    
    This reverts commit 8e03481356ea482d5ec65bb043c3239a8bc55617.

 xz-memlimit.patch | 14 ++++++++++++++
 xz-parallel.patch | 21 +++++++++++++++++++++
 xz.spec           |  8 ++++++--
 3 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/xz.spec b/xz.spec
index 58259ec..a36b5df 100644
--- a/xz.spec
+++ b/xz.spec
@@ -18,13 +18,15 @@
 Summary:       LZMA Encoder/Decoder
 Summary(pl.UTF-8):     Koder/Dekoder LZMA
 Name:          xz
-Version:       5.6.0
+Version:       5.4.6
 Release:       1
 Epoch:         1
 License:       LGPL v2.1+, helper scripts on GPL v2+
 Group:         Applications/Archiving
 Source0:       
https://github.com/tukaani-project/xz/releases/download/v%{version}/%{name}-%{version}.tar.bz2
-# Source0-md5: 6efd76c69f61a87e175c198f30b9dab8
+# Source0-md5: 098549e685e27620f2fe2883b02c35f2
+Patch0:                %{name}-parallel.patch
+Patch1:                %{name}-memlimit.patch
 URL:           https://tukaani.org/xz/
 %{?with_asm:BuildRequires:     gcc >= 5:3.4}
 BuildRequires: rpm >= 4.4.9-56
@@ -115,6 +117,8 @@ Biblioteka statyczna LZMA.
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
 
 %build
 %configure \
diff --git a/xz-memlimit.patch b/xz-memlimit.patch
new file mode 100644
index 0000000..2509c49
--- /dev/null
+++ b/xz-memlimit.patch
@@ -0,0 +1,14 @@
+diff -urNp -x '*.orig' xz-5.2.5.org/src/xz/hardware.c 
xz-5.2.5/src/xz/hardware.c
+--- xz-5.2.5.org/src/xz/hardware.c     2021-03-21 00:19:11.655899186 +0100
++++ xz-5.2.5/src/xz/hardware.c 2021-03-21 00:19:11.892899186 +0100
+@@ -67,6 +67,10 @@ hardware_memlimit_set(uint64_t new_memli
+               assert(new_memlimit <= 100);
+               new_memlimit = (uint32_t)new_memlimit * total_ram / 100;
+       }
++ 
++      // limit to some sane value (in case of 64bit host and 32bit processes)
++      if (new_memlimit >= SIZE_MAX/100 * 95)
++              new_memlimit = SIZE_MAX/100 * 95;
+ 
+       if (set_compress) {
+               memlimit_compress = new_memlimit;
diff --git a/xz-parallel.patch b/xz-parallel.patch
new file mode 100644
index 0000000..a9e4acb
--- /dev/null
+++ b/xz-parallel.patch
@@ -0,0 +1,21 @@
+--- xz-5.1.1alpha/src/xz/xz.1~ 2011-04-12 12:42:58.000000000 +0200
++++ xz-5.1.1alpha/src/xz/xz.1  2011-10-22 23:07:14.357449738 +0200
+@@ -913,7 +913,7 @@
+ .B 0
+ makes
+ .B xz
+-use up to as many threads as the processor(s) on the system support.
++use up to as many threads as the processor(s) on the system support (default 
in PLD).
+ The actual number of threads can be fewer than
+ .I threads
+ if the input file is not big enough
+--- xz-5.4.0/src/xz/hardware.c.orig    2022-12-14 21:03:50.227052828 +0100
++++ xz-5.4.0/src/xz/hardware.c 2022-12-14 23:25:02.994248765 +0100
+@@ -334,5 +334,7 @@
+               memlimit_mt_default = mem_ceiling;
+ #endif
+ 
++      hardware_threads_set(0);
++      hardware_memlimit_set(80, true, false, false, true);
+       return;
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xz.git/commitdiff/b369fe78b7b4a02e900fb6fe7ac035a9bba39436

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to