summaryrefslogtreecommitdiff
path: root/app-arch/par2cmdline
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-07-14 01:38:22 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-07-14 01:38:22 +0100
commitae5005f56ad29d19861ad8a8acb541cf0e99c8d9 (patch)
tree519be2a26050e34055ea7f44d9272c9365e10e5d /app-arch/par2cmdline
parentd01ca4361883c2aec4ffb1c2dcd75980773fdc31 (diff)
gentoo auto-resync : 14:07:2022 - 01:38:22
Diffstat (limited to 'app-arch/par2cmdline')
-rw-r--r--app-arch/par2cmdline/Manifest3
-rw-r--r--app-arch/par2cmdline/files/par2cmdline-0.8.1-big-endian.patch70
-rw-r--r--app-arch/par2cmdline/par2cmdline-0.8.1.ebuild1
3 files changed, 73 insertions, 1 deletions
diff --git a/app-arch/par2cmdline/Manifest b/app-arch/par2cmdline/Manifest
index 3168ed3ed1a5..f655ce45c43f 100644
--- a/app-arch/par2cmdline/Manifest
+++ b/app-arch/par2cmdline/Manifest
@@ -1,5 +1,6 @@
+AUX par2cmdline-0.8.1-big-endian.patch 2911 BLAKE2B 749e0f955997d52da1b676d750057724e78302cdf70bff777b1bbf68945faedabbd050339950a96121a4aa197af0b0520a4e9665f3d3767fbacdf60a6baa2f55 SHA512 4186f8b3506dab8128abae28549fd2af4200aa656c65682fe68f02c04c1b0bc45144d24851ff54ef82ac4d40d7f1eb3ae9fae31d426a1092447cee339e3c0016
DIST par2cmdline-0.8.0.tar.bz2 3130388 BLAKE2B acaa366288720d87115ed2b4470ada276ccdff8bc23d7cc8f7c8aab03f9dc992777fd0d67e39b877ed94b77cca679f5c9d2824c778f6481e71c7120a90b45cc0 SHA512 af91024dc80a4af0935c2fc0b867e57a8d3879d93146f52ab62d8bb105f2c637abe46c762302515417691d12144818446932c970d1018d2f10c0d4e1fa455020
DIST par2cmdline-0.8.1.tar.bz2 3213343 BLAKE2B 4778fd32012c61739e04a4e564eaedf48527c04b0d83c5467c34808913e81cd5459a6a5bfabe79ca74f520761ebd3592e80b714f3ef45cc98866da919757a176 SHA512 b33ee654bd14269afb02d48175abf183281270c3e0dad9ffcaa0aa69c4271715a85e550d6d56fe5460ebfe9a37dc53b7d2210cd79a6f55d3921dc5dd5972c846
EBUILD par2cmdline-0.8.0.ebuild 768 BLAKE2B 884c01c68cf08b345dee94c4db74f15648f01d5b14c6e211937dc6d79b5c64ca28feda23179bf148c73fd65eed1a4ac3fa7215b155ccac202afe1db86ae6b1a9 SHA512 e98ad86ee881a190855fdaf263cda584e7de277960d31b3b7bf0d80c8944adf5ba6c6a7d916168e7a158c9daf344136d0ea34b0d2395c1932f8bfb07401bf918
-EBUILD par2cmdline-0.8.1.ebuild 769 BLAKE2B 0d722cb256b03cd112124caed0cbefcdd6e2d6b23c8293f76bc40141146315324509fa0a0f3c2d73ff4aa6f2d69c0408c804c4bc55853cf3d6c6989d11b7ca07 SHA512 14e8681dc4ba4bda303da238e215065be0932e9c9924776a17071b528444bf2989ceeb697a2bc13e247522725fd1370aafdde0ffd72ecd37d4e7db97f9539447
+EBUILD par2cmdline-0.8.1.ebuild 817 BLAKE2B 58636a417626901a302f369338fe262a326e6b43bfd9f1255fea226b60bbaac5f504a53c302d4e18400b85bb0db4ee87f573ef9a9737e2746ec9716e50e12315 SHA512 d54e28b92f56002e8fcfb727a4299b4668b80cc1622469157340b6cb9b0283c55379190459af3e29093b160cc191500c2a4fc001025ca455aeebfb6fd0284bab
MISC metadata.xml 313 BLAKE2B 13e31cd90dad938be801aba6086fa8234878f9b691decd84e1fb56108a10e368c6442098b8574874f5c405f33d85c6236eb30e21e8f57e7e7c09deefe541a1d8 SHA512 88cd31f008359d686c66f9813f498c5c4c3f7662a5acfe5c7eac7c244bc0688fc544b36dd711c1949624c186e143f0d46e9c636b7ff54f401f67d95f3d33d69d
diff --git a/app-arch/par2cmdline/files/par2cmdline-0.8.1-big-endian.patch b/app-arch/par2cmdline/files/par2cmdline-0.8.1-big-endian.patch
new file mode 100644
index 000000000000..e45f8f3235d1
--- /dev/null
+++ b/app-arch/par2cmdline/files/par2cmdline-0.8.1-big-endian.patch
@@ -0,0 +1,70 @@
+# backport upstream pr #144, fixes test failure on big endian archs;
+# see https://github.com/Parchive/par2cmdline/issues/143
+From 4f3576a314d7169912842ec9dc1e595e61e52653 Mon Sep 17 00:00:00 2001
+From: Michael Nahas <mike@nahas.com>
+Date: Tue, 11 Feb 2020 22:42:08 -0600
+Subject: [PATCH] Fix for Github issue #143. Test did not account for
+ endianness correctly.
+
+---
+ src/reedsolomon_test.cpp | 30 +++++++++++++++++++++++++++---
+ 1 file changed, 27 insertions(+), 3 deletions(-)
+
+diff --git a/src/reedsolomon_test.cpp b/src/reedsolomon_test.cpp
+index 1285b3c..c8d26e9 100644
+--- a/src/reedsolomon_test.cpp
++++ b/src/reedsolomon_test.cpp
+@@ -433,6 +433,23 @@ int test3() {
+
+
+ // Check that the correct constants are being used for Par2
++
++//The test pretends there are 10 input blocks ("NUM_IN") and 1
++//recovery block ("NUM_REC"), each 1024 bytes long ("BUF_SIZE"). These
++//are all stored in data[11][BUF_SIZE], with the input blocks
++//occupying data[0] through data[9] and the recovery block in
++//data[10].
++
++//The test zeroes out the input blocks and then writes a 1 into the
++//first location of the first input block, and into the second
++//location of the second input block, etc. It then generates the
++//recovery block using many calls to ReedSolomon. When that happens,
++//those 1s are multiplied by the coefficients for each input block. So
++//the first location of recovery block holds the coefficient for the
++//first input block, the second location has the coefficient for the
++//second input block, etc. Those values are checked against the
++//expected values passed to the function.
++
+ template<typename gtype, typename utype>
+ int test4(int NUM_IN, int *expected_bases) {
+ //const int NUM_IN = 10;
+@@ -448,8 +465,9 @@ int test4(int NUM_IN, int *expected_bases) {
+ for (int k = 0; k < BUF_SIZE; k++) {
+ data[i][k] = (u8)0;
+ }
+- // EXCEPT put a 1 in a different place for each file
+- ((gtype *)(&(data[i][0])))[i] = (utype) 1;
++ // EXCEPT write a (little endian) 1 in a different place for each file
++ // In the i-th file, it is written into the i-th location
++ data[i][sizeof(utype)*i] = (u8) 1;
+ }
+ // zero recovery
+ for (int j = 0; j < NUM_REC; j++) {
+@@ -488,7 +506,13 @@ int test4(int NUM_IN, int *expected_bases) {
+ // The recovery file has exponent 1 and should
+ // contain each base to the power 1.
+ for (int i = 0; i < NUM_IN; i++) {
+- int base = (utype) ((gtype *) &(data[NUM_IN+0][0]))[i];
++ // read little-endian value
++ utype v = 0;
++ for (int byte_index = 0; byte_index < sizeof(utype); byte_index++) {
++ u8 byte = data[NUM_IN+0][sizeof(utype)*i + byte_index];
++ v |= (((utype)byte) << (byte_index*8));
++ }
++ int base = v;
+ if (base != expected_bases[i]) {
+ cerr << "base at location " << i << " did not match expected." << endl;
+ cerr << " base = " << base << endl;
+--
+2.17.1
+
diff --git a/app-arch/par2cmdline/par2cmdline-0.8.1.ebuild b/app-arch/par2cmdline/par2cmdline-0.8.1.ebuild
index e12295b12951..adeb06611a33 100644
--- a/app-arch/par2cmdline/par2cmdline-0.8.1.ebuild
+++ b/app-arch/par2cmdline/par2cmdline-0.8.1.ebuild
@@ -14,6 +14,7 @@ SLOT="0"
KEYWORDS="amd64 ~arm ~hppa ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos"
IUSE="openmp"
+PATCHES=( "${FILESDIR}"/${P}-big-endian.patch )
DOCS="AUTHORS ChangeLog README" # NEWS is empty, PORTING and ROADMAP are for building
pkg_pretend() {