From nobody Mon Sep 02 07:50: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 4Wy1By2GR8z5MjVq; Mon, 02 Sep 2024 07:50:34 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wy1By0kvkz58wP; Mon, 2 Sep 2024 07:50:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725263434; 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=58x4T1ub/mLJWCLj/acXBJ0lSNnsTddVciptDxslMVs=; b=eag962RoH5yVX1S5Z5SneyOm25Jsj6FiB+UgtwkM6HyE9TpC9uONC6CTvHl8pchO8VWvG0 VsjnMzu43joNFJrRE8QqMnOA3C68EeX4otEUejakD89IfOXWsdbivgHW6jve2nzGWyc18C rVw2EvahoL2NQ2HzuqIIJtVzEX3EYL79DOHyjL8hs5b0oAlSubhXqV6MvvORKDFO36oGe3 ZZLPz3lgI7nNTU5AKNp5hMlkSeaqfwUncACP9HTH0eIbX44IzzNH6ANagSvPEiywIraRJD ae/nNcHmy/SHl/EF/YuWCIolLfjWkcltU7d2QoQCWutDMJKONcaSNmklkE7kXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725263434; a=rsa-sha256; cv=none; b=GJTNJlsBagd6+ymr6mLK08MeeAFYkt3MKNll269DjHSavSKG5riwHOGIk6zugrzVtuvuzj cD/qdbuK/I+8gU7theOh4y3AeSiHzW++o+X46Qx2WdsnUOtlHzMSSo30HWxzgDbUA+AE4p y9VpWhmnrieNc3WZD+X1XTuKgeDHrrehIFic2xJDmuY8pGkSs5OOkq+aM/Da6b1d65aAn4 DgnA94Bcp7V+SjRDYZGdtgzv+iVUVHuAeSInIM7mTJQcZyb3b5FHMFcwAMtR5IToD98eLk vQ5yWxrPciX+UDuCRAqtTq5McN41p7quyNOc69M2GPzvXJ1s/Gez06v7lomFAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725263434; 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=58x4T1ub/mLJWCLj/acXBJ0lSNnsTddVciptDxslMVs=; b=kW1pnOQtxbxsKnBsDk2i8yDsTthV41i81bTVUSIaBbDa2fvKbvQMaEdgOuvAh2ivh2UgXq 5KdhNKycysljaHVEYDl+uqbsw3qrHUqXagnls6zJJxTp2SynjMEbx+3gXDZthHCsyu1ZZA ek8g3ytO0PanywIWEK6evlvZ7Pmhe9S7bb/K684ckrWe2zPN1v33fyE83CmgXcDds9o93K ch04djj3V78VmexV5nyKxUteNUhJMuzB2XPxfxmswC0SxnerrSVaL+MFWw8w2NxIpyFYJ4 8f86aBbk3JF0FJavjvI55oJKtEf/rq/etxfIZcXrI337hOwRoyepJpL31k7tSQ== 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 4Wy1By0MHFz13PS; Mon, 2 Sep 2024 07:50:34 +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 4827oXbN003455; Mon, 2 Sep 2024 07:50:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4827oXNc003452; Mon, 2 Sep 2024 07:50:33 GMT (envelope-from git) Date: Mon, 2 Sep 2024 07:50:33 GMT Message-Id: <202409020750.4827oXNc003452@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: 3db7d7ff7deb - main - devel/py-rapidfuzz: 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: 3db7d7ff7deb3be6a0ddaf7e67c56c1940f34c13 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=3db7d7ff7deb3be6a0ddaf7e67c56c1940f34c13 commit 3db7d7ff7deb3be6a0ddaf7e67c56c1940f34c13 Author: Dimitry Andric AuthorDate: 2024-09-01 16:06:10 +0000 Commit: Dimitry Andric CommitDate: 2024-09-02 07:46:48 +0000 devel/py-rapidfuzz: 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 devel/py-rapidfuzz 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, | ^ /wrkdirs/usr/ports/devel/rapidfuzz-cpp/work/rapidfuzz-cpp-3.0.5/test/distance/examples/ocr.cpp:3:28: note: in instantiation of template class 'std::basic_string' requested here 3 | std::basic_string ocr_example1 = { | ^ /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here 23 | struct _LIBCPP_TEMPLATE_VIS char_traits; | ^ Once the fix for devel/rapidfuzz-cpp is in, this port only needs a few replacements of `std::basic_string` with `std::vector`. [1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals PR: 281194 Approved by: yuri (maintainer) MFH: 2024Q3 --- .../files/patch-src_rapidfuzz_utils.hpp | 25 +++++++++++++++++++ .../files/patch-src_rapidfuzz_utils__cpp.hpp | 29 ++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/devel/py-rapidfuzz/files/patch-src_rapidfuzz_utils.hpp b/devel/py-rapidfuzz/files/patch-src_rapidfuzz_utils.hpp new file mode 100644 index 000000000000..6642b9dfc402 --- /dev/null +++ b/devel/py-rapidfuzz/files/patch-src_rapidfuzz_utils.hpp @@ -0,0 +1,25 @@ +--- src/rapidfuzz/utils.hpp.orig 2024-08-06 20:55:30 UTC ++++ src/rapidfuzz/utils.hpp +@@ -10,7 +10,7 @@ + #include + #include + #include +-#include ++#include + + uint32_t UnicodeDefaultProcess(uint32_t ch); + +@@ -80,11 +80,9 @@ template + } + + template +-std::basic_string default_process(std::basic_string s) ++std::vector default_process(std::vector str) + { +- std::basic_string str(s); +- +- int64_t len = default_process(&str[0], str.size()); ++ int64_t len = default_process(str.data(), str.size()); + str.resize(len); + return str; + } diff --git a/devel/py-rapidfuzz/files/patch-src_rapidfuzz_utils__cpp.hpp b/devel/py-rapidfuzz/files/patch-src_rapidfuzz_utils__cpp.hpp new file mode 100644 index 000000000000..b7289a739904 --- /dev/null +++ b/devel/py-rapidfuzz/files/patch-src_rapidfuzz_utils__cpp.hpp @@ -0,0 +1,29 @@ +--- src/rapidfuzz/utils_cpp.hpp.orig 2024-08-06 20:55:30 UTC ++++ src/rapidfuzz/utils_cpp.hpp +@@ -9,20 +9,20 @@ static inline PyObject* default_process_impl(PyObject* + switch (c_sentence.kind) { + case RF_UINT8: + { +- auto proc_str = default_process( +- std::basic_string(static_cast(c_sentence.data), c_sentence.length)); ++ auto data = static_cast(c_sentence.data); ++ auto proc_str = default_process(std::vector(data, data + c_sentence.length)); + return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, proc_str.data(), (Py_ssize_t)proc_str.size()); + } + case RF_UINT16: + { +- auto proc_str = default_process( +- std::basic_string(static_cast(c_sentence.data), c_sentence.length)); ++ auto data = static_cast(c_sentence.data); ++ auto proc_str = default_process(std::vector(data, data + c_sentence.length)); + return PyUnicode_FromKindAndData(PyUnicode_2BYTE_KIND, proc_str.data(), (Py_ssize_t)proc_str.size()); + } + case RF_UINT32: + { +- auto proc_str = default_process( +- std::basic_string(static_cast(c_sentence.data), c_sentence.length)); ++ auto data = static_cast(c_sentence.data); ++ auto proc_str = default_process(std::vector(data, data + c_sentence.length)); + return PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, proc_str.data(), (Py_ssize_t)proc_str.size()); + } + // ToDo: for now do not process these elements should be done in some way in the future