2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchzip
|
2020-04-24 23:36:52 +00:00
|
|
|
, jre, makeWrapper }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "epubcheck";
|
2023-02-16 17:41:37 +00:00
|
|
|
version = "5.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/w3c/epubcheck/releases/download/v${version}/epubcheck-${version}.zip";
|
2023-02-16 17:41:37 +00:00
|
|
|
sha256 = "sha256-Lcd+rLO4G2i5FTq/okjKQ1+EIfuZ8khkCijgeDxxwq8=";
|
2020-04-24 23:36:52 +00: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"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/w3c/epubcheck";
|
|
|
|
description = "Validation tool for EPUB";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = with licenses; [ asl20 bsd3 mpl10 w3c ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
|
|
|
}
|