From nobody Wed Nov 20 10:05:49 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 4XtcSY3pdcz5dXk7; Wed, 20 Nov 2024 10:05:49 +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 4XtcSY1clbz4fV9; Wed, 20 Nov 2024 10:05:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732097149; 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=tUlQqagfyjwnGlQEWFfDAU1a8+Hl3/L1SCVImVpBJtg=; b=VYqYBxuKKTzdETxjhgW8ejtOjbnnYujkthnUtMISe9E7XAzJ5T3P+8zhSybynk65WIAVvE Ai/ViampZg0bIx/9RIK/Blv6tnTTBmVuXMS+Kn29VDm6Dv35zDCgoHmCN+IFQwriO4ln/P WY/kV7X1YaQHjp2nV7swvrR+2ItiE9rgDNiQeXH2kBcJJTYhUtygCsRroh25qjtT1LIqIe yOQTyuyY+dQJ2Bp96rvEy+nRreH/EUdTZKBblSQLqzIOAclE3ZsPc0CUSGlX+E1Tmn4vS1 Edfq5RIgunFsEyf75+onH3vxJmlnaa9v2eOnkuqwqLmdRXYTSihIvOSTFDle+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732097149; 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=tUlQqagfyjwnGlQEWFfDAU1a8+Hl3/L1SCVImVpBJtg=; b=GRBrRtKupQHhFIfgu2P5hDeZTmy2DpINuOVyFIZVws6oJ8LXU7AKlkYXRfN4nMjatmCQX+ 3Gc/Uu84MjUvoaXElQNYx6BcvFkqf0aF+xndOLC77OQwB31ScGDWwXudYtP67LTIVDbQv/ O65RA4n7pu2Zy+3nbIcmFoKg5xtsmqfBx8y8PBrna0DrS99NiMzw7P7lphZ/Les0RCAhbe XUJRD85J8h3YoP8iNu771fsp4pFyijCMorwpeHw2rJc37tMcmZ57AwOk5ZomL7bXC+3bMv g+B0ssSw16lo1/wWbvf+qlWtgP+PotjaqYbC5UURP/xgSAc7u+fSiih120r7lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732097149; a=rsa-sha256; cv=none; b=qE844f+NhClvOATOqrX1Qu5pSNA+QUo+8fmZrxnYO5pogz5dnPH/rCPJT8scwer53aDRht CTAJPsTbDNVkWOkT1HzEF+Nb5EIUaMmh8mtLEfIEVNHOIBbhyo5ft4KjQszqaPbbyjYBfN PHAYYb2Q+1k0VNrZkoi90G+vkK5FjQxTM3k9r8GvdgCPTSgMj6vADShV/MuzBycc1pp7Pu ggTleGjbnOc3l+RKOTxmDksXGMKUNWo0EG47o8C98jHSkxIsnY8WikhcG/h663Ll/nbE1r aOXrQZT+wmNAxMwycaQws3lpgtEsl/btkOXmTsPy9rrk6qO8Lh4DfU2YkT+pzg== 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 4XtcSY1Dq2zqS2; Wed, 20 Nov 2024 10:05:49 +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 4AKA5ndr024246; Wed, 20 Nov 2024 10:05:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AKA5nAb024243; Wed, 20 Nov 2024 10:05:49 GMT (envelope-from git) Date: Wed, 20 Nov 2024 10:05:49 GMT Message-Id: <202411201005.4AKA5nAb024243@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dima Panov Subject: git: e287976630a6 - main - finance/ledger: fix build with boost-1.86 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: fluffy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e287976630a64690f9cd0fddfde199b322da52fe Auto-Submitted: auto-generated The branch main has been updated by fluffy: URL: https://cgit.FreeBSD.org/ports/commit/?id=e287976630a64690f9cd0fddfde199b322da52fe commit e287976630a64690f9cd0fddfde199b322da52fe Author: Dima Panov AuthorDate: 2024-11-20 09:52:46 +0000 Commit: Dima Panov CommitDate: 2024-11-20 10:05:22 +0000 finance/ledger: fix build with boost-1.86 Sponsored by: Future Crew, LLC --- finance/ledger/Makefile | 2 +- finance/ledger/files/patch-src_filters.cc | 48 ++++++++++++++++++ .../{patch-system.hh.in => patch-src_system.hh.in} | 0 finance/ledger/files/patch-src_utils.h | 57 ++++++++++++++++++++++ 4 files changed, 106 insertions(+), 1 deletion(-) diff --git a/finance/ledger/Makefile b/finance/ledger/Makefile index 999091db2bb7..cc37dd26b187 100644 --- a/finance/ledger/Makefile +++ b/finance/ledger/Makefile @@ -1,7 +1,7 @@ PORTNAME= ledger DISTVERSIONPREFIX= v DISTVERSION= 3.3.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= finance MAINTAINER= woodycarey@hotmail.com diff --git a/finance/ledger/files/patch-src_filters.cc b/finance/ledger/files/patch-src_filters.cc new file mode 100644 index 000000000000..56310c98dd19 --- /dev/null +++ b/finance/ledger/files/patch-src_filters.cc @@ -0,0 +1,48 @@ +--- src/filters.cc.orig 2023-03-30 07:40:48 UTC ++++ src/filters.cc +@@ -237,8 +237,6 @@ void anonymize_posts::operator()(post_t& post) + + void anonymize_posts::operator()(post_t& post) + { +- boost::uuids::detail::sha1 sha; +- unsigned int message_digest[5]; + bool copy_xact_details = false; + + if (last_xact != post.xact) { +@@ -255,12 +253,7 @@ void anonymize_posts::operator()(post_t& post) + std::ostringstream buf; + buf << reinterpret_cast(post.xact->payee.c_str()) + << integer_gen() << post.xact->payee.c_str(); +- +- sha.reset(); +- sha.process_bytes(buf.str().c_str(), buf.str().length()); +- sha.get_digest(message_digest); +- +- xact.payee = to_hex(message_digest); ++ xact.payee = sha1sum(buf.str(), 8); + xact.note = none; + } else { + xact.journal = post.xact->journal; +@@ -273,12 +266,7 @@ void anonymize_posts::operator()(post_t& post) + acct = acct->parent) { + std::ostringstream buf; + buf << integer_gen() << acct << acct->fullname(); +- +- sha.reset(); +- sha.process_bytes(buf.str().c_str(), buf.str().length()); +- sha.get_digest(message_digest); +- +- account_names.push_front(to_hex(message_digest)); ++ account_names.push_front(sha1sum(buf.str(), 8)); + } + + account_t * new_account = +@@ -1268,7 +1256,7 @@ void budget_posts::report_budget_items(const date_t& d + foreach (pending_posts_list::iterator& i, posts_to_erase) + pending_posts.erase(i); + } +- ++ + if (pending_posts.size() == 0) + return; + diff --git a/finance/ledger/files/patch-system.hh.in b/finance/ledger/files/patch-src_system.hh.in similarity index 100% rename from finance/ledger/files/patch-system.hh.in rename to finance/ledger/files/patch-src_system.hh.in diff --git a/finance/ledger/files/patch-src_utils.h b/finance/ledger/files/patch-src_utils.h new file mode 100644 index 000000000000..33e41412a62b --- /dev/null +++ b/finance/ledger/files/patch-src_utils.h @@ -0,0 +1,57 @@ +--- src/utils.h.orig 2023-03-30 07:40:48 UTC ++++ src/utils.h +@@ -607,29 +607,39 @@ inline int peek_next_nonws(std::istream& in) { + *_p = '\0'; \ + } + +-inline string to_hex(unsigned int * message_digest, const int len = 1) +-{ ++inline string digest_to_hex( ++ const boost::uuids::detail::sha1::digest_type& message_digest, ++ size_t len = sizeof(boost::uuids::detail::sha1::digest_type) * 2 ++) { + std::ostringstream buf; ++ buf.setf(std::ios_base::hex, std::ios_base::basefield); ++ buf.fill('0'); + +- for(int i = 0; i < 5 ; i++) { +- buf.width(8); +- buf.fill('0'); +- buf << std::hex << message_digest[i]; +- if (i + 1 >= len) +- break; // only output the first LEN dwords ++ // sha1::digest_type is an array type and may change between Boost versions ++ const size_t count = std::min( ++ sizeof(message_digest) / sizeof(message_digest[0]), ++ (len - 1) / (sizeof(message_digest[0]) * 2) + 1 ++ ); ++ for(size_t i = 0; i < count; i++) { ++ buf.width(sizeof(message_digest[i]) * 2); ++ buf << (unsigned int)message_digest[i]; + } +- return buf.str(); ++ string hex = buf.str(); ++ hex.resize(len, '0'); // in case a partial element is requested ++ return hex; + } + +-inline string sha1sum(const string& str) +-{ +- boost::uuids::detail::sha1 sha; ++inline string sha1sum( ++ const string& str, ++ size_t len = sizeof(boost::uuids::detail::sha1::digest_type) * 2 ++) { ++ static boost::uuids::detail::sha1 sha; ++ boost::uuids::detail::sha1::digest_type message_digest; + ++ sha.reset(); + sha.process_bytes(str.c_str(), str.length()); +- +- unsigned int message_digest[5]; + sha.get_digest(message_digest); +- return to_hex(message_digest, 5); ++ return digest_to_hex(message_digest, len); + } + + extern const string version;