nixpkgs/pkgs/tools/text/epubcheck/default.nix

42 lines
1.0 KiB
Nix
Raw Normal View History

2019-04-25 15:52:15 +01:00
{ stdenv, fetchzip
, jre, makeWrapper }:
stdenv.mkDerivation rec {
pname = "epubcheck";
2019-07-29 22:18:32 +01:00
version = "4.2.2";
2019-04-25 15:52:15 +01:00
src = fetchzip {
url = "https://github.com/w3c/epubcheck/releases/download/v${version}/epubcheck-${version}.zip";
2019-07-29 22:18:32 +01:00
sha256 = "0vz7k6i6y60ml20pbw2p9iqy6kxw4ziqszg6hbgz102x1jk8788d";
2019-04-25 15:52:15 +01:00
};
nativeBuildInputs = [ makeWrapper ];
dontBuild = true;
installPhase = ''
mkdir -p $out/lib
cp -r lib/* $out/lib
mkdir -p $out/libexec/epubcheck
cp epubcheck.jar $out/libexec/epubcheck
classpath=$out/libexec/epubcheck/epubcheck.jar
for jar in $out/lib/*.jar; do
classpath="$classpath:$jar"
done
mkdir -p $out/bin
makeWrapper ${jre}/bin/java $out/bin/epubcheck \
--add-flags "-classpath $classpath com.adobe.epubcheck.tool.Checker"
'';
meta = with stdenv.lib; {
homepage = "https://github.com/w3c/epubcheck";
2019-04-25 15:52:15 +01:00
description = "Validation tool for EPUB";
license = with licenses; [ asl20 bsd3 mpl10 w3c ];
platforms = platforms.all;
maintainers = with maintainers; [ eadwu ];
};
}