git.iko.soy/typeable/nixpkgs
on master help sign in
log4cxx: fix gcc6 build
commit326f54d9ba0a0c45da125313ed400034cf396f19 authorJörg Thalheim <joerg@thalheim.io> dateSat 26 Aug 2017, 09:42 (9 years ago) parent6895ef6
2 files changed+127−4
pkgs/development/libraries/log4cxx/default.nix+10−4 pkgs/development/libraries/log4cxx/narrowing-fixes.patch+117
pkgs/development/libraries/log4cxx/default.nix+10−4
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, autoconf, automake, libtool, libxml2, cppunit, boost
1+{ stdenv, fetchurl, libtool, libxml2, cppunit, boost
22, apr, aprutil, db, expat
33}:
44
@@ -11,6 +11,11 @@ stdenv.mkDerivation rec {
1111 sha256 = "130cjafck1jlqv92mxbn47yhxd2ccwwnprk605c6lmm941i3kq0d";
1212 };
1313
14+ patches = [
15+ # adapted from upstream commit; will be fixed in next version
16+ ./narrowing-fixes.patch
17+ ];
18+
1419 postPatch = ''
1520 sed -i -e '1,/^#include/ {
1621 /^#include/i \
@@ -21,11 +26,12 @@ stdenv.mkDerivation rec {
2126 src/main/cpp/inputstreamreader.cpp \
2227 src/main/cpp/socketoutputstream.cpp
2328 '' + stdenv.lib.optionalString stdenv.isDarwin ''
24− sed -i 's/namespace std { class locale; }/#include <locale>/' src/main/include/log4cxx/helpers/simpledateformat.h
25− sed -i 's/\(#include <cctype>\)/\1\n#include <cstdlib>/' src/main/cpp/stringhelper.cpp
29+ sed -i 's/namespace std { class locale; }/#include <locale>/' src/main/include/log4cxx/helpers/simpledateformat.h
30+ sed -i 's/\(#include <cctype>\)/\1\n#include <cstdlib>/' src/main/cpp/stringhelper.cpp
2631 '';
2732
28− buildInputs = [autoconf automake libtool libxml2 cppunit boost apr aprutil db expat];
33+ buildInputs = [ libxml2 cppunit boost apr aprutil db expat ];
34+ nativeBuildInputs = [ libtool ];
2935
3036 meta = {
3137 homepage = http://logging.apache.org/log4cxx/index.html;
pkgs/development/libraries/log4cxx/narrowing-fixes.patchnew file+117
@@ -0,0 +1,117 @@
1+diff --git a/src/main/cpp/locationinfo.cpp b/src/main/cpp/locationinfo.cpp
2+index e76ea29..bd22a1d 100644
3+--- a/src/main/cpp/locationinfo.cpp
4++++ b/src/main/cpp/locationinfo.cpp
5+@@ -149,18 +149,21 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
6+ os.writeNull(p);
7+ } else {
8+ char prolog[] = {
9+- 0x72, 0x00, 0x21, 0x6F, 0x72, 0x67, 0x2E,
10+- 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E, 0x6C,
11+- 0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69,
12+- 0x2E, 0x4C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F,
13+- 0x6E, 0x49, 0x6E, 0x66, 0x6F, 0xED, 0x99, 0xBB,
14+- 0xE1, 0x4A, 0x91, 0xA5, 0x7C, 0x02, 0x00, 0x01,
15+- 0x4C, 0x00, 0x08, 0x66, 0x75, 0x6C, 0x6C, 0x49,
16+- 0x6E, 0x66, 0x6F,
17+- 0x74, 0x00, 0x12, 0x4C, 0x6A,
18+- 0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67,
19+- 0x2F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B,
20+- 0x78, 0x70 };
21++ 0x72,
22++ 0x00,
23++ 0x21, 0x6F, 0x72, 0x67, 0x2E, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E,
24++ 0x6C, 0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69, 0x2E, 0x4C, 0x6F,
25++ 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x49, 0x6E, 0x66, 0x6F, static_cast<char>(0xED),
26++ static_cast<char>(0x99), static_cast<char>(0xBB), static_cast<char>(0xE1),
27++ 0x4A, static_cast<char>(0x91), static_cast<char>(0xA5), 0x7C, 0x02,
28++ 0x00,
29++ 0x01, 0x4C,
30++ 0x00,
31++ 0x08, 0x66, 0x75, 0x6C, 0x6C, 0x49, 0x6E, 0x66, 0x6F, 0x74,
32++ 0x00,
33++ 0x12, 0x4C, 0x6A, 0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67, 0x2F,
34++ 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B, 0x78, 0x70
35++ };
36+ os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, prolog, sizeof(prolog), p);
37+ char* line = p.itoa(lineNumber);
38+ //
39+diff --git a/src/main/cpp/loggingevent.cpp b/src/main/cpp/loggingevent.cpp
40+index 1c0d4be..edbf40b 100644
41+--- a/src/main/cpp/loggingevent.cpp
42++++ b/src/main/cpp/loggingevent.cpp
43+@@ -242,7 +242,7 @@ void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) {
44+ 0x68, 0x65, 0x2E, 0x6C, 0x6F, 0x67, 0x34, 0x6A,
45+ 0x2E, 0x73, 0x70, 0x69, 0x2E, 0x4C, 0x6F, 0x67,
46+ 0x67, 0x69, 0x6E, 0x67, 0x45, 0x76, 0x65, 0x6E,
47+- 0x74, 0xF3, 0xF2, 0xB9, 0x23, 0x74, 0x0B, 0xB5,
48++ 0x74, static_cast<char>(0xF3), static_cast<char>(0xF2), static_cast<char>(0xB9), 0x23, 0x74, 0x0B, static_cast<char>(0xB5),
49+ 0x3F, 0x03, 0x00, 0x0A, 0x5A, 0x00, 0x15, 0x6D,
50+ 0x64, 0x63, 0x43, 0x6F, 0x70, 0x79, 0x4C, 0x6F,
51+ 0x6F, 0x6B, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75,
52+diff --git a/src/main/cpp/objectoutputstream.cpp b/src/main/cpp/objectoutputstream.cpp
53+index 7cd696b..5442420 100644
54+--- a/src/main/cpp/objectoutputstream.cpp
55++++ b/src/main/cpp/objectoutputstream.cpp
56+@@ -36,7 +36,7 @@ ObjectOutputStream::ObjectOutputStream(OutputStreamPtr outputStream, Pool& p)
57+ objectHandle(0x7E0000),
58+ classDescriptions(new ClassDescriptionMap())
59+ {
60+- char start[] = { 0xAC, 0xED, 0x00, 0x05 };
61++ char start[] = { static_cast<char>(0xAC), static_cast<char>(0xED), 0x00, 0x05 };
62+ ByteBuffer buf(start, sizeof(start));
63+ os->write(buf, p);
64+ }
65+@@ -81,15 +81,15 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
66+ //
67+ // TC_OBJECT and the classDesc for java.util.Hashtable
68+ //
69+- char prolog[] = {
70+- 0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61,
71+- 0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61,
72+- 0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13,
73+- 0xBB, 0x0F, 0x25, 0x21, 0x4A, 0xE4, 0xB8, 0x03,
74+- 0x00, 0x02, 0x46, 0x00, 0x0A, 0x6C, 0x6F, 0x61,
75+- 0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49,
76+- 0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68,
77+- 0x6F, 0x6C, 0x64, 0x78, 0x70 };
78++ char prolog[] = {
79++ 0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61,
80++ 0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61,
81++ 0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13,
82++ static_cast<char>(0xBB), 0x0F, 0x25, 0x21, 0x4A, static_cast<char>(0xE4), static_cast<char>(0xB8), 0x03,
83++ 0x00, 0x02, 0x46, 0x00, 0x0A, 0x6C, 0x6F, 0x61,
84++ 0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49,
85++ 0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68,
86++ 0x6F, 0x6C, 0x64, 0x78, 0x70 };
87+ writeProlog("java.util.Hashtable", 1, prolog, sizeof(prolog), p);
88+ //
89+ // loadFactor = 0.75, threshold = 5, blockdata start, buckets.size = 7
90+diff --git a/src/test/cpp/xml/domtestcase.cpp b/src/test/cpp/xml/domtestcase.cpp
91+index a500628..29d67dd 100644
92+--- a/src/test/cpp/xml/domtestcase.cpp
93++++ b/src/test/cpp/xml/domtestcase.cpp
94+@@ -190,9 +190,9 @@ public:
95+ DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase3.xml"));
96+ LOG4CXX_INFO(logger, "File name is expected to end with a superscript 3");
97+ #if LOG4CXX_LOGCHAR_IS_UTF8
98+- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xC2, 0xB3, 0 };
99++ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xC2), static_cast<logchar>(0xB3), 0 };
100+ #else
101+- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xB3, 0 };
102++ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xB3), 0 };
103+ #endif
104+ File file;
105+ file.setPath(fname);
106+@@ -209,9 +209,9 @@ public:
107+ DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase4.xml"));
108+ LOG4CXX_INFO(logger, "File name is expected to end with an ideographic 4");
109+ #if LOG4CXX_LOGCHAR_IS_UTF8
110+- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xE3, 0x86, 0x95, 0 };
111++ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xE3), static_cast<logchar>(0x86), static_cast<logchar>(0x95), 0 };
112+ #else
113+- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0x3195, 0 };
114++ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0x3195), 0 };
115+ #endif
116+ File file;
117+ file.setPath(fname);