1{ lib, stdenv, fetchzip, jre_headless }:
2
3stdenv.mkDerivation rec {
4 pname = "xmlbeans";
5 version = "5.0.2-20211014";
6
7 src = fetchzip {
8 url = "https://dlcdn.apache.org/poi/xmlbeans/release/bin/xmlbeans-bin-${version}.zip";
9 sha256 = "sha256-1o0kfBMhka/Midtg+GzpVDDygixL6mrfxtY5WrjLN+0=";
10 };
11
12 postPatch = ''
13 rm bin/*.cmd
14 substituteInPlace bin/dumpxsb \
15 --replace 'echo `dirname $0`' ""
16
17 substituteInPlace bin/_setlib \
18 --replace 'echo XMLBEANS_LIB=$XMLBEANS_LIB' ""
19
20 for file in bin/*; do
21 substituteInPlace $file \
22 --replace "java " "${jre_headless}/bin/java "
23 done
24 '';
25
26 installPhase = ''
27 mkdir -p $out
28 chmod +x bin/*
29 cp -r bin/ lib/ $out/
30 '';
31
32 meta = with lib; {
33 description = "Java library for accessing XML by binding it to Java types";
34 homepage = "https://xmlbeans.apache.org/";
35 downloadPage = "https://dlcdn.apache.org/poi/xmlbeans/release/bin/";
36 license = licenses.asl20;
37 maintainers = with maintainers; [ SuperSandro2000 ];
38 };
39}