git: 6392477b572e - main - devel/rgbds: Fix tests
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 31 Dec 2024 01:35:33 UTC
The branch main has been updated by eduardo:
URL: https://cgit.FreeBSD.org/ports/commit/?id=6392477b572ecfc5c13c1434348f1a0be804c87b
commit 6392477b572ecfc5c13c1434348f1a0be804c87b
Author: Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2024-12-31 01:30:56 +0000
Commit: Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-12-31 01:30:56 +0000
devel/rgbds: Fix tests
- Remove build dependency on bash
- Remove unneeded dos2unix conversion also known to break part of tests
- Prepare to 0.9.1 and apply merged patches
---
devel/rgbds/Makefile | 13 ++++++----
devel/rgbds/files/extra-patch-fix_rgbfix | 29 +++++++++++++++++++++++
devel/rgbds/files/extra-patch-inc_signal | 21 ++++++++++++++++
devel/rgbds/files/patch-test_gfx_rgbgfx__test.cpp | 10 --------
devel/rgbds/files/patch-test_run-tests.sh | 14 +++++++++++
5 files changed, 72 insertions(+), 15 deletions(-)
diff --git a/devel/rgbds/Makefile b/devel/rgbds/Makefile
index 4a6d71637c9b..87438a6a3e83 100644
--- a/devel/rgbds/Makefile
+++ b/devel/rgbds/Makefile
@@ -1,5 +1,6 @@
PORTNAME= rgbds
DISTVERSION= 0.9.0
+PORTREVISION= 1
CATEGORIES= devel games
MASTER_SITES= https://github.com/gbdev/rgbds/releases/download/v${DISTVERSION}/
@@ -10,17 +11,19 @@ WWW= https://rgbds.gbdev.io/
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
-BUILD_DEPENDS= bash>0:shells/bash
LIB_DEPENDS= libpng16.so:graphics/png
TEST_DEPENDS= bash>0:shells/bash \
git>0:devel/git \
xxd>0:sysutils/xxd
-USES= bison cmake:testing dos2unix pkgconfig shebangfix
-
+USES= bison cmake:testing pkgconfig shebangfix
SHEBANG_FILES= contrib/view_palettes.sh src/bison.sh test/*.sh test/*/*.sh
-WRKSRC= ${WRKDIR}/rgbds
-TESTING_UNSAFE= https://github.com/gbdev/rgbds/issues/1580
+CMAKE_OFF= USE_NONFREE_TESTS
+
+EXTRA_PATCHES= ${FILESDIR}/extra-patch-fix_rgbfix:-p1 \
+ ${FILESDIR}/extra-patch-inc_signal:-p1
+
+WRKSRC= ${WRKDIR}/rgbds
.include <bsd.port.mk>
diff --git a/devel/rgbds/files/extra-patch-fix_rgbfix b/devel/rgbds/files/extra-patch-fix_rgbfix
new file mode 100644
index 000000000000..6edf93f10c42
--- /dev/null
+++ b/devel/rgbds/files/extra-patch-fix_rgbfix
@@ -0,0 +1,29 @@
+From b99ce3845e863894e918b483f80ffbb1e9f91252 Mon Sep 17 00:00:00 2001
+From: Rangi42 <sylvie.oukaour+rangi42@gmail.com>
+Date: Sun, 29 Dec 2024 13:09:37 -0500
+Subject: [PATCH] Fix RGBFIX writing bytes when one syscall is not sufficient
+
+---
+ src/fix/main.cpp | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/fix/main.cpp b/src/fix/main.cpp
+index ce9a1d8d8..06a3a88a2 100644
+--- a/src/fix/main.cpp
++++ b/src/fix/main.cpp
+@@ -805,13 +805,11 @@ static ssize_t writeBytes(int fd, uint8_t *buf, size_t len) {
+
+ if (ret == -1 && errno != EINTR) // Return errors, unless we only were interrupted
+ return -1;
+- // EOF reached
+- if (ret == 0)
+- return total;
+- // If anything was read, accumulate it, and continue
++ // If anything was written, accumulate it, and continue
+ if (ret != -1) {
+ total += ret;
+ len -= ret;
++ buf += ret;
+ }
+ }
+
diff --git a/devel/rgbds/files/extra-patch-inc_signal b/devel/rgbds/files/extra-patch-inc_signal
new file mode 100644
index 000000000000..ddd2537a2288
--- /dev/null
+++ b/devel/rgbds/files/extra-patch-inc_signal
@@ -0,0 +1,21 @@
+From 06daf2a9b59595cc1f5df6213921e25dd35824ce Mon Sep 17 00:00:00 2001
+From: Rangi <35663410+Rangi42@users.noreply.github.com>
+Date: Mon, 30 Dec 2024 17:22:14 -0500
+Subject: [PATCH] Include <signal.h> in rgbgfx_test.cpp (#1589)
+
+---
+ test/gfx/rgbgfx_test.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/test/gfx/rgbgfx_test.cpp b/test/gfx/rgbgfx_test.cpp
+index e2bcd7a10..68b4d266d 100644
+--- a/test/gfx/rgbgfx_test.cpp
++++ b/test/gfx/rgbgfx_test.cpp
+@@ -5,6 +5,7 @@
+ #include <sys/stat.h>
+ #include <sys/wait.h>
+
++ #include <signal.h>
+ #include <spawn.h>
+ #include <unistd.h>
+ #else
diff --git a/devel/rgbds/files/patch-test_gfx_rgbgfx__test.cpp b/devel/rgbds/files/patch-test_gfx_rgbgfx__test.cpp
deleted file mode 100644
index e3f42d092f5f..000000000000
--- a/devel/rgbds/files/patch-test_gfx_rgbgfx__test.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
---- test/gfx/rgbgfx_test.cpp.orig 2024-12-25 20:36:32 UTC
-+++ test/gfx/rgbgfx_test.cpp
-@@ -23,6 +23,7 @@
- #include <fstream>
- #include <limits>
- #include <png.h>
-+#include <signal.h>
- #include <stdarg.h>
- #include <stdlib.h>
- #include <string.h>
diff --git a/devel/rgbds/files/patch-test_run-tests.sh b/devel/rgbds/files/patch-test_run-tests.sh
new file mode 100644
index 000000000000..9ccae4b54623
--- /dev/null
+++ b/devel/rgbds/files/patch-test_run-tests.sh
@@ -0,0 +1,14 @@
+Do not run extra tests that require build
+
+--- test/run-tests.sh.orig 2024-12-31 01:19:31 UTC
++++ test/run-tests.sh
+@@ -74,6 +74,6 @@ fi
+ test_downstream pret pokered compare pokered.gbc ea9bcae617fdf159b045185467ae58b2e4a48b9a
+ test_downstream zladx LADX-Disassembly default azle.gbc d90ac17e9bf17b6c61624ad9f05447bdb5efc01a
+ fi
+-test_downstream AntonioND ucity all ucity.gbc 67e67a4eaefb12ddc98d3caa8959102b885c0405
+-test_downstream pinobatch libbet all libbet.gb 7001af0f0664ba4e941310cde2c4c8392423abd2
+-test_downstream LIJI32 SameBoy bootroms build/bin/BootROMs/cgb_boot.bin 113903775a9d34b798c2f8076672da6626815a91
++#test_downstream AntonioND ucity all ucity.gbc 67e67a4eaefb12ddc98d3caa8959102b885c0405
++#test_downstream pinobatch libbet all libbet.gb 7001af0f0664ba4e941310cde2c4c8392423abd2
++#test_downstream LIJI32 SameBoy bootroms build/bin/BootROMs/cgb_boot.bin 113903775a9d34b798c2f8076672da6626815a91