commit:     d08727de58d06ab9f92a14a83f200e973141cdd6
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 25 21:22:02 2025 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Oct 25 21:22:33 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d08727de

sci-electronics/fasthenry: add 3.0.24.03.14

Closes: https://bugs.gentoo.org/946592
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 sci-electronics/fasthenry/Manifest                 |  1 +
 .../fasthenry/fasthenry-3.0.24.03.14.ebuild        | 36 +++++++++++
 .../files/fasthenry-3.0.24.03.14-cflags.patch      | 75 ++++++++++++++++++++++
 .../files/fasthenry-3.0.24.03.14-ldflags.patch     | 40 ++++++++++++
 4 files changed, 152 insertions(+)

diff --git a/sci-electronics/fasthenry/Manifest 
b/sci-electronics/fasthenry/Manifest
index 16ee16c4b522..40a1f206a1d0 100644
--- a/sci-electronics/fasthenry/Manifest
+++ b/sci-electronics/fasthenry/Manifest
@@ -1 +1,2 @@
+DIST fasthenry-3.0wr-031424.tar.gz 5211870 BLAKE2B 
9fca528ea85abeca1e00acdc228183d9a0045ccb77f25069205adaed0fdfa78a687c481e49aaf9d3cf38e68c670294b5fb59ce2056bce47a7ef4b7ad141fc723
 SHA512 
5089a3cd62b17766a153074b8286f29569163ecc93ee409d649fc09f33791d60d807f7a8f76db70bf5e9d86ca77b25049b06bfaf734088e4444853274815ec74
 DIST fasthenry-3.0wr-071720.tar.gz 5196905 BLAKE2B 
577e1b6c9b5483144f54de96439a2f11d41bfe54fbd9973084c2e17d180843ceaaa946899ae1bc71ef7dcf3b048da9775f2015fe03ce01ece67f66f998adba9b
 SHA512 
90419c9e8cbdbb16dcb34db65e4e87643cbdbfad980012ea8c08d4fc062a113e388a38705d4d5af3970107ff71630fe7afe3b29e1de731c147798e683ec71cd3

diff --git a/sci-electronics/fasthenry/fasthenry-3.0.24.03.14.ebuild 
b/sci-electronics/fasthenry/fasthenry-3.0.24.03.14.ebuild
new file mode 100644
index 000000000000..cd32d8525d8d
--- /dev/null
+++ b/sci-electronics/fasthenry/fasthenry-3.0.24.03.14.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Three dimensional inductance computation program, Whiteley 
Research version"
+HOMEPAGE="http://www.wrcad.com/freestuff.html";
+SRC_URI="http://www.wrcad.com/ftp/pub/fasthenry-$(ver_cut 1-2)wr-$(ver_cut 
4)$(ver_cut 5)$(ver_cut 3).tar.gz"
+S=${WORKDIR}/fasthenry-3.0wr
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+
+KEYWORDS="~amd64"
+IUSE="cpu_flags_x86_avx"
+RESTRICT="mirror bindist"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-3.0.20.07.17-ar.patch"
+       "${FILESDIR}/${P}-ldflags.patch"
+       "${FILESDIR}/${P}-cflags.patch"
+)
+
+src_compile() {
+       tc-export CC AR
+       emake HAVX=$(usex cpu_flags_x86_avx 1 0) all
+}
+
+src_install() {
+       dobin bin/fasthenry
+       dobin bin/zbuf
+       dodoc -r doc/*
+       dodoc -r examples
+}

diff --git 
a/sci-electronics/fasthenry/files/fasthenry-3.0.24.03.14-cflags.patch 
b/sci-electronics/fasthenry/files/fasthenry-3.0.24.03.14-cflags.patch
new file mode 100644
index 000000000000..2229297d3455
--- /dev/null
+++ b/sci-electronics/fasthenry/files/fasthenry-3.0.24.03.14-cflags.patch
@@ -0,0 +1,75 @@
+diff '--color=auto' -ruN fasthenry-3.0wr.orig/src/fasthenry/mk_syscfg.inc 
fasthenry-3.0wr/src/fasthenry/mk_syscfg.inc
+--- fasthenry-3.0wr.orig/src/fasthenry/mk_syscfg.inc   2024-01-06 
21:27:26.000000000 +0100
++++ fasthenry-3.0wr/src/fasthenry/mk_syscfg.inc        2025-10-25 
23:07:57.993608185 +0200
+@@ -7,24 +7,7 @@
+ # is 4.8 or later.  This should also work for macOS clang on Intel
+ # Macs.
+ 
+-ifeq "$(shell uname -m)" "x86_64"
+-HAVX = 0
+-CC := gcc
+-GCC_major := "`gcc -dumpversion | cut -f1 -d.`"
+-GCC_minor := "`gcc -dumpversion | cut -f2 -d.`"
+-CHKMAJG := $(shell expr $(GCC_major) ">" 4)
+-CHKMAJE := $(shell expr $(GCC_major) "=" 4)
+-ifeq "$(CHKMAJG)" "1"
+-    HAVX = 1
+-else
+-ifeq "$(CHKMAJE)" "1"
+-CHKMINGE := $(shell expr $(GCC_minor) ">=" 8)
+-ifeq "$(CHKMINGE)" "1"
+-    HAVX = 1
+-endif
+-endif
+-endif
+-endif
++# We need HAVX=(0|1) to be supplied by portage
+ 
+ # If you build with AVX enabled, and run on a system that does not
+ # have AVX, the program will crash.  If is not likely that you would
+@@ -33,11 +16,13 @@
+ # There seems to be no way to accommodate the presence/absence of AVX
+ # at run-time nicely.
+ 
++# -mavx should come from CFLAGS if needed
++
+ ifeq "$(HAVX)" "1"
+-    MAVX = -mavx -DWITH_AVX
++    MAVX = -DWITH_AVX
+ endif
+ 
+-CFLAGS = -O3 -DFOUR $(MAVX) 
++CFLAGS += -DFOUR $(MAVX)
+ 
+ # For debugging.
+ #CFLAGS = -O -g -DFOUR $(MAVX)
+diff '--color=auto' -ruN fasthenry-3.0wr.orig/src/sparse/Makefile 
fasthenry-3.0wr/src/sparse/Makefile
+--- fasthenry-3.0wr.orig/src/sparse/Makefile   2025-10-25 23:06:07.850948286 
+0200
++++ fasthenry-3.0wr/src/sparse/Makefile        2025-10-25 23:06:26.660231747 
+0200
+@@ -4,7 +4,7 @@
+ #  UC Berkeley
+ #
+ #CFLAGS = -O -g
+-CFLAGS = -O3
++#CFLAGS = -O3
+ LINTFLAGS = -lc -lm
+ SHELL = /bin/sh
+ #CC = cc
+diff '--color=auto' -ruN fasthenry-3.0wr.orig/src/zbuf/mk_syscfg.inc 
fasthenry-3.0wr/src/zbuf/mk_syscfg.inc
+--- fasthenry-3.0wr.orig/src/zbuf/mk_syscfg.inc        2020-07-23 
00:18:23.000000000 +0200
++++ fasthenry-3.0wr/src/zbuf/mk_syscfg.inc     2025-10-25 23:06:26.660231747 
+0200
+@@ -2,7 +2,7 @@
+ # except for MinGW.
+ 
+ #CFLAGS = -O -g -DFOUR
+-CFLAGS = -O3 -DFOUR
++CFLAGS += -DFOUR
+ 
+ # For MinGW, there is no getrusage, and we'll skip a gethostname call
+ # to avoid having to link with winsock.
+@@ -12,4 +12,4 @@
+ 
+ # We're going to assume gcc, you'll need to comment this if a
+ # non-compatible compiler is used.
+-CC := gcc
++#CC := gcc

diff --git 
a/sci-electronics/fasthenry/files/fasthenry-3.0.24.03.14-ldflags.patch 
b/sci-electronics/fasthenry/files/fasthenry-3.0.24.03.14-ldflags.patch
new file mode 100644
index 000000000000..f01dccd34990
--- /dev/null
+++ b/sci-electronics/fasthenry/files/fasthenry-3.0.24.03.14-ldflags.patch
@@ -0,0 +1,40 @@
+diff '--color=auto' -ruN fasthenry-3.0wr.orig/src/fasthenry/Makefile 
fasthenry-3.0wr/src/fasthenry/Makefile
+--- fasthenry-3.0wr.orig/src/fasthenry/Makefile        2024-03-16 
22:10:11.000000000 +0100
++++ fasthenry-3.0wr/src/fasthenry/Makefile     2025-10-25 23:04:36.696574531 
+0200
+@@ -53,7 +53,7 @@
+       @if [ $(SOLVER) = SPARSE_SOLVER ]; then \
+           cd ../sparse; make CC=$(CC); \
+       fi
+-      $(CC) -o $(BIN)/fasthenry $(CFLAGS) $(OBJS) $(MOBJS) $(NONUNIOBJS) \
++      $(CC) -o $(BIN)/fasthenry $(LDFLAGS) $(CFLAGS) $(OBJS) $(MOBJS) 
$(NONUNIOBJS) \
+ $(SOLVERLIB) -lm
+ 
+ clean:
+diff '--color=auto' -ruN fasthenry-3.0wr.orig/src/misc/Makefile 
fasthenry-3.0wr/src/misc/Makefile
+--- fasthenry-3.0wr.orig/src/misc/Makefile     2024-03-16 20:28:28.000000000 
+0100
++++ fasthenry-3.0wr/src/misc/Makefile  2025-10-25 23:02:40.023816161 +0200
+@@ -1,10 +1,10 @@
+ all: MakeLcircuit ReadOutput
+ 
+ MakeLcircuit: MakeLcircuit.c
+-      $(CC) -O -o MakeLcircuit MakeLcircuit.c -lm
++      $(CC) $(LDFLAGS) $(CFLAGS) -o MakeLcircuit MakeLcircuit.c -lm
+ 
+ ReadOutput: ReadOutput.c
+-      $(CC) -O -o ReadOutput ReadOutput.c -lm
++      $(CC) $(LDFLAGS) $(CFLAGS) -o ReadOutput ReadOutput.c -lm
+ 
+ clean::
+       -@rm -f *.o MakeLcircuit ReadOutput
+diff '--color=auto' -ruN fasthenry-3.0wr.orig/src/zbuf/Makefile 
fasthenry-3.0wr/src/zbuf/Makefile
+--- fasthenry-3.0wr.orig/src/zbuf/Makefile     2024-03-16 21:09:10.000000000 
+0100
++++ fasthenry-3.0wr/src/zbuf/Makefile  2025-10-25 23:03:50.656880672 +0200
+@@ -45,7 +45,7 @@
+ zbuf::
+       $(MAKE) $(BIN)/zbuf
+ $(BIN)/zbuf: $(OBJS)
+-      $(CC) -o $(BIN)/zbuf $(CFLAGS) $(OBJS) $(LIBS)
++      $(CC) $(LDFLAGS) -o $(BIN)/zbuf $(CFLAGS) $(OBJS) $(LIBS)
+ 
+ clean:
+       $(RM) -f *.o

Reply via email to