public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sci-electronics/puff/, sci-electronics/puff/files/
@ 2021-07-03 15:47 Thomas Beierlein
  0 siblings, 0 replies; only message in thread
From: Thomas Beierlein @ 2021-07-03 15:47 UTC (permalink / raw
  To: gentoo-commits

commit:     23e6cad3c576c32f97ad857da284e51a88ae9da1
Author:     Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  3 15:46:30 2021 +0000
Commit:     Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
CommitDate: Sat Jul  3 15:47:36 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23e6cad3

sci-electronics/puff: Do not call 'ld' directly

Closes: https://bugs.gentoo.org/799440
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org>

 .../puff/files/puff-20100127-Makefile.patch         | 19 +++++++++++++++++++
 .../puff/files/puff-20181104-Makefile.patch         | 21 +++++++++++++++++++++
 sci-electronics/puff/puff-20100127-r1.ebuild        | 10 ++++------
 sci-electronics/puff/puff-20181104.ebuild           |  9 ++++-----
 4 files changed, 48 insertions(+), 11 deletions(-)

diff --git a/sci-electronics/puff/files/puff-20100127-Makefile.patch b/sci-electronics/puff/files/puff-20100127-Makefile.patch
new file mode 100644
index 00000000000..025b7237adf
--- /dev/null
+++ b/sci-electronics/puff/files/puff-20100127-Makefile.patch
@@ -0,0 +1,19 @@
+--- Makefile.old	2010-01-22 18:02:32.000000000 +0100
++++ Makefile	2021-07-03 16:55:59.092249878 +0200
+@@ -1,12 +1,13 @@
+ X11LIBDIR = /usr/X11R6/lib
+ PASCALCOMPILER = fpc
+-CC = gcc
+-CFLAGS = -O2 -g
++#CC = gcc
++#CFLAGS = -O2 -g
+ 
+ POBJS =	puff.o pfart.o pffft.o pfmsc.o pfrw.o pfst.o pfun1.o pfun2.o pfun3.o xgraph.o
+ 
+ puff:	$(POBJS) puff_c.o ppas.sh
+-	sed 's/link.res/link.res puff_c.o \/usr\/lib\/libX11.so/' <ppas.sh  >ppasx.sh
++	sed -i -e 's!^[^[:space:]]\+ -b!$(LD) -b!g' ppas.sh
++	sed 's/.res/.res $(LDFLAGS) puff_c.o \/usr\/lib64\/libX11.so/' <ppas.sh  >ppasx.sh
+ 	sh ppasx.sh
+ 
+ %.o:	%.pas

diff --git a/sci-electronics/puff/files/puff-20181104-Makefile.patch b/sci-electronics/puff/files/puff-20181104-Makefile.patch
new file mode 100644
index 00000000000..a874b9173ae
--- /dev/null
+++ b/sci-electronics/puff/files/puff-20181104-Makefile.patch
@@ -0,0 +1,21 @@
+# fix lib path for X11 and dont ignore LDFLAGS
+# respect CC and LD
+--- Makefile.old	2021-07-03 16:34:49.937098627 +0200
++++ Makefile	2021-07-03 16:33:56.615284555 +0200
+@@ -1,12 +1,13 @@
+ X11LIBDIR = /usr/X11R6/lib
+ PASCALCOMPILER = fpc
+-CC = gcc
+-CFLAGS = -O2 -g
++#CC = gcc
++#CFLAGS = -O2 -g
+ 
+ POBJS =	puff.o pfart.o pffft.o pfmsc.o pfrw.o pfst.o pfun1.o pfun2.o pfun3.o xgraph.o
+ 
+ puff:	$(POBJS) puff_c.o ppas.sh
+-	sed 's/link.res/link.res puff_c.o -lX11/' <ppas.sh  >ppasx.sh
++	sed -i -e 's!^[^[:space:]]\+ -b!$(LD) -b!g' ppas.sh
++	sed 's/.res/.res $(LDFLAGS) puff_c.o -lX11/' <ppas.sh  >ppasx.sh
+ 	sh ppasx.sh
+ 
+ %.o:	%.pas

diff --git a/sci-electronics/puff/puff-20100127-r1.ebuild b/sci-electronics/puff/puff-20100127-r1.ebuild
index 1c89266a793..3ec8bccda1f 100644
--- a/sci-electronics/puff/puff-20100127-r1.ebuild
+++ b/sci-electronics/puff/puff-20100127-r1.ebuild
@@ -20,16 +20,14 @@ DEPEND="${RDEPEND}
 src_prepare() {
 	default
 	# fix lib path for X11 and dont ignore LDFLAGS
-	sed -i  -e "s#lib\\\/#$(get_libdir)\\\/#" \
-		-e 's/CFLAGS/#CFLAGS/' \
-		-e 's/CC =/#CC =/' \
-		-e 's/link.res/.res/g' \
-		-e 's/.res pu/.res $(LDFLAGS) pu/' Makefile || die
+	# respect CC and LD
+	eapply -p0 "${FILESDIR}"/$P-Makefile.patch
+	eapply_user
 }
 
 src_compile() {
 	LDFLAGS="$(raw-ldflags)"
-	emake -j1 CC="$(tc-getCC)"
+	emake -j1 CC="$(tc-getCC)" LD="$(tc-getLD)"
 }
 
 src_install() {

diff --git a/sci-electronics/puff/puff-20181104.ebuild b/sci-electronics/puff/puff-20181104.ebuild
index bf281406eae..3ec8bccda1f 100644
--- a/sci-electronics/puff/puff-20181104.ebuild
+++ b/sci-electronics/puff/puff-20181104.ebuild
@@ -20,15 +20,14 @@ DEPEND="${RDEPEND}
 src_prepare() {
 	default
 	# fix lib path for X11 and dont ignore LDFLAGS
-	sed -i  -e 's/CFLAGS/#CFLAGS/' \
-		-e 's/CC =/#CC =/' \
-		-e 's/link.res/.res/g' \
-		-e 's/.res pu/.res $(LDFLAGS) pu/' Makefile || die
+	# respect CC and LD
+	eapply -p0 "${FILESDIR}"/$P-Makefile.patch
+	eapply_user
 }
 
 src_compile() {
 	LDFLAGS="$(raw-ldflags)"
-	emake -j1 CC="$(tc-getCC)"
+	emake -j1 CC="$(tc-getCC)" LD="$(tc-getLD)"
 }
 
 src_install() {


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-03 15:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-03 15:47 [gentoo-commits] repo/gentoo:master commit in: sci-electronics/puff/, sci-electronics/puff/files/ Thomas Beierlein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox