@@ -1,34 +1,49 @@
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 = if stdenv.isDarwin then ''
29+ export DYLD_LIBRARY_PATH="`pwd`/src/lib_json:$DYLD_LIBRARY_PATH"
30+ '' else ''
31+ export LD_LIBRARY_PATH="`pwd`/src/lib_json:$LD_LIBRARY_PATH"
32+ '';
2533
26− buildInputs = [ cmake python ];
34+ nativeBuildInputs = [ cmake python ];
35+
36+ cmakeFlags = [
37+ "-DBUILD_SHARED_LIBS=ON"
38+ "-DBUILD_STATIC_LIBS=OFF"
39+ ];
2740
2841 meta = with stdenv.lib; {
42+ inherit version;
2943 homepage = https://github.com/open-source-parsers/jsoncpp;
3044 description = "A C++ library for interacting with JSON.";
45+ maintainers = with maintainers; [ ttuegel cpages ];
3146 license = licenses.mit;
32− platforms = platforms.linux;
47+ platforms = platforms.all;
3348 };
3449}