Fri Aug 18 10:51:52 2023 UTC ()
games/minetest: fix messed-up patches


(pin)
diff -r1.1 -r0 pkgsrc/games/minetest/patches/patch-CMakeLists.txt
diff -r0 -r1.1 pkgsrc/games/minetest/patches/patch-lib_irrlichtmt_source_Irrlicht_CIrrDeviceLinux.cpp
diff -r0 -r1.1 pkgsrc/games/minetest/patches/patch-lib_irrlichtmt_source_Irrlicht_os.cpp
diff -r1.4 -r0 pkgsrc/games/minetest/patches/patch-src_util_string.cpp
Fri Aug 18 19:51:52 2023
Mon Jun 26 19:38:33 2023
pkgsrc/games/minetest/patches/patch-CMakeLists.txt,v

anoncvs not yet been updated

File Deleted: pkgsrc/games/minetest/patches/patch-CMakeLists.txt

File Added: pkgsrc/games/minetest/patches/patch-lib_irrlichtmt_source_Irrlicht_CIrrDeviceLinux.cpp
$NetBSD: patch-lib_irrlichtmt_source_Irrlicht_CIrrDeviceLinux.cpp,v 1.1 2023/08/18 10:51:52 pin Exp $

Use FreeBSD's support for NetBSD

--- lib/irrlichtmt/source/Irrlicht/CIrrDeviceLinux.cpp.orig	2023-03-05 20:45:09.000000000 +0000
+++ lib/irrlichtmt/source/Irrlicht/CIrrDeviceLinux.cpp
@@ -47,7 +47,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#ifdef __FreeBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
 #include <sys/joystick.h>
 #else
 
@@ -1578,7 +1578,7 @@ bool CIrrDeviceLinux::activateJoysticks(
 		if (-1 == info.fd)
 			continue;
 
-#ifdef __FreeBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
 		info.axes=2;
 		info.buttons=2;
 #else
@@ -1602,7 +1602,7 @@ bool CIrrDeviceLinux::activateJoysticks(
 		returnInfo.Axes = info.axes;
 		returnInfo.Buttons = info.buttons;
 
-#ifndef __FreeBSD__
+#if !defined(__NetBSD__) && !defined(__FreeBSD__)
 		char name[80];
 		ioctl( info.fd, JSIOCGNAME(80), name);
 		returnInfo.Name = name;
@@ -1637,7 +1637,7 @@ void CIrrDeviceLinux::pollJoysticks()
 	{
 		JoystickInfo & info =  ActiveJoysticks[j];
 
-#ifdef __FreeBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
 		struct joystick js;
 		if (read(info.fd, &js, sizeof(js)) == sizeof(js))
 		{

File Added: pkgsrc/games/minetest/patches/patch-lib_irrlichtmt_source_Irrlicht_os.cpp
$NetBSD: patch-lib_irrlichtmt_source_Irrlicht_os.cpp,v 1.1 2023/08/18 10:51:52 pin Exp $

Add NetBSD's endian functions

--- lib/irrlichtmt/source/Irrlicht/os.cpp.orig	2023-03-05 20:45:09.000000000 +0000
+++ lib/irrlichtmt/source/Irrlicht/os.cpp
@@ -33,6 +33,11 @@
 	#define bswap_16(X) letoh16(X)
 	#define bswap_32(X) letoh32(X)
 	#define bswap_64(X) letoh64(X)
+#elif defined(__NetBSD__)
+	#include <endian.h>
+	#define bswap_16(X) htole16(X)
+	#define bswap_32(X) htole32(X)
+	#define bswap_64(X) htole64(X)
 #elif !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__PPC__) && !defined(_IRR_WINDOWS_API_)
 	#include <byteswap.h>
 #else

File Deleted: pkgsrc/games/minetest/patches/patch-src_util_string.cpp