diff --git a/build/build-jasp.sh b/build/build-jasp.sh index 1221525..97a3fea 100755 --- a/build/build-jasp.sh +++ b/build/build-jasp.sh @@ -491,6 +491,30 @@ install -d "$STAGE_DIR$PREFIX/Modules" # on-demand downloads; shipping them alongside the installed form sends the # same content twice and took the tarball from 1.86 GB to 4.3 GB. +# jaspModuleTools is installed from GitHub HEAD, which writes the manifest +# version as an array ([[0,96,5]]). JASP's InstalledModules::parseModuleInfo +# calls isMember() on it, which jsoncpp refuses for arrays; the exception is +# caught per manifest and logged only to the (off by default) log file, so +# every bundled module is silently dropped and JASP starts with none at all. +# A plain version string is the first form that parser accepts. +log "normalising module manifest versions" +python3 - "$STAGE_DIR$PREFIX/Modules/manifests" <<'PY' +import json, pathlib, sys +manifests = sorted(pathlib.Path(sys.argv[1]).glob("*_manifest.json")) +if not manifests: + sys.exit("error: no module manifests were staged") +for p in manifests: + d = json.loads(p.read_text()) + v = d.get("version") + if isinstance(v, list): + parts = v[0] if v and isinstance(v[0], list) else v + d["version"] = ".".join(str(x) for x in parts) + p.write_text(json.dumps(d, indent=1) + "\n") + if not isinstance(d.get("version"), (str, dict)): + sys.exit(f"error: {p.name} has a version JASP cannot parse: {d.get('version')!r}") +print(f" {len(manifests)} manifests carry a version JASP can parse") +PY + install -Dm644 /work/packaging/org.jaspstats.JASP.desktop \ "$STAGE_DIR/usr/share/applications/org.jaspstats.JASP.desktop"