Skip to content

Commit

Permalink
devel/z88dk: the port had been improved (+)
Browse files Browse the repository at this point in the history
- Fix the test suite (renew dependency list, patch some loose ends)
- Switch to GNU m4 for the time being: while --define= command line
  option can be replaced with -D, there are other things that break
  against our system m4(1) particularly when running the test suite
- Strip several binaries upon installation as reported by stage Q/A
  • Loading branch information
Alexey Dokuchaev authored and Alexey Dokuchaev committed Nov 17, 2022
1 parent de3b9f5 commit 198f2be
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 12 deletions.
23 changes: 11 additions & 12 deletions devel/z88dk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,19 @@ BUILD_DEPENDS= dos2unix:converters/unix2dos \
p5-Path-Tiny>=0:devel/p5-Path-Tiny \
p5-YAML-Tiny>=0:textproc/p5-YAML-Tiny \
ragel:devel/ragel re2c:devel/re2c
TEST_DEPENDS= dos2unix:converters/unix2dos \
TEST_DEPENDS= dos2unix:converters/unix2dos gm4:devel/m4 \
p5-CPU-Z80-Assembler>=0:devel/p5-CPU-Z80-Assembler \
p5-Capture-Tiny>=0:devel/p5-Capture-Tiny \
p5-Capture-Tiny-Extended>=0:devel/p5-Capture-Tiny-Extended \
p5-Clone>=0:devel/p5-Clone \
p5-Data-Dump>=0:devel/p5-Data-Dump \
p5-Data-HexDump>=0:devel/p5-Data-HexDump \
p5-File-Slurp>=0:devel/p5-File-Slurp \
p5-Iterator-Simple-Lookahead>=0:devel/p5-Iterator-Simple-Lookahead \
p5-List-Uniq>=0:devel/p5-List-Uniq \
p5-Modern-Perl>=0:lang/p5-Modern-Perl \
p5-Object-Tiny-RW>=0:devel/p5-Object-Tiny-RW \
p5-Path-Tiny>=0:devel/p5-Path-Tiny \
p5-Regexp-Common>=0:textproc/p5-Regexp-Common \
p5-Template-Plugin-YAML>=0:textproc/p5-Template-Plugin-YAML \
p5-Test-Differences>=0:devel/p5-Test-Differences \
p5-Test-HexDifferences>=0:devel/p5-Test-HexDifferences \
p5-Text-Table>=0:textproc/p5-Text-Table
p5-Text-Diff>=0:textproc/p5-Text-Diff \
p5-Text-Table>=0:textproc/p5-Text-Table \
p5-YAML-Tiny>=0:textproc/p5-YAML-Tiny
RUN_DEPENDS= gm4:devel/m4

USES= gmake gnome perl5 shebangfix tar:tgz
USE_GNOME= libxml2
Expand All @@ -52,10 +47,14 @@ post-patch:
${WRKSRC}/src/z80asm/parse_ragel.pl
@${REINPLACE_CMD} -e 's,dos2unix -q,dos2unix,' \
${WRKSRC}/src/z80asm/Makefile
@${REINPLACE_CMD} -e 's/process(".m4", ext, "/&g/' \
${WRKSRC}/src/zcc/zcc.c
@${REINPLACE_CMD} -e 's,"make,"${MAKE_CMD},' \
${WRKSRC}/src/zobjcopy/t/test.t
@${REINPLACE_CMD} -e '/\/bin\//s,bash,sh,' \
${WRKSRC}/src/common/t/run_tests.sh
@${REINPLACE_CMD} -e '179s/$$(CFLAGS)/$$(filter -O%,&)/' \
${WRKSRC}/support/multitarget_build/Makefile
@${REINPLACE_CMD} -e '/^CFLAGS =/s,$$, -I../../../include,' \
${WRKSRC}/test/suites/make.config

pre-build:
${LN} -sf z88dk/bin ${BINARY_LINKDIR}
Expand Down
26 changes: 26 additions & 0 deletions devel/z88dk/files/patch-src_common_t_run__tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- src/common/t/run_tests.sh.orig 2022-07-06 03:00:02 UTC
+++ src/common/t/run_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh

set +e # allow tests to fail without aborting make test

@@ -10,7 +10,7 @@ for t in $( cat t/test1.hh | sed -e 's/^[^"]*"//' -e '
touch $f
fi
- nr=$[$nr+1]
+ nr=$((nr+1))
t/test $t > $f.mine.stdout 2> $f.mine.stderr
rv=$?
(echo stdout: ; cat $f.mine.stdout ; echo stderr: ; cat $f.mine.stderr ; echo exit: $rv ) > $f.mine
@@ -25,7 +25,7 @@ for t in $( cat t/test1.hh | sed -e 's/^[^"]*"//' -e '
else
diff -w $f $f.mine | sed -e 's/^/\# /'
fi
- fail=$[$fail+1]
+ fail=$((fail+1))
fi
done
17 changes: 17 additions & 0 deletions devel/z88dk/files/patch-src_z80asm_Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- src/z80asm/Makefile.orig 2022-07-10 03:00:02 UTC
+++ src/z80asm/Makefile
@@ -155,10 +155,10 @@ install: $(PROJ)$(EXESUFFIX) z80asm_lib
# install
#------------------------------------------------------------------------------
install: $(PROJ)$(EXESUFFIX) z80asm_lib
- $(INSTALL) $(PROJ)$(EXESUFFIX) $(PREFIX)/bin/$(PROJ)$(EXESUFFIX)
- $(INSTALL) $(PROJ)$(EXESUFFIX) $(PREFIX)/bin/$(BARE_PROJ)$(EXESUFFIX)
- $(INSTALL) asmpp.pl $(PREFIX)/bin/z88dk-asmpp
- $(INSTALL) asmstyle.pl $(PREFIX)/bin/z88dk-asmstyle
+ $(BSD_INSTALL_PROGRAM) $(PROJ)$(EXESUFFIX) $(PREFIX)/bin/$(PROJ)$(EXESUFFIX)
+ $(BSD_INSTALL_PROGRAM) $(PROJ)$(EXESUFFIX) $(PREFIX)/bin/$(BARE_PROJ)$(EXESUFFIX)
+ $(BSD_INSTALL_SCRIPT) asmpp.pl $(PREFIX)/bin/z88dk-asmpp
+ $(BSD_INSTALL_SCRIPT) asmstyle.pl $(PREFIX)/bin/z88dk-asmstyle
ifeq ($(CROSS),0)
$(MAKE) -C dev/z80asm_lib install PREFIX=$(PREFIX_SHARE)
endif
13 changes: 13 additions & 0 deletions devel/z88dk/files/patch-src_zx0_Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- src/zx0/Makefile.orig 2021-02-08 03:00:08 UTC
+++ src/zx0/Makefile
@@ -23,8 +23,8 @@ install: z88dk-zx0$(EXESUFFIX) z88dk-dzx0$(EXESUFFIX)
$(CC) -o z88dk-dzx0$(EXESUFFIX) $(LDFLAGS) $^

install: z88dk-zx0$(EXESUFFIX) z88dk-dzx0$(EXESUFFIX)
- $(INSTALL) z88dk-zx0$(EXESUFFIX) $(PREFIX)/bin/z88dk-zx0$(EXESUFFIX)
- $(INSTALL) z88dk-dzx0$(EXESUFFIX) $(PREFIX)/bin/z88dk-dzx0$(EXESUFFIX)
+ $(BSD_INSTALL_PROGRAM) z88dk-zx0$(EXESUFFIX) $(PREFIX)/bin/z88dk-zx0$(EXESUFFIX)
+ $(BSD_INSTALL_PROGRAM) z88dk-dzx0$(EXESUFFIX) $(PREFIX)/bin/z88dk-dzx0$(EXESUFFIX)

clean:
$(RM) z88dk-zx0$(EXESUFFIX) $(OBJS)

0 comments on commit 198f2be

Please sign in to comment.