summaryrefslogtreecommitdiff
path: root/sci-mathematics/yafu
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-02-25 19:25:33 +0000
committerV3n3RiX <venerix@koprulu.sector>2025-02-25 19:25:33 +0000
commit67dbd3ba144944fbf4b466be1b5fa0569b774e6f (patch)
tree721c7f9085992578da57f71ea0c5becb6827cdb4 /sci-mathematics/yafu
parentd4653056cc74d97f24bef0d56b4ebe11c53c8b76 (diff)
gentoo auto-resync : 25:02:2025 - 19:25:33
Diffstat (limited to 'sci-mathematics/yafu')
-rw-r--r--sci-mathematics/yafu/Manifest5
-rw-r--r--sci-mathematics/yafu/files/yafu-1.34.3-Makefile.patch11
-rw-r--r--sci-mathematics/yafu/files/yafu-1.34.3-fix-makefiles.patch75
-rw-r--r--sci-mathematics/yafu/files/yafu-1.34.3-mpz_set.patch14
-rw-r--r--sci-mathematics/yafu/yafu-1.34.3-r1.ebuild57
-rw-r--r--sci-mathematics/yafu/yafu-1.34.3-r2.ebuild51
6 files changed, 143 insertions, 70 deletions
diff --git a/sci-mathematics/yafu/Manifest b/sci-mathematics/yafu/Manifest
index 93631a27d2f9..347cf0e446b9 100644
--- a/sci-mathematics/yafu/Manifest
+++ b/sci-mathematics/yafu/Manifest
@@ -1,4 +1,5 @@
-AUX yafu-1.34.3-Makefile.patch 211 BLAKE2B 787be431c83a03f4db65c4117f6b75b8f510dee9fcf93b8bcf20a7dcdf4393068da16720914e9dba6a098df7698a5101567b01b7f2addc1d3032ac9204a718d0 SHA512 ee88e14d5d7bc61f1666712ca96800f9f2715e3634e69edb4e8d4aceb4cc364f72fdffa7117970204574100cf3481f458dea2b5effa6b025cd26fb5c77a45d42
+AUX yafu-1.34.3-fix-makefiles.patch 2315 BLAKE2B 58510fa056d94aa4e3e57fc1dbc6fda201479466c9e095096a2eff276c0176a8b0ae956a2e0790f7fffa9290aa9f31395608203101dc83cb3a2b6d370cca4a15 SHA512 31ec61ef4c1673fb1d17fecbc639f43dd03e9dcb9eb62d49a8639aad9a215354d3070c26b81912b06edf3c147ace0cb10bdf1e1553e9753e3896dc34830a64c7
+AUX yafu-1.34.3-mpz_set.patch 427 BLAKE2B 0446f1ef768e3dce78b0611aa235162bf8b800178ec3b4683c15e301ba06ee832f71bd1e1a725e58a5c5edfa3b0c3444aa86acf2e09c9eaca8fb4eb53de67c79 SHA512 285c6720712e106a53a82b9844d4ddb3b7c2d678fea1a988ad4ec7a27322b132b5228041ed2773631ff5409ea77dfbe7749fe7c17b564de4e15cd535ff2a2e12
DIST yafu-1.34-src.zip 686655 BLAKE2B 6c5ccb587aeacf4c72c7969d409846ad768f2f7ec1c7c100372617ce75c00a6d61a0a00691f6ebce4de1250e00cb4abe4abeee5278d2aab19d0d8861c8bd1916 SHA512 f8afba77e0286c579b4152517ba3a0b6b85d43606e4fafc653dc06b7f7c2aba0f8f3c65b38f3496657495bff476dd4cc8e06daaad8a7a78a36fc6e1c0cf046a4
-EBUILD yafu-1.34.3-r1.ebuild 1339 BLAKE2B 884874bcbdf188c4c82fe2089755f87f62f4e1cb9df13c07f0ab204811eda04c04861a3b10f954cba857d1ed1526c2269f60c5a40d9b4994efd5482cf997cd15 SHA512 8ed3568aea91378e51fc4e30686e5e4dfc9d91a2dc1746474ce93f1825848d714efc17183d247f0dde0951051b6e4c2541a7032b031629f0e0d004f270462a07
+EBUILD yafu-1.34.3-r2.ebuild 998 BLAKE2B 02dc0145b99c0eddba41da711e35825ff20f17b9a3a04e0a355a628f88e7e2bc3e8cc423426d0c518295ec7056e142f81636c069ba875c7cf0520f00e978bb2a SHA512 0e922a05a1ee5624e32eedf34adc590f3dc591c3b20c681567b62dc4b5f957c4d77892d7f4ee89018457d72c91b1b947e07ef41a760c851e2cc9eb73a0427abf
MISC metadata.xml 242 BLAKE2B a794792e99da2e384e10cf510ccecb79d22a49025b15bda7e9da2bfd0f931dd19e2f45b8ed7a46ad779de32c593be3d13b2d0292fe7d150ac6b912e0d83be188 SHA512 b4ea86c5a13f67ec76ff845162b94a6d554cecb2869a1c1cc292388ae5e9073c0544b1567ebe77583447da12cfa172c3b46d775db51077479bdf5fa48cb330fa
diff --git a/sci-mathematics/yafu/files/yafu-1.34.3-Makefile.patch b/sci-mathematics/yafu/files/yafu-1.34.3-Makefile.patch
deleted file mode 100644
index bee579150c9d..000000000000
--- a/sci-mathematics/yafu/files/yafu-1.34.3-Makefile.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -87,7 +87,7 @@ ifeq ($(CC),icc)
- CFLAGS += -mtune=core2 -march=core2
- endif
-
--LIBS += -lecm -lgmp
-+LIBS += -lecm -lgmp -lgomp
-
- CFLAGS += $(OPT_FLAGS) $(WARN_FLAGS) $(INC)
-
diff --git a/sci-mathematics/yafu/files/yafu-1.34.3-fix-makefiles.patch b/sci-mathematics/yafu/files/yafu-1.34.3-fix-makefiles.patch
new file mode 100644
index 000000000000..d077c7308bd2
--- /dev/null
+++ b/sci-mathematics/yafu/files/yafu-1.34.3-fix-makefiles.patch
@@ -0,0 +1,75 @@
+Conglomerates previous makefile fix, seds and fixes to let toolchain
+compiler and settings be used to the build system.
+Removes non-existing include and library directories that arose as result
+of initial development on mingw with hand-build dependencies.
+Replaces wrong default path to system ggnfs from "same directory" to "system binaries"
+Was sed:
+sed -i -e 's~strcpy(fobj->nfs_obj.ggnfs_dir,"./");~strcpy(fobj->nfs_obj.ggnfs_dir,"/usr/bin/");~' factor/factor_common.c || die
+Must somehow include EPREFIX there...
+--- a/Makefile
++++ b/Makefile
+@@ -17,20 +17,13 @@
+ # --bbuhrow@gmail.com 7/28/09
+ # ----------------------------------------------------------------------*/
+
+-CC = gcc
+ #CC = x86_64-w64-mingw32-gcc-4.5.1
+ #CFLAGS = -march=core2 -mtune=core2
+-CFLAGS = -g
+ WARN_FLAGS = -Wall # -Wconversion
+-OPT_FLAGS = -O3
+ INC = -I. -Iinclude
+
+ # modify these for your particular gmp/gmp-ecm installation
+-INC += -I../gmp/include
+-LIBS += -L../gmp/lib/linux/x86_64
+
+-INC += -I../gmp-ecm/include
+-LIBS += -L../gmp-ecm/lib/linux/x86_64
+
+ ifeq ($(STATIC),1)
+ CFLAGS += -static
+@@ -39,8 +32,6 @@
+ ifeq ($(PROFILE),1)
+ CFLAGS += -pg
+ CFLAGS += -DPROFILING
+-else
+- OPT_FLAGS += -fomit-frame-pointer
+ endif
+
+ # if this option is specified then compile *both* the sse2 and sse4.1 versions of the
+@@ -87,7 +78,7 @@
+ CFLAGS += -mtune=core2 -march=core2
+ endif
+
+-LIBS += -lecm -lgmp
++LIBS += -lecm -lgmp -lgomp
+
+ CFLAGS += $(OPT_FLAGS) $(WARN_FLAGS) $(INC)
+
+@@ -232,10 +223,10 @@
+ @echo "add 'PROFILE=1' to make with profiling enabled (slower) "
+
+ x86: $(MSIEVE_OBJS) $(YAFU_OBJS) $(YAFU_NFS_OBJS)
+- $(CC) -m32 $(CFLAGS) $(MSIEVE_OBJS) $(YAFU_OBJS) $(YAFU_NFS_OBJS) -o yafu $(LIBS)
++ $(CC) $(LDFLAGS) -m32 $(CFLAGS) $(MSIEVE_OBJS) $(YAFU_OBJS) $(YAFU_NFS_OBJS) -o yafu $(LIBS)
+
+ x86_64: $(MSIEVE_OBJS) $(YAFU_OBJS) $(YAFU_NFS_OBJS)
+- $(CC) $(CFLAGS) $(MSIEVE_OBJS) $(YAFU_OBJS) $(YAFU_NFS_OBJS) -o yafu $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(MSIEVE_OBJS) $(YAFU_OBJS) $(YAFU_NFS_OBJS) -o yafu $(LIBS)
+
+
+ clean:
+
+--- a/factor/factor_common.c
++++ b/factor/factor_common.c
+@@ -296,7 +296,7 @@
+ #elif defined(WIN32)
+ strcpy(fobj->nfs_obj.ggnfs_dir,".\\");
+ #else
+- strcpy(fobj->nfs_obj.ggnfs_dir,"./");
++ strcpy(fobj->nfs_obj.ggnfs_dir,"/usr/bin/");
+ #endif
+
+ //initialize autofactor object
+
diff --git a/sci-mathematics/yafu/files/yafu-1.34.3-mpz_set.patch b/sci-mathematics/yafu/files/yafu-1.34.3-mpz_set.patch
new file mode 100644
index 000000000000..523fef69745e
--- /dev/null
+++ b/sci-mathematics/yafu/files/yafu-1.34.3-mpz_set.patch
@@ -0,0 +1,14 @@
+Correct way to assign value to mpz_t is to use openmp's funcion-like macro,
+because it's horrible one-element array.
+https://bugs.gentoo.org/920324
+--- a/top/eratosthenes/soe_util.c
++++ b/top/eratosthenes/soe_util.c
+@@ -131,7 +131,7 @@
+ sdata->pbound = sieve_p[num_sp - 1];
+ sdata->pboundi = num_sp;
+ }
+- sdata->offset = offset;
++ mpz_set(*(sdata->offset), offset);
+ mpz_clear(tmpz);
+ sdata->sieve_range = 1;
+ }
diff --git a/sci-mathematics/yafu/yafu-1.34.3-r1.ebuild b/sci-mathematics/yafu/yafu-1.34.3-r1.ebuild
deleted file mode 100644
index 0a965899b443..000000000000
--- a/sci-mathematics/yafu/yafu-1.34.3-r1.ebuild
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit flag-o-matic
-
-MY_PV="$(ver_cut 1-2)"
-DESCRIPTION="Yet another factoring utility"
-HOMEPAGE="https://sourceforge.net/projects/yafu/"
-SRC_URI="https://downloads.sourceforge.net/${PN}/${MY_PV}/${PN}-${MY_PV}-src.zip"
-
-SLOT="0"
-LICENSE="public-domain"
-KEYWORDS="~amd64 ~x86"
-
-DEPEND="
- || (
- >=sys-devel/gcc-4.2:*[openmp]
- llvm-core/clang-runtime:*[openmp]
- )
- dev-libs/gmp:0=
- sci-mathematics/gmp-ecm"
-RDEPEND="${DEPEND}"
-BDEPEND="app-arch/unzip"
-
-PATCHES=( "${FILESDIR}"/${P}-Makefile.patch )
-
-src_prepare() {
- default
- sed -i \
- -e 's:../gmp/include:gmp:' \
- -e 's:../gmp-ecm/include:gmp-ecm:' \
- -e 's:# LIBS += -L../msieve/lib/linux/x86_64:LIBS += -lmsieve -lz -ldl:' \
- -e 's:CFLAGS = -g:#CFLAGS = -g:' \
- -e '/$(LIBS)$/s:$(CC):$(CC) $(LDFLAGS):g' Makefile || die
- sed -i -e 's:\"config.h\":<gmp-ecm/config.h>:g' top/driver.c || die
-
- # proper ggnfs default path
- sed -i -e 's~strcpy(fobj->nfs_obj.ggnfs_dir,"./");~strcpy(fobj->nfs_obj.ggnfs_dir,"/usr/bin/");~' factor/factor_common.c || die
-}
-
-src_configure() {
- append-cflags -fcommon
- default
-}
-
-src_compile() {
- local VAR
- use amd64 && emake $VAR x86_64
- use x86 && emake $VAR x86
-}
-
-src_install() {
- dobin "${S}"/yafu
- dodoc docfile.txt README yafu.ini
-}
diff --git a/sci-mathematics/yafu/yafu-1.34.3-r2.ebuild b/sci-mathematics/yafu/yafu-1.34.3-r2.ebuild
new file mode 100644
index 000000000000..342b94dbcb06
--- /dev/null
+++ b/sci-mathematics/yafu/yafu-1.34.3-r2.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic edos2unix toolchain-funcs
+
+MY_PV="$(ver_cut 1-2)"
+DESCRIPTION="Yet another factoring utility"
+HOMEPAGE="https://sourceforge.net/projects/yafu/"
+SRC_URI="https://downloads.sourceforge.net/${PN}/${MY_PV}/${PN}-${MY_PV}-src.zip"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="
+ || (
+ >=sys-devel/gcc-4.2:*[openmp]
+ llvm-core/clang-runtime:*[openmp]
+ )
+ dev-libs/gmp:0=
+ sci-mathematics/gmp-ecm"
+RDEPEND="${DEPEND}"
+BDEPEND="app-arch/unzip"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-makefiles.patch
+ "${FILESDIR}"/${P}-mpz_set.patch
+)
+
+src_prepare() {
+ edos2unix top/eratosthenes/soe_util.c factor/factor_common.c
+ default
+}
+
+src_compile() {
+ tc-export CC
+ append-cflags -fcommon
+ use amd64 && emake x86_64
+ use x86 && emake x86
+}
+
+src_test() {
+ "${S}"/yafu "factor(121)" || die
+}
+
+src_install() {
+ dobin "${S}"/yafu
+ dodoc docfile.txt README yafu.ini
+}