commit:     2ec14c2b5670832a8de8affeab091e42c380d3cd
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 20 18:29:08 2018 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Wed Jun 20 18:31:56 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ec14c2b

sys-devel/dev86: Fix make call (#649940), strip properly (#651462)

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 sys-devel/dev86/dev86-0.16.21-r3.ebuild        | 78 ++++++++++++++++++++++++
 sys-devel/dev86/files/dev86-0.16.21-make.patch | 82 ++++++++++++++++++++++++++
 2 files changed, 160 insertions(+)

diff --git a/sys-devel/dev86/dev86-0.16.21-r3.ebuild 
b/sys-devel/dev86/dev86-0.16.21-r3.ebuild
new file mode 100644
index 00000000000..1ba9e30203d
--- /dev/null
+++ b/sys-devel/dev86/dev86-0.16.21-r3.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit toolchain-funcs
+
+DESCRIPTION="Bruce's C compiler - Simple C compiler to generate 8086 code"
+HOMEPAGE="http://www.debath.co.uk/ https://github.com/lkundrak/dev86";
+SRC_URI="http://v3.sk/~lkundrak/dev86/Dev86src-${PV}.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND="sys-devel/bin86"
+DEPEND="${RDEPEND}
+       dev-util/gperf"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-pic.patch"
+       "${FILESDIR}/${PN}-0.16.19-fortify.patch"
+       "${FILESDIR}/${P}-non-void-return-clang.patch"
+       "${FILESDIR}/${PN}-0.16.21-make.patch"
+)
+
+src_prepare() {
+       default
+
+       # elksemu doesn't compile under amd64
+       if use amd64; then
+               einfo "Not compiling elksemu on amd64"
+               sed -i \
+                       -e 's,alt-libs elksemu,alt-libs,' \
+                       -e 's,install-lib install-emu,install-lib,' \
+                       makefile.in || die
+       fi
+
+       sed -i -e "s:-O2 -g:${CFLAGS}:" -e '/INEXE=/s:-s::' makefile.in || die
+       sed -i -e "s:/lib/:/$(get_libdir)/:" bcc/bcc.c || die
+       sed -i -e '/INSTALL_OPTS=/s:-s::' bin86/Makefile || die
+       sed -i -e '/install -m 755 -s/s:-s::' dis88/Makefile || die
+}
+
+src_compile() {
+       # Don't mess with CPPFLAGS as they tend to break compilation
+       # (bug #343655).
+       unset CPPFLAGS
+
+       # First `make` is also a config, so set all the path vars here
+       emake -j1 \
+               DIST="${D}" \
+               CC="$(tc-getCC)" \
+               LIBDIR="/usr/$(get_libdir)/bcc" \
+               INCLDIR="/usr/$(get_libdir)/bcc"
+
+       export PATH=${S}/bin:${PATH}
+
+       cd bin || die
+       ln -s ncc bcc || die
+       cd .. || die
+
+       cd bootblocks || die
+       emake DIST="${D}"
+}
+
+src_install() {
+       emake -j1 install-all DIST="${D}"
+       dostrip -x "/usr/*/bcc/lib*.a /usr/*/i386/libc.a"
+
+       dobin bootblocks/makeboot
+       # remove all the stuff supplied by bin86
+       rm "${D}"/usr/bin/{as,ld,nm,objdump,size}86 || die
+       rm "${D}"/usr/man/man1/{as,ld}86.1 || die
+
+       dodir /usr/share
+       mv "${D}"/usr/{man,share/man} || die
+}

diff --git a/sys-devel/dev86/files/dev86-0.16.21-make.patch 
b/sys-devel/dev86/files/dev86-0.16.21-make.patch
new file mode 100644
index 00000000000..248ff5814db
--- /dev/null
+++ b/sys-devel/dev86/files/dev86-0.16.21-make.patch
@@ -0,0 +1,82 @@
+From f14f78efcd5c865b470173dc06959c8de61e9711 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Thu, 8 Mar 2018 19:31:17 +0100
+Subject: [PATCH] build: Always use $(MAKE) to spawn sub-make
+
+Always use $(MAKE) instead of literal 'make' to spawn the correct make
+variant. Otherwise, e.g. when using 'gmake' on FreeBSD the Makefiles
+spawn BSD make and things fail because of incompatible MAKEFLAGS
+set by GNU make.
+---
+ bootblocks/Makefile | 10 +++++-----
+ libbsd/Makefile     |  2 +-
+ makefile.in         |  2 +-
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/bootblocks/Makefile b/bootblocks/Makefile
+index d954ea1..2887d86 100644
+--- a/bootblocks/Makefile
++++ b/bootblocks/Makefile
+@@ -55,31 +55,31 @@ fs_min.o: minix.h
+ 
+ bootfile.sys: $(MSRC) $(MINC)
+       @rm -f $(MOBJ)
+-      make 'CFLAGS=$(CFLAGS) -DDOSFLOPPY' monitor.out
++      $(MAKE) 'CFLAGS=$(CFLAGS) -DDOSFLOPPY' monitor.out
+       mv monitor.out bootfile.sys
+       @rm -f $(MOBJ)
+ 
+ boottar.sys: $(MSRC) $(MINC) tarboot.bin
+       @rm -f $(MOBJ)
+-      make 'CFLAGS=$(CFLAGS) -DTARFLOPPY' monitor.out
++      $(MAKE) 'CFLAGS=$(CFLAGS) -DTARFLOPPY' monitor.out
+       mv monitor.out boottar.sys
+       @rm -f $(MOBJ)
+ 
+ bootminix.sys: $(MSRC) $(MINC) minix.bin
+       @rm -f $(MOBJ)
+-      make 'CFLAGS=$(CFLAGS) -DMINFLOPPY' monitor.out
++      $(MAKE) 'CFLAGS=$(CFLAGS) -DMINFLOPPY' monitor.out
+       mv monitor.out bootminix.sys
+       @rm -f $(MOBJ)
+ 
+ monitor.sys: $(MSRC) $(MINC)
+       @rm -f $(MOBJ)
+-      make monitor.out
++      $(MAKE) monitor.out
+       mv monitor.out monitor.sys
+       @rm -f $(MOBJ)
+ 
+ monitor: $(MSRC) $(MINC)
+       @rm -f $(MOBJ)
+-      make 'CFLAGS=-ansi $(DEFS)' monitor.out
++      $(MAKE) 'CFLAGS=-ansi $(DEFS)' monitor.out
+       mv monitor.out monitor
+       @rm -f $(MOBJ)
+ 
+diff --git a/libbsd/Makefile b/libbsd/Makefile
+index 2b29f72..722b86d 100644
+--- a/libbsd/Makefile
++++ b/libbsd/Makefile
+@@ -29,7 +29,7 @@ install: all
+       install -m 644 $(LIBBSD) $(LIBDIR)/i86
+ 
+ tests: dummy
+-      make -C tests
++      $(MAKE) -C tests
+ 
+ $(LIBBSD): $(OBJS)
+       $(AR) rc $(LIBBSD) $(OBJS)
+diff --git a/makefile.in b/makefile.in
+index b586da1..97ea519 100644
+--- a/makefile.in
++++ b/makefile.in
+@@ -326,7 +326,7 @@ config: ;
+ #endif
+ 
+ makec:
+-      echo 'cd $$1 ; shift ; make "$$@"' > makec
++      echo 'cd $$1 ; shift ; $(MAKE) "$$@"' > makec
+       chmod +x makec
+ 
+ versions: bcc/version.h

Reply via email to