2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, libtool, libxml2, cppunit, boost
|
2014-01-31 20:05:37 +00:00
|
|
|
, apr, aprutil, db, expat
|
2009-04-01 10:47:19 +01:00
|
|
|
}:
|
2007-11-11 16:22:29 +00:00
|
|
|
|
2013-11-22 15:26:26 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "log4cxx";
|
2013-11-22 15:26:26 +00:00
|
|
|
version = "0.10.0";
|
|
|
|
|
2009-02-12 14:52:23 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "http://apache.mirrors.hoobly.com/logging/log4cxx/${version}/apache-${pname}-${version}.tar.gz";
|
2009-02-12 14:52:23 +00:00
|
|
|
sha256 = "130cjafck1jlqv92mxbn47yhxd2ccwwnprk605c6lmm941i3kq0d";
|
|
|
|
};
|
2013-11-22 14:28:25 +00:00
|
|
|
|
2017-08-26 09:42:42 +01:00
|
|
|
patches = [
|
|
|
|
# adapted from upstream commit; will be fixed in next version
|
|
|
|
./narrowing-fixes.patch
|
|
|
|
];
|
|
|
|
|
2013-11-22 14:28:25 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e '1,/^#include/ {
|
|
|
|
/^#include/i \
|
|
|
|
#include <cstdio> \
|
|
|
|
#include <cstdlib> \
|
|
|
|
#include <cstring>
|
|
|
|
}' src/examples/cpp/console.cpp \
|
|
|
|
src/main/cpp/inputstreamreader.cpp \
|
|
|
|
src/main/cpp/socketoutputstream.cpp
|
2021-01-21 17:00:13 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2017-08-26 09:42:42 +01:00
|
|
|
sed -i 's/namespace std { class locale; }/#include <locale>/' src/main/include/log4cxx/helpers/simpledateformat.h
|
|
|
|
sed -i 's/\(#include <cctype>\)/\1\n#include <cstdlib>/' src/main/cpp/stringhelper.cpp
|
2013-11-22 14:28:25 +00:00
|
|
|
'';
|
|
|
|
|
2017-08-26 09:42:42 +01:00
|
|
|
buildInputs = [ libxml2 cppunit boost apr aprutil db expat ];
|
|
|
|
nativeBuildInputs = [ libtool ];
|
2009-04-01 10:47:19 +01:00
|
|
|
|
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://logging.apache.org/log4cxx/index.html";
|
2009-04-01 10:47:19 +01:00
|
|
|
description = "A logging framework for C++ patterned after Apache log4j";
|
2021-01-21 17:00:13 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
platforms = lib.platforms.unix;
|
2009-04-01 10:47:19 +01:00
|
|
|
};
|
2007-11-11 16:22:29 +00:00
|
|
|
}
|