From 96717a908bb6599ebf85bd52a14a38d0c8cfe11e Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Wed, 28 Jan 2026 16:54:04 -0500 Subject: [PATCH] claude: Add archiveOnly flag for optional dependencies Add `archiveOnly` boolean flag to Dependency interface. When true, the dependency is uploaded to S3 via archive-bin-deps but skipped during configure.sh. This enables optional dependencies that are installed separately via `quarto install`. Add verapdf as first archive-only dependency. VeraPDF requires Java and is only needed for PDF/A validation, so it shouldn't be bundled with every quarto installation. Co-Authored-By: Claude Opus 4.5 --- .../src/common/dependencies/dependencies.ts | 15 +++++- package/src/common/dependencies/verapdf.ts | 47 +++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 package/src/common/dependencies/verapdf.ts diff --git a/package/src/common/dependencies/dependencies.ts b/package/src/common/dependencies/dependencies.ts index d85a15d8321..55be2feef5b 100644 --- a/package/src/common/dependencies/dependencies.ts +++ b/package/src/common/dependencies/dependencies.ts @@ -15,6 +15,7 @@ import { esBuild } from "./esbuild.ts"; import { pandoc } from "./pandoc.ts"; import { archiveUrl } from "../archive-binary-dependencies.ts"; import { typst } from "./typst.ts"; +import { verapdf } from "./verapdf.ts"; // The list of binary dependencies for Quarto export const kDependencies = [ @@ -22,7 +23,8 @@ export const kDependencies = [ pandoc(version("PANDOC")), dartSass(version("DARTSASS")), esBuild(version("ESBUILD")), - typst(version("TYPST")) + typst(version("TYPST")), + verapdf(version("VERAPDF")), ]; // Defines a binary dependency for Quarto @@ -30,6 +32,9 @@ export interface Dependency { name: string; bucket: string; version: string; + // If true, this dependency is only archived to S3 but not downloaded during configure. + // Use for optional dependencies installed separately via `quarto install`. + archiveOnly?: boolean; architectureDependencies: Record< string, ArchitectureDependency @@ -66,8 +71,14 @@ export async function configureDependency( targetDir: string, config: PlatformConfiguration, ) { + // Skip archive-only dependencies (installed separately via `quarto install`) + if (dependency.archiveOnly) { + info(`Skipping ${dependency.name} (archive-only)`); + return; + } + info(`Preparing ${dependency.name} (${config.os} - ${config.arch})`); - let archDep = dependency.architectureDependencies[config.arch]; + const archDep = dependency.architectureDependencies[config.arch]; if (archDep) { const platformDep = archDep[config.os]; diff --git a/package/src/common/dependencies/verapdf.ts b/package/src/common/dependencies/verapdf.ts new file mode 100644 index 00000000000..85f7d8edbce --- /dev/null +++ b/package/src/common/dependencies/verapdf.ts @@ -0,0 +1,47 @@ +/* + * verapdf.ts + * + * Copyright (C) 2020-2022 Posit Software, PBC + */ + +import { Dependency } from "./dependencies.ts"; + +export function verapdf(version: string): Dependency { + // VeraPDF is a Java application distributed as an installer ZIP. + // The same artifact works on all platforms. + const filename = `verapdf-greenfield-${version}-installer.zip`; + // Version format is X.Y.Z, but releases are organized under X.Y directories + const majorMinor = version.substring(0, version.lastIndexOf(".")); + const url = + `https://software.verapdf.org/releases/${majorMinor}/${filename}`; + + // VeraPDF is an archive-only dependency - it's uploaded to S3 for + // `quarto install verapdf` but not automatically installed during configure. + // This is because it requires Java and is only needed for PDF/A validation. + const release = { + filename, + url, + configure: async () => { + // No-op: verapdf is installed via `quarto install verapdf`, not configure.sh + }, + }; + + return { + name: "VeraPDF", + bucket: "verapdf", + version, + archiveOnly: true, + // Same artifact for all platforms since it's Java + architectureDependencies: { + "x86_64": { + "darwin": release, + "linux": release, + "windows": release, + }, + "aarch64": { + "darwin": release, + "linux": release, + }, + }, + }; +}