From nobody Sat Oct 15 18:09:28 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 4MqWVc5RYqz4fPt4; Sat, 15 Oct 2022 18:09:28 +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 4MqWVc4tg5z43tn; Sat, 15 Oct 2022 18:09:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665857368; 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=vmABQisKDN306JaXiiFdScupcdDrD1jHPPGOgLGu18E=; b=rqJUw9bwZEROetqUo22qXwA+lz+0GKzuVW0koQ9cR7P3Ss6iBtRq2Pi1trWvDUNzvAU/gH C14wTPJoLGiudVRaM+ug4UySynQQBT3/rnP/CRUb+bY+zLq7p/iTf1seOpdO3GvHLRHa7+ MORkGNbQPmEdW8vPqevqlmKUGYTd+NiK8hJU+SOCV/+1kyMAsjZK5giity7NPEN+u0YMTC dvxFH6dxoADJtecwMQ3K4HyKVEM/ecdO5D1Zkym3cgAp5iYBWqRBG2A6E3US8sDTZReArf JrDJLFuNZmc6giZsPavXMFDq0UhkRGHCwa5GSGvmXeEDjGxIzmUnDyn9quOjcQ== 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 4MqWVc3wDnz1C7w; Sat, 15 Oct 2022 18:09:28 +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 29FI9SNE099640; Sat, 15 Oct 2022 18:09:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29FI9S9G099639; Sat, 15 Oct 2022 18:09:28 GMT (envelope-from git) Date: Sat, 15 Oct 2022 18:09:28 GMT Message-Id: <202210151809.29FI9S9G099639@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Alexey Dokuchaev Subject: git: c5f751f8a9d0 - main - games/xray_re-tools: unbreak the build against new nVidia Texture Tools 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: danfe X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5f751f8a9d0d1a0a753f9b95562db4c97eea836 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665857368; 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=vmABQisKDN306JaXiiFdScupcdDrD1jHPPGOgLGu18E=; b=GZ+4xRGEelyR0KCYXk8wqnjfWD3DD3Ro4yAKnCqLh5QjppqcxfqR/4LW0RCZ/uJO3HNh8Q 8FWD8X2N8HVvyzI7efwFCXHfLh6F79yWsbUPMYhX83dOujipkxL670rz5NnJ4ziYSlxhEE P6SE9gBdXXbe8Tcik0mGAZ9eCeowraaFNUr87H+Z3acbydnR8g2SM7hDgu44ZuUYiGwPP2 3zaH4obLJ6NXZWjdRzVZxgifq8mglYKeYaC9cbFzhG4cS/+/6+9I8zUDcSud7UL9hRGQKy FiSptTvEaQoT+t7azX3Oa2Hw31QB99QI8JV8nrp8nDp4mp74rHefPFeTyv7gpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665857368; a=rsa-sha256; cv=none; b=tYQhkVQ+/uSbXTx+r7Q8wbIG9rmQLNm5diGaQem3H2xm316hXw2UcAbb2q0yLwZ+/hjIC9 DM0o5gqwlOVcECaOmhNG+hNIv7BuqAQKGA8niiPS6vVtrz+tx8wxO3wFkuorNb0W11Gvej iZ4ag5AjhBrKLs/kQKX/ABUd3AGH5ooDwlMnf6KGZOwqOXptYcdYLmyBV4iIUtDHrnasYS /x1YnNxSux3jLt3ttw+fFzMX4ebXBSKbJbqpx9+DnjcRoSa7OCCegPuP846vYwoFji4hii qaJ1R/8GCpKy9T6OF117gNAbtB5AtUFw/l/jnsq5iZwU/b4RmZAfJ9wOIcjx0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by danfe: URL: https://cgit.FreeBSD.org/ports/commit/?id=c5f751f8a9d0d1a0a753f9b95562db4c97eea836 commit c5f751f8a9d0d1a0a753f9b95562db4c97eea836 Author: Alexey Dokuchaev AuthorDate: 2022-10-15 18:08:20 +0000 Commit: Alexey Dokuchaev CommitDate: 2022-10-15 18:08:20 +0000 games/xray_re-tools: unbreak the build against new nVidia Texture Tools In 2020 Ignacio had modified the API with NVTT upstream commit adce1a00 which must have been cleanup, but was more than that. Particularly, it shuffled things around DirectDrawSurface class, and thus had broken the port's build. While here, remove all bundled 3rd-party code to prevent accidental use thereof. --- games/xray_re-tools/Makefile | 10 ++++- games/xray_re-tools/files/Makefile | 3 +- .../patch-sources_3rd-party_nvtt_nvcore_Memory.h | 20 --------- ...ch-sources_3rd-party_nvtt_nvcore_poshlib_posh.h | 14 ------- .../patch-sources_xray__re_xr__image__dds.cxx | 48 ++++++++++++++++++++++ 5 files changed, 58 insertions(+), 37 deletions(-) diff --git a/games/xray_re-tools/Makefile b/games/xray_re-tools/Makefile index 91c0d035e431..6267cb8bf449 100644 --- a/games/xray_re-tools/Makefile +++ b/games/xray_re-tools/Makefile @@ -6,12 +6,11 @@ MAINTAINER= danfe@FreeBSD.org COMMENT= X-Ray engine game asset converter (unofficial) WWW= https://github.com/abramcumner/xray_re-tools +BUILD_DEPENDS= ${NONEXISTENT}:graphics/nvidia-texture-tools:patch LIB_DEPENDS= liblzo2.so:archivers/lzo2 \ libvorbisfile.so:audio/libvorbis \ libnvtt.so:graphics/nvidia-texture-tools -BROKEN= does not link: ld: error: undefined symbol: nv::mem::malloc - USE_GITHUB= yes GH_ACCOUNT= abramcumner GH_TAGNAME= 52721d2 @@ -19,11 +18,13 @@ GH_TAGNAME= 52721d2 MAKEFILE= ${FILESDIR}/Makefile BUILD_WRKSRC= ${WRKSRC}/sources WITHOUT_FBSD10_FIX= yes +_NVTT_WRKSRC= ${MAKE} -C ${PORTSDIR}/graphics/nvidia-texture-tools -V WRKSRC PLIST_FILES= bin/xr_converter post-extract: @${MV} ${WRKSRC}/sources/3rd\ party ${WRKSRC}/sources/3rd-party + @cd ${WRKSRC}/sources/3rd-party && ${RM} -r libogg libvorbis nvtt @${MV} ${WRKSRC}/sources/utils/converter/opcode/Ice/IceTrilist.h \ ${WRKSRC}/sources/utils/converter/opcode/Ice/IceTriList.h @${LN} -s StdAfx.h ${WRKSRC}/sources/utils/converter/opcode/Stdafx.h @@ -53,6 +54,11 @@ post-patch: @${REINPLACE_CMD} -e 's,MINGW32__),& || defined(__FreeBSD__),' \ ${WRKSRC}/sources/xray_re/xr_types.h +post-configure: + @${LN} -sf ${_NVTT_WRKSRC:sh}/src ${WRKSRC}/sources/3rd-party/nvtt + @${REINPLACE_CMD} -e '/#include "nvconfig\.h"/d' \ + ${WRKSRC}/sources/3rd-party/nvtt/nvcore/nvcore.h + do-install: ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/converter \ ${STAGEDIR}${PREFIX}/bin/xr_converter diff --git a/games/xray_re-tools/files/Makefile b/games/xray_re-tools/files/Makefile index 3220d663a3ba..0ac7ccba00a4 100644 --- a/games/xray_re-tools/files/Makefile +++ b/games/xray_re-tools/files/Makefile @@ -1,5 +1,6 @@ CXXFLAGS+= -Wall -Wextra -CPPFLAGS+= -Ixray_re -Iutils/converter/opcode -I3rd-party/nvtt -I$(LOCALBASE)/include +CPPFLAGS+= -Ixray_re -Iutils/converter/opcode -I3rd-party/nvtt \ + -I3rd-party/nvtt/../extern/poshlib -I$(LOCALBASE)/include LDFLAGS+= -L$(LOCALBASE)/lib xray_re_OBJS= xray_re/xr_ai_cross_table.o \ diff --git a/games/xray_re-tools/files/patch-sources_3rd-party_nvtt_nvcore_Memory.h b/games/xray_re-tools/files/patch-sources_3rd-party_nvtt_nvcore_Memory.h deleted file mode 100644 index b6b6833f06ad..000000000000 --- a/games/xray_re-tools/files/patch-sources_3rd-party_nvtt_nvcore_Memory.h +++ /dev/null @@ -1,20 +0,0 @@ ---- sources/3rd-party/nvtt/nvcore/Memory.h.orig 2018-09-02 12:42:44 UTC -+++ sources/3rd-party/nvtt/nvcore/Memory.h -@@ -28,7 +28,7 @@ namespace nv - - // Override new/delete - --inline void * operator new (size_t size) throw() -+inline void * operator new (size_t size) _THROW_BAD_ALLOC - { - return nv::mem::malloc(size); - } -@@ -38,7 +38,7 @@ inline void operator delete (void *p) throw() - nv::mem::free(p); - } - --inline void * operator new [] (size_t size) throw() -+inline void * operator new [] (size_t size) _THROW_BAD_ALLOC - { - return nv::mem::malloc(size); - } diff --git a/games/xray_re-tools/files/patch-sources_3rd-party_nvtt_nvcore_poshlib_posh.h b/games/xray_re-tools/files/patch-sources_3rd-party_nvtt_nvcore_poshlib_posh.h deleted file mode 100644 index 7448d82366c0..000000000000 --- a/games/xray_re-tools/files/patch-sources_3rd-party_nvtt_nvcore_poshlib_posh.h +++ /dev/null @@ -1,14 +0,0 @@ ---- sources/3rd-party/nvtt/nvcore/poshlib/posh.h.orig 2018-09-02 12:42:44 UTC -+++ sources/3rd-party/nvtt/nvcore/poshlib/posh.h -@@ -293,6 +293,11 @@ Metrowerks: - # define POSH_OS_STRING "Linux" - #endif - -+#if defined __FreeBSD__ -+# define POSH_OS_LINUX 1 -+# define POSH_OS_STRING "FreeBSD" -+#endif -+ - #if defined __CYGWIN32__ - # define POSH_OS_CYGWIN32 1 - # define POSH_OS_STRING "Cygwin" diff --git a/games/xray_re-tools/files/patch-sources_xray__re_xr__image__dds.cxx b/games/xray_re-tools/files/patch-sources_xray__re_xr__image__dds.cxx new file mode 100644 index 000000000000..4323a3afc70c --- /dev/null +++ b/games/xray_re-tools/files/patch-sources_xray__re_xr__image__dds.cxx @@ -0,0 +1,48 @@ +--- sources/xray_re/xr_image_dds.cxx.orig 2018-09-02 12:42:44 UTC ++++ sources/xray_re/xr_image_dds.cxx +@@ -7,6 +7,7 @@ + #include + #include + #pragma warning(pop) ++#undef sqrt + #include "xr_image.h" + #include "xr_file_system.h" + +@@ -14,13 +15,14 @@ bool xr_image::load_dds(const std::string& path) + + bool xr_image::load_dds(const std::string& path) + { +- nv::DirectDrawSurface dds(path.c_str()); ++ nv::DirectDrawSurface dds; ++ dds.load(path.c_str()); + if (!dds.isValid() || !dds.isTexture2D()) + return false; + nv::Image image; +- dds.mipmap(&image, 0, 0); +- m_width = image.width(); +- m_height = image.height(); ++ imageFromDDS(&image, dds, 0, 0); ++ m_width = image.width; ++ m_height = image.height; + m_data = new rgba32[m_width*m_height]; + for (unsigned i = m_height*m_width; i > 0;) { + const nv::Color32& pix = image.pixel(--i); +@@ -50,6 +52,7 @@ struct dds_writer: public nvtt::OutputHandler { + dds_writer(xr_writer& _w); + + virtual void beginImage(int size, int width, int height, int depth, int face, int miplevel); ++ virtual void endImage(); + virtual bool writeData(const void* data, int size); + xr_writer& w; + }; +@@ -60,6 +63,10 @@ void dds_writer::beginImage(int size, int width, int h + { + } + ++void dds_writer::endImage() ++{ ++} ++ + bool dds_writer::writeData(const void* data, int size) + { + w.w_raw(data, size_t(size & INT_MAX));