@@ -1,34 +1,47 @@
11{ stdenv
2−, fetchgit
2+, fetchFromGitHub
33, cmake
44, python
55}:
66stdenv.mkDerivation rec {
77 name = "jsoncpp-${version}";
8− version = "1.7.2";
8+ version = "1.8.0";
99
10− src = fetchgit {
11− url = https://github.com/open-source-parsers/jsoncpp.git;
12− sha256 = "04w4cfmvyv52rpqhc370ln8rhlsrr515778bixhgafqbp3p4x34k";
13− rev = "c8054483f82afc3b4db7efe4e5dc034721649ec8";
10+ src = fetchFromGitHub {
11+ owner = "open-source-parsers";
12+ repo = "jsoncpp";
13+ rev = version;
14+ sha256 = "1lg22zrjnl10x1bw0wfz72xd2kfbzynyggk8vdwd89mp1g8xjl9d";
1415 };
1516
16− configurePhase = ''
17− mkdir -p Build
18− pushd Build
17+ /* During darwin bootstrap, we have a cp that doesn't understand the
18+ * --reflink=auto flag, which is used in the default unpackPhase for dirs
19+ */
20+ unpackPhase = ''
21+ cp -a ${src} ${src.name}
22+ chmod -R +w ${src.name}
23+ export sourceRoot=${src.name}
24+ '';
1925
20− mkdir -p $out
21− cmake .. -DCMAKE_INSTALL_PREFIX=$out \
22− -DBUILD_SHARED_LIBS=ON \
23− -DCMAKE_BUILD_TYPE=Release
24− '';
26+ # Hack to be able to run the test, broken because we use
27+ # CMAKE_SKIP_BUILD_RPATH to avoid cmake resetting rpath on install
28+ preBuild = ''
29+ export LD_LIBRARY_PATH="`pwd`/src/lib_json:$LD_LIBRARY_PATH"
30+ '';
2531
26− buildInputs = [ cmake python ];
32+ nativeBuildInputs = [ cmake python ];
33+
34+ cmakeFlags = [
35+ "-DBUILD_SHARED_LIBS=ON"
36+ "-DBUILD_STATIC_LIBS=OFF"
37+ ];
2738
2839 meta = with stdenv.lib; {
40+ inherit version;
2941 homepage = https://github.com/open-source-parsers/jsoncpp;
3042 description = "A C++ library for interacting with JSON.";
43+ maintainers = with maintainers; [ ttuegel page ];
3144 license = licenses.mit;
32− platforms = platforms.linux;
45+ platforms = platforms.all;
3346 };
3447}