From 88e640fd68115e424b7f539bf2496b69db2563db Mon Sep 17 00:00:00 2001 From: teh Date: Thu, 8 Jun 2023 17:09:56 +0100 Subject: [PATCH] jsonnet: Build with cmake (#236510) The current build doesn't install all necessary libraries to use jsonnet from c/c++ --- .../development/compilers/jsonnet/default.nix | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/pkgs/development/compilers/jsonnet/default.nix b/pkgs/development/compilers/jsonnet/default.nix index 20bde279be48..a4aec00711fb 100644 --- a/pkgs/development/compilers/jsonnet/default.nix +++ b/pkgs/development/compilers/jsonnet/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, jekyll, fetchFromGitHub }: +{ stdenv, lib, jekyll, cmake, fetchFromGitHub, gtest }: stdenv.mkDerivation rec { pname = "jsonnet"; @@ -12,28 +12,21 @@ stdenv.mkDerivation rec { sha256 = "sha256-FtVJE9alEl56Uik+nCpJMV5DMVVmRCnE1xMAiWdK39Y="; }; - nativeBuildInputs = [ jekyll ]; + nativeBuildInputs = [ jekyll cmake ]; + buildInputs = [ gtest ]; + + cmakeFlags = ["-DBUILD_STATIC_LIBS=ON" "-DUSE_SYSTEM_GTEST=ON" ]; enableParallelBuilding = true; - makeFlags = [ - "jsonnet" - "jsonnetfmt" - "libjsonnet.so" - ]; - # Upstream writes documentation in html, not in markdown/rst, so no # other output formats, sorry. - preBuild = '' - jekyll build --source ./doc --destination ./html + postBuild = '' + jekyll build --source ../doc --destination ./html ''; - installPhase = '' - mkdir -p $out/bin $out/lib $out/include $out/share/doc/jsonnet - cp jsonnet $out/bin/ - cp jsonnetfmt $out/bin/ - cp libjsonnet*.so $out/lib/ - cp -a include/*.h $out/include/ + postInstall = '' + mkdir -p $out/share/doc/jsonnet cp -r ./html $out/share/doc/jsonnet '';