Files
Jungfraujoch/viewer/resources/generate_licenses_html.mjs
T
leonarski_f 75e401f0e5
Build Packages / Unit tests (push) Successful in 1h31m59s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 8m43s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 10m5s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 9m27s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m56s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 9m24s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 10m27s
Build Packages / build:rpm (rocky8) (push) Successful in 9m20s
Build Packages / build:rpm (rocky9) (push) Successful in 10m50s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m54s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 8m38s
Build Packages / DIALS test (push) Successful in 12m13s
Build Packages / XDS test (durin plugin) (push) Successful in 7m8s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 7m8s
Build Packages / XDS test (neggia plugin) (push) Successful in 7m50s
Build Packages / Generate python client (push) Successful in 16s
Build Packages / Build documentation (push) Successful in 50s
Build Packages / Create release (push) Skipped
v1.0.0-rc.153 (#63)
This is an UNSTABLE release. It includes many experimental features, as well as many AI generated fixes. We recommend using rc.152 for production use.

* jfjoch_broker: Add EXPERIMENTAL pixelrefine mode for image processing
* jfjoch_broker: Allow to load user mask from 8-bit and 16-bit TIFF files
* jfjoch_broker: Add ROI calculation in non-FPGA workflow
* jfjoch_broker: Fixes to TCP image pusher
* jfjoch_broker: Remove NUMA bindings
* jfjoch_broker: Improvements to indexing
* jfjoch_broker: For PSI EIGER, trimming energies are taken from the detector configuration (now compulsory) instead of hardcoded values
* jfjoch_writer: Save ROI definitions and the per-pixel ROI bitmap in the master file; azimuthal ROIs support phi (angular) sectors
* jfjoch_viewer: Major redesign with dockable panels and saved layouts, plus on-canvas creation/move/resize of box, circle and azimuthal ROIs
* jfjoch_viewer: Run jfjoch_process reprocessing jobs from inside the GUI and overlay per-run results

Reviewed-on: #63
2026-06-23 20:29:49 +02:00

72 lines
2.7 KiB
JavaScript

// Generate viewer/resources/third_party_licenses.html from the repo-level licenses/ texts.
//
// The viewer embeds this file as a Qt resource (:/third_party_licenses.html) and shows it in the
// "Third-party Licenses" window (QTextBrowser). It is committed so the Windows/macOS viewer build
// needs no generator at build time; re-run this on Linux when licenses/ changes:
//
// node viewer/resources/generate_licenses_html.mjs
//
import { readFileSync, readdirSync, writeFileSync } from "node:fs";
import { join, dirname } from "node:path";
import { fileURLToPath } from "node:url";
const here = dirname(fileURLToPath(import.meta.url));
const licensesDir = join(here, "..", "..", "licenses");
const outFile = join(here, "third_party_licenses.html");
const esc = (s) =>
s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
// Friendlier titles for the few non-obvious file names; otherwise the file stem is used.
const titles = {
"Qt6-NOTICE": "Qt 6",
"Qt6-LGPL-3.0": "Qt 6 — LGPL-3.0 (full text)",
"NVIDIA-CUDA-NOTICE": "NVIDIA CUDA Toolkit",
"NVIDIA-CUDA-EULA": "NVIDIA CUDA Toolkit — EULA (full text)",
"base64-macaron": "Base64 (Macaron)",
"cpp-httplib": "cpp-httplib",
"eigen-README": "Eigen (notes)",
"fast-feedback-indexer": "Fast feedback indexer",
"nlohmann-json": "nlohmann/json",
"xbflash-qspi": "xbflash.qspi",
"xilinx-hls-headers": "Xilinx HLS arbitrary-precision headers",
"slsDetectorPackage-GPL-3.0": "slsDetectorPackage (GPL-3.0)",
"slsDetectorPackage-LGPL-3.0": "slsDetectorPackage (LGPL-3.0)",
};
const files = readdirSync(licensesDir)
.filter((f) => f.endsWith(".txt"))
.sort((a, b) => a.localeCompare(b));
const entries = files.map((f) => {
const stem = f.replace(/\.txt$/, "");
return { id: stem, title: titles[stem] || stem, text: readFileSync(join(licensesDir, f), "utf8").trimEnd() };
});
const toc = entries.map((e) => `<li><a href="#${e.id}">${esc(e.title)}</a></li>`).join("\n");
const sections = entries
.map((e) => `<h2 id="${e.id}">${esc(e.title)}</h2>\n<pre>${esc(e.text)}</pre>`)
.join("\n<hr>\n");
const html = `<!DOCTYPE html>
<!-- Generated by viewer/resources/generate_licenses_html.mjs - do not edit by hand. -->
<html>
<head><meta charset="utf-8"><title>Third-party licenses</title></head>
<body>
<h1>Third-party software licenses</h1>
<p>The Jungfraujoch viewer is licensed under the GNU General Public License v3 (GPL-3.0).
It builds on the third-party components listed below, each under its own license. The complete
manifest with copyright holders is in THIRD_PARTY_NOTICES.md in the source distribution.</p>
<h2>Contents</h2>
<ul>
${toc}
</ul>
<hr>
${sections}
</body>
</html>
`;
writeFileSync(outFile, html, "utf8");
console.log(`Wrote ${outFile} (${entries.length} components).`);