From nobody Tue Sep 13 17:14:22 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MRqnq0gPzz4bvVS; Tue, 13 Sep 2022 17:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MRqnp4Vcdz3MHQ; Tue, 13 Sep 2022 17:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663089262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WJH8YqqIahXKqrWGCyuUGrOaLS8qBsSz2ShC5ycv48U=; b=Y0J9PdKdaAvSw/Mu8iK2PIwfHAtsRRiH/l7acS6b34LGN2Gb4JAWPD3YkY4YU/qs3jRiPT W1lPqhsdsr65TqwgFdZJAsWFc5HFZPNaV9rL6RYYLPnVPeFUDiP+QiYe09doeEWcEl/Dt/ FNs+LWSTeMsn5GLdwyDpmaz3qBuWwIoWndwQZ6u/sEodZsLg1aIqnpu4XHMAPXk8kDeO/i 2xB3hS+xSeqdRoxKeuozyU7wHEkQbGmunLqp6Js39W5dDAcyIjyn2RglRbefNkHcumLHdq HFJJB2F/K1pVjkQZqZ4auRA+L98/+lO5in3VptbOU+LyoEq1u3BnWFmQUdrghA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MRqnp3ZP4zPdl; Tue, 13 Sep 2022 17:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28DHEMVr023811; Tue, 13 Sep 2022 17:14:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28DHEM0O023810; Tue, 13 Sep 2022 17:14:22 GMT (envelope-from git) Date: Tue, 13 Sep 2022 17:14:22 GMT Message-Id: <202209131714.28DHEM0O023810@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Piotr Kubaj Subject: git: ea1d2da0e754 - main - misc/cuttlefish: fix build on big-endian List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea1d2da0e754d141a66585bfb27345ccad389552 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663089262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WJH8YqqIahXKqrWGCyuUGrOaLS8qBsSz2ShC5ycv48U=; b=jiwSL6Fserua+wWoxfvWtLVsKixpo1kokvyjWgWoogXWVgK0SvaJZ+J8XrAWCsPPuxwtGr +ko+XiKMUjNgELqEp/Zcs4EC9snPnYOSEmFv/MveWXpVRWUR2CQ9CTQ8HdHWIp+R58GlQJ e/QY3AyyK01LczGBVjb8L17mSyJ2E60Qa6ytLiLeqGUPBwbuXfdXIa2JafCNFVra9qoGBv BERdQ2qeXJiUHWJsYBCyTwWWSHWfsVIbGndH9qDV4lym3QXxfLi5x6Lb3cCxGfwWq3mE6f RF8jAEr2/CGiyxkhlJts5/kM4arz+NWvWRcnADBIbrVqGLOsVG8RkWjg1rpV9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663089262; a=rsa-sha256; cv=none; b=pj4GoFsR83pHfFPd75dzb8ysX1gKXp01ZEidL+vFteCHAItAQuq+of3GbgyZrMln5l/Xe5 rWecZPdHEF2L3LpM1Q+MqJR9jVrWPKiaTJJh7ilCzfY5ySGrKkVcZnmFFSQMKuRYoYnFGl L35USF7GI8lOQ9etNGE/hpCttQe2/5ql0vNB97yIkQuA3MqVHkeZUup8hI6XgaKFsORtD2 ZX1PEdUR7yxubss+3isoxsj8aBhsIHU/NhsBH5lUf4cxgPBkPgGcvZB5+BwF2RRTFB05vh /JRKamXaSiFo66IoqEx8CuDwkjcZDIJBligsOBlPMw4lvY9Py28Jbx9d/4i2mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=ea1d2da0e754d141a66585bfb27345ccad389552 commit ea1d2da0e754d141a66585bfb27345ccad389552 Author: Piotr Kubaj AuthorDate: 2022-09-13 17:04:34 +0000 Commit: Piotr Kubaj 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 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]);