From nobody Thu Nov 21 23:09:33 2024 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 4XvYpP5TW9z5djqd; Thu, 21 Nov 2024 23:09:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XvYpP50wKz4NpC; Thu, 21 Nov 2024 23:09:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732230573; 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=B0DHQ5YwOVnb+DgCzzMxMMKkTz47qX6ImbbhgH44hP4=; b=Z1UPrRdRWaYvyT3rcDrkRt2zy6bZachRmNda3WNKi2k0j+ByoRyzCkyXzffNnfbFR8chrh vUuxjSiC1K4mKDo5Aksnko6YWt5vumG1fJ2X5S2BjuRbvn6LVePshx46x35AghDcDbVDmQ R2prsgYIhJq3vy78mbjLG1sTzQJJuU4A3hCppqsjQkL9Cg7FcMMOJeIqxYDL5za8QDLPa/ 13AvnyVfDRVVfpnKq4YziXEN+vqJuvmomXbwznkFqOPpYkJMPrLlF2iSwfEpV3p1A+o/tC zcApGqNwbt9wVe/yGcSkHF2P85F0sAcmq4DBiKKRZy20XHwyv1M6UaC2bgZqXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732230573; 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=B0DHQ5YwOVnb+DgCzzMxMMKkTz47qX6ImbbhgH44hP4=; b=IgDloiut54E+kIKDgrSyY6P9bbj435T5vD6jRPstAp0RxgVyDvbogn2iENaMzxE9S8219L UKNyoGpVq1qC4Fscl+eZZb3RHxpwb+dSCxptPRTxlOrjiDCUYqbiu5A29YUCUuI4tjfE/X QB1GPVwKbNMKVjHKFX3IS6lNyWSYFINctVTq10NfnYN+FwzvImKabtdBr34MVg0g65UJK/ kVe6Ry1maPGnNUSAghvT0H6X4L/gwMnQWrjBr6bn8dWD3EhYzSUeZSJ28BAdZlBMoqbrQe 4HpTYsurEm0XYrzY+pTFdss8XPJ8CY2E9FbTZ1acDwMR4uNx4ri9mm24z0uQtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732230573; a=rsa-sha256; cv=none; b=pK9kD4ZqWY/8TJKIwAjKgxa5YZGXKZyKgaykAz7VMSv08FhGB+8s+tvlOK2uX1Zdd5W7Iq G4q0eFyT4ErBNfO1ZFxg49qjhsapGXfa7nK3J1fmNvnqyeFS7UHJz6zB8iGb8pyzIlrXPk 6Nz2T0Z5RIlZCt5G+Eat5bUUB4ZMB8jvLEUsGl/WnQbz/SLaasakJW4n5gY5hdTP9DNx88 esvXEOfn9IBtW0cRlh4cWbzXESXX639I+DjbUeckrebQ8ShqZzPwAR21ginh/bpF/5t7Et Ur+sdUrXWb5hPieguY92EQg6rihdph4YiQjGCyBlBa58l8k3mB5igKOWykAe+Q== 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 4XvYpP4chwz103X; Thu, 21 Nov 2024 23:09:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4ALN9XUl084999; Thu, 21 Nov 2024 23:09:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ALN9X8B084996; Thu, 21 Nov 2024 23:09:33 GMT (envelope-from git) Date: Thu, 21 Nov 2024 23:09:33 GMT Message-Id: <202411212309.4ALN9X8B084996@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: 6133473e4227 - main - graphics/povray37: fix build with libc++ 19 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: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6133473e4227abbfcf023bea6ab5eeed9c17e55b Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=6133473e4227abbfcf023bea6ab5eeed9c17e55b commit 6133473e4227abbfcf023bea6ab5eeed9c17e55b Author: Dimitry Andric AuthorDate: 2024-11-09 12:04:23 +0000 Commit: Dimitry Andric CommitDate: 2024-11-21 23:06:15 +0000 graphics/povray37: fix build with libc++ 19 As noted in the libc++ 19 release notes [1], std::char_traits<> is now only provided for char, char8_t, char16_t, char32_t and wchar_t, and any instantiation for other types will fail. This causes graphics/povray37 to fail to compile with clang 19 and libc++ 19, resulting in errors similar to: /usr/include/c++/v1/string:820:42: error: implicit instantiation of undefined template 'std::char_traits' 820 | static_assert(is_same<_CharT, typename traits_type::char_type>::value, | ^ ./base/configbase.h:159:19: note: in instantiation of template class 'std::basic_string' requested here 159 | inline UCS2String ASCIItoUCS2String(const char *s) | ^ /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here 23 | struct _LIBCPP_TEMPLATE_VIS char_traits; | ^ This can be fixed by defining `POVMSUCS2` as `char16_t` instead of `unsigned short`, `UCS2` as `char16_t` instead of `unsigned short`, and `UCS4` as `char32_t` instead of `unsigned int` in the passed-in `CPPFLAGS` variable. Also, patch up `vfe.cpp` and `vfeconf.h` to use `char16_t` and `u16string` instead of the non-standard types. [1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals PR: 282645 Approved by: bsd@philippost.de (maintainer) MFH: 2024Q4 --- graphics/povray37/Makefile | 3 +++ graphics/povray37/files/patch-vfe_vfe.cpp | 26 ++++++++++++++++++++++++++ graphics/povray37/files/patch-vfe_vfeconf.h | 19 +++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/graphics/povray37/Makefile b/graphics/povray37/Makefile index ca49e21b35de..dd49d7396768 100644 --- a/graphics/povray37/Makefile +++ b/graphics/povray37/Makefile @@ -24,6 +24,9 @@ GNU_CONFIGURE_MANPREFIX=${PREFIX}/share CONFIGURE_ARGS= COMPILED_BY=${HOSTARCH}-portbld-${OPSYS:tl}-${OSREL:R} \ --program-transform-name='s/povray/${PKGBASE}/' \ --disable-optimiz +CPPFLAGS+= -D POVMSUCS2="char16_t" +CPPFLAGS+= -D UCS2="char16_t" +CPPFLAGS+= -D UCS4="char32_t" VERSION_BASE= ${PORTVERSION:C/([0-9]+\.[0-9]+).*/\1/} ETCDIR= ${PREFIX}/etc/${PORTNAME}/${VERSION_BASE} diff --git a/graphics/povray37/files/patch-vfe_vfe.cpp b/graphics/povray37/files/patch-vfe_vfe.cpp new file mode 100644 index 000000000000..f4c8e56714ef --- /dev/null +++ b/graphics/povray37/files/patch-vfe_vfe.cpp @@ -0,0 +1,26 @@ +--- vfe/vfe.cpp.orig 2021-07-08 09:56:01 UTC ++++ vfe/vfe.cpp +@@ -1372,7 +1372,7 @@ int Allow_File_Write (const char *Filename, const unsi + return (vfeSession::GetSessionFromThreadID()->TestAccessAllowed(Filename, true)); + } + +-int Allow_File_Write (const unsigned short *Filename, const unsigned int FileType) ++int Allow_File_Write (const char16_t *Filename, const unsigned int FileType) + { + if (strcmp(UCS2toASCIIString(Filename).c_str(), "stdout") == 0 || strcmp(UCS2toASCIIString(Filename).c_str(), "stderr") == 0) + return true; +@@ -1384,12 +1384,12 @@ int Allow_File_Read (const char *Filename, const unsig + return (vfeSession::GetSessionFromThreadID()->TestAccessAllowed(Filename, false)); + } + +-int Allow_File_Read (const unsigned short *Filename, const unsigned int FileType) ++int Allow_File_Read (const char16_t *Filename, const unsigned int FileType) + { + return (vfeSession::GetSessionFromThreadID()->TestAccessAllowed(Filename, false)); + } + +-FILE *vfeFOpen (const std::basic_string& name, const char *mode) ++FILE *vfeFOpen (const UCS2String& name, const char *mode) + { + return (fopen (UCS2toASCIIString (name).c_str(), mode)) ; + } diff --git a/graphics/povray37/files/patch-vfe_vfeconf.h b/graphics/povray37/files/patch-vfe_vfeconf.h new file mode 100644 index 000000000000..e0761680ed1f --- /dev/null +++ b/graphics/povray37/files/patch-vfe_vfeconf.h @@ -0,0 +1,19 @@ +--- vfe/vfeconf.h.orig 2021-07-08 09:56:01 UTC ++++ vfe/vfeconf.h +@@ -61,12 +61,12 @@ namespace vfe + int vfe_POVMS_Sys_QueueSend(POVMS_Sys_QueueNode *q, void *p, int l) ; + int Allow_File_Write (const char *Filename, const unsigned int FileType); + int Allow_File_Read (const char *Filename, const unsigned int FileType); +- int Allow_File_Read (const unsigned short *Filename, const unsigned int FileType); +- int Allow_File_Write (const unsigned short *Filename, const unsigned int FileType); ++ int Allow_File_Read (const char16_t *Filename, const unsigned int FileType); ++ int Allow_File_Write (const char16_t *Filename, const unsigned int FileType); + POVMS_Sys_Thread_Type POVMS_GetCurrentThread(); + void vfeAssert (const char *message, const char *filename, int line) ; +- FILE *vfeFOpen (const std::basic_string& name, const char *mode); +- bool vfeRemove (const std::basic_string& name); ++ FILE *vfeFOpen (const std::u16string& name, const char *mode); ++ bool vfeRemove (const std::u16string& name); + + #if defined _DEBUG + void *vfe_POVMS_Sys_Malloc(size_t size, const char *func, const char *file, int line) ;