diff options
author | Jeremy Parker <jeremyp@booktopia.com.au> | 2023-07-10 19:39:08 +1000 |
---|---|---|
committer | Jeremy Parker <jeremyp@booktopia.com.au> | 2023-07-10 22:35:08 +1000 |
commit | e0698cf8980650e4733ca39d8151facbd7297e7f (patch) | |
tree | 9705b4020def6c43edb81e609a9e7ec496c16336 /pkgs/development/compilers/jsonnet | |
parent | 12d4e183c16795c341b93e2c54df12d352356c43 (diff) |
jsonnet: fix linking issue with libjsonnet++
Diffstat (limited to 'pkgs/development/compilers/jsonnet')
-rw-r--r-- | pkgs/development/compilers/jsonnet/default.nix | 13 | ||||
-rw-r--r-- | pkgs/development/compilers/jsonnet/fix-cpp-unresolved-symbols.patch | 12 |
2 files changed, 23 insertions, 2 deletions
diff --git a/pkgs/development/compilers/jsonnet/default.nix b/pkgs/development/compilers/jsonnet/default.nix index a4aec00711fb1..ce31fe08195ad 100644 --- a/pkgs/development/compilers/jsonnet/default.nix +++ b/pkgs/development/compilers/jsonnet/default.nix @@ -3,7 +3,7 @@ stdenv.mkDerivation rec { pname = "jsonnet"; version = "0.20.0"; - outputs = ["out" "doc"]; + outputs = [ "out" "doc" ]; src = fetchFromGitHub { rev = "v${version}"; @@ -15,7 +15,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ jekyll cmake ]; buildInputs = [ gtest ]; - cmakeFlags = ["-DBUILD_STATIC_LIBS=ON" "-DUSE_SYSTEM_GTEST=ON" ]; + cmakeFlags = [ + "-DUSE_SYSTEM_GTEST=ON" + "-DBUILD_STATIC_LIBS=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}" + "-DBUILD_SHARED_BINARIES=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" + ]; + + # https://github.com/google/jsonnet/issues/778 + patches = [ + ./fix-cpp-unresolved-symbols.patch + ]; enableParallelBuilding = true; diff --git a/pkgs/development/compilers/jsonnet/fix-cpp-unresolved-symbols.patch b/pkgs/development/compilers/jsonnet/fix-cpp-unresolved-symbols.patch new file mode 100644 index 0000000000000..dc4cdcf2ea1be --- /dev/null +++ b/pkgs/development/compilers/jsonnet/fix-cpp-unresolved-symbols.patch @@ -0,0 +1,12 @@ +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 3a52458..872e6c6 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -10,6 +10,7 @@ set(LIBJSONNETPP_SOURCE + + add_library(libjsonnet++ SHARED ${LIBJSONNETPP_HEADERS} ${LIBJSONNETPP_SOURCE}) + add_dependencies(libjsonnet++ jsonnet) ++target_link_libraries(libjsonnet++ libjsonnet) + # target_link_libraries(libjsonnet libjsonnet) + + # CMake prepends CMAKE_SHARED_LIBRARY_PREFIX to shared libraries, so without |