Hi! -- Backstory:
While trying to test the wip port of VVVVVV [0] on macppc, i've found out that the bundled physfs was not able to detect zipfiles as such on this platform, and fixed the issue. It appears that VVVVVV uses the same version than devel/physfs. So i've tried, still on macppc, to see how games/blobby, a physfs consumer using zip resources files, fares. It appears that blobby is broken at runtime on all archs, so i've updated blobby [1]. It appears that while zipfiles are loaded on amd64, they're not on macppc without the fix i'm proposing here. -- The problem actually is that physfs' internal endianness detection is too basic to work. It was missing `__powerpc__', so i used <endian.h>, as seen in the already existing lzma patch. That diff has been tested successfully in a partial bulk against consumers on amd64 [2], and macppc. According to check_sym, there is no dynamic changes. Because the issue is happening at runtime, i had to test the runtime on 2 platforms, so it's pretty lightly tested. Special care has been taken about texture and sound items. Here are the results with tested architectures -- i've found no issues due to this patch: D=no datafiles, P=not on powerpc, L=x86/LE only, !=non-physfs issues devel/sdl-sound amd64, macppc emulators/dosbox amd64, macppc (ran DOOM II) D games/barony games/blobby amd64, macppc (-wip version) games/colobot/colobot amd64, !macppc (ppc: hang forever) games/dxx-rebirth amd64, !macppc (ppc: uchar issue?) games/gargoyle amd64, macppc L games/hedgewars amd64 games/lincity-ng amd64, macppc games/love amd64, macppc games/neverball amd64, macppc games/roadfighter amd64, macppc P games/solarus/roth amd64 P games/solarus/solarus amd64 P games/solarus/zsdx amd64 P games/solarus/zsxd amd64 L games/sumwars amd64 L games/warzone2100 amd64 Comments/feedback are welcome, Charlène. [0] https://github.com/jasperla/openbsd-wip/tree/master/games/vvvvvv [1] https://github.com/jasperla/openbsd-wip/tree/master/games/blobby [2] https://bin.charlenew.xyz/physfs_logs.tgz Index: Makefile =================================================================== RCS file: /cvs/ports/devel/physfs/Makefile,v retrieving revision 1.16 diff -u -p -u -p -r1.16 Makefile --- Makefile 4 Aug 2019 20:52:47 -0000 1.16 +++ Makefile 20 Jan 2020 15:42:04 -0000 @@ -3,6 +3,7 @@ COMMENT= library to provide abstract access to various archives DISTNAME= physfs-3.0.2 +REVISION= 0 CATEGORIES= devel MASTER_SITES= ${HOMEPAGE}downloads/ EXTRACT_SUFX= .tar.bz2 Index: patches/patch-src_physfs_internal_h =================================================================== RCS file: patches/patch-src_physfs_internal_h diff -N patches/patch-src_physfs_internal_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_physfs_internal_h 20 Jan 2020 15:42:04 -0000 @@ -0,0 +1,26 @@ +$OpenBSD$ + +Fix endianess detection on powerpc (and maybe more BE_ARCHS) + +Index: src/physfs_internal.h +--- src/physfs_internal.h.orig ++++ src/physfs_internal.h +@@ -221,6 +221,10 @@ extern void SZIP_global_init(void); + #include <endian.h> + #define PHYSFS_BYTEORDER __BYTE_ORDER + #else /* __linux__ */ ++#ifdef __OpenBSD__ ++#include <endian.h> ++#define PHYSFS_BYTEORDER BYTE_ORDER ++#else /* __OpenBSD__ */ + #if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ +@@ -230,6 +234,7 @@ extern void SZIP_global_init(void); + #else + #define PHYSFS_BYTEORDER PHYSFS_LIL_ENDIAN + #endif ++#endif /* __OpenBSD__ */ + #endif /* __linux__ */ + +