forked from mirrors/nixpkgs
6960a96a0c
See https://hydra.nixos.org/build/80999410 Without a sandbox the `checkPhase` breaks with the following error: ``` /nix/store/i6vl5lwlz5jbkg4r6p340dwmj6fha3xq-stdenv-linux/setup: bin/jbake: /usr/bin/env: bad interpreter: No such file or directory jbake did not return correct version ``` Running `patchShebangs` before fixes the issue. Addresses #45960
35 lines
892 B
Nix
35 lines
892 B
Nix
{ stdenv, fetchzip, makeWrapper, jre }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
version = "2.6.1";
|
|
name = "jbake-${version}";
|
|
|
|
src = fetchzip {
|
|
url = "https://dl.bintray.com/jbake/binary/${name}-bin.zip";
|
|
sha256 = "0zlh2azmv8gj3c4d4ndivar31wd42nmvhxq6xhn09cib9kffxbc7";
|
|
};
|
|
|
|
buildInputs = [ makeWrapper jre ];
|
|
|
|
postPatch = "patchShebangs .";
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -vr * $out
|
|
wrapProgram $out/bin/jbake --set JAVA_HOME "${jre}"
|
|
'';
|
|
|
|
checkPhase = ''
|
|
export JAVA_HOME=${jre}
|
|
bin/jbake | grep -q "${version}" || (echo "jbake did not return correct version"; exit 1)
|
|
'';
|
|
doCheck = true;
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "JBake is a Java based, open source, static site/blog generator for developers & designers";
|
|
homepage = "https://jbake.org/";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ moaxcp ];
|
|
};
|
|
}
|