Skip to content

Commit 13c1791

Browse files
author
riastradh
committed
finance/ledger: Fix build with boost>=1.86.
Patch backported from upstream master, since there's been no upstream release since the breakage. No revbump because this has been broken since the revbump last month for boost 1.86.
1 parent 6ed618d commit 13c1791

3 files changed

Lines changed: 66 additions & 1 deletion

File tree

finance/ledger/distinfo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
$NetBSD: distinfo,v 1.13 2024/05/02 13:27:04 riastradh Exp $
1+
$NetBSD: distinfo,v 1.14 2024/11/26 22:59:34 riastradh Exp $
22

33
BLAKE2s (ledger-3.3.2.tar.gz) = 9204b163d03fe6d2d286614a47d65317d33c8d1bca885d7f3c9447f334b57d7c
44
SHA512 (ledger-3.3.2.tar.gz) = d5d7058f0e9a02ad1d46e6780675d446070824b321f0f4c1ea6ac0c3dd4f11f259113bc36cbc796e4bb6d0a7898d6a68a25cce639e27a2b2434eec11a612ecb0
55
Size (ledger-3.3.2.tar.gz) = 825274 bytes
66
SHA1 (patch-src_CMakeLists.txt) = 8d6a16523554c98c8559702db681af6fb4f413aa
77
SHA1 (patch-src_amount.cc) = 245d2dfe0182ca431188c324531ac1204be902be
88
SHA1 (patch-src_expr.cc) = e707cbcba58a31534072ed490c9ba95f8dc4005d
9+
SHA1 (patch-src_filters.cc) = be5a1f382006ae014cea0c028d774f68d4e58ca8
910
SHA1 (patch-src_format.cc) = c7fe4821bc86a9126978235fa44859f84ea92989
1011
SHA1 (patch-src_item.cc) = 5e97a09824a04092161d8a0ca956a43ef084a03d
1112
SHA1 (patch-src_lookup.cc) = 0140f88386a6a9bbfa82e48fca4f3555f40a03aa
@@ -18,4 +19,5 @@ SHA1 (patch-src_system.hh.in) = 2993ef00740cbaa0ba60792e421a33642b8bba6e
1819
SHA1 (patch-src_textual.cc) = 698581b6193b39449f84ff27bc695a9b14c877c9
1920
SHA1 (patch-src_times.cc) = 544235432f6811f1a5c73ee72b3011709b606f17
2021
SHA1 (patch-src_utils.cc) = 06d8c17822a945a9d08c1122fb05f0568fdcf493
22+
SHA1 (patch-src_utils.h) = b050118f37e8fe2c030fdd1dd8affcbdc08626c5
2123
SHA1 (patch-src_xact.cc) = 89befd42102146e7a46f92ce458a7f1bc321ce55
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$NetBSD: patch-src_filters.cc,v 1.1 2024/11/26 22:59:34 riastradh Exp $
2+
3+
Fix build with boost>=1.86, which broke API compatibility.
4+
https://github.com/ledger/ledger/issues/2378
5+
6+
--- src/filters.cc.orig 2023-03-30 07:40:48.000000000 +0000
7+
+++ src/filters.cc
8+
@@ -238,7 +238,7 @@ void anonymize_posts::render_commodity(a
9+
void anonymize_posts::operator()(post_t& post)
10+
{
11+
boost::uuids::detail::sha1 sha;
12+
- unsigned int message_digest[5];
13+
+ unsigned char message_digest[20];
14+
bool copy_xact_details = false;
15+
16+
if (last_xact != post.xact) {
17+
@@ -1268,7 +1268,7 @@ void budget_posts::report_budget_items(c
18+
foreach (pending_posts_list::iterator& i, posts_to_erase)
19+
pending_posts.erase(i);
20+
}
21+
-
22+
+
23+
if (pending_posts.size() == 0)
24+
return;
25+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
$NetBSD: patch-src_utils.h,v 1.3 2024/11/26 22:59:34 riastradh Exp $
2+
3+
Fix build with boost>=1.86, which broke API compatibility.
4+
https://github.com/ledger/ledger/issues/2378
5+
6+
--- src/utils.h.orig 2023-03-30 07:40:48.000000000 +0000
7+
+++ src/utils.h
8+
@@ -607,14 +607,14 @@ inline int peek_next_nonws(std::istream&
9+
*_p = '\0'; \
10+
}
11+
12+
-inline string to_hex(unsigned int * message_digest, const int len = 1)
13+
+inline string to_hex(unsigned char * message_digest, const int len = 4)
14+
{
15+
std::ostringstream buf;
16+
17+
- for(int i = 0; i < 5 ; i++) {
18+
- buf.width(8);
19+
+ for(int i = 0; i < 20 ; i++) {
20+
+ buf.width(2);
21+
buf.fill('0');
22+
- buf << std::hex << message_digest[i];
23+
+ buf << std::hex << (int)message_digest[i];
24+
if (i + 1 >= len)
25+
break; // only output the first LEN dwords
26+
}
27+
@@ -627,9 +627,9 @@ inline string sha1sum(const string& str)
28+
29+
sha.process_bytes(str.c_str(), str.length());
30+
31+
- unsigned int message_digest[5];
32+
+ unsigned char message_digest[20];
33+
sha.get_digest(message_digest);
34+
- return to_hex(message_digest, 5);
35+
+ return to_hex(message_digest, 20);
36+
}
37+
38+
extern const string version;

0 commit comments

Comments
 (0)