sys-devel/bc: fix cross-compile builds #627126
authorMike Frysinger <vapier@chromium.org>
Tue, 18 Sep 2018 03:47:29 +0000 (23:47 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 18 Sep 2018 03:48:36 +0000 (23:48 -0400)
Fixes: https://bugs.gentoo.org/627126

sys-devel/bc/bc-1.07.1-r2.ebuild
sys-devel/bc/files/bc-1.07.1-use-system-bc.patch [new file with mode: 0644]

index 5a7d1afa3a78036db3dc24c7f0eea29de352ca64..99044d02af94d43dfb597aba499ef612cf01cbf5 100644 (file)
@@ -35,6 +35,9 @@ PATCHES=(
 src_prepare() {
        default
 
+       # Avoid bad build tool usage when cross-compiling.  #627126
+       tc-is-cross-compiler && eapply "${FILESDIR}/${PN}-1.07.1-use-system-bc.patch"
+
        # A patch to make this into a configure option has been sent upstream,
        # but lets avoid regenerating all the autotools just for this.
        if use forced-sandbox ; then
diff --git a/sys-devel/bc/files/bc-1.07.1-use-system-bc.patch b/sys-devel/bc/files/bc-1.07.1-use-system-bc.patch
new file mode 100644 (file)
index 0000000..03ccb68
--- /dev/null
@@ -0,0 +1,16 @@
+when cross-compiling, the local fbc binary won't work.  use the system
+bc instead as the demands of the .b script are simple enough.
+
+https://bugs.gentoo.org/627126
+
+--- a/bc/Makefile.in
++++ b/bc/Makefile.in
+@@ -628,7 +628,7 @@ libmath.h: libmath.b $(fbcOBJ) $(LIBBC)
+       echo '{0}' > libmath.h
+       $(MAKE) global.o
+       $(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
+-      ./fbc -c $(srcdir)/libmath.b </dev/null >libmath.h
++      bc -c $(srcdir)/libmath.b </dev/null >libmath.h
+       $(srcdir)/fix-libmath_h
+       rm -f ./fbc ./global.o
+ sbc.o: sbc.c