summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-arch/par2cmdline')
-rw-r--r--app-arch/par2cmdline/Manifest4
-rw-r--r--app-arch/par2cmdline/files/par2cmdline-0.8.1-big-endian.patch70
-rw-r--r--app-arch/par2cmdline/metadata.xml2
-rw-r--r--app-arch/par2cmdline/par2cmdline-0.7.3.ebuild30
-rw-r--r--app-arch/par2cmdline/par2cmdline-0.8.1-r1.ebuild (renamed from app-arch/par2cmdline/par2cmdline-0.8.0.ebuild)8
-rw-r--r--app-arch/par2cmdline/par2cmdline-0.8.1-r2.ebuild (renamed from app-arch/par2cmdline/par2cmdline-0.7.4.ebuild)13
6 files changed, 82 insertions, 45 deletions
diff --git a/app-arch/par2cmdline/Manifest b/app-arch/par2cmdline/Manifest
index 9d79307b95f8..0e93c2d1291a 100644
--- a/app-arch/par2cmdline/Manifest
+++ b/app-arch/par2cmdline/Manifest
@@ -1,3 +1 @@
-DIST par2cmdline-0.7.3.tar.bz2 3129759 BLAKE2B 4206c1ec4b41e58044b29d1ae0fe7c2cb9611b87aee2186105cc3f6f1afb5a22540ae31b837edd6a8a4b852000081bc52a16e88c6951326504f219edbd2f0b0a SHA512 85fe91f2e7cc1888171390f82fe2d12279e65eab17b3a6db209998aed316c5ea9dd5e63004cf975cbe460c1ef27860af31160e8757921c4027e27997dcd8be8a
-DIST par2cmdline-0.7.4.tar.bz2 3129835 BLAKE2B 5cdc03a71d3db04928eb818037f66e4d624ee7479f1b942982b095e24a4a17c6fd5aebd032b4ba81b23f15b80ee4727b027746edbe9d1b4390cc327f469e5c5c SHA512 20f99556b4dae2e4467d781a96adab8d9f9a42dd43707de788b268eeea2bf59d92847e3c4faf413ea3de361360ef1236e97343ee8b625c9c2cd65ec9546e61ec
-DIST par2cmdline-0.8.0.tar.bz2 3130388 BLAKE2B acaa366288720d87115ed2b4470ada276ccdff8bc23d7cc8f7c8aab03f9dc992777fd0d67e39b877ed94b77cca679f5c9d2824c778f6481e71c7120a90b45cc0 SHA512 af91024dc80a4af0935c2fc0b867e57a8d3879d93146f52ab62d8bb105f2c637abe46c762302515417691d12144818446932c970d1018d2f10c0d4e1fa455020
+DIST par2cmdline-0.8.1.tar.bz2 3213343 BLAKE2B 4778fd32012c61739e04a4e564eaedf48527c04b0d83c5467c34808913e81cd5459a6a5bfabe79ca74f520761ebd3592e80b714f3ef45cc98866da919757a176 SHA512 b33ee654bd14269afb02d48175abf183281270c3e0dad9ffcaa0aa69c4271715a85e550d6d56fe5460ebfe9a37dc53b7d2210cd79a6f55d3921dc5dd5972c846
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/metadata.xml b/app-arch/par2cmdline/metadata.xml
index 09a2860b01fe..7c3051dd25f0 100644
--- a/app-arch/par2cmdline/metadata.xml
+++ b/app-arch/par2cmdline/metadata.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>swegener@gentoo.org</email>
diff --git a/app-arch/par2cmdline/par2cmdline-0.7.3.ebuild b/app-arch/par2cmdline/par2cmdline-0.7.3.ebuild
deleted file mode 100644
index adb97f855c6e..000000000000
--- a/app-arch/par2cmdline/par2cmdline-0.7.3.ebuild
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit toolchain-funcs
-
-DESCRIPTION="A PAR-2.0 file verification and repair tool"
-HOMEPAGE="https://github.com/Parchive/par2cmdline"
-SRC_URI="https://github.com/Parchive/${PN}/releases/download/v${PV}/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~hppa ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
-IUSE="openmp"
-
-DOCS="AUTHORS ChangeLog README" # NEWS is empty, PORTING and ROADMAP are for building
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-}
-
-pkg_setup() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-}
-
-src_test() {
- # test22 fails when run in parallel
- emake -j1 check
-}
diff --git a/app-arch/par2cmdline/par2cmdline-0.8.0.ebuild b/app-arch/par2cmdline/par2cmdline-0.8.1-r1.ebuild
index 67f4910edf79..2c68a78dc0f9 100644
--- a/app-arch/par2cmdline/par2cmdline-0.8.0.ebuild
+++ b/app-arch/par2cmdline/par2cmdline-0.8.1-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=8
inherit toolchain-funcs
@@ -11,10 +11,10 @@ SRC_URI="https://github.com/Parchive/${PN}/releases/download/v${PV}/${P}.tar.bz2
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="amd64 ~arm ~hppa ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+KEYWORDS="amd64 ~arm ~hppa ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos"
IUSE="openmp"
-DOCS="AUTHORS ChangeLog README" # NEWS is empty, PORTING and ROADMAP are for building
+PATCHES=( "${FILESDIR}"/${P}-big-endian.patch )
pkg_pretend() {
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
diff --git a/app-arch/par2cmdline/par2cmdline-0.7.4.ebuild b/app-arch/par2cmdline/par2cmdline-0.8.1-r2.ebuild
index 5dfb2290f555..e026448f3a80 100644
--- a/app-arch/par2cmdline/par2cmdline-0.7.4.ebuild
+++ b/app-arch/par2cmdline/par2cmdline-0.8.1-r2.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=8
inherit toolchain-funcs
@@ -11,10 +11,10 @@ SRC_URI="https://github.com/Parchive/${PN}/releases/download/v${PV}/${P}.tar.bz2
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
IUSE="openmp"
-DOCS="AUTHORS ChangeLog README" # NEWS is empty, PORTING and ROADMAP are for building
+PATCHES=( "${FILESDIR}"/${P}-big-endian.patch )
pkg_pretend() {
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
@@ -24,7 +24,6 @@ pkg_setup() {
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}
-src_test() {
- # test22 fails when run in parallel
- emake -j1 check
+src_configure() {
+ econf $(use_enable openmp)
}