2017-02-28 17:11:32 +01:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, jsoncpp, argtable, curl, libmicrohttpd
|
2018-07-21 02:44:44 +02:00
|
|
|
, doxygen, catch, pkgconfig
|
2016-06-28 08:41:24 +02:00
|
|
|
}:
|
2017-02-28 17:11:32 +01:00
|
|
|
|
2016-06-28 08:41:24 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "libjson-rpc-cpp";
|
2017-02-28 17:11:32 +01:00
|
|
|
version = "0.7.0";
|
2013-10-14 16:11:46 +02:00
|
|
|
|
2017-02-28 17:11:32 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cinemast";
|
|
|
|
repo = "libjson-rpc-cpp";
|
|
|
|
sha256 = "07bg4nyvx0yyhy8c4x9i22kwqpx5jlv36dvpabgbb46ayyndhr7a";
|
|
|
|
rev = "v${version}";
|
2016-06-28 08:41:24 +02:00
|
|
|
};
|
2013-10-14 16:11:46 +02:00
|
|
|
|
2017-02-28 17:11:32 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-I${catch}/include/catch";
|
2016-08-02 17:31:10 +02:00
|
|
|
|
2017-02-28 17:11:32 +01:00
|
|
|
postPatch = ''
|
2016-06-28 08:41:24 +02:00
|
|
|
for f in cmake/FindArgtable.cmake \
|
|
|
|
src/stubgenerator/stubgenerator.cpp \
|
|
|
|
src/stubgenerator/stubgeneratorfactory.cpp
|
|
|
|
do
|
|
|
|
sed -i -re 's/argtable2/argtable3/g' $f
|
|
|
|
done
|
2013-10-14 16:11:46 +02:00
|
|
|
|
2016-06-28 08:41:24 +02:00
|
|
|
sed -i -re 's#MATCHES "jsoncpp"#MATCHES ".*/jsoncpp/json$"#g' cmake/FindJsoncpp.cmake
|
|
|
|
'';
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
mkdir -p Build/Install
|
|
|
|
pushd Build
|
|
|
|
|
|
|
|
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/Install \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
'';
|
2017-02-28 17:11:32 +01:00
|
|
|
|
2017-11-17 23:44:01 +01:00
|
|
|
installPhase = ''
|
2016-06-28 08:41:24 +02:00
|
|
|
mkdir -p $out
|
|
|
|
|
|
|
|
function fixRunPath {
|
|
|
|
p=$(patchelf --print-rpath $1)
|
2017-09-03 08:58:57 +02:00
|
|
|
q="$p:${stdenv.lib.makeLibraryPath [ jsoncpp argtable libmicrohttpd curl ]}:$out/lib"
|
2016-06-28 08:41:24 +02:00
|
|
|
patchelf --set-rpath $q $1
|
|
|
|
}
|
|
|
|
|
|
|
|
make install
|
2013-10-14 16:11:46 +02:00
|
|
|
|
2016-06-28 08:41:24 +02:00
|
|
|
sed -i -re "s#-([LI]).*/Build/Install(.*)#-\1$out\2#g" Install/lib/pkgconfig/*.pc
|
|
|
|
for f in Install/lib/*.so* $(find Install/bin -executable -type f); do
|
|
|
|
fixRunPath $f
|
|
|
|
done
|
2017-02-28 17:11:32 +01:00
|
|
|
|
2016-06-28 08:41:24 +02:00
|
|
|
cp -r Install/* $out
|
|
|
|
'';
|
2013-10-14 16:11:46 +02:00
|
|
|
|
2017-09-03 08:58:57 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2016-06-28 08:41:24 +02:00
|
|
|
buildInputs = [ cmake jsoncpp argtable curl libmicrohttpd doxygen catch ];
|
2013-10-14 16:11:46 +02:00
|
|
|
|
2017-11-17 23:44:01 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2016-06-28 08:41:24 +02:00
|
|
|
meta = with stdenv.lib; {
|
2013-10-14 16:11:46 +02:00
|
|
|
description = "C++ framework for json-rpc (json remote procedure call)";
|
2013-12-13 17:33:13 +01:00
|
|
|
homepage = https://github.com/cinemast/libjson-rpc-cpp;
|
2016-06-28 08:41:24 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
2013-10-14 16:11:46 +02:00
|
|
|
};
|
|
|
|
}
|