sys-devel/dev86: bump to v1.0.1

use "-std=c89" as workaround

Bug: https://bugs.gentoo.org/757675
Bug: https://bugs.gentoo.org/891533
Bug: https://bugs.gentoo.org/920450
Closes: https://bugs.gentoo.org/699812
Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/40267
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Z. Liu 2025-01-22 21:50:39 +08:00 committed by Sam James
parent adb75fb4d4
commit 297c2d0cdc
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
4 changed files with 137 additions and 0 deletions

View File

@ -1 +1,2 @@
DIST Dev86src-0.16.21.tar.gz 717215 BLAKE2B 977353422937f57d2046f151a53008dcec90f4060d60675dcb81fa58af5f1ed758a1950dcbd211cda57c84b55bf58ffbad28195ff115db50a7a1108d434b8b4e SHA512 6d35dc3c7f9735cf7967cdb2bc0f7bee967ae26667cd8cef56bbdf7d7855ef1d35057db4c0031ff86b9b95d3c8ee44aff408446115b35b6c10cf207a33838016
DIST Dev86src-1.0.1.tar.gz 745528 BLAKE2B e64ab251342cb97bdb581a6170d269282221983d3c751963e6a3ec2d5f1d6878bdf96740a3a84939e2bed110ec84179e9bd8f55209b2be8f66c178d829ac390e SHA512 0b0e08d8a66faf12599085c44082832101202bfe9c5fcbe4e564e104f56075c699b2680d61924a523fc9f61288a75648ec30cd5257c15abed8d95fab55211231

View File

@ -0,0 +1,69 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
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="https://codeberg.org/jbruchon/dev86/archive/v${PV}.tar.gz -> Dev86src-${PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
IUSE=""
RDEPEND="sys-devel/bin86"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${P}-makefile.patch"
)
S="${WORKDIR}/dev86"
src_prepare() {
default
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
ln -s lib lib64 || die
ln -s ../kinclude/arch libc/include/arch || die
ln -s ../kinclude/linuxmt libc/include/linuxmt || die
# First `make` is also a config, so set all the path vars here
emake -j1 \
CC="$(tc-getCC)" \
LIBDIR="/usr/$(get_libdir)/bcc" \
INCLDIR="/usr/$(get_libdir)/bcc" \
all
export PATH=${S}/bin:${PATH}
cd bootblocks || die
emake \
HOSTCC="$(tc-getCC)"
}
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
}

View File

@ -0,0 +1,66 @@
quick fix to make build success w/ modern compiler
fix should be done in upstream
diff --git a/Makefile b/Makefile
index 359c47a..8868558 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ BUILD_LDFLAGS ?= $(LDFLAGS)
# Some makes take the last of a list as the default ...
all: make.fil
- PATH="`pwd`/bin:$$PATH" $(MAKE) -f make.fil VERSION=$(VERSION) TOPDIR=`pwd` $@
+ PATH="`pwd`/bin:`pwd`/bcc:`pwd`/copt:`pwd`/cpp:$$PATH" $(MAKE) -f make.fil VERSION=$(VERSION) TOPDIR=`pwd` $@
$(TARGETS): make.fil
PATH="`pwd`/bin:$$PATH" $(MAKE) -f make.fil VERSION=$(VERSION) TOPDIR=`pwd` $@
diff --git a/bootblocks/Makefile b/bootblocks/Makefile
index a4c3a2e..4b4aca1 100644
--- a/bootblocks/Makefile
+++ b/bootblocks/Makefile
@@ -1,5 +1,5 @@
HOSTCC=cc
-HOSTCCFLAGS=-O2 -pipe
+HOSTCCFLAGS=-O2 -pipe -std=c89 -Wno-error=return-type
BCC=bcc
AS86=as86
diff --git a/dis88/Makefile b/dis88/Makefile
index 146d1cf..9c3ab4f 100644
--- a/dis88/Makefile
+++ b/dis88/Makefile
@@ -25,7 +25,7 @@
# be necessary to alter the formats of the tables.
#CC=bcc
-CFLAGS=-O
+CFLAGS=-O -std=c89
LDFLAGS=
PREFIX=/usr
diff --git a/dis88/dis.h b/dis88/dis.h
index 21bbc2e..bfc64e7 100644
--- a/dis88/dis.h
+++ b/dis88/dis.h
@@ -163,7 +163,7 @@ _PROTOTYPE(void mahand, (int j ));
_PROTOTYPE(void mjhand, (int j ));
/* dismain.c */
-_PROTOTYPE(void main, (int argc, char **argv ));
+_PROTOTYPE(int main, (int argc, char **argv ));
/* distabs.c */
_PROTOTYPE(char *getnam, (int k ));
diff --git a/dis88/dismain.c b/dis88/dismain.c
index 6f51e73..fb07d3e 100644
--- a/dis88/dismain.c
+++ b/dis88/dismain.c
@@ -538,7 +538,7 @@ static void disbss()
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-void
+int
main(argc,argv)
int argc; /* Command-line args from OS */

View File

@ -3,6 +3,7 @@
<pkgmetadata>
<!-- maintainer-needed -->
<upstream>
<remote-id type="codeberg">jbruchon/dev86</remote-id>
<remote-id type="github">lkundrak/dev86</remote-id>
</upstream>
</pkgmetadata>