10 common-updater-scripts,
15 inherit (lib.versions) major majorMinor splitVersion;
16 inherit (lib.strings) concatStringsSep versionAtLeast;
27 license ? lib.licenses.mpl20,
33 mainProgram = if prog == null then pname else prog;
34 jar' = if jar == null then pname else jar;
37 inherit pname version src;
39 nativeBuildInputs = [ unzip ];
43 mkdir -p $out/bin $out/share $out/share/java
44 cp -s "$out"/*.jar "$out/share/java/" # */
46 mv $out/doc $out/share
47 cat > $out/bin/${mainProgram} <<EOF
49 export JAVA_HOME=${jre}
50 exec ${jre}/bin/java -jar $out/${jar'}.jar "\$@"
52 chmod a+x $out/bin/${mainProgram}
55 passthru = lib.optionalAttrs (updateScript != null) {
60 inherit description license mainProgram;
62 if versionAtLeast finalAttrs.version "11" then
63 "https://www.saxonica.com/products/latest.xml"
65 "https://www.saxonica.com/products/archive.xml";
66 sourceProvenance = with sourceTypes; [ binaryBytecode ];
67 maintainers = with maintainers; [ rvl ];
68 platforms = platforms.all;
73 # Saxon release zipfiles and tags often use dashes instead of dots.
74 dashify = version: concatStringsSep "-" (splitVersion version);
76 # SaxonJ-HE release files are pushed to the Saxon-HE GitHub repository.
77 # They are also available from Maven.
79 # Older releases were uploaded to SourceForge. They are also
80 # available from the Saxon-Archive GitHub repository.
85 versionLister = writeShellScript "saxon-he-versionLister" ''
88 common-updater-scripts
92 major_ver="${major version}"
93 list-git-tags --url="https://github.com/Saxonica/Saxon-HE.git" \
95 -e "s/SaxonHE([0-9]+)-([0-9]+)/\1.\2/" \
96 -e "/^''${major_ver:-[0-9]+}\./p"
103 tag = "SaxonHE${dashify version}";
104 filename = "${major version}/Java/${tag}J.zip";
106 "https://raw.githubusercontent.com/Saxonica/Saxon-HE/${tag}/${filename}";
115 url = "mirror://sourceforge/saxon/saxon${dashify version}.zip";
116 sha256 = "0l5y3y2z4wqgh80f26dwwxwncs8v3nkz3nidv14z024lmk730vs3";
118 description = "XSLT 1.0 processor";
119 # https://saxon.sourceforge.net/saxon6.5.3/conditions.html
120 license = lib.licenses.mpl10;
124 saxonb_8_8 = common rec {
129 url = "mirror://sourceforge/saxon/saxonb${dashify version}j.zip";
130 sha256 = "15bzrfyd2f1045rsp9dp4znyhmizh1pm97q8ji2bc0b43q23xsb8";
132 description = "Complete and conformant processor of XSLT 2.0, XQuery 1.0, and XPath 2.0";
136 saxonb_9_1 = common rec {
141 url = "mirror://sourceforge/saxon/Saxon-B/${version}/saxonb${dashify version}j.zip";
142 sha256 = "1d39jdnwr3v3pzswm81zry6yikqlqy9dp2l2wmpqdiw00r5drg4j";
144 description = "Complete and conformant processor of XSLT 2.0, XQuery 1.0, and XPath 2.0";
147 # Saxon-HE (home edition) replaces Saxon-B as the open source
148 # version of the Saxon XSLT and XQuery processor.
149 saxon_9-he = common rec {
154 url = "mirror://sourceforge/saxon/Saxon-HE/${majorMinor version}/SaxonHE${dashify version}J.zip";
155 sha256 = "1inxd7ia7rl9fxfrw8dy9sb7rqv76ipblaki5262688wf2dscs60";
157 description = "Processor for XSLT 3.0, XPath 2.0 and 3.1, and XQuery 3.1";
160 saxon_11-he = common rec {
163 jar = "saxon-he-${version}";
165 url = github.downloadUrl version;
166 sha256 = "/AVX5mtZSO6Is19t3+FlEvtIBsnwB3MIWAPCht8Aqnw=";
168 updateScript = github.updateScript version;
169 description = "Processor for XSLT 3.0, XPath 2.0 and 3.1, and XQuery 3.1";
172 saxon_12-he = common rec {
175 jar = "saxon-he-${version}";
177 url = github.downloadUrl version;
178 hash = "sha256-NaRnKHkr1M7C/CYtSHd7THm1ze7wPSmB46ZOyzoZ9xY=";
180 updateScript = github.updateScript version;
181 description = "Processor for XSLT 3.0, XPath 3.1, and XQuery 3.1";