commit: 8d88e9a74fc8eb9a1a476fb6d92a1a10967bc050 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sun Jul 27 06:44:57 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sun Jul 27 07:13:22 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d88e9a7
dev-libs/jerasure: update EAPI 7 -> 8, fix C99 issues * EAPI 8 * Fix C99 issues * Fix missing autoconf macro, making ac_cv_sizeof_long blank Closes: https://bugs.gentoo.org/871453 Closes: https://bugs.gentoo.org/955579 Signed-off-by: Sam James <sam <AT> gentoo.org> .../jerasure/files/jerasure-2.0.0-autoconf.patch | 10 + dev-libs/jerasure/files/jerasure-2.0.0-c99.patch | 327 +++++++++++++++++++++ dev-libs/jerasure/jerasure-2.0.0-r3.ebuild | 38 +++ 3 files changed, 375 insertions(+) diff --git a/dev-libs/jerasure/files/jerasure-2.0.0-autoconf.patch b/dev-libs/jerasure/files/jerasure-2.0.0-autoconf.patch new file mode 100644 index 000000000000..60b347cf3adc --- /dev/null +++ b/dev-libs/jerasure/files/jerasure-2.0.0-autoconf.patch @@ -0,0 +1,10 @@ +--- a/m4/ax_ext.m4 ++++ b/m4/ax_ext.m4 +@@ -164,6 +164,7 @@ AC_DEFUN([AX_EXT], + fi + fi + ++ AC_CHECK_SIZEOF([long]) + if test "$ac_cv_sizeof_long" -eq 8; then + SIMD_FLAGS="$SIMD_FLAGS -DARCH_64" + fi diff --git a/dev-libs/jerasure/files/jerasure-2.0.0-c99.patch b/dev-libs/jerasure/files/jerasure-2.0.0-c99.patch new file mode 100644 index 000000000000..173acd1772b0 --- /dev/null +++ b/dev-libs/jerasure/files/jerasure-2.0.0-c99.patch @@ -0,0 +1,327 @@ +https://bugs.gentoo.org/871453 +https://bugs.gentoo.org/955579 +--- a/Examples/cauchy_01.c ++++ b/Examples/cauchy_01.c +@@ -50,10 +50,11 @@ + #include <string.h> + #include "jerasure.h" + #include "reed_sol.h" ++#include "cauchy.h" + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: cauchy_01 n w - Converts the value n to a bitmatrix using GF(2^w).\n"); + fprintf(stderr, " \n"); +--- a/Examples/cauchy_02.c ++++ b/Examples/cauchy_02.c +@@ -54,7 +54,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: cauchy_02 k m w seed - CRS coding example using Bloemer's original matrix.\n"); + fprintf(stderr, " \n"); +@@ -84,7 +84,7 @@ usage(char *s) + exit(1); + } + +-static print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) ++static void print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) + { + int i, j, x; + unsigned char *up; +--- a/Examples/cauchy_03.c ++++ b/Examples/cauchy_03.c +@@ -54,7 +54,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: cauchy_03 k m w seed - CRS coding example improving the matrix.\n"); + fprintf(stderr, " \n"); +@@ -88,7 +88,7 @@ usage(char *s) + exit(1); + } + +-static print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) ++static void print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) + { + int i, j, x; + unsigned char *up; +--- a/Examples/cauchy_04.c ++++ b/Examples/cauchy_04.c +@@ -54,7 +54,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: cauchy_04 k m w seed - CRS coding example improving the matrix.\n"); + fprintf(stderr, " \n"); +@@ -85,7 +85,7 @@ usage(char *s) + exit(1); + } + +-static print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) ++static void print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) + { + int i, j, x; + unsigned char *up; +--- a/Examples/decoder.c ++++ b/Examples/decoder.c +@@ -65,6 +65,7 @@ same arguments, and encoder.c does error check. + #include <sys/time.h> + #include <sys/stat.h> + #include <signal.h> ++#include <unistd.h> + #include "jerasure.h" + #include "reed_sol.h" + #include "galois.h" +--- a/Examples/encoder.c ++++ b/Examples/encoder.c +@@ -63,6 +63,7 @@ is the file name with "_k#" or "_m#" and then the extension. + #include <stdlib.h> + #include <errno.h> + #include <signal.h> ++#include <unistd.h> + #include <gf_rand.h> + #include "jerasure.h" + #include "reed_sol.h" +--- a/Examples/jerasure_01.c ++++ b/Examples/jerasure_01.c +@@ -50,7 +50,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: jerasure_01 r c w - creates and prints out a matrix in GF(2^w).\n\n"); + fprintf(stderr, " Element i,j is equal to 2^(i*c+j)\n"); +--- a/Examples/jerasure_02.c ++++ b/Examples/jerasure_02.c +@@ -50,7 +50,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: jerasure_02 r c w - Converts the matrix of jerasure_01 to a bit matrix.\n"); + fprintf(stderr, " \n"); +--- a/Examples/jerasure_03.c ++++ b/Examples/jerasure_03.c +@@ -51,7 +51,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: jerasure_03 k w - Creates a kxk Cauchy matrix in GF(2^w). \n\n"); + fprintf(stderr, " k must be < 2^w. Element i,j is 1/(i+(2^w-j-1)). (If that is\n"); +--- a/Examples/jerasure_04.c ++++ b/Examples/jerasure_04.c +@@ -51,7 +51,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: jerasure_04 k w - Performs the analogous bit-matrix operations to jerasure_03.\n\n"); + fprintf(stderr, " It converts the matrix to a kw*kw bit matrix and does the same operations.\n"); +--- a/Examples/jerasure_05.c ++++ b/Examples/jerasure_05.c +@@ -53,7 +53,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: jerasure_05 k m w size seed - Does a simple Reed-Solomon coding example in GF(2^w).\n"); + fprintf(stderr, " \n"); +--- a/Examples/jerasure_06.c ++++ b/Examples/jerasure_06.c +@@ -53,7 +53,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: jerasure_06 k m w packetsize seed\n"); + fprintf(stderr, "Does a simple Cauchy Reed-Solomon coding example in GF(2^w).\n"); +@@ -72,7 +72,7 @@ usage(char *s) + exit(1); + } + +-static print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) ++static void print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) + { + int i, j, x; + unsigned char *up; +--- a/Examples/jerasure_07.c ++++ b/Examples/jerasure_07.c +@@ -53,7 +53,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: jerasure_07 k m w seed - Scheduled Cauchy Reed-Solomon coding example in GF(2^w).\n"); + fprintf(stderr, " \n"); +@@ -72,7 +72,7 @@ usage(char *s) + exit(1); + } + +-static print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) ++static void print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) + { + int i, j, x; + unsigned char *up; +--- a/Examples/jerasure_08.c ++++ b/Examples/jerasure_08.c +@@ -53,7 +53,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: jerasure_08 k w seed - Example schedule cache usage with RAID-6\n"); + fprintf(stderr, " \n"); +@@ -75,7 +75,7 @@ usage(char *s) + exit(1); + } + +-static print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) ++static void print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) + { + int i, j, x; + unsigned char *up; +--- a/Examples/liberation_01.c ++++ b/Examples/liberation_01.c +@@ -54,7 +54,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: liberation_01 k w seed - Liberation RAID-6 coding/decoding example in GF(2^w).\n"); + fprintf(stderr, " \n"); +@@ -73,7 +73,7 @@ usage(char *s) + exit(1); + } + +-static print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) ++static void print_array(char **ptrs, int ndevices, int size, int packetsize, char *label) + { + int i, j, x; + unsigned char *up; +--- a/Examples/reed_sol_01.c ++++ b/Examples/reed_sol_01.c +@@ -54,7 +54,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: reed_sol_01 k m w seed - Does a simple Reed-Solomon coding example in GF(2^w).\n"); + fprintf(stderr, " \n"); +--- a/Examples/reed_sol_02.c ++++ b/Examples/reed_sol_02.c +@@ -52,7 +52,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: reed_sol_02 k m w - Vandermonde matrices in GF(2^w).\n"); + fprintf(stderr, " \n"); +--- a/Examples/reed_sol_03.c ++++ b/Examples/reed_sol_03.c +@@ -53,7 +53,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: reed_sol_03 k w seed - Does a simple RAID-6 coding example in GF(2^w).\n"); + fprintf(stderr, " \n"); +--- a/Examples/reed_sol_04.c ++++ b/Examples/reed_sol_04.c +@@ -54,7 +54,7 @@ + + #define talloc(type, num) (type *) malloc(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: reed_sol_04 w seed - Shows reed_sol_galois_wXX_region_multby_2\n"); + fprintf(stderr, " \n"); +--- a/Examples/reed_sol_test_gf.c ++++ b/Examples/reed_sol_test_gf.c +@@ -49,6 +49,7 @@ + #include <string.h> + #include <gf_complete.h> + #include <gf_method.h> ++#include <gf_rand.h> + #include <stdint.h> + #include "jerasure.h" + #include "reed_sol.h" +@@ -68,7 +69,7 @@ static void free16(void *ptr) { + + #define talloc(type, num) (type *) malloc16(sizeof(type)*(num)) + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: reed_sol_test_gf k m w seed (additional GF args) - Tests Reed-Solomon in GF(2^w).\n"); + fprintf(stderr, " \n"); +--- a/Examples/reed_sol_time_gf.c ++++ b/Examples/reed_sol_time_gf.c +@@ -51,6 +51,7 @@ + #include <gf_rand.h> + #include <gf_method.h> + #include <stdint.h> ++#include <sys/time.h> + #include "jerasure.h" + #include "reed_sol.h" + +@@ -87,7 +88,7 @@ timer_split (const double *t) + return (cur_t - *t); + } + +-usage(char *s) ++void usage(char *s) + { + fprintf(stderr, "usage: reed_sol_time_gf k m w seed iterations bufsize (additional GF args) - Test and time Reed-Solomon in a particular GF(2^w).\n"); + fprintf(stderr, " \n"); +-- +2.50.1 + +--- a/Examples/encoder.c ++++ b/Examples/encoder.c +@@ -621,6 +621,7 @@ int is_prime(int w) { + else { return 0; } + } + } ++ return 0; + } + + /* Handles ctrl-\ event */ diff --git a/dev-libs/jerasure/jerasure-2.0.0-r3.ebuild b/dev-libs/jerasure/jerasure-2.0.0-r3.ebuild new file mode 100644 index 000000000000..006dfc51af5b --- /dev/null +++ b/dev-libs/jerasure/jerasure-2.0.0-r3.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +DESCRIPTION="A Library in C Facilitating Erasure Coding for Storage Applications" +HOMEPAGE="http://jerasure.org" +SRC_URI="https://dev.gentoo.org/~prometheanfire/dist/${P}.tar.gz" +S="${WORKDIR}/${PN}.git" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" + +DEPEND="dev-libs/gf-complete" +RDEPEND="${DEPEND}" + +DOCS=( Manual.pdf README README.txt README.nd ) + +PATCHES=( + "${FILESDIR}"/${PN}-2.0.0-c99.patch + "${FILESDIR}"/${PN}-2.0.0-autoconf.patch +) + +src_prepare() { + default + sed -i -e 's/ $(SIMD_FLAGS)//g' src/Makefile.am Examples/Makefile.am || die + eautoreconf +} + +src_install() { + default + einstalldocs + doheader include/{cauchy,galois,liberation,reed_sol}.h + find "${D}" -name '*.la' -delete || die +}
