jsonnet: Build with cmake (#236510)
The current build doesn't install all necessary libraries to use jsonnet from c/c++
This commit is contained in:
@@ -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
|
||||
'';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user