git: ea1d2da0e754 - main - misc/cuttlefish: fix build on big-endian
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 13 Sep 2022 17:14:22 UTC
The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=ea1d2da0e754d141a66585bfb27345ccad389552 commit ea1d2da0e754d141a66585bfb27345ccad389552 Author: Piotr Kubaj <pkubaj@FreeBSD.org> AuthorDate: 2022-09-13 17:04:34 +0000 Commit: Piotr Kubaj <pkubaj@FreeBSD.org> CommitDate: 2022-09-13 17:04:34 +0000 misc/cuttlefish: fix build on big-endian --- misc/cuttlefish/Makefile | 4 ++- ...ch-lib_FreeImage_Source_FreeImage_PluginBMP.cpp | 29 ++++++++++++++++++++++ ...ch-lib_FreeImage_Source_FreeImage_PluginDDS.cpp | 25 +++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/misc/cuttlefish/Makefile b/misc/cuttlefish/Makefile index 5f2eaf6495cd..8de2849f3428 100644 --- a/misc/cuttlefish/Makefile +++ b/misc/cuttlefish/Makefile @@ -13,7 +13,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt TEST_DEPENDS= ispc:devel/ispc -USES= cmake:testing compiler:c++11-lang +USES= cmake:testing compiler:c++11-lang dos2unix USE_GITHUB= yes GH_ACCOUNT= akb825 @@ -32,5 +32,7 @@ GH_TUPLE= akb825:freeimage:dae76e95cd4a9fbb58b0a6d635fd3c3f4b222076:akb825_freei CMAKE_OFF= CUTTLEFISH_BUILD_DOCS CUTTLEFISH_BUILD_TESTS CMAKE_ON= CUTTLEFISH_SHARED CMAKE_TESTING_ON= CUTTLEFISH_BUILD_TESTS +DOS2UNIX_FILES= lib/FreeImage/Source/FreeImage/PluginDDS.cpp \ + lib/FreeImage/Source/FreeImage/PluginBMP.cpp .include <bsd.port.mk> diff --git a/misc/cuttlefish/files/patch-lib_FreeImage_Source_FreeImage_PluginBMP.cpp b/misc/cuttlefish/files/patch-lib_FreeImage_Source_FreeImage_PluginBMP.cpp new file mode 100644 index 000000000000..a25093a3b40d --- /dev/null +++ b/misc/cuttlefish/files/patch-lib_FreeImage_Source_FreeImage_PluginBMP.cpp @@ -0,0 +1,29 @@ +--- lib/FreeImage/Source/FreeImage/PluginBMP.cpp.orig 2022-09-12 21:40:45 UTC ++++ lib/FreeImage/Source/FreeImage/PluginBMP.cpp +@@ -1419,7 +1419,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, + + free(buffer); + #ifdef FREEIMAGE_BIGENDIAN +- } else if (bpp == 16) { ++ } else if (dst_bpp == 16) { + int padding = dst_pitch - dst_width * sizeof(WORD); + WORD pad = 0; + WORD pixel; +@@ -1440,7 +1440,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, + } + #endif + #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB +- } else if (bpp == 24) { ++ } else if (dst_bpp == 24) { + int padding = dst_pitch - dst_width * sizeof(FILE_BGR); + DWORD pad = 0; + FILE_BGR bgr; +@@ -1461,7 +1461,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, + } + } + } +- } else if (bpp == 32) { ++ } else if (dst_bpp == 32) { + FILE_BGRA bgra; + for(unsigned y = 0; y < dst_height; y++) { + BYTE *line = FreeImage_GetScanLine(dib, y); diff --git a/misc/cuttlefish/files/patch-lib_FreeImage_Source_FreeImage_PluginDDS.cpp b/misc/cuttlefish/files/patch-lib_FreeImage_Source_FreeImage_PluginDDS.cpp new file mode 100644 index 000000000000..85d4ad587073 --- /dev/null +++ b/misc/cuttlefish/files/patch-lib_FreeImage_Source_FreeImage_PluginDDS.cpp @@ -0,0 +1,25 @@ +--- lib/FreeImage/Source/FreeImage/PluginDDS.cpp.orig 2022-09-12 21:40:59 UTC ++++ lib/FreeImage/Source/FreeImage/PluginDDS.cpp +@@ -356,14 +356,14 @@ SwapHeader(DDSHEADER *header) { + for(int i=0; i<11; i++) { + SwapLong(&header->surfaceDesc.dwReserved1[i]); + } +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwSize); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwFlags); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwFourCC); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwRGBBitCount); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwRBitMask); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwGBitMask); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwBBitMask); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwRGBAlphaBitMask); ++ SwapLong(&header->surfaceDesc.ddspf.dwSize); ++ SwapLong(&header->surfaceDesc.ddspf.dwFlags); ++ SwapLong(&header->surfaceDesc.ddspf.dwFourCC); ++ SwapLong(&header->surfaceDesc.ddspf.dwRGBBitCount); ++ SwapLong(&header->surfaceDesc.ddspf.dwRBitMask); ++ SwapLong(&header->surfaceDesc.ddspf.dwGBitMask); ++ SwapLong(&header->surfaceDesc.ddspf.dwBBitMask); ++ SwapLong(&header->surfaceDesc.ddspf.dwRGBAlphaBitMask); + SwapLong(&header->surfaceDesc.ddsCaps.dwCaps1); + SwapLong(&header->surfaceDesc.ddsCaps.dwCaps2); + SwapLong(&header->surfaceDesc.ddsCaps.dwReserved[0]);