#!/usr/bin/env bash # Collect the verbatim license texts of all third-party components into this directory. # # This is the bulk reference material that accompanies THIRD_PARTY_NOTICES.md (the human-readable # manifest at the repo root). Run from the repo root after a configure/build has populated the # FetchContent source trees (build/_deps or cmake-build-*/_deps). Re-run when a dependency version # changes. The output (licenses/*.txt) is committed so a source checkout needs no build to ship the # notices. # # bash licenses/COLLECT.sh # set -euo pipefail cd "$(dirname "$0")/.." OUT=licenses # Copy $1 to licenses/$2, trying each source path in $1 (space-separated) until one exists. copy_license() { local dest="$1"; shift local src for src in "$@"; do if [[ -f "$src" ]]; then cp "$src" "$OUT/$dest" echo " $dest <- $src" return 0 fi done echo " !! MISSING: $dest (none of: $*)" >&2 return 0 } # Search the populated dependency trees in order of preference. DEPS=(_deps cmake-build-release/_deps build/_deps cmake-build-debug/_deps) find_dep() { # find_dep local d for d in "${DEPS[@]}"; do [[ -f "$d/$1" ]] && { echo "$d/$1"; return; }; done } echo "Collecting third-party license texts into $OUT/ ..." # --- Fetched at build, statically linked into the C++ binaries ------------------------------- copy_license spdlog.txt "$(find_dep spdlog-src/LICENSE)" copy_license zstd.txt "$(find_dep zstd-src/LICENSE)" copy_license hdf5.txt "$(find_dep hdf5-src/LICENSE)" copy_license catch2.txt "$(find_dep catch2-src/LICENSE.txt)" copy_license cpp-httplib.txt "$(find_dep httplib-src/LICENSE)" copy_license libzmq.txt "$(find_dep libzmq-src/LICENSE)" copy_license libtiff.txt "$(find_dep tiff-src/LICENSE.md)" copy_license fftw.txt "$(find_dep fftw-src/COPYING)" copy_license ceres-solver.txt "$(find_dep ceres-src/LICENSE)" copy_license abseil.txt "$(find_dep ceres-src/third_party/abseil-cpp/LICENSE)" copy_license fast-feedback-indexer.txt "$(find_dep fast-indexer-src/LICENSE.md)" copy_license eigen.txt "$(find_dep eigen3-src/COPYING.MPL2)" copy_license eigen-README.txt "$(find_dep eigen3-src/COPYING.README)" copy_license zlib.txt "$(find_dep zlib-src/LICENSE.md)" # slsDetectorPackage is LGPL-3.0-or-later: ship both the GPL-3.0 base and the LGPL-3.0 addendum. copy_license slsDetectorPackage-LGPL-3.0.txt "$(find_dep sls_detector_package-src/LICENSES/LGPL-3.0)" copy_license slsDetectorPackage-GPL-3.0.txt "$(find_dep sls_detector_package-src/LICENSES/GPL-3.0)" # libjpeg-turbo is built out-of-line by preview/ (ExternalProject), not under _deps. # Mbed TLS is fetched only for viewer builds, so these are MISSING unless the configured tree # had JFJOCH_VIEWER_BUILD / JFJOCH_VIEWER_ONLY on. copy_license mbedtls.txt "$(find_dep mbedtls-src/LICENSE)" copy_license tf-psa-crypto.txt "$(find_dep mbedtls-src/tf-psa-crypto/LICENSE)" copy_license libjpeg-turbo.txt \ cmake-build-release/preview/libjpeg-turbo/src/libjpeg-turbo-project/LICENSE.md \ build/preview/libjpeg-turbo/src/libjpeg-turbo-project/LICENSE.md # --- Vendored directly in the repository ---------------------------------------------------- copy_license nlohmann-json.txt include/nlohmann/LICENSE.MIT copy_license tinycbor.txt frame_serialize/tinycbor/LICENSE copy_license bitshuffle.txt compression/bitshuffle/LICENSE copy_license bitshuffle-hperf.txt compression/bitshuffle_hperf/LICENSE-APACHE copy_license lz4.txt compression/lz4/LICENSE copy_license xilinx-hls-headers.txt fpga/include/LICENSE.HLS_Headers copy_license gemmi.txt gemmi_gph/LICENSE.txt # GEMMI bundles six third-party headers under its own include tree, each under its own licence # (see THIRD_PARTY_NOTICES.md). Only PEGTL ships a LICENSE file; sajson, fast_float, half, pocketfft # and tinydir carry their terms in a comment at the top of the header, so licenses/sajson.txt, # fast-float.txt, half.txt, pocketfft.txt and tinydir.txt are kept by hand - re-extract them from the # headers when GEMMI is updated. copy_license pegtl.txt gemmi_gph/gemmi/third_party/tao/LICENSE copy_license xbflash-qspi.txt tools/xbflash.qspi/LICENSE copy_license wingetopt.txt tools/wingetopt/LICENSE # --- Data files in the repository -------------------------------------------------------------- copy_license alphafold-db.txt tools/battery/models/LICENSE.txt # --- Runtime SDK license texts, copied from their system install (best effort) --------------- # These come from outside the build tree; the committed copies are authoritative if absent here. copy_license Qt6-LGPL-3.0.txt /usr/share/common-licenses/LGPL-3 copy_license NVIDIA-CUDA-EULA.txt \ /usr/local/cuda/EULA.txt /usr/local/cuda-12.8/EULA.txt echo "Done. base64-macaron.txt, traccc.txt, Qt6-NOTICE.txt and NVIDIA-CUDA-NOTICE.txt are maintained by hand."