libjson-rpc-cpp: 0.7.0 -> 1.3.0
This commit is contained in:
parent
bc838c8686
commit
12c5cfda1d
@ -1,19 +1,47 @@
|
|||||||
{ stdenv, fetchFromGitHub, cmake, jsoncpp, argtable, curl, libmicrohttpd
|
{ stdenv
|
||||||
, doxygen, catch, pkgconfig
|
, fetchFromGitHub
|
||||||
|
, fetchpatch
|
||||||
|
, pkg-config
|
||||||
|
, cmake
|
||||||
|
, argtable
|
||||||
|
, catch2
|
||||||
|
, curl
|
||||||
|
, doxygen
|
||||||
|
, hiredis
|
||||||
|
, jsoncpp
|
||||||
|
, libmicrohttpd
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "libjson-rpc-cpp";
|
pname = "libjson-rpc-cpp";
|
||||||
version = "0.7.0";
|
version = "1.3.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "cinemast";
|
owner = "cinemast";
|
||||||
repo = "libjson-rpc-cpp";
|
repo = "libjson-rpc-cpp";
|
||||||
sha256 = "07bg4nyvx0yyhy8c4x9i22kwqpx5jlv36dvpabgbb46ayyndhr7a";
|
sha256 = "sha256-EAakiqlfMprwLjloDekOssaB/EnAmn5njcwHGZtYs9w=";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
};
|
};
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = "-I${catch}/include/catch";
|
NIX_CFLAGS_COMPILE = "-I${catch2}/include/catch2";
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
name = "int-to-MHD_Result.patch";
|
||||||
|
url = "https://patch-diff.githubusercontent.com/raw/cinemast/libjson-rpc-cpp/pull/299.patch";
|
||||||
|
sha256 = "sha256-hiey6etzbOxhMElTMX7offKbey7c2OO/UWeN03k0AaM=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkg-config cmake doxygen ];
|
||||||
|
buildInputs = [
|
||||||
|
argtable
|
||||||
|
catch2
|
||||||
|
curl
|
||||||
|
hiredis
|
||||||
|
jsoncpp
|
||||||
|
libmicrohttpd
|
||||||
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
for f in cmake/FindArgtable.cmake \
|
for f in cmake/FindArgtable.cmake \
|
||||||
@ -26,37 +54,43 @@ stdenv.mkDerivation rec {
|
|||||||
sed -i -re 's#MATCHES "jsoncpp"#MATCHES ".*/jsoncpp/json$"#g' cmake/FindJsoncpp.cmake
|
sed -i -re 's#MATCHES "jsoncpp"#MATCHES ".*/jsoncpp/json$"#g' cmake/FindJsoncpp.cmake
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configurePhase = ''
|
preConfigure = ''
|
||||||
mkdir -p Build/Install
|
mkdir -p Build/Install
|
||||||
pushd Build
|
pushd Build
|
||||||
|
|
||||||
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/Install \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
# this hack is needed because the cmake scripts
|
||||||
mkdir -p $out
|
# require write permission to absolute paths
|
||||||
|
configurePhase = ''
|
||||||
|
runHook preConfigure
|
||||||
|
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/Install \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
|
runHook postConfigure
|
||||||
|
'';
|
||||||
|
|
||||||
|
preInstall = ''
|
||||||
function fixRunPath {
|
function fixRunPath {
|
||||||
p=$(patchelf --print-rpath $1)
|
p=$(patchelf --print-rpath $1)
|
||||||
q="$p:${stdenv.lib.makeLibraryPath [ jsoncpp argtable libmicrohttpd curl ]}:$out/lib"
|
q="$p:${stdenv.lib.makeLibraryPath [ jsoncpp argtable libmicrohttpd curl ]}:$out/lib"
|
||||||
patchelf --set-rpath $q $1
|
patchelf --set-rpath $q $1
|
||||||
}
|
}
|
||||||
|
|
||||||
make install
|
mkdir -p $out
|
||||||
|
'';
|
||||||
|
|
||||||
sed -i -re "s#-([LI]).*/Build/Install(.*)#-\1$out\2#g" Install/lib/pkgconfig/*.pc
|
postInstall = ''
|
||||||
for f in Install/lib/*.so* $(find Install/bin -executable -type f); do
|
sed -i -re "s#-([LI]).*/Build/Install(.*)#-\1$out\2#g" Install/lib64/pkgconfig/*.pc
|
||||||
|
for f in Install/lib64/*.so* $(find Install/bin -executable -type f); do
|
||||||
fixRunPath $f
|
fixRunPath $f
|
||||||
done
|
done
|
||||||
|
|
||||||
cp -r Install/* $out
|
cp -r Install/* $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
installPhase = ''
|
||||||
buildInputs = [ cmake jsoncpp argtable curl libmicrohttpd doxygen catch ];
|
runHook preInstall
|
||||||
|
make install
|
||||||
enableParallelBuilding = true;
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "C++ framework for json-rpc (json remote procedure call)";
|
description = "C++ framework for json-rpc (json remote procedure call)";
|
||||||
|
@ -14634,7 +14634,9 @@ in
|
|||||||
|
|
||||||
libjreen = callPackage ../development/libraries/libjreen { };
|
libjreen = callPackage ../development/libraries/libjreen { };
|
||||||
|
|
||||||
libjson-rpc-cpp = callPackage ../development/libraries/libjson-rpc-cpp { };
|
libjson-rpc-cpp = callPackage ../development/libraries/libjson-rpc-cpp {
|
||||||
|
libmicrohttpd = libmicrohttpd_0_9_72;
|
||||||
|
};
|
||||||
|
|
||||||
libkate = callPackage ../development/libraries/libkate { };
|
libkate = callPackage ../development/libraries/libkate { };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user