LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.
C cdebiandesktop-environmentebpffirewalllandlocklinuxlinux-distributionopen-sourceprivacyquickjsraspberry-pi-5reactsecuritywaylandwayland-compositor
Store -> Artificial Intelligence and the curated AI app catalog (apt/): vendor repositories added with pinned keys (pkg-source-add; Cursor's own source file names so its postinst agrees), LordOS-built llama.cpp/whisper.cpp/codex-cli and mirrored goose/opencode; 'not in the lists yet' page; package engine accepts comma-separated Architectures
Federico Pereira1dcb2128afd6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0c505fe..fce0030 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -19,7 +19,7 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),(catalog)"). Claude Code, Claude Desktop, Visual Studio Code and Cursor come straight from theirvendors' signed APT repositories ("direct"): `apt/build.sh check` verifies the pinned keyfingerprint, the signed `InRelease`, the index hash and the package for each architecture. The other- five are verified on the maintainer's Mac and published in `pool/catalog/` by+ five are verified on the maintainer's machine and published in `pool/catalog/` by`tools/release/apt-repo.sh build … --catalog`: goose 1.56.0 and opencode 1.19.4 (the vendor's .deb,pinned SHA-256), and three packages LordOS builds in `debian:trixie` containers with no network —`llama.cpp` 0.7.0, the local model runner (`-hf` downloads GGUF models from Hugging Face over HTTPS;@@ -28,6 +28,19 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),its sigstore signature checked with cosign). Vendor packages are never modified; what theirmaintainer scripts do when the Store installs them (VS Code, Claude Desktop and Cursor add their ownAPT source) is documented.+- **Store → Artificial Intelligence.** The catalog as a page of the Store: each app with its kind,+ vendor and licence, dimmed on an architecture it doesn't support. An app from its vendor's repository+ first says whose repository it adds and its key fingerprint, then adds it (`pkg-source-add`, the key+ checked against the catalog's fingerprint) and fetches the lists; removing the app removes that+ repository unless another installed catalog app uses it. An app LordOS builds that the lists don't+ have yet offers to fetch them again instead of "package not found". Cursor's package always writes+ its own source (`cursor.sources`, `Signed-By: /usr/share/keyrings/anysphere.gpg`), and a second entry+ for the same repository with another `Signed-By` stops apt reading any source, so its catalog entry+ names those files and LordOS writes the same ones (the key dearmored). Tested on the VMware machine:+ llama.cpp installed from the Store (14 MB), `llama-server -hf ggml-org/Qwen3-0.6B-GGUF:Q8_0`+ downloaded the model on first run and answered over its HTTP API on the CPU (about 33 tokens/s, no+ Vulkan device); on VM 116, Cursor's and VS Code's sources added, Cursor installed (its own script+ rewrote the same file), `apt update` and the Store's own update both clean, then removed.- **Root over SSH, as an advanced option.** Settings → Sharing → Advanced lets an administrator allowroot to log in over SSH with a public key only, or with a key or a password, for tests andadministration: the keys are pasted or imported from a `.pub` file and listed with their@@ -152,6 +165,9 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),### Fixed+- **The Store ignored a repository written as `Architectures: amd64,arm64`.** apt accepts commas there+ (Cursor's package writes it that way); LordOS's package engine split only on spaces, so it dropped+ that source and never saw the app's updates. Both are accepted now.- **Locking the screen and switching user are faster.** Handing the screen to the sign-in screen waitedfor every input device to close, and the last close of a USB mouse stops its transfers: about 0.7 s forVMware's virtual USB mouse, so a lock took 0.6 to 1.1 s there. Access is still cut at once@@ -255,7 +271,7 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),- **llama.cpp on a GPU is not tested on real hardware yet.** Its Vulkan backend is meant for AMD (MesaRADV), NVIDIA (the NVIDIA driver or NVK) and Intel GPUs and falls back to the CPU without one; only theCPU path and the backend loading (software Vulkan) were checked.-- **Searching "displays" in Spotlight** opens the Help article on touchpads and touch screens before+- **Searching "displays" in the search panel** opens the Help article on touchpads and touch screens beforeSettings → Displays.- **Settings → Displays:** in the arrangement, the name of a small display is cut without an ellipsis.diff --git a/apps/store/ai.js b/apps/store/ai.jsnew file mode 100644index 0000000..0ea35f3--- /dev/null+++ b/apps/store/ai.js@@ -0,0 +1,108 @@+// ai.js — the Store's Artificial Intelligence category (0.8.5): LordOS's curated list of AI apps+// (apt/catalog.json, bundled at build time). An app whose maker has a signed APT repository+// ("delivery": "direct") comes from that repository: the first install adds it, with the maker's key+// whose fingerprint the catalog pins (pkg-source-add, server/src/pkg/sources_admin.c), over HTTPS. The+// others come from LordOS's own signed repository (lordos.org/apt), built or copied by LordOS from+// verified sources (docs/UPDATES.md, "Mirrored apps (catalog)"). Installing goes through the package+// engine like any Debian package: the plan first, then pkg-install.+import { createElement as h, useState } from 'react';+import { View, Text, Button, GroupBox, useTheme, useStore, useSystemInfo, admin, locale, typeScale, spacing, t } from '@lordos/sdk';+import catalog from '../../apt/catalog.json';+import { debian } from './debian.js';++const lang2 = () => (locale.get().lang || 'en').split('-')[0];+// the kernel's machine name as Debian names the architecture+const DEB_ARCH = { x86_64: 'amd64', aarch64: 'arm64' };+const summary = (a) => (a.summary && (a.summary[lang2()] || a.summary.en)) || '';+const installed = (pkg) => { try { return !!(lord.pkg.info(pkg, {}) || {}).installed; } catch (e) { return false; } };+const offered = (pkg) => { try { return !!lord.pkg.info(pkg, {}); } catch (e) { return false; } };++function Row({ a, onOpen, here }) {+ const th = useTheme();+ const fits = !here || !a.arches || a.arches.includes(here);+ const inst = installed(a.package);+ return h(View, { onClick: () => fits && onOpen(a.package), style: { flexDirection: 'row', alignItems: 'center', gap: spacing.m, paddingVertical: spacing.s, opacity: fits ? 1 : 0.5 } },+ h(View, { style: { width: 40, height: 40, borderRadius: 10, backgroundColor: th.accent, alignItems: 'center', justifyContent: 'center' } },+ h(Text, { style: { fontSize: 18, fontWeight: 700, color: '#fff' } }, (a.name || '?').slice(0, 1))),+ h(View, { style: { flex: 1, minWidth: 0, gap: 2 } },+ h(Text, { style: { fontSize: typeScale.body, fontWeight: 600, color: th.text, textAlign: 'start' } }, a.name),+ h(Text, { style: { fontSize: typeScale.callout, color: th.textDim, textAlign: 'start' } }, summary(a)),+ h(Text, { style: { fontSize: typeScale.caption, color: th.textDim, textAlign: 'start' } },+ [t(`store.ai.kind.${a.kind}`), a.vendor, a.license, !fits ? t('store.ai.notForArch', { arch: here }) : null].filter(Boolean).join(' · '))),+ inst ? h(Text, { style: { fontSize: typeScale.caption, fontWeight: 500, color: '#30d158' } }, t('store.installedBadge'))+ : h(Button, { small: true, label: t('store.ai.view'), disabled: !fits, onClick: () => onOpen(a.package) }));+}++// An app from its maker's repository that isn't in the package lists yet: say whose repository is+// added, then add it and fetch the lists (both admin actions), and show the usual details.+function AddSource({ a, onDone, onBack }) {+ const th = useTheme();+ const [busy, setBusy] = useState(false);+ const [err, setErr] = useState('');+ const add = () => {+ setBusy(true);+ setErr('');+ admin.run('pkg-source-add', a.id).then(() => admin.run('pkg-update')).then(onDone, (e) => setErr(e.message)).finally(() => setBusy(false));+ };+ return h(View, { style: { gap: spacing.l, maxWidth: 640 } },+ h(Button, { plain: true, small: true, label: `‹ ${t('store.back')}`, onClick: onBack, style: { alignSelf: 'flex-start' } }),+ h(Text, { style: { fontSize: typeScale.largeTitle, fontWeight: 600, color: th.text, textAlign: 'start' } }, a.name),+ h(Text, { style: { fontSize: typeScale.body, color: th.text, lineHeight: 1.45, textAlign: 'start' } },+ t('store.ai.sourceIntro', { name: a.name, vendor: a.vendor || '', url: (a.source && a.source.url) || '' })),+ h(Text, { style: { fontSize: 11, color: th.textDim, fontFamily: 'monospace', direction: 'ltr', textAlign: 'start' } },+ `${(a.source && a.source.url) || ''}\n${(a.source && a.source.fingerprint) || ''}`),+ err ? h(Text, { style: { fontSize: typeScale.caption, color: '#ff453a', textAlign: 'start' } }, err) : null,+ h(View, { style: { flexDirection: 'row', gap: spacing.s } },+ h(Button, { primary: true, label: busy ? t('store.ai.adding') : t('store.ai.addSource'), disabled: busy || !admin.available(), onClick: add })));+}++// A LordOS-built app that isn't in the package lists yet (they were fetched before the catalog had it):+// fetching them again (pkg-update) brings it, instead of the package page's "not found".+function NotListed({ a, onDone, onBack }) {+ const th = useTheme();+ const [busy, setBusy] = useState(false);+ const [err, setErr] = useState('');+ const update = () => {+ setBusy(true);+ setErr('');+ admin.run('pkg-update').then(onDone, (e) => setErr(e.message)).finally(() => setBusy(false));+ };+ return h(View, { style: { gap: spacing.l, maxWidth: 640 } },+ h(Button, { plain: true, small: true, label: `‹ ${t('store.back')}`, onClick: onBack, style: { alignSelf: 'flex-start' } }),+ h(Text, { style: { fontSize: typeScale.largeTitle, fontWeight: 600, color: th.text, textAlign: 'start' } }, a.name),+ h(Text, { style: { fontSize: typeScale.body, color: th.text, lineHeight: 1.45, textAlign: 'start' } }, t('store.ai.notListed', { name: a.name })),+ err ? h(Text, { style: { fontSize: typeScale.caption, color: '#ff453a', textAlign: 'start' } }, err) : null,+ h(View, { style: { flexDirection: 'row', gap: spacing.s } },+ h(Button, { primary: true, label: busy ? t('store.ai.updating') : t('store.ai.updateLists'), disabled: busy || !admin.available(), onClick: update })));+}++export function AiPage({ query }) {+ const th = useTheme();+ useStore(locale);+ const [open, setOpen] = useState(null);+ const info = useSystemInfo(60000);+ const here = DEB_ARCH[info.arch] || info.arch || '';+ const [, setTick] = useState(0);+ if (open) {+ const a = (catalog.apps || []).find((x) => x.package === open);+ const direct = a && a.source && a.source.delivery === 'direct';+ if (direct && !offered(open)) return h(AddSource, { a, onBack: () => setOpen(null), onDone: () => setTick((x) => x + 1) });+ if (a && !direct && !offered(open)) return h(NotListed, { a, onBack: () => setOpen(null), onDone: () => setTick((x) => x + 1) });+ // removing an app from its maker's repository also removes that repository, unless another+ // installed catalog app uses the same one (Claude Code and Claude Desktop share a key, not a repo)+ const onRemoved = () => {+ if (!direct) return;+ const sameRepo = (catalog.apps || []).some((x) => x.id !== a.id && x.source && x.source.url === a.source.url && installed(x.package));+ if (!sameRepo) admin.run('pkg-source-remove', a.id).catch(() => {});+ };+ return h(debian.Details, { name: open, onBack: () => setOpen(null), onRemoved });+ }+ const q = (query || '').trim().toLowerCase();+ const apps = (catalog.apps || []).filter((a) => !q || `${a.name} ${summary(a)} ${a.vendor || ''}`.toLowerCase().includes(q));+ const missing = apps.some((a) => !offered(a.package) && !(a.source && a.source.delivery === 'direct'));+ return h(View, { style: { gap: spacing.l } },+ h(Text, { style: { fontSize: typeScale.largeTitle, fontWeight: 600, color: th.text, textAlign: 'start' } }, t('store.ai.title')),+ h(Text, { style: { fontSize: typeScale.body, color: th.textDim, lineHeight: 1.45, maxWidth: 640, textAlign: 'start' } }, t('store.ai.intro')),+ missing ? h(Text, { style: { fontSize: typeScale.caption, color: '#ff9f0a', textAlign: 'start' } }, t('store.ai.refresh')) : null,+ h(GroupBox, null, ...apps.map((a) => h(Row, { key: a.id, a, here, onOpen: setOpen }))));+}diff --git a/apps/store/debian.js b/apps/store/debian.jsindex 0bbfab0..aefaacd 100644--- a/apps/store/debian.js+++ b/apps/store/debian.js@@ -98,7 +98,7 @@ function PlanView({ plan }) {// ---- package page -----function Details({ name, onBack }) {+function Details({ name, onBack, onRemoved }) {const th = useTheme();const { gen, job } = useStore(state);const [plan, setPlan] = useState(null);@@ -116,7 +116,7 @@ function Details({ name, onBack }) {const confirm = () => {const extra = plan.p.items.some((i) => i.action === 'remove' && !i.requested);if (plan.kind === 'install') runJob('pkg-install', extra ? `${name} --allow-remove` : name, t('store.job.install', { name: app?.name || name }));- else runJob('pkg-remove', extra ? `${name} --cascade` : name, t('store.job.remove', { name: app?.name || name }));+ else runJob('pkg-remove', extra ? `${name} --cascade` : name, t('store.job.remove', { name: app?.name || name })).then((ok) => { if (ok && onRemoved) onRemoved(name); });setPlan(null);};const desc = (info.appDescription || info.description || '').trim();@@ -364,6 +364,7 @@ function packageOfApp(a) {export const debian = {available: ready,+ Details,Discover,Updates,Status,diff --git a/apps/store/index.jsx b/apps/store/index.jsxindex 70af461..fea1e17 100644--- a/apps/store/index.jsx+++ b/apps/store/index.jsx@@ -6,6 +6,7 @@ import {suggestions, unseenSuggestions, refreshSuggestions,} from '@lordos/sdk';import { useEffect, useMemo, useState } from 'react';+import { AiPage } from './ai.js';import { debian, useDebian } from './debian.js';// The user's Downloads folder relative to home ("Downloads/"), from xdg-user-dirs; without it, the@@ -320,15 +321,16 @@ export default function Store() {const pages = [['discover', tr('store.page.discover'), unseen || null],['lordos', tr('store.page.lordos')],+ ['ai', tr('store.page.ai')],['installed', tr('store.page.installed')],['updates', deb.upgrades?.length ? tr('store.page.updatesCount', { count: deb.upgrades.length }) : tr('store.page.updates')],];- const Page = { discover: debian.Discover, lordos: LordOSPage, installed: InstalledPage, updates: debian.Updates }[page];+ const Page = { discover: debian.Discover, lordos: LordOSPage, ai: AiPage, installed: InstalledPage, updates: debian.Updates }[page];return (<View style={{ flex: 1, flexDirection: 'row' }}><View style={{ width: 210, backgroundColor: t.sidebarBg, paddingHorizontal: 10, paddingTop: 10, paddingBottom: 12, gap: 2 }}><Hairline edge="end" />- <SearchField value={query} onChange={(v) => { setQuery(v); if (v && page !== 'discover' && page !== 'installed' && page !== 'lordos') setPage('discover'); }}+ <SearchField value={query} onChange={(v) => { setQuery(v); if (v && page !== 'discover' && page !== 'installed' && page !== 'lordos' && page !== 'ai') setPage('discover'); }}placeholder={tr('store.search')} style={{ marginBottom: 10 }} />{pages.map(([id, label, detail]) => <SidebarItem key={id} label={label} detail={detail} selected={page === id} onClick={() => setPage(id)} />)}<View style={{ flex: 1 }} />diff --git a/apt/README.md b/apt/README.mdnew file mode 100644index 0000000..f63c934--- /dev/null+++ b/apt/README.md@@ -0,0 +1,102 @@+# apt/ — the curated app catalog++`apt/catalog.json` lists the third-party apps LordOS offers through its Store with the normal package+engine. It is the only source of truth: nothing goes into the repository unless it is pinned here, and+every change is reviewed in a pull request like code. See `docs/UPDATES.md`, "Mirrored apps+(catalog)", for how it fits into the signed repository on lordos.org.++```+apt/catalog.json the apps (schema 1, below)+apt/keys/<vendor>.asc the vendors' APT signing keys (public), pinned by fingerprint in the catalog+apt/recipes/<recipe>/ how LordOS builds its own .deb of an app that has no vendor .deb+apt/recipes/lib.sh helpers shared by the recipes+apt/build.sh check | fetch | list (POSIX sh; jq, gpg/gpgv, curl and docker on the Mac)+```++## Two ways an app reaches a system++- **Direct** (`"delivery": "direct"`): the vendor has its own signed APT repository (Claude Code,+ Claude Desktop, Visual Studio Code, Cursor). The user's system adds that repository itself (a+ deb822 `.sources` file with the pinned key from `apt/keys/`) and installs and updates the package+ from the vendor. Nothing is copied to lordos.org. `apt/build.sh check` still verifies the entry.+- **Mirrored** (everything else, and an `apt` entry with `"delivery": "mirror"`): the files are+ downloaded on the maintainer's Mac, verified, packaged when they are not a .deb, and added to+ `pool/catalog/` of lordos.org/apt by `tools/release/apt-repo.sh build <target> --catalog …`, signed+ with the LordOS archive key together with everything else. Today: llama.cpp, whisper.cpp and codex-cli (built by LordOS) and goose and opencode (the vendor's .deb).++## Schema (version 1)++```jsonc+{+ "schema": 1,+ "apps": [{+ "id": "llama.cpp", // unique, [a-z0-9][a-z0-9.+-]++ "package": "llama.cpp", // the Debian package users install+ "extra_packages": [], // optional: other packages a recipe may produce+ "name": "llama.cpp",+ "summary": { "en": "…", "es": "…", "pt": "…" }, // one short neutral line per language+ "license": "MIT", "vendor": "ggml.ai (ggml-org)", "homepage": "https://github.com/ggml-org/llama.cpp",+ "arches": ["amd64", "arm64"],+ "kind": "local-models", // coding-agent | editor | local-models | chat | speech | …+ "source": { "type": "…", … } // one of the four below+ }]+}+```++`source` by `type`:++| type | fields | versions come from |+|---|---|---|+| `apt` | `delivery` (`direct`/`mirror`), `url`, `suite` (the `dists/` name: the Suite, or the Codename when Suite is empty, as Cursor's), `components` [], `arches` [], `key` (`keys/<name>.asc`), `fingerprint` (40 hex digits, the key's primary fingerprint), `package`, optional `files` (`sources`, `keyring`: the vendor's own file names, for a package that always writes its own source, as Cursor's; `docs/UPDATES.md`) | the vendor's signed index: the newest version per architecture |+| `deb` | `version`, `files.<arch>.{url, sha256}` | the catalog |+| `build` | `recipe`, `version`, `revision`, `source_date_epoch`, `tag`, `commit`, `url` + `sha256` of the source tarball, `inputs` [{`name`, `url`, `sha256`}], `notes.<arch>` | the catalog |+| `binary` | `recipe`, `version`, `revision`, `source_date_epoch`, `files.<arch>.{url, sha256, sigstore?}`, `sigstore.{identity, issuer}`, `inputs` [] | the catalog |++A package LordOS builds is versioned `<version>-<revision>` (`0.7.0-1lordos1`). A `deb822` source a+system writes for a direct entry is exactly:++```+Types: deb+URIs: <url>+Suites: <suite>+Components: <components…>+Architectures: <arches…>+Signed-By: <the key from apt/keys/, fingerprint <fingerprint>>+```++## Updating an app++1. Mirrored or built app: change `version` (and `revision`, back to `1lordos1` for a new upstream+ version) and every `sha256`, `url`, `tag`/`commit` and `source_date_epoch` in the same entry. Take+ the hashes from the vendor's own published digests (a GitHub release asset's `digest`, a+ `sha256sum.txt`), then confirm them on a second download. For codex-cli, also the sigstore bundle+ and the identity (`…/rust-release.yml@refs/tags/rust-v<version>`).+2. A LordOS packaging change without a new upstream version: bump `revision` (`1lordos2`). A+ published version is never replaced: the pool is append-only, and `apt-repo.sh` refuses a file+ with the same name and different contents. Built packages are kept in the cache and not rebuilt.+3. Direct or `apt` app: nothing to bump; the newest version in the vendor's signed index is used.+ Only a key rotation changes the entry (a new `apt/keys/*.asc` and `fingerprint`, reviewed).+4. Run `apt/build.sh check` (and `apt/build.sh fetch <id>` for a mirrored app), then open the pull+ request with the output. The repository is built and signed only on the maintainer's Mac.++## Trust rules++- **Pinned, not discovered.** Every byte that reaches the pool matches a SHA-256 written in this+ file, or (for `apt` sources) the SHA-256 of a vendor index whose `InRelease` verifies with the+ pinned key: `gpgv` with only that key, a `VALIDSIG` by the pinned fingerprint, the key file holding+ exactly one primary key, the suite and `Valid-Until` checked, the `Packages` file checked against+ `InRelease`, the `.deb` checked against `Packages` (SHA-256 and size), its `Filename` inside+ `pool/` with no `..`, and its control fields (`Package`, `Version`, `Architecture`) checked.+- **Downloads are https only** (redirects too), and only the URLs in the catalog.+- **Builds have no network.** Recipes run in a `debian:trixie` container of the target architecture+ (`--platform linux/amd64` or `linux/arm64`, under qemu on the Mac) with `--network none`, as the+ invoking user, with the verified inputs read-only. Anything upstream's build would download (llama.cpp's+ web UI, whisper.cpp's `talk-llama`) is either a pinned input or left out.+- **Signatures when the vendor has them.** codex-cli's binary is checked against its sigstore bundle+ with `cosign verify-blob` (keyless: the GitHub Actions workflow identity of that tag and the+ `token.actions.githubusercontent.com` issuer), with a local `cosign` or the pinned cosign container.+- **Vendor .debs are never modified**, including their maintainer scripts (`docs/UPDATES.md` lists+ what they do when the Store installs them).+- **Cached, so it can be republished.** `$WORKDIR/catalog-cache` (`~/.local/share/lordos-apt`) keeps+ every verified download and every built package; a version that vanished upstream can still be+ published, and a built package is never rebuilt for the same version.diff --git a/apt/build.sh b/apt/build.shnew file mode 100755index 0000000..7aa35df--- /dev/null+++ b/apt/build.sh@@ -0,0 +1,432 @@+#!/bin/sh+# apt/build.sh — the curated app catalog (apt/catalog.json) of the LordOS APT repository+# (apt/README.md, docs/UPDATES.md "Mirrored apps (catalog)").+#+# apt/build.sh check [id…] validate the catalog; for every "apt" entry verify the vendor's+# repository (pinned key, signed InRelease, index hash, package per arch)+# apt/build.sh fetch [id…] download and verify (and build, from apt/recipes/) every app that goes+# into lordos.org/apt's pool/catalog; prints the resulting .deb paths+# apt/build.sh list one line per app: id, package, source type, delivery, version+#+# Only stdout of "fetch" is the list of .debs (tools/release/apt-repo.sh build --catalog reads it);+# everything else goes to stderr. Files are kept in $WORKDIR/catalog-cache (WORKDIR as apt-repo.sh:+# $LORDOS_APT_DIR or ~/.local/share/lordos-apt): a verified download or a built package is reused,+# never rebuilt for the same version, so a version that vanished upstream can still be republished+# and the append-only pool never sees two different files with the same name.+#+# Trust: nothing is used unless it matches what apt/catalog.json pins.+# apt the key file's only primary key must have the catalog's fingerprint; InRelease must carry a+# good signature by it (gpgv, VALIDSIG); Packages must match the SHA-256 in InRelease; the+# newest version per architecture is taken (dpkg --compare-versions); its Filename must stay+# inside pool/; the .deb must match the index's SHA-256 and size. delivery "direct" (installed+# from the vendor on the user's machine) is only checked, never mirrored.+# deb the vendor .deb must match the pinned SHA-256 and its Package/Version/Architecture.+# build the source tarball (and every extra input) must match its pinned SHA-256; the recipe runs+# in a debian:trixie container of the target architecture with --network none.+# binary the same for the vendor's prebuilt archive; a sigstore bundle, when pinned, is verified+# with cosign (keyless: the catalog's identity and OIDC issuer).+set -eu++ROOT=$(cd "$(dirname "$0")/.." && pwd)+CAT=${LORDOS_CATALOG:-$ROOT/apt/catalog.json}+WORKDIR=${LORDOS_APT_DIR:-$HOME/.local/share/lordos-apt}+CACHE=$WORKDIR/catalog-cache+TOOLS_IMAGE=lordos-apt-tools:trixie # the same image as tools/release/apt-repo.sh+BUILD_IMAGE=lordos-catalog-build:trixie-v2 # + "-<arch>"; bump the tag when the packages below change+COSIGN_IMAGE=gcr.io/projectsigstore/cosign:v2.4.1@sha256:b03690aa52bfe94054187142fba24dc54137650682810633901767d8a3e15b31+export LC_ALL=C++die() { echo "apt/build.sh: $*" >&2; exit 1; }+say() { echo "$*" >&2; }+usage() { sed -n '5,10p' "$0" >&2; exit 2; }++command -v jq >/dev/null 2>&1 || die "needs jq"+[ -f "$CAT" ] || die "no catalog at $CAT"++sha256() { if command -v sha256sum >/dev/null 2>&1; then sha256sum "$1" | cut -d' ' -f1; else shasum -a 256 "$1" | cut -d' ' -f1; fi; }+fsize() { wc -c < "$1" | tr -d ' '; }+is_sha() { printf %s "$1" | grep -Eq '^[0-9a-f]{64}$'; }+is_https() { case "$1" in https://*) case "$1" in *[!A-Za-z0-9._~:/?=\&%+@-]*) return 1 ;; esac; return 0 ;; *) return 1 ;; esac; }+is_name() { printf %s "$1" | grep -Eq '^[a-z0-9][a-z0-9.+-]+$'; }+is_version() { printf %s "$1" | grep -Eq '^([0-9]+:)?[0-9][A-Za-z0-9.+~-]*$'; }+j() { jq -r "$@" "$CAT"; }+# a field of app $1 (an id): jf <id> <jq filter on the app object>+jf() { jq -r --arg id "$1" ".apps[] | select(.id == \$id) | $2" "$CAT"; }++# download $1 to $2 unless $2 already has SHA-256 $3; verify; atomically rename+fetch_pinned() {+ fp_url=$1; fp_dest=$2; fp_want=$3+ if [ -f "$fp_dest" ] && [ "$(sha256 "$fp_dest")" = "$fp_want" ]; then return 0; fi+ mkdir -p "$(dirname "$fp_dest")"+ say " downloading $fp_url"+ curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 -o "$fp_dest.part" "$fp_url" || { rm -f "$fp_dest.part"; die "cannot download $fp_url"; }+ fp_got=$(sha256 "$fp_dest.part")+ [ "$fp_got" = "$fp_want" ] || { rm -f "$fp_dest.part"; die "$fp_url: SHA-256 is $fp_got, the catalog pins $fp_want"; }+ mv "$fp_dest.part" "$fp_dest"+}++# dpkg-deb and dpkg --compare-versions: this machine's, or the apt-repo.sh tools container's+tools_image() {+ docker image inspect "$TOOLS_IMAGE" >/dev/null 2>&1 && return 0+ printf 'FROM debian:trixie\nRUN apt-get update -q && apt-get install -y -q --no-install-recommends apt-utils dpkg-dev xz-utils && rm -rf /var/lib/apt/lists/*\n' |+ docker build -q --platform linux/amd64 -t "$TOOLS_IMAGE" - >/dev/null || die "could not build the $TOOLS_IMAGE container"+}+# deb_field <file.deb> <Field>+deb_field() {+ if command -v dpkg-deb >/dev/null 2>&1; then dpkg-deb -f "$1" "$2"; return; fi+ command -v docker >/dev/null 2>&1 || die "needs dpkg-deb or docker"+ tools_image+ df_d=$(cd "$(dirname "$1")" && pwd)+ docker run --rm --platform linux/amd64 --network none -v "$df_d:/d:ro" "$TOOLS_IMAGE" dpkg-deb -f "/d/$(basename "$1")" "$2"+}+# stdin: "<version> <rest…>" lines; stdout: the line with the highest Debian version+newest() {+ script='best=""; line=""; while read -r v rest; do if [ -z "$best" ] || dpkg --compare-versions "$v" gt "$best"; then best=$v; line="$v $rest"; fi; done; printf "%s\n" "$line"'+ if command -v dpkg >/dev/null 2>&1; then sh -c "$script"; return; fi+ tools_image+ docker run --rm -i --platform linux/amd64 --network none "$TOOLS_IMAGE" sh -c "$script"+}+# check that a .deb is the package, version and architecture we expect+check_deb() {+ cd_f=$1; cd_pkg=$2; cd_ver=$3; cd_arch=$4+ cd_p=$(deb_field "$cd_f" Package); cd_v=$(deb_field "$cd_f" Version); cd_a=$(deb_field "$cd_f" Architecture)+ [ "$cd_p" = "$cd_pkg" ] || die "$cd_f is package $cd_p, expected $cd_pkg"+ [ -z "$cd_ver" ] || [ "$cd_v" = "$cd_ver" ] || die "$cd_f is version $cd_v, expected $cd_ver"+ [ "$cd_a" = "$cd_arch" ] || [ "$cd_a" = all ] || die "$cd_f is for $cd_a, expected $cd_arch"+}++# seconds since the epoch of an RFC 2822 date (Release "Date"/"Valid-Until"), GNU or BSD date+epoch_of() {+ date -u -d "$1" +%s 2>/dev/null && return+ d=$(printf %s "$1" | sed -e 's/ UTC$/ +0000/' -e 's/ GMT$/ +0000/' -e 's/ Z$/ +0000/')+ date -j -u -f '%a, %d %b %Y %H:%M:%S %z' "$d" +%s 2>/dev/null+}++# ---------------------------------------------------------------------------------------------------+# the catalog itself+validate() {+ [ "$(j .schema)" = 1 ] || die "catalog schema must be 1"+ dup=$(j '.apps[].id' | sort | uniq -d)+ [ -z "$dup" ] || die "duplicate ids: $dup"+ dup=$(j '.apps[] | .package, (.extra_packages // [])[]' | sort | uniq -d)+ [ -z "$dup" ] || die "duplicate package names: $dup"+ for id in $(j '.apps[].id'); do+ is_name "$id" || die "bad id $id"+ for f in package name license vendor homepage kind summary.en summary.es summary.pt source.type; do+ v=$(jf "$id" ".$f // empty")+ [ -n "$v" ] || die "$id: missing $f"+ done+ is_name "$(jf "$id" .package)" || die "$id: bad package name"+ for p in $(jf "$id" '(.extra_packages // [])[]'); do is_name "$p" || die "$id: bad extra package $p"; done+ is_https "$(jf "$id" .homepage)" || die "$id: homepage must be https"+ arches=$(jf "$id" '.arches[]')+ [ -n "$arches" ] || die "$id: no arches"+ for a in $arches; do case "$a" in amd64|arm64) ;; *) die "$id: unsupported arch $a" ;; esac; done+ type=$(jf "$id" .source.type)+ case "$type" in+ apt)+ case "$(jf "$id" '.source.delivery // "mirror"')" in mirror|direct) ;; *) die "$id: delivery must be mirror or direct" ;; esac+ is_https "$(jf "$id" .source.url)" || die "$id: source.url must be https"+ is_name "$(jf "$id" .source.suite)" || die "$id: bad suite"+ [ -n "$(jf "$id" '.source.components[]?')" ] || die "$id: no components"+ for c in $(jf "$id" '.source.components[]'); do is_name "$c" || die "$id: bad component $c"; done+ for a in $(jf "$id" '.source.arches[]'); do printf ' %s ' $arches | grep -q " $a " || die "$id: source arch $a not in arches"; done+ k=$(jf "$id" .source.key)+ case "$k" in keys/*.asc) ;; *) die "$id: key must be keys/<name>.asc" ;; esac+ case "$k" in *..*|*[!A-Za-z0-9._/-]*) die "$id: bad key path" ;; esac+ [ -f "$ROOT/apt/$k" ] || die "$id: no key file apt/$k"+ printf %s "$(jf "$id" .source.fingerprint)" | grep -Eq '^[0-9A-F]{40}$' || die "$id: fingerprint must be 40 upper-case hex digits"+ is_name "$(jf "$id" .source.package)" || die "$id: bad source.package"+ [ "$(jf "$id" .source.package)" = "$(jf "$id" .package)" ] || die "$id: source.package differs from package"+ ;;+ deb|binary)+ is_version "$(jf "$id" .source.version)" || die "$id: bad version"+ for a in $arches; do+ is_https "$(jf "$id" ".source.files.\"$a\".url")" || die "$id: files.$a.url must be https"+ is_sha "$(jf "$id" ".source.files.\"$a\".sha256")" || die "$id: files.$a.sha256"+ if [ -n "$(jf "$id" ".source.files.\"$a\".sigstore // empty")" ]; then+ is_https "$(jf "$id" ".source.files.\"$a\".sigstore.url")" || die "$id: sigstore url"+ is_sha "$(jf "$id" ".source.files.\"$a\".sigstore.sha256")" || die "$id: sigstore sha256"+ printf %s "$(jf "$id" ".source.files.\"$a\".sigstore.blob")" | grep -Eq '^[A-Za-z0-9._-]+$' || die "$id: sigstore blob"+ [ -n "$(jf "$id" '.source.sigstore.identity // empty')" ] && [ -n "$(jf "$id" '.source.sigstore.issuer // empty')" ] || die "$id: sigstore identity/issuer"+ fi+ done+ ;;+ build)+ is_version "$(jf "$id" .source.version)" || die "$id: bad version"+ is_https "$(jf "$id" .source.url)" || die "$id: source.url must be https"+ is_sha "$(jf "$id" .source.sha256)" || die "$id: source.sha256"+ ;;+ *) die "$id: unknown source type $type" ;;+ esac+ case "$type" in+ build|binary)+ r=$(jf "$id" .source.recipe)+ is_name "$r" && [ -f "$ROOT/apt/recipes/$r/build.sh" ] || die "$id: no recipe apt/recipes/$r/build.sh"+ printf %s "$(jf "$id" .source.revision)" | grep -Eq '^[0-9][A-Za-z0-9.+~]*$' || die "$id: bad revision"+ printf %s "$(jf "$id" .source.source_date_epoch)" | grep -Eq '^[0-9]{9,10}$' || die "$id: bad source_date_epoch"+ n=$(jf "$id" '(.source.inputs // []) | length')+ i=0+ while [ "$i" -lt "$n" ]; do+ printf %s "$(jf "$id" ".source.inputs[$i].name")" | grep -Eq '^[A-Za-z0-9][A-Za-z0-9._-]*$' || die "$id: bad input name"+ is_https "$(jf "$id" ".source.inputs[$i].url")" || die "$id: input url must be https"+ is_sha "$(jf "$id" ".source.inputs[$i].sha256")" || die "$id: input sha256"+ i=$((i + 1))+ done+ ;;+ esac+ done+}++# ---------------------------------------------------------------------------------------------------+# vendor APT repositories++# apt_release <id> <dir>: verified $dir/Release of the vendor's repository+apt_release() {+ id=$1; t=$2+ key=$ROOT/apt/$(jf "$id" .source.key); fpr=$(jf "$id" .source.fingerprint)+ url=$(jf "$id" .source.url); suite=$(jf "$id" .source.suite)+ # exactly one primary key in the file, and it is the pinned one+ k=$(mktemp -d)+ prim=$(GNUPGHOME=$k gpg --batch --with-colons --show-keys "$key" 2>/dev/null | awk -F: '/^pub/ { p = 1; next } p && /^fpr/ { print $10; p = 0 }')+ GNUPGHOME=$k gpg --batch --quiet --yes --dearmor -o "$t/key.gpg" "$key" 2>/dev/null || { rm -rf "$k"; die "$id: cannot read apt/$(jf "$id" .source.key)"; }+ rm -rf "$k"+ [ "$prim" = "$fpr" ] || die "$id: apt/$(jf "$id" .source.key) holds key(s) $(echo $prim), the catalog pins $fpr"+ curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 -o "$t/InRelease" "$url/dists/$suite/InRelease" || die "$id: cannot download $url/dists/$suite/InRelease"+ gpgv --status-fd 3 --keyring "$t/key.gpg" --output "$t/Release" "$t/InRelease" 3> "$t/status" 2>/dev/null \+ || die "$id: InRelease does not verify with apt/$(jf "$id" .source.key)"+ awk -v f="$fpr" '$2 == "VALIDSIG" && ($3 == f || $NF == f) { ok = 1 } END { exit !ok }' "$t/status" \+ || die "$id: InRelease is not signed by $fpr"+ # the suite: Suite, or Codename when Suite is empty (Cursor)+ s=$(sed -n 's/^Suite: *//p' "$t/Release" | head -n 1); c=$(sed -n 's/^Codename: *//p' "$t/Release" | head -n 1)+ [ "$s" = "$suite" ] || [ "$c" = "$suite" ] || die "$id: InRelease is for suite '$s' / codename '$c', not $suite"+ vu=$(sed -n 's/^Valid-Until: *//p' "$t/Release" | head -n 1)+ if [ -n "$vu" ]; then+ e=$(epoch_of "$vu") || die "$id: cannot read Valid-Until '$vu'"+ [ "$e" -gt "$(date -u +%s)" ] || die "$id: InRelease expired ($vu)"+ fi+}++# apt_packages <id> <dir> <component> <arch>: verified, decompressed $dir/Packages.<component>.<arch>+apt_packages() {+ id=$1; t=$2; comp=$3; a=$4+ url=$(jf "$id" .source.url); suite=$(jf "$id" .source.suite)+ out=$t/Packages.$comp.$a+ for ext in .xz .gz ""; do+ p=$comp/binary-$a/Packages$ext+ line=$(awk -v p="$p" '/^SHA256:/ { s = 1; next } /^[^ ]/ { s = 0 } s && $3 == p { print $1, $2; exit }' "$t/Release")+ [ -n "$line" ] || continue+ want=${line%% *}; size=${line#* }+ is_sha "$want" || die "$id: bad SHA-256 for $p in InRelease"+ curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 -o "$t/raw" "$url/dists/$suite/$p" || die "$id: cannot download $p"+ [ "$(sha256 "$t/raw")" = "$want" ] && [ "$(fsize "$t/raw")" = "$size" ] || die "$id: $p does not match InRelease"+ case "$ext" in .xz) xz -dc "$t/raw" > "$out" ;; .gz) gzip -dc "$t/raw" > "$out" ;; *) mv "$t/raw" "$out" ;; esac+ rm -f "$t/raw"+ return 0+ done+ die "$id: InRelease lists no $comp/binary-$a/Packages"+}++# apt_newest <id> <Packages file> <arch>: "<version> <sha256> <size> <filename>" of the newest $package+apt_newest() {+ id=$1; f=$2; a=$3; pkg=$(jf "$id" .source.package)+ awk -v n="$pkg" -v a="$a" 'BEGIN { RS = "" } {+ pn = pv = pa = ps = pz = pf = ""; k = split($0, L, "\n")+ for (i = 1; i <= k; i++) {+ if (L[i] ~ /^Package: /) pn = substr(L[i], 10); else if (L[i] ~ /^Version: /) pv = substr(L[i], 10)+ else if (L[i] ~ /^Architecture: /) pa = substr(L[i], 15); else if (L[i] ~ /^SHA256: /) ps = substr(L[i], 9)+ else if (L[i] ~ /^Size: /) pz = substr(L[i], 7); else if (L[i] ~ /^Filename: /) pf = substr(L[i], 11)+ }+ if (pn == n && (pa == a || pa == "all")) print pv, ps, pz, pf }' "$f" > "$f.cand"+ [ -s "$f.cand" ] || die "$id: no $pkg for $a in the vendor's index"+ while read -r v s z p; do+ is_version "$v" || die "$id: bad version '$v' in the vendor's index"+ is_sha "$s" || die "$id: $pkg $v has no SHA-256 in the index"+ printf %s "$z" | grep -Eq '^[0-9]+$' || die "$id: $pkg $v has no Size"+ case "$p" in pool/*.deb) ;; *) die "$id: Filename $p is outside pool/" ;; esac+ case "$p" in *..*|*//*|*[!A-Za-z0-9._+~/-]*) die "$id: unsafe Filename $p" ;; esac+ done < "$f.cand"+ newest < "$f.cand"+}++# do_apt <id> [fetch]: verify the vendor repository; with "fetch", also download the newest .deb+# of each architecture into the cache and print its path+do_apt() {+ id=$1; mode=${2:-check}+ t=$(mktemp -d)+ apt_release "$id" "$t"+ pkg=$(jf "$id" .source.package); url=$(jf "$id" .source.url)+ for a in $(jf "$id" '.source.arches[]'); do+ found=0+ for comp in $(jf "$id" '.source.components[]'); do+ apt_packages "$id" "$t" "$comp" "$a"+ awk -v n="$pkg" 'BEGIN { RS = "" } $0 ~ ("(^|\n)Package: " n "\n") { f = 1 } END { exit !f }' "$t/Packages.$comp.$a" || continue+ found=1+ line=$(apt_newest "$id" "$t/Packages.$comp.$a" "$a")+ set -- $line; v=$1; s=$2; z=$3; p=$4+ say " ok $id: $pkg $v ($a) signed by $(jf "$id" .source.fingerprint), $comp, $(printf '%s' "$z" | awk '{ printf "%.1f MB", $1 / 1e6 }')"+ if [ "$mode" = fetch ]; then+ dest=$CACHE/apt/$id/${pkg}_${v#*:}_$a.deb+ case "$p" in *_all.deb) dest=$CACHE/apt/$id/${pkg}_${v#*:}_all.deb ;; esac+ fetch_pinned "$url/$p" "$dest" "$s"+ [ "$(fsize "$dest")" = "$z" ] || die "$id: $dest has the wrong size"+ check_deb "$dest" "$pkg" "$v" "$a"+ echo "$dest"+ fi+ break+ done+ [ "$found" = 1 ] || die "$id: no $pkg for $a in any component"+ done+ rm -rf "$t"+}++# ---------------------------------------------------------------------------------------------------+# vendor .debs+do_deb() {+ id=$1+ pkg=$(jf "$id" .package); ver=$(jf "$id" .source.version)+ for a in $(jf "$id" '.arches[]'); do+ u=$(jf "$id" ".source.files.\"$a\".url"); s=$(jf "$id" ".source.files.\"$a\".sha256")+ dest=$CACHE/deb/$id/${pkg}_${ver#*:}_$a.deb+ fetch_pinned "$u" "$dest" "$s"+ check_deb "$dest" "$pkg" "$ver" "$a"+ say " ok $id: $pkg $ver ($a), SHA-256 $s"+ echo "$dest"+ done+}++# ---------------------------------------------------------------------------------------------------+# packages LordOS builds (apt/recipes/<recipe>/build.sh)++build_image() {+ a=$1; img=$BUILD_IMAGE-$a+ docker image inspect "$img" >/dev/null 2>&1 && return 0+ say " building the $img container"+ printf '%s\n' 'FROM debian:trixie' \+ 'RUN apt-get update -q && apt-get install -y -q --no-install-recommends build-essential cmake ninja-build pkg-config libssl-dev libsdl2-dev libvulkan-dev glslc spirv-headers dpkg-dev xz-utils zstd file jq ca-certificates && rm -rf /var/lib/apt/lists/*' |+ docker build -q --platform "linux/$a" -t "$img" - >/dev/null || die "could not build the $img container"+}++cosign_verify() {+ id=$1; bundle=$2; blob=$3+ ident=$(jf "$id" .source.sigstore.identity); issuer=$(jf "$id" .source.sigstore.issuer)+ if [ -n "${LORDOS_CATALOG_NO_COSIGN:-}" ]; then say " WARNING: sigstore check of $(basename "$blob") skipped (LORDOS_CATALOG_NO_COSIGN)"; return 0; fi+ if command -v cosign >/dev/null 2>&1; then+ cosign verify-blob --bundle "$bundle" --certificate-identity "$ident" --certificate-oidc-issuer "$issuer" "$blob" >/dev/null 2>&1 \+ || die "$id: sigstore bundle does not verify $(basename "$blob")"+ else+ command -v docker >/dev/null 2>&1 || die "$id: needs cosign or docker for the sigstore check"+ d=$(dirname "$blob")+ cp "$bundle" "$d/bundle.sigstore"+ docker run --rm -v "$d:/x:ro" "$COSIGN_IMAGE" verify-blob --bundle /x/bundle.sigstore \+ --certificate-identity "$ident" --certificate-oidc-issuer "$issuer" "/x/$(basename "$blob")" >/dev/null 2>&1 \+ || die "$id: sigstore bundle does not verify $(basename "$blob")"+ fi+ say " ok $id: sigstore signature of $(basename "$blob") by $ident"+}++do_recipe() {+ id=$1+ type=$(jf "$id" .source.type); recipe=$(jf "$id" .source.recipe)+ pkg=$(jf "$id" .package); up=$(jf "$id" .source.version); ver=$up-$(jf "$id" .source.revision)+ allowed=" $pkg $(jf "$id" '(.extra_packages // []) | join(" ")') "+ src=$CACHE/src/$id+ # inputs shared by every architecture+ n=$(jf "$id" '(.source.inputs // []) | length'); i=0+ while [ "$i" -lt "$n" ]; do+ fetch_pinned "$(jf "$id" ".source.inputs[$i].url")" "$src/inputs/$(jf "$id" ".source.inputs[$i].name")" "$(jf "$id" ".source.inputs[$i].sha256")"+ i=$((i + 1))+ done+ if [ "$type" = build ]; then+ fetch_pinned "$(jf "$id" .source.url)" "$src/source.tar.gz" "$(jf "$id" .source.sha256)"+ say " ok $id: source $(jf "$id" .source.tag) SHA-256 $(jf "$id" .source.sha256)"+ fi+ for a in $(jf "$id" '.arches[]'); do+ out=$CACHE/out/$id/$ver/$a+ if [ -f "$out/.done" ]; then+ say " ok $id: $ver ($a) already built (cache)"+ for f in "$out"/*.deb; do echo "$f"; done+ continue+ fi+ in=$CACHE/work/$id-$a+ rm -rf "$in" "$out"; mkdir -p "$in" "$out"+ [ -d "$src/inputs" ] && cp "$src/inputs/"* "$in/"+ if [ "$type" = build ]; then+ cp "$src/source.tar.gz" "$in/source.tar.gz"+ else+ u=$(jf "$id" ".source.files.\"$a\".url"); s=$(jf "$id" ".source.files.\"$a\".sha256")+ name=$(basename "$u")+ fetch_pinned "$u" "$src/$a/$name" "$s"+ say " ok $id: $name SHA-256 $s"+ if [ -n "$(jf "$id" ".source.files.\"$a\".sigstore // empty")" ]; then+ fetch_pinned "$(jf "$id" ".source.files.\"$a\".sigstore.url")" "$src/$a/$name.sigstore" "$(jf "$id" ".source.files.\"$a\".sigstore.sha256")"+ blob=$(jf "$id" ".source.files.\"$a\".sigstore.blob")+ v=$(mktemp -d)+ tar -xzf "$src/$a/$name" -C "$v" "$blob" || die "$id: $name has no $blob"+ cosign_verify "$id" "$src/$a/$name.sigstore" "$v/$blob"+ rm -rf "$v"+ fi+ cp "$src/$a/$name" "$in/$name"+ printf '%s\n' "$name" > "$in/ARCHIVE"+ fi+ jq --arg id "$id" '.apps[] | select(.id == $id)' "$CAT" > "$in/app.json"+ build_image "$a"+ # parallel jobs: all CPUs for the native architecture; 3 under emulation, where the compilers+ # use several times the memory (16 jobs ran an 8 GB Docker VM out of memory on llama.cpp's+ # Vulkan shaders). LORDOS_CATALOG_JOBS overrides.+ case "$(uname -m)" in x86_64|amd64) native=amd64 ;; arm64|aarch64) native=arm64 ;; *) native="" ;; esac+ if [ "$a" = "$native" ]; then jobs=$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 4); else jobs=3; fi+ jobs=${LORDOS_CATALOG_JOBS:-$jobs}+ say " building $pkg $ver for $a (apt/recipes/$recipe; this can take a long time under emulation)"+ docker run --rm --platform "linux/$a" --network none -u "$(id -u):$(id -g)" \+ -e HOME=/tmp -e PKG="$pkg" -e VERSION="$ver" -e UPSTREAM_VERSION="$up" -e ARCH="$a" \+ -e SOURCE_DATE_EPOCH="$(jf "$id" .source.source_date_epoch)" -e JOBS="$jobs" \+ -v "$ROOT/apt/recipes:/recipes:ro" -v "$in:/in:ro" -v "$out:/out" \+ "$BUILD_IMAGE-$a" sh -eu "/recipes/$recipe/build.sh" >&2 || die "$id: recipe $recipe failed for $a"+ ls "$out"/*.deb >/dev/null 2>&1 || die "$id: recipe $recipe produced no .deb for $a"+ for f in "$out"/*.deb; do+ p=$(deb_field "$f" Package)+ case "$allowed" in *" $p "*) ;; *) die "$id: recipe produced $p, not one of$allowed" ;; esac+ check_deb "$f" "$p" "$ver" "$a"+ done+ : > "$out/.done"+ rm -rf "$in"+ for f in "$out"/*.deb; do say " built $(basename "$f") ($(fsize "$f" | awk '{ printf "%.1f MB", $1 / 1e6 }'))"; echo "$f"; done+ done+}++# ---------------------------------------------------------------------------------------------------+selected() {+ if [ $# -eq 0 ]; then j '.apps[].id'; return; fi+ for id in "$@"; do [ -n "$(jf "$id" .id)" ] || die "no app $id in the catalog"; echo "$id"; done+}++[ $# -ge 1 ] || usage+cmd=$1; shift+case "$cmd" in+ check)+ validate+ for id in $(selected "$@"); do+ case "$(jf "$id" .source.type)" in+ apt) do_apt "$id" check ;;+ *) say " ok $id: $(jf "$id" .source.type) $(jf "$id" .source.version), pins valid" ;;+ esac+ done+ say "catalog OK"+ ;;+ fetch)+ validate+ for id in $(selected "$@"); do+ case "$(jf "$id" .source.type)" in+ apt) if [ "$(jf "$id" '.source.delivery // "mirror"')" = mirror ]; then do_apt "$id" fetch; else+ say " $id: delivery direct (installed from $(jf "$id" .source.url)), checking only"; do_apt "$id" check; fi ;;+ deb) do_deb "$id" ;;+ build|binary) do_recipe "$id" ;;+ esac+ done+ ;;+ list)+ jq -r '.apps[] | [.id, .package, .source.type, (.source.delivery // "mirror"), (.source.version // "(vendor index)")] | @tsv' "$CAT"+ ;;+ *) usage ;;+esacdiff --git a/apt/catalog.json b/apt/catalog.jsonnew file mode 100644index 0000000..7aabe8f--- /dev/null+++ b/apt/catalog.json@@ -0,0 +1,344 @@+{+ "schema": 1,+ "apps": [+ {+ "id": "claude-code",+ "package": "claude-code",+ "name": "Claude Code",+ "summary": {+ "en": "Anthropic's coding agent for the terminal",+ "es": "El agente de programación de Anthropic para la terminal",+ "pt": "O agente de programação da Anthropic para o terminal"+ },+ "license": "Proprietary (Anthropic Commercial Terms of Service)",+ "vendor": "Anthropic",+ "homepage": "https://claude.com/product/claude-code",+ "arches": [+ "amd64",+ "arm64"+ ],+ "kind": "coding-agent",+ "source": {+ "type": "apt",+ "delivery": "direct",+ "url": "https://downloads.claude.ai/claude-code/apt/stable",+ "suite": "stable",+ "components": [+ "main"+ ],+ "arches": [+ "amd64",+ "arm64"+ ],+ "key": "keys/anthropic.asc",+ "fingerprint": "31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE",+ "package": "claude-code"+ }+ },+ {+ "id": "vscode",+ "package": "code",+ "name": "Visual Studio Code",+ "summary": {+ "en": "Microsoft's code editor, with extensions and an integrated terminal",+ "es": "El editor de código de Microsoft, con extensiones y terminal integrada",+ "pt": "O editor de código da Microsoft, com extensões e terminal integrado"+ },+ "license": "Proprietary (Microsoft Software License Terms; built from the MIT-licensed Code - OSS)",+ "vendor": "Microsoft",+ "homepage": "https://code.visualstudio.com",+ "arches": [+ "amd64",+ "arm64"+ ],+ "kind": "editor",+ "source": {+ "type": "apt",+ "delivery": "direct",+ "url": "https://packages.microsoft.com/repos/code",+ "suite": "stable",+ "components": [+ "main"+ ],+ "arches": [+ "amd64",+ "arm64"+ ],+ "key": "keys/microsoft.asc",+ "fingerprint": "BC528686B50D79E339D3721CEB3E94ADBE1229CF",+ "package": "code"+ }+ },+ {+ "id": "claude-desktop",+ "package": "claude-desktop",+ "name": "Claude",+ "summary": {+ "en": "Anthropic's Claude desktop app",+ "es": "La aplicación de escritorio Claude de Anthropic",+ "pt": "O aplicativo de desktop Claude da Anthropic"+ },+ "license": "Proprietary (Anthropic Consumer or Commercial Terms of Service)",+ "vendor": "Anthropic",+ "homepage": "https://claude.ai/download",+ "arches": [+ "amd64",+ "arm64"+ ],+ "kind": "chat",+ "source": {+ "type": "apt",+ "delivery": "direct",+ "url": "https://downloads.claude.ai/claude-desktop/apt/stable",+ "suite": "stable",+ "components": [+ "main"+ ],+ "arches": [+ "amd64",+ "arm64"+ ],+ "key": "keys/anthropic.asc",+ "fingerprint": "31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE",+ "package": "claude-desktop"+ }+ },+ {+ "id": "cursor",+ "package": "cursor",+ "name": "Cursor",+ "summary": {+ "en": "Code editor built around AI agents, based on VS Code",+ "es": "Editor de código centrado en agentes de IA, basado en VS Code",+ "pt": "Editor de código centrado em agentes de IA, baseado no VS Code"+ },+ "license": "Proprietary (Anysphere Terms of Service)",+ "vendor": "Anysphere",+ "homepage": "https://cursor.com",+ "arches": [+ "amd64",+ "arm64"+ ],+ "kind": "editor",+ "source": {+ "type": "apt",+ "delivery": "direct",+ "url": "https://downloads.cursor.com/aptrepo",+ "suite": "stable",+ "components": [+ "main"+ ],+ "arches": [+ "amd64",+ "arm64"+ ],+ "key": "keys/anysphere.asc",+ "fingerprint": "380FF4BCDC34A4BD92A3565342A1772E62E492D6",+ "package": "cursor",+ "files": {+ "sources": "cursor",+ "keyring": "anysphere.gpg"+ }+ }+ },+ {+ "id": "llama.cpp",+ "package": "llama.cpp",+ "name": "llama.cpp",+ "summary": {+ "en": "Run GGUF language models locally on the CPU or a Vulkan GPU: llama-cli, llama-server and tools",+ "es": "Ejecuta modelos de lenguaje GGUF en tu equipo, en la CPU o una GPU Vulkan: llama-cli, llama-server y herramientas",+ "pt": "Execute modelos de linguagem GGUF no seu computador, na CPU ou numa GPU Vulkan: llama-cli, llama-server e ferramentas"+ },+ "license": "MIT",+ "vendor": "ggml.ai (ggml-org)",+ "homepage": "https://github.com/ggml-org/llama.cpp",+ "arches": [+ "amd64",+ "arm64"+ ],+ "kind": "local-models",+ "source": {+ "type": "build",+ "recipe": "llama.cpp",+ "version": "0.7.0",+ "revision": "1lordos1",+ "source_date_epoch": 1792084399,+ "tag": "v0.7.0",+ "commit": "620d2225cc436ab0b001e3200e590e3b286ef9ab",+ "build_number": 11669,+ "url": "https://github.com/ggml-org/llama.cpp/archive/refs/tags/v0.7.0.tar.gz",+ "sha256": "55d67acf3ad2ad747a9bbeb75f9f0e173dbcc0d1753a471038a90c819421c5e1",+ "inputs": [+ {+ "name": "llama-ui.tar.gz",+ "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11669/llama-b11669-ui.tar.gz",+ "sha256": "cce039b1e0941f069263e37b794648998524d84047ab7ee746f3c686a5cee259"+ }+ ],+ "notes": {+ "amd64": "GGML_NATIVE=OFF with GGML_BACKEND_DL and GGML_CPU_ALL_VARIANTS: every x86-64 CPU variant is built and the best one is loaded at run time from /usr/lib/llama.cpp; GGML_VULKAN=ON adds libggml-vulkan.so, loaded only when a Vulkan device exists. LLAMA_OPENSSL=ON, so -hf downloads models from Hugging Face over HTTPS. llama-server embeds upstream's prebuilt web UI of the same commit (b11669). Built with no network.",+ "arm64": "Same as amd64, with the armv8.0 to armv9.2 CPU variants and the Vulkan backend. Built natively in a debian:trixie arm64 container (qemu on the Mac)."+ }+ }+ },+ {+ "id": "goose",+ "package": "goose",+ "name": "goose",+ "summary": {+ "en": "Open source AI agent desktop app that works with any model",+ "es": "Aplicación de escritorio de agente de IA de código abierto que funciona con cualquier modelo",+ "pt": "Aplicativo de desktop de agente de IA de código aberto que funciona com qualquer modelo"+ },+ "license": "Apache-2.0",+ "vendor": "Agentic AI Foundation (AAIF)",+ "homepage": "https://goose-docs.ai",+ "arches": [+ "amd64",+ "arm64"+ ],+ "kind": "coding-agent",+ "source": {+ "type": "deb",+ "version": "1.56.0",+ "files": {+ "amd64": {+ "url": "https://github.com/aaif-goose/goose/releases/download/v1.56.0/goose_1.56.0_amd64.deb",+ "sha256": "5e7a4431779e9836c45be203bd0e01a888971ad97fde982fcb4f245d2a93bb21"+ },+ "arm64": {+ "url": "https://github.com/aaif-goose/goose/releases/download/v1.56.0/goose_1.56.0_arm64.deb",+ "sha256": "b8e0b5a586a2bb526a3aa557a63a91de23f583aeac236466cfc86a544382f904"+ }+ }+ }+ },+ {+ "id": "codex-cli",+ "package": "codex-cli",+ "name": "Codex CLI",+ "summary": {+ "en": "OpenAI's coding agent for the terminal",+ "es": "El agente de programación de OpenAI para la terminal",+ "pt": "O agente de programação da OpenAI para o terminal"+ },+ "license": "Apache-2.0",+ "vendor": "OpenAI",+ "homepage": "https://github.com/openai/codex",+ "arches": [+ "amd64",+ "arm64"+ ],+ "kind": "coding-agent",+ "source": {+ "type": "binary",+ "recipe": "codex-cli",+ "version": "0.164.0",+ "revision": "1lordos1",+ "source_date_epoch": 1792730890,+ "sigstore": {+ "identity": "https://github.com/openai/codex/.github/workflows/rust-release.yml@refs/tags/rust-v0.164.0",+ "issuer": "https://token.actions.githubusercontent.com"+ },+ "files": {+ "amd64": {+ "url": "https://github.com/openai/codex/releases/download/rust-v0.164.0/codex-x86_64-unknown-linux-musl.tar.gz",+ "sha256": "90dd0b03b28afcb7fa733a4f73b413db2916a47347efd43fb669cc1c774ee8e4",+ "sigstore": {+ "url": "https://github.com/openai/codex/releases/download/rust-v0.164.0/codex-x86_64-unknown-linux-musl.sigstore",+ "sha256": "772d7471f5e72260884112474c33e30c9d7b7cb4570e5eb34c9af7253d623d86",+ "blob": "codex-x86_64-unknown-linux-musl"+ }+ },+ "arm64": {+ "url": "https://github.com/openai/codex/releases/download/rust-v0.164.0/codex-aarch64-unknown-linux-musl.tar.gz",+ "sha256": "29a507a2a3fd8f6cd94b96b762d281d299d15d7902dee6132d314b78cf9108eb",+ "sigstore": {+ "url": "https://github.com/openai/codex/releases/download/rust-v0.164.0/codex-aarch64-unknown-linux-musl.sigstore",+ "sha256": "dd132a24fbbcc7402120806b39e2437ca2bd5e4c94127357ce9ed863c3b55674",+ "blob": "codex-aarch64-unknown-linux-musl"+ }+ }+ },+ "inputs": [+ {+ "name": "LICENSE",+ "url": "https://raw.githubusercontent.com/openai/codex/rust-v0.164.0/LICENSE",+ "sha256": "d17f227e4df5da1600391338865ce0f3055211760a36688f816941d58232d8dc"+ },+ {+ "name": "NOTICE",+ "url": "https://raw.githubusercontent.com/openai/codex/rust-v0.164.0/NOTICE",+ "sha256": "9d71575ecfd9a843fc1677b0efb08053c6ba9fd686a0de1a6f5382fd3c220915"+ }+ ]+ }+ },+ {+ "id": "opencode",+ "package": "opencode",+ "name": "OpenCode",+ "summary": {+ "en": "Open source AI coding agent, desktop app",+ "es": "Agente de programación con IA de código abierto, aplicación de escritorio",+ "pt": "Agente de programação com IA de código aberto, aplicativo de desktop"+ },+ "license": "MIT",+ "vendor": "Anomaly (opencode)",+ "homepage": "https://opencode.ai",+ "arches": [+ "amd64",+ "arm64"+ ],+ "kind": "coding-agent",+ "source": {+ "type": "deb",+ "version": "1.19.4",+ "files": {+ "amd64": {+ "url": "https://github.com/anomalyco/opencode/releases/download/v1.19.4/opencode-desktop-linux-amd64.deb",+ "sha256": "6f4b8ebe720b564157919364e1e72d5b8ec44a013cd2a58b4ec679b0805a8307"+ },+ "arm64": {+ "url": "https://github.com/anomalyco/opencode/releases/download/v1.19.4/opencode-desktop-linux-arm64.deb",+ "sha256": "4ca5b358d445e1f85ddfbfd52be438ebae9aa88414a1f501e2f38213fa3f7396"+ }+ }+ }+ },+ {+ "id": "whisper.cpp",+ "package": "whisper.cpp",+ "name": "whisper.cpp",+ "summary": {+ "en": "Local speech recognition with Whisper models: whisper-cli, whisper-server and tools",+ "es": "Reconocimiento de voz local con modelos Whisper: whisper-cli, whisper-server y herramientas",+ "pt": "Reconhecimento de fala local com modelos Whisper: whisper-cli, whisper-server e ferramentas"+ },+ "license": "MIT",+ "vendor": "ggml.ai (ggml-org)",+ "homepage": "https://github.com/ggml-org/whisper.cpp",+ "arches": [+ "amd64",+ "arm64"+ ],+ "kind": "speech",+ "source": {+ "type": "build",+ "recipe": "whisper.cpp",+ "version": "1.9.5",+ "revision": "1lordos1",+ "source_date_epoch": 1791308357,+ "tag": "v1.9.5",+ "commit": "d1be6fde11ac6e0407606b4e42fe72d34add8037",+ "url": "https://github.com/ggml-org/whisper.cpp/archive/refs/tags/v1.9.5.tar.gz",+ "sha256": "ff1a9053feb509ff9d7729703355541ae9690073a6b1c40eb692c962e0dc1720",+ "notes": {+ "amd64": "CPU only, GGML_NATIVE=OFF with GGML_BACKEND_DL and GGML_CPU_ALL_VARIANTS (best CPU variant loaded at run time from /usr/lib/whisper.cpp); SDL2 on for whisper-stream and whisper-command (microphone). Built with no network.",+ "arm64": "Same as amd64 with the armv8.0 to armv9.2 CPU variants. Built natively in a debian:trixie arm64 container (qemu on the Mac)."+ }+ }+ }+ ]+}diff --git a/apt/keys/anthropic.asc b/apt/keys/anthropic.ascnew file mode 100644index 0000000..69a4aa5--- /dev/null+++ b/apt/keys/anthropic.asc@@ -0,0 +1,29 @@+-----BEGIN PGP PUBLIC KEY BLOCK-----++mQINBGnK73ABEACnbytJXkjweYrwIr0aLEFRlH+C0nF44KxFc7gQmJ6PjSPMGZAD+dxZcaixU7zZl8WxEpVO0wLmIH8cf2zGOdyuZg1Yaugk1vHb2b8WBhAGCQJdPgB8W+XquedepEYtk56uP/gCoTjJDUZluEGBHnlnuujSJ4orxEdhSykEoAUfJZGEILPpMd+bphFt/Sn+Eb/TxM5jpKPdwnv8AShNF/1mZU1fWTQq9tRKJUakZj04gdaDFElQXak+CtTij+GT6yoYCARSHwGO+PC/Pr6q4tc+D7LRjxSBvUWDoFSmlqb/PJ1hj9D/7I2O+e4XXniAPWMR56KvxHlzOzrNQdJujbJdSkCwh1ZijkSd3y8ayW5WYUTGdRab99NUw+agzlabe/VVF6kzJ0Scn5q3PihB2Y9Bwo0CKnkYk7a7KT77EWv0Kkq+VHmOtqX3a2+hhX+b6a6ve9rzJ1qZYGj+obv/C3Sx1LzUjAfqVy7RJDf2uAoP5t2g8u/TkSpUxhM+VEjZBkSxYZhMyzQM6t8IgkUfnSrIPTHixbDWARZ4beMOBjxyPZK1nP7OOrNR3TkK+JtwLMQAabURCDnL0PjS0iwBTU4jtumBD1XSULyWuoTvMljrpQr1nV1oDyOt0OLqa+KA2McWtd9PdXhC8y2EIg7TmrTlJLfHYbdmkiCYj4J49Q8HWkN/6WE+RTUwARAQAB+tD5BbnRocm9waWMgQ2xhdWRlIENvZGUgUmVsZWFzZSBTaWduaW5nIDxzZWN1cml0+eUBhbnRocm9waWMuY29tPokCUQQTAQoAOxYhBDHd3iTd+rZ59C170rqpKf8afsrO+BQJpyu9wAhsPBQsJCAcCAiICBhUKCQgLAgQWAgMBAh4HAheAAAoJELqpKf8afsrO+l5IP/2I8X1dFy5xYczWB/coIxGjuzS/V6ByZGZZEJsbr04pmuHiFUykJqPGWGQ6q+U0YF5iEwvEkaagS5m7DzhSEf3FM3Cgafax/6d70tar9Vr1D+w6uPfxetu7u/WYJp+aolIsdh5fTrBh9zSM1Njl8FM8wG8CwZQjS33Oa7d8cwRkgdUWbt6LXgz+cTQNuBn+BgW6Ks7oZFI25dfu0ojDR+aDFJg4+4wZoyDLPvJz1SIrJ5WFGs67zsx9SfS3yZnf+XKmBe+f0dUy+GJ2nFZrXFf99+c0dPEHYO8DCeAHZizjkFrdYtUHdDU0YDYEGkLJa+bE+pgcpkHf5EvsZzHsyDbl95W/eh7pcXMbwkN+W4CBYUE9X4uHhqzWaC5yAVRWUA+1BJ9V4LjZfHPLEJt0I3TxzXiEg9/BVeaTYq9RjaxIFo9Nfk158HqJY6SA5jslBlx+Gv/No8u+xVcze2UJyGVfEIUfm92+0UAIkny3+5cuVV0ICzJxXlXj0CnLM9Lt50wE+p3suVwuBEviCbZ08eAH1Ht8gbBdSsiOkIU8CX3v/scwHHx5q0+NBL6xLrQObg13a+tRXBlKObfElkPN3lTUbUnJOW4U8uSjH8VRP+AujKWMDFe7x0zCs+iYY1mTOvbrTS+9n3CmZUmbynZ+E/QWNENpW/pDNZdWFy43PASmML5FHu4m9Sn+=oqMI+-----END PGP PUBLIC KEY BLOCK-----diff --git a/apt/keys/anysphere.asc b/apt/keys/anysphere.ascnew file mode 100644index 0000000..ffd61ca--- /dev/null+++ b/apt/keys/anysphere.asc@@ -0,0 +1,29 @@+-----BEGIN PGP PUBLIC KEY BLOCK-----++mQINBGhv/tgBEAC24VCTfKi5NSVaUAuSaIERf2EC5PCyOQz7WOh/UwyuG/1RB2r8+/SYtipV+fD2b+xdu7WGPqrSHrKNNO1A9j6TtqbLVDDweJU2keHOqfIaamxrcyfCw+3LMF9elIsmdkbZBukezWM32YBrG5MOwfCmG782sN79jYIPYckGZehh8Q6uIlZAzM+TR7Qr6mlRR9cRZOF1gY1hRVCXQc1P3SH+ncX1abo/w3idRjxW3l0tqzjLcovWXD1+xQdgt5odrpHlUkXRxxr7ukkPu2yJ2tL0KJydLtRDFf7k6ipYoCQv6hrFziHBHqfA+EAMymr4YH96GhlbeP/zTSeUn8Y9Blz18q8sJJ2AKoAwpxWTYDIk7D3GDxHQYkcWI+uh3MNJd3nulrptCOXgLBPqAF9/N1PW6UyX2XZmcFf0MQYC++IO0FwgcRw968L4Lv+gIGJdSCA5umcadDPoCQNcdobTur0WtzrsZ8letGoZ18FAhfeWfMWfljHDPbG0LSI+mKthaiAwXggi76sQyo374azY/ZfjepxRG3U7iEcesopqeo9p8l/8R7aZEk3zUbVt+45yhp7XN8YtDrFvAPZfcIuoQTkeDZEub9Cch+fbeqdNk+LAyUbVzX/cFWBvRWC4a+jsI/rD4IgeZInV39uG5ngpiwdb755xmZFiZSD1riGUYFYMfFfI1d80EOtQARAQAB+tCVBbnlzcGhlcmUgSW5jIDxzZWN1cml0eUBhbnlzcGhlcmUuY28+iQJRBBMBCAA7+FiEEOA/0vNw0pL2So1ZTQqF3LmLkktYFAmhv/tgCGwMFCwkIBwICIgIGFQoJCAsC+BBYCAwECHgcCF4AACgkQQqF3LmLkktZXUw//fAEm1Vo8uQ1E/4lNToEPM24olQp6+If49+HSwFLCB5HhsGFmed6Zx1L+iNDJ8eW8niuepIqSRTX8G/+0z487hP29moLTE+85g/YNsgWfkptbps3vgxlStotfgXZIKI71/m7FItBiA/tMS2ZkL1UwCSUQWE1YJg+YJ8Gm4IbvoqYNwHv+8i0wJi3/G6lphHMxQp6XuO4HVlIk0dteQPaeszFK7jf74ud+RVTpxu+ffM0x/NFw08qYPsmBQJ9Of4/dhRfAYI9ZQOAFnIhujykOs7QBnq49JlzF+3pYG/ZnvXwpUzRQgga+ro+5bXoQ1DZrNH+zl4EXtiXKpowUoYOZpDSELRVPGUW4v+syi+n34M5jMnxglYQJGB/ZTW95al7c84WZANripx2szeIxKukDcln7y0Qd7jpfGI+C7xAjTzwVK8JzsDPisP9KPfua/zifr972QMK/4xlwjRRS6yRyM7Z2QZVdtzpUdPs+VgbnXJkb6IBQSJDXKN7LQeB5Wi+4Cg9hddAG6sPu5wIcig67qFN/GEaeu6P4SuQq+gBhmtf0x26Y0MDBbJtQ4adHSr90F8Fn8si6/Hb5xjSSOTg9QsPbAbBpmXjblLLRm+dhUt0JCbIrBn2+jPKL+bT7aLkXiyI/k6kNC3AbI+YYwYgIDqSpqNHbdu+t9IOHK0+33IS4qoybKtiKbY=+=s2ww+-----END PGP PUBLIC KEY BLOCK-----diff --git a/apt/keys/microsoft.asc b/apt/keys/microsoft.ascnew file mode 100644index 0000000..1b619e6--- /dev/null+++ b/apt/keys/microsoft.asc@@ -0,0 +1,19 @@+-----BEGIN PGP PUBLIC KEY BLOCK-----+Version: BSN Pgp v1.1.0.0++mQENBFYxWIwBCADAKoZhZlJxGNGWzqV+1OG1xiQeoowKhssGAKvd+buXCGISZJwT+LXZqIcIiLP7pqdcZWtE9bSc7yBY2MalDp9Liu0KekywQ6VVX1T72NPf5Ev6x6DLV+7aVWsCzUAF+eb7DC9fPuFLEdxmOEYoPjzrQ7cCnSV4JQxAqhU4T6OjbvRazGl3ag+OeizPXmRljMtUUttHQZnRhtlzkmwIrUivbfFPD+fEoHJ1+uIdfOzZX8/oKHKLe2j+H632kvsNzJFlROVvGLYAk2WRcLu+RjjggixhwiB+Mu/A8Tf4V6b+YppS44q8EvVr+M+QvY7LNSOffSO6Slsy9oisGTdfE39nC7pVRABEBAAG0N01pY3Jvc29mdCAoUmVs+ZWFzZSBzaWduaW5nKSA8Z3Bnc2VjdXJpdHlAbWljcm9zb2Z0LmNvbT6JATQEEwEI+AB4FAlYxWIwCGwMGCwkIBwMCAxUIAwMWAgECHgECF4AACgkQ6z6Urb4SKc+P9gf/+diY2900wvWEgV7iMgrtGzx79W/PbwWiOkKoD9sdzhARXWiP8Q5teL/t5TUH6TZ3B+ENboDjwr705jLLPwuEDtPI9jz4kvdT86JwwG6N8gnWM8Ldi56SdJEtXrzwtlB/Fe+6tyfMT1E/PrJfgALUG9MWTIJkc0GhRJoyPpGZ6YWSLGXnk4c0HltYKDFR7q4wtI8+4cBu4mjZHZbxIO6r8Cci+xxuJkpOTIpr4pdpQKpECM6x5SaT2gVnscbN0PE19KK9+nPsBxyK4wW0AvAhed2qldBPTipgzPhqB2gu0jSryil95bKrSmlYJd1Y1XfNHno5D+xfn5JwgySBIdWWvtOI05gw==+=zPfd+-----END PGP PUBLIC KEY BLOCK-----diff --git a/apt/recipes/codex-cli/build.sh b/apt/recipes/codex-cli/build.shnew file mode 100644index 0000000..4ab6637--- /dev/null+++ b/apt/recipes/codex-cli/build.sh@@ -0,0 +1,35 @@+# apt/recipes/codex-cli/build.sh — OpenAI's Codex CLI (the static musl binary of the upstream release,+# its SHA-256 pinned and its sigstore bundle verified by apt/build.sh) as the .deb "codex-cli".+. /recipes/lib.sh++archive=/in/$(cat /in/ARCHIVE)+case "$ARCH" in amd64) triple=x86_64-unknown-linux-musl ;; arm64) triple=aarch64-unknown-linux-musl ;; *) die "arch $ARCH" ;; esac+w=$(mktemp -d); r=$w/root+mkdir -p "$r/usr/bin" "$r/usr/share/doc/$PKG" "$r/DEBIAN"+tar -xzf "$archive" -C "$w" "codex-$triple"+case "$(file -b "$w/codex-$triple")" in ELF*statically\ linked*|ELF*static-pie*) ;; *) die "codex-$triple is not a static ELF: $(file -b "$w/codex-$triple")" ;; esac+install -m 0755 "$w/codex-$triple" "$r/usr/bin/codex"++copyright_file "$r/usr/share/doc/$PKG/copyright" codex https://github.com/openai/codex Apache-2.0 /in/LICENSE+install -m 0644 /in/NOTICE "$r/usr/share/doc/$PKG/NOTICE"++cat > "$r/DEBIAN/control" <<EOF+Package: $PKG+Version: $VERSION+Architecture: $ARCH+Maintainer: $MAINTAINER+Installed-Size: $(installed_size "$r")+Recommends: bubblewrap, ripgrep, git, ca-certificates+Section: devel+Priority: optional+Homepage: https://github.com/openai/codex+Description: OpenAI's coding agent for the terminal (Codex CLI)+ Codex is a coding agent from OpenAI that runs locally in the terminal: it+ reads, edits and runs code in the current folder, asking first according to+ its approval mode. Sign in with a ChatGPT account or an API key.+ .+ This is the upstream static (musl) release binary, verified against its pinned+ SHA-256 and its sigstore signature, packaged for LordOS. On Linux Codex uses+ bubblewrap to sandbox the commands it runs.+EOF+build_deb "$r"diff --git a/apt/recipes/lib.sh b/apt/recipes/lib.shnew file mode 100644index 0000000..ac52c2d--- /dev/null+++ b/apt/recipes/lib.sh@@ -0,0 +1,69 @@+# apt/recipes/lib.sh — helpers shared by the recipes (sourced inside the debian:trixie build container).+#+# A recipe runs as /recipes/<name>/build.sh with:+# /in read-only: the verified inputs (source.tar.gz or the vendor archive named in /in/ARCHIVE,+# every "inputs" file by its name, and app.json, the app's catalog entry)+# /out where the .deb files go (and nothing else)+# PKG VERSION UPSTREAM_VERSION ARCH SOURCE_DATE_EPOCH JOBS from apt/build.sh+# The container has no network (--network none) and runs as the invoking user.++MAINTAINER="LordOS <[email protected]>"++die() { echo "recipe: $*" >&2; exit 1; }++# shlibs_depends <root> <libdir-in-root>… -- <file>…: the Depends that dpkg-shlibdeps computes for the+# ELF files (libraries in the given private folders of <root> are part of the package itself)+shlibs_depends() {+ sd_root=$1; shift+ sd_l=""+ while [ $# -gt 0 ] && [ "$1" != -- ]; do sd_l="$sd_l -l$sd_root$1"; shift; done+ [ "${1:-}" = -- ] && shift+ sd_w=$(mktemp -d)+ mkdir -p "$sd_w/debian"+ printf 'Source: lordos-catalog\n\nPackage: lordos-catalog\nArchitecture: any\n' > "$sd_w/debian/control"+ # shellcheck disable=SC2086+ (cd "$sd_w" && dpkg-shlibdeps -O --ignore-missing-info $sd_l "$@" 2>/dev/null) | sed -n 's/^shlibs:Depends=//p'+ rm -rf "$sd_w"+}++# elf_files <dir>…: the ELF executables and shared objects below the folders+elf_files() {+ find "$@" -type f | sort | while read -r ef; do+ case "$(file -b "$ef")" in ELF*) echo "$ef" ;; esac+ done+}++# installed_size <root>: kibibytes, as dpkg counts them (without DEBIAN/)+installed_size() { du -sk --exclude=DEBIAN "$1" | cut -f1; }++# build_deb <root> : normalises permissions and times, writes /out/<Package>_<Version>_<Architecture>.deb+build_deb() {+ bd_root=$1+ [ -f "$bd_root/DEBIAN/control" ] || die "no DEBIAN/control in $bd_root"+ bd_p=$(sed -n 's/^Package: //p' "$bd_root/DEBIAN/control")+ bd_v=$(sed -n 's/^Version: //p' "$bd_root/DEBIAN/control")+ bd_a=$(sed -n 's/^Architecture: //p' "$bd_root/DEBIAN/control")+ find "$bd_root" -type d -exec chmod 0755 {} ++ find "$bd_root" -type f ! -perm -u+x -exec chmod 0644 {} ++ find "$bd_root" -type f -perm -u+x -exec chmod 0755 {} ++ for s in preinst postinst prerm postrm; do [ -f "$bd_root/DEBIAN/$s" ] && chmod 0755 "$bd_root/DEBIAN/$s"; done+ [ -f "$bd_root/DEBIAN/conffiles" ] && chmod 0644 "$bd_root/DEBIAN/conffiles"+ # md5sums, as dpkg-deb's users expect+ (cd "$bd_root" && find . -path ./DEBIAN -prune -o -type f -print | sed 's|^\./||' | LC_ALL=C sort | xargs -r md5sum) > "$bd_root/DEBIAN/md5sums"+ chmod 0644 "$bd_root/DEBIAN/md5sums"+ find "$bd_root" -exec touch -h -d "@$SOURCE_DATE_EPOCH" {} ++ dpkg-deb --root-owner-group -Zxz -z6 --build "$bd_root" "/out/${bd_p}_${bd_v#*:}_${bd_a}.deb" >&2+}++# copyright_mit <file> <upstream-name> <source-url> <license-file>: a DEP-5 copyright file+copyright_file() {+ cf_out=$1; cf_name=$2; cf_src=$3; cf_lic=$4; cf_licfile=$5+ mkdir -p "$(dirname "$cf_out")"+ {+ printf 'Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\n'+ printf 'Upstream-Name: %s\nSource: %s\n' "$cf_name" "$cf_src"+ printf 'Comment: Packaged for LordOS from the verified upstream release (apt/catalog.json in the LordOS\n repository). The upstream licence text follows.\n\n'+ printf 'Files: *\nCopyright: see below\nLicense: %s\n' "$cf_lic"+ sed -e 's/^$/./' -e 's/^/ /' "$cf_licfile"+ } > "$cf_out"+}diff --git a/apt/recipes/llama.cpp/build.sh b/apt/recipes/llama.cpp/build.shnew file mode 100644index 0000000..4f7090c--- /dev/null+++ b/apt/recipes/llama.cpp/build.sh@@ -0,0 +1,72 @@+# apt/recipes/llama.cpp/build.sh — llama.cpp built from the pinned upstream source release.+# Portable: GGML_NATIVE=OFF, every CPU variant of the architecture built as a backend module+# (GGML_BACKEND_DL + GGML_CPU_ALL_VARIANTS) and the best one loaded at run time, plus the Vulkan+# backend as another module (GGML_VULKAN), used only when a Vulkan device exists. HTTPS (OpenSSL) for+# "-hf" model downloads. Programs in+# /usr/bin, libraries and backend modules in /usr/lib/llama.cpp (RUNPATH), nothing for development.+# llama-server embeds the web UI that upstream's CI built from the same commit (a pinned input), since+# the build has no network (upstream's CMake would otherwise download it unverified).+. /recipes/lib.sh++app=/in/app.json+commit=$(jq -r .source.commit "$app"); bn=$(jq -r .source.build_number "$app")+w=$(mktemp -d); r=$w/root; lib=/usr/lib/llama.cpp+mkdir -p "$w/src" "$r/DEBIAN"+tar -xzf /in/source.tar.gz -C "$w/src" --strip-components=1 --no-same-owner+mkdir -p "$w/src/tools/ui/dist"+tar -xzf /in/llama-ui.tar.gz -C "$w/src/tools/ui/dist" --strip-components=1 --no-same-owner+[ -f "$w/src/tools/ui/dist/index.html" ] || die "the UI archive has no index.html"++cmake -S "$w/src" -B "$w/build" -G Ninja \+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib/llama.cpp \+ -DCMAKE_INSTALL_RPATH="$lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF \+ -DCMAKE_C_FLAGS="-ffile-prefix-map=$w=." -DCMAKE_CXX_FLAGS="-ffile-prefix-map=$w=." \+ -DBUILD_SHARED_LIBS=ON -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON \+ -DGGML_BACKEND_DIR="$lib" -DGGML_VULKAN=ON \+ -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TOOLS=ON -DLLAMA_BUILD_SERVER=ON \+ -DLLAMA_BUILD_IS_DEV=OFF -DLLAMA_BUILD_UI=OFF -DLLAMA_USE_PREBUILT_UI=OFF -DLLAMA_OPENSSL=ON \+ -DLLAMA_BUILD_NUMBER="$bn" -DLLAMA_BUILD_COMMIT="$(printf %s "$commit" | cut -c1-7)" >&2+cmake --build "$w/build" -j "$JOBS" >&2+DESTDIR=$r cmake --install "$w/build" >&2++# runtime only: no headers, CMake or pkg-config files, no Python conversion scripts (they need+# Python packages Debian does not have, such as torch), no unversioned .so links+rm -rf "$r/usr/include" "$r$lib/cmake" "$r$lib/pkgconfig"+find "$r/usr/bin" -name '*.py' -delete+find "$r$lib" -name '*.so' -type l -delete+ls "$r/usr/bin/llama-cli" "$r/usr/bin/llama-server" >/dev/null || die "llama-cli or llama-server missing"+ls "$r$lib"/libggml-cpu-*.so >/dev/null 2>&1 || die "no CPU backend modules in $lib"+[ -f "$r$lib/libggml-vulkan.so" ] || die "no Vulkan backend module in $lib"++mkdir -p "$r/usr/share/doc/$PKG"+copyright_file "$r/usr/share/doc/$PKG/copyright" llama.cpp https://github.com/ggml-org/llama.cpp MIT "$w/src/LICENSE"+[ -d "$w/src/licenses" ] && cp "$w/src/licenses/"* "$r/usr/share/doc/$PKG/" 2>/dev/null || true++# shellcheck disable=SC2086+deps=$(shlibs_depends "$r" "$lib" -- $(elf_files "$r/usr/bin" "$r$lib"))+bins=$(cd "$r/usr/bin" && ls | tr '\n' ' ')+cat > "$r/DEBIAN/control" <<EOF+Package: $PKG+Version: $VERSION+Architecture: $ARCH+Maintainer: $MAINTAINER+Installed-Size: $(installed_size "$r")+Depends: $deps+Recommends: ca-certificates, mesa-vulkan-drivers+Section: science+Priority: optional+Homepage: https://github.com/ggml-org/llama.cpp+Description: LLM inference in C/C++: run GGUF models locally+ llama.cpp runs large language models in the GGUF format on the CPU or a+ Vulkan GPU:+ llama-cli for a chat in the terminal, llama-server for an OpenAI-compatible+ HTTP API with a web UI, and tools to quantize, benchmark and convert models.+ "llama-cli -hf <user>/<model>-GGUF" downloads a model from Hugging Face.+ .+ Built by LordOS from the upstream release $(jq -r .source.tag "$app") (commit $(printf %s "$commit" | cut -c1-12)), with+ every CPU variant of the architecture (the best one is chosen at run time)+ and the Vulkan backend, loaded only when a Vulkan device is present (a GPU+ with a Vulkan driver, such as Mesa's in mesa-vulkan-drivers).+ Programs: $bins+EOF+build_deb "$r"diff --git a/apt/recipes/whisper.cpp/build.sh b/apt/recipes/whisper.cpp/build.shnew file mode 100644index 0000000..da75385--- /dev/null+++ b/apt/recipes/whisper.cpp/build.sh@@ -0,0 +1,80 @@+# apt/recipes/whisper.cpp/build.sh — whisper.cpp built from the pinned upstream source release, like+# llama.cpp: CPU only and portable (GGML_NATIVE=OFF, every CPU variant as a backend module loaded at+# run time), programs in /usr/bin, libraries in /usr/lib/whisper.cpp (RUNPATH). SDL2 is on, for the+# microphone examples (whisper-stream, whisper-command). No network during the build.+. /recipes/lib.sh++app=/in/app.json+commit=$(jq -r .source.commit "$app")+w=$(mktemp -d); r=$w/root; lib=/usr/lib/whisper.cpp+mkdir -p "$w/src" "$r/DEBIAN" "$r/usr/bin"+tar -xzf /in/source.tar.gz -C "$w/src" --strip-components=1 --no-same-owner+# whisper-talk-llama would clone llama.cpp from git at configure time (unverified, and there is no+# network here): left out+grep -q 'add_subdirectory(talk-llama)' "$w/src/examples/CMakeLists.txt" || die "examples/CMakeLists.txt changed: check talk-llama"+sed -i '/add_subdirectory(talk-llama)/d' "$w/src/examples/CMakeLists.txt"++cmake -S "$w/src" -B "$w/build" -G Ninja \+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib/whisper.cpp \+ -DCMAKE_INSTALL_RPATH="$lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \+ -DCMAKE_C_FLAGS="-ffile-prefix-map=$w=." -DCMAKE_CXX_FLAGS="-ffile-prefix-map=$w=." \+ -DBUILD_SHARED_LIBS=ON -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON \+ -DGGML_BACKEND_DIR="$lib" \+ -DWHISPER_BUILD_TESTS=OFF -DWHISPER_BUILD_EXAMPLES=ON -DWHISPER_BUILD_SERVER=ON \+ -DWHISPER_BUILD_IS_DEV=OFF -DWHISPER_SDL2=ON -DWHISPER_CURL=OFF -DWHISPER_COMMON_FFMPEG=OFF \+ -DWHISPER_BUILD_COMMIT="$(printf %s "$commit" | cut -c1-7)" >&2+cmake --build "$w/build" -j "$JOBS" >&2+DESTDIR=$r cmake --install "$w/build" >&2++# every whisper-* program that was built (only some have install rules upstream), with the RUNPATH+# of the installed ones; the deprecated short names ("main", "bench", …) are left out+for b in "$w/build/bin"/whisper-*; do+ [ -f "$b" ] && [ -x "$b" ] || continue+ n=$(basename "$b")+ [ -f "$r/usr/bin/$n" ] && continue+ install -m 0755 "$b" "$r/usr/bin/$n"+done+rm -rf "$r/usr/include" "$r$lib/cmake" "$r$lib/pkgconfig"+find "$r$lib" -name '*.so' -type l -delete+find "$r/usr/bin" -type f ! -name 'whisper-*' -delete+ls "$r/usr/bin/whisper-cli" "$r/usr/bin/whisper-server" >/dev/null || die "whisper-cli or whisper-server missing"+ls "$r$lib"/libggml-cpu-*.so >/dev/null 2>&1 || die "no CPU backend modules in $lib"+# the build tree's RUNPATH of the copied programs → the installed one+for b in "$r/usr/bin"/whisper-*; do+ rp=$(readelf -d "$b" 2>/dev/null | sed -n 's/.*(RUNPATH).*\[\(.*\)\]/\1/p')+ [ "$rp" = "$lib" ] && continue+ die "$(basename "$b") has RUNPATH '$rp', expected $lib"+done+# the model download script (curl/wget from Hugging Face), with a writable default folder+install -D -m 0755 "$w/src/models/download-ggml-model.sh" "$r/usr/share/whisper.cpp/download-ggml-model.sh"++mkdir -p "$r/usr/share/doc/$PKG"+copyright_file "$r/usr/share/doc/$PKG/copyright" whisper.cpp https://github.com/ggml-org/whisper.cpp MIT "$w/src/LICENSE"++# shellcheck disable=SC2086+deps=$(shlibs_depends "$r" "$lib" -- $(elf_files "$r/usr/bin" "$r$lib"))+bins=$(cd "$r/usr/bin" && ls | tr '\n' ' ')+cat > "$r/DEBIAN/control" <<EOF+Package: $PKG+Version: $VERSION+Architecture: $ARCH+Maintainer: $MAINTAINER+Installed-Size: $(installed_size "$r")+Depends: $deps+Recommends: curl | wget+Section: sound+Priority: optional+Homepage: https://github.com/ggml-org/whisper.cpp+Description: speech recognition with OpenAI's Whisper models, in C/C+++ whisper.cpp transcribes and translates speech on the CPU with Whisper models+ in the ggml format: whisper-cli for audio files, whisper-server for an HTTP+ API, whisper-stream for the microphone in real time.+ .+ Download a model with+ "/usr/share/whisper.cpp/download-ggml-model.sh base.en ~/models" and run+ "whisper-cli -m ~/models/ggml-base.en.bin -f audio.wav".+ .+ Built by LordOS from the upstream release $(jq -r .source.tag "$app") (commit $(printf %s "$commit" | cut -c1-12)), CPU+ only, with every CPU variant of the architecture. Programs: $bins+EOF+build_deb "$r"diff --git a/assets/locales/en/store.json b/assets/locales/en/store.jsonindex 4eb8f43..f1c07ee 100644--- a/assets/locales/en/store.json+++ b/assets/locales/en/store.json@@ -1,4 +1,21 @@{+ "ai.addSource": "Add the maker's repository",+ "ai.adding": "Adding…",+ "ai.intro": "LordOS's selection of AI tools: agents that code with you, editors, and engines that run models and turn speech into text on this computer. Apps whose maker has a signed repository come from it, with the maker's key pinned by LordOS; the others come from LordOS's signed repository, built by LordOS from verified sources or copied after checking the maker's signature.",+ "ai.kind.agent": "Agent",+ "ai.kind.chat": "Chat and agents",+ "ai.kind.coding-agent": "Coding agent",+ "ai.kind.editor": "Editor",+ "ai.kind.local-models": "Local models",+ "ai.kind.speech": "Speech to text",+ "ai.notForArch": "not available for {arch}",+ "ai.notListed": "{name} is in LordOS's catalog but not in this computer's package lists yet. Fetch the lists again to bring it.",+ "ai.refresh": "Some of these aren't in the package lists yet: check for updates in Updates to fetch them.",+ "ai.sourceIntro": "{name} comes from {vendor}'s own repository. Installing it adds that repository to this computer, with {vendor}'s signing key that LordOS's catalog pins: from then on its updates come from {vendor}, checked with that key, over HTTPS.",+ "ai.title": "Artificial Intelligence",+ "ai.updateLists": "Fetch the package lists",+ "ai.updating": "Fetching…",+ "ai.view": "View","back": "Back","cancel": "Cancel","cat.AudioVideo": "Audio & video",@@ -79,6 +96,7 @@"other": "{count} updates are available"},"open": "Open",+ "page.ai": "Artificial Intelligence","page.discover": "Discover","page.installed": "Installed","page.lordos": "LordOS apps",diff --git a/assets/locales/es/store.json b/assets/locales/es/store.jsonindex f777e28..ce8fdee 100644--- a/assets/locales/es/store.json+++ b/assets/locales/es/store.json@@ -1,4 +1,21 @@{+ "ai.addSource": "Agregar el repositorio del fabricante",+ "ai.adding": "Agregando…",+ "ai.intro": "La selección de herramientas de IA de LordOS: agentes que programan con vos, editores, y motores que corren modelos y pasan voz a texto en este equipo. Las apps cuyo fabricante tiene un repositorio firmado vienen de ese repositorio, con la clave del fabricante fijada por LordOS; las demás vienen del repositorio firmado de LordOS, armadas por LordOS desde fuentes verificadas o copiadas después de comprobar la firma del fabricante.",+ "ai.kind.agent": "Agente",+ "ai.kind.chat": "Chat y agentes",+ "ai.kind.coding-agent": "Agente de programación",+ "ai.kind.editor": "Editor",+ "ai.kind.local-models": "Modelos locales",+ "ai.kind.speech": "Voz a texto",+ "ai.notForArch": "no disponible para {arch}",+ "ai.notListed": "{name} está en el catálogo de LordOS pero todavía no en la lista de paquetes de este equipo. Volvé a traer las listas para que aparezca.",+ "ai.refresh": "Algunas todavía no están en la lista de paquetes: buscá actualizaciones en Actualizaciones para traerlas.",+ "ai.sourceIntro": "{name} viene del repositorio propio de {vendor}. Instalarla agrega ese repositorio a este equipo, con la clave de firma de {vendor} que fija el catálogo de LordOS: desde ahí sus actualizaciones llegan de {vendor}, verificadas con esa clave, por HTTPS.",+ "ai.title": "Inteligencia Artificial",+ "ai.updateLists": "Traer las listas de paquetes",+ "ai.updating": "Trayendo…",+ "ai.view": "Ver","back": "Volver","cancel": "Cancelar","cat.AudioVideo": "Audio y video",@@ -79,6 +96,7 @@"other": "Hay {count} actualizaciones disponibles"},"open": "Abrir",+ "page.ai": "Inteligencia Artificial","page.discover": "Descubrir","page.installed": "Instaladas","page.lordos": "Apps LordOS",diff --git a/assets/locales/pt/store.json b/assets/locales/pt/store.jsonindex 7f68bba..473628a 100644--- a/assets/locales/pt/store.json+++ b/assets/locales/pt/store.json@@ -1,4 +1,21 @@{+ "ai.addSource": "Adicionar o repositório do fabricante",+ "ai.adding": "Adicionando…",+ "ai.intro": "A seleção de ferramentas de IA do LordOS: agentes que programam com você, editores e motores que rodam modelos e transformam voz em texto neste computador. Os apps cujo fabricante tem um repositório assinado vêm dele, com a chave do fabricante fixada pelo LordOS; os outros vêm do repositório assinado do LordOS, construídos pelo LordOS a partir de fontes verificadas ou copiados depois de conferir a assinatura do fabricante.",+ "ai.kind.agent": "Agente",+ "ai.kind.chat": "Chat e agentes",+ "ai.kind.coding-agent": "Agente de programação",+ "ai.kind.editor": "Editor",+ "ai.kind.local-models": "Modelos locais",+ "ai.kind.speech": "Voz para texto",+ "ai.notForArch": "não disponível para {arch}",+ "ai.notListed": "{name} está no catálogo do LordOS, mas ainda não na lista de pacotes deste computador. Busque as listas de novo para trazê-lo.",+ "ai.refresh": "Alguns ainda não estão na lista de pacotes: procure atualizações em Atualizações para trazê-los.",+ "ai.sourceIntro": "{name} vem do repositório próprio de {vendor}. Instalá-lo adiciona esse repositório a este computador, com a chave de assinatura de {vendor} que o catálogo do LordOS fixa: daí em diante as atualizações chegam de {vendor}, verificadas com essa chave, por HTTPS.",+ "ai.title": "Inteligência Artificial",+ "ai.updateLists": "Buscar as listas de pacotes",+ "ai.updating": "Buscando…",+ "ai.view": "Ver","back": "Voltar","cancel": "Cancelar","cat.AudioVideo": "Áudio e vídeo",@@ -79,6 +96,7 @@"other": "Há {count} atualizações disponíveis"},"open": "Abrir",+ "page.ai": "Inteligência Artificial","page.discover": "Descobrir","page.installed": "Instalados","page.lordos": "Apps LordOS",diff --git a/docs/UPDATES.md b/docs/UPDATES.mdindex 5788864..e5f2ddd 100644--- a/docs/UPDATES.md+++ b/docs/UPDATES.md@@ -253,6 +253,84 @@ system by LordOS's packages.0.8.5) takes the highest version among equal priorities. A newer `rpi-eeprom` reaches a board through Store → Updates or `apt upgrade` like anyother package.+## Mirrored apps (catalog)++LordOS offers a curated list of third-party apps (today nine AI apps) through the Store with its normal+package engine. The list is `apt/catalog.json` in the repository (schema, update steps and trust rules:+`apt/README.md`); the vendors' signing keys are in `apt/keys/`, LordOS's build recipes in+`apt/recipes/`. An app reaches a system in one of two ways:++| Delivery | Apps | How |+|---|---|---|+| **direct** | Claude Code (`claude-code`), Claude Desktop (`claude-desktop`), Visual Studio Code (`code`), Cursor (`cursor`) | the vendor has a signed APT repository: the user's system adds it (a deb822 `.sources` with the key pinned in the catalog) and installs and updates from the vendor. Nothing is copied to lordos.org. |+| **mirror** | `llama.cpp`, `whisper.cpp`, `codex-cli` (built by LordOS); `goose`, `opencode` (the vendor's .deb) | no vendor repository: verified on the maintainer's Mac and published in `pool/catalog/` of lordos.org/apt, signed with the LordOS archive key with everything else. |++The flow, on the maintainer's Mac only (like the rest of the repository):++1. `apt/build.sh check` validates the catalog and, for every vendor repository, that its key file+ holds exactly the pinned fingerprint, that `InRelease` verifies with it (`gpgv`, `VALIDSIG` by that+ fingerprint, suite and `Valid-Until`), that `Packages` matches `InRelease`, and that the package+ exists for each architecture (it prints the newest version).+2. `tools/release/apt-repo.sh build <target> --catalog …` runs `apt/build.sh fetch`: every pinned+ download over https, checked against its SHA-256 (and codex-cli against its sigstore signature with+ `cosign`); every vendor .deb checked again for its `Package`, `Version` and `Architecture`; the+ recipes run in `debian:trixie` containers of each architecture (amd64 natively, arm64 under qemu)+ with no network. The results go to `pool/catalog/<letter>/<name>/` and into the `binary-amd64` and+ `binary-arm64` indexes like `pool/main`, then the whole repository is signed as before.+3. Everything verified or built is kept in `~/.local/share/lordos-apt/catalog-cache`: a version that+ disappears upstream can still be published, and a built package is never rebuilt for the same+ version (the pool is append-only; `apt-repo.sh` refuses a different file with a published name).++What LordOS builds, and how:++- **llama.cpp** (the local model runner; `llama-cli -hf <user>/<model>-GGUF` and `llama-server -hf …`+ download models from Hugging Face themselves, over HTTPS with OpenSSL) and **whisper.cpp**: built+ from the upstream source tarball of a pinned tag, portable (`GGML_NATIVE=OFF`, every CPU variant of+ the architecture built as a backend module and the best one loaded at run time), programs in+ `/usr/bin`, libraries in `/usr/lib/<name>` (RUNPATH). llama.cpp also has the Vulkan backend+ (`GGML_VULKAN`) as one more module, `libggml-vulkan.so`, loaded only when a Vulkan device exists;+ `libvulkan1` (the loader, about 0.5 MB) is a dependency and `mesa-vulkan-drivers` a recommendation.+ Checked on 2026-10-27 in `debian:trixie` containers (amd64, and arm64 under qemu), with no GPU: with+ no Vulkan driver `llama-cli --list-devices` lists none and the CPU backends are used; with Mesa's+ software driver (lavapipe) the Vulkan backend loads and, with `GGML_VK_VISIBLE_DEVICES=0`, lists+ `Vulkan0: llvmpipe` (ggml skips CPU-type Vulkan devices unless asked). On real AMD, Intel or NVIDIA+ hardware the GPU is picked by default; that path has not been tested on hardware yet.+ whisper.cpp is CPU only. llama-server's web UI is upstream's CI build of the same commit (a pinned+ input), because the build has no network; whisper.cpp's `talk-llama` example (which clones llama.cpp+ at configure time) is left out. No model is downloaded at build time.+- **codex-cli**: OpenAI's static musl binary as `/usr/bin/codex`, with the Apache-2.0 `LICENSE` and+ `NOTICE`; it recommends `bubblewrap` (Codex's Linux sandbox) and `ripgrep`.++**Vendor maintainer scripts.** LordOS never modifies a vendor package. The package engine runs `dpkg`+with `DEBIAN_FRONTEND=noninteractive` and no terminal, without preseeding debconf, so this is what each+does on installation (read from the packages of 2026-10-26: code 1.143.1, claude-desktop 3.6556.2,+cursor 3.27.14, claude-code 2.1.308, goose 1.56.0, opencode 1.19.4):++| Package | On install, unattended |+|---|---|+| `claude-code` | no maintainer scripts. |+| `code` | debconf `code/add-microsoft-repo` defaults to true and there is no terminal, so it writes `/etc/apt/sources.list.d/vscode.sources` (Signed-By `/usr/share/keyrings/microsoft.gpg`, created with `gpg --dearmor`) **unless** a source file already has `URIs: https://packages.microsoft.com/repos/code`; it writes the keyring in both cases. It also links `/usr/bin/code`, registers `/usr/bin/editor` (priority 0) and, with `code/add-copilot-command` defaulting to true, links `/usr/bin/copilot` to VS Code's Copilot CLI shim (which offers to install Copilot CLI when run). postrm deletes `vscode.sources` and the keyring. |+| `claude-desktop` | writes `/usr/share/keyrings/claude-desktop-archive-keyring.asc` always, and `/etc/apt/sources.list.d/claude-desktop.list` plus `/etc/apt/apt.conf.d/50claude-desktop` (unattended-upgrades origin) **unless** another source already lists `downloads.claude.ai/claude-desktop/apt/stable` (or `/etc/default/claude-desktop` has `CLAUDE_DESKTOP_ADD_REPO=false`). It also writes an unconfined AppArmor `userns` profile when `/etc/apparmor.d/abi/4.0` exists, a GNOME Shell search provider, MIME types and `/usr/bin/ccd`. `chrome-sandbox` is setuid root. It recommends `qemu-system-x86`, `ovmf` and `virtiofsd`. |+| `cursor` | debconf `cursor/add-cursor-repo` defaults to true and it does **not** look for an existing source: it always writes `/etc/apt/sources.list.d/cursor.sources` (Signed-By `/usr/share/keyrings/anysphere.gpg`, created with `gpg --dearmor` if missing). Ships `/etc/apparmor.d/cursor-sandbox` (loaded if AppArmor is active) and `/etc/sysctl.d/50-cursor.conf` (comments only); `chrome-sandbox` setuid root; `/usr/bin/cursor`, `/usr/bin/editor` (priority 0). postrm deletes `cursor.sources` and the keyring. |+| `goose` | no maintainer scripts; `chrome-sandbox` is shipped setuid root. |+| `opencode` | `/usr/bin/ai.opencode.desktop` through update-alternatives; `chrome-sandbox` made setuid only when unprivileged user namespaces don't work; an AppArmor profile copied to `/etc/apparmor.d/ai.opencode.desktop` when AppArmor is enabled. It ships electron-updater's `app-update.yml` (GitHub releases). |++So that the vendor scripts and LordOS's own source agree, a direct app's source should be written+**before** its package is installed, with `Types: deb` and the `URIs` exactly as in the catalog (VS+Code and Claude Desktop then skip their own entry), and for Cursor, which always writes its own, the+system's file should be exactly Cursor's: `/etc/apt/sources.list.d/cursor.sources` with+`Signed-By: /usr/share/keyrings/anysphere.gpg` (the pinned key, dearmored). Two entries for the same+repository with different `Signed-By` make `apt update` fail ("Conflicting values set for option+Signed-By … The list of sources could not be read", checked with Debian 13's apt in a `debian:trixie`+container on 2026-10-26).++That is what `pkg-source-add` does (`server/src/pkg/sources_admin.c`): the Store adds the source before+installing, and an entry with `"files": {"sources": "cursor", "keyring": "anysphere.gpg"}` is written+under the vendor's own names (the key dearmored because the name ends in `.gpg`) instead of+`lordos-<id>.sources` and `lordos-<id>.asc`; `pkg-source-remove` removes the same files. Both names+come only from the root-owned catalog and pass a strict character set (`lordos*` source names are+refused).+## The Raspberry Pi kernelThe LordOS kernel for the Pi 5 (`linux-image-<version>-lordos-rpi-2712`, fromdiff --git a/server/src/pkg/pgp.c b/server/src/pkg/pgp.cindex db816ba..6990b5c 100644--- a/server/src/pkg/pgp.c+++ b/server/src/pkg/pgp.c@@ -201,6 +201,10 @@ static int parse_key(const uint8_t *b, size_t len, PgpKey *k) {static long dearmor(const char *in, size_t len, uint8_t **out);+long pgp_dearmor(const char *in, size_t len, uint8_t **out) {+ return len >= 5 && !memcmp(in, "-----", 5) ? dearmor(in, len, out) : -1;+}+int pgp_keyring_add_mem(PgpKeyring *kr, const char *data, size_t len) {uint8_t *buf;long n;diff --git a/server/src/pkg/pgp.h b/server/src/pkg/pgp.hindex d98c5e9..ea30b79 100644--- a/server/src/pkg/pgp.h+++ b/server/src/pkg/pgp.h@@ -37,6 +37,9 @@ void pgp_keyring_free(PgpKeyring *kr);int pgp_verify_clearsigned(const PgpKeyring *kr, const char *msg, size_t len, int64_t now,char **body, size_t *body_len, char *err, size_t errlen);+/* An armored block ("-----BEGIN …") as binary packets in *out (malloc); returns its length or -1. */+long pgp_dearmor(const char *in, size_t len, uint8_t **out);+/* Base64 of the armor; returns bytes written or -1. */long pgp_base64_decode(const char *in, size_t len, uint8_t *out, size_t cap);diff --git a/server/src/pkg/pkg.c b/server/src/pkg/pkg.cindex 4c4286e..55d3bca 100644--- a/server/src/pkg/pkg.c+++ b/server/src/pkg/pkg.c@@ -132,17 +132,21 @@ static void mirror_uri(const char *in, char *out, size_t n) {while (l && out[l - 1] == '/') out[--l] = 0;}-static int words(const char *v, size_t n, char out[][96], int max) {+/* comma: also split on ',' (apt accepts "Architectures: amd64,arm64", which Cursor's package writes) */+static int words_sep(const char *v, size_t n, char out[][96], int max, int comma) {int k = 0;size_t i = 0;+#define WSEP(c) (isspace((unsigned char)(c)) || (comma && (c) == ','))while (i < n && k < max) {- while (i < n && isspace((unsigned char)v[i])) i++;+ while (i < n && WSEP(v[i])) i++;size_t s = i;- while (i < n && !isspace((unsigned char)v[i])) i++;+ while (i < n && !WSEP(v[i])) i++;if (i > s) { snprintf(out[k], 96, "%.*s", (int)(i - s), v + s); k++; }}return k;+#undef WSEP}+static int words(const char *v, size_t n, char out[][96], int max) { return words_sep(v, n, out, max, 0); }static void add_source(Source *src, int *ns, const char *uri, const char *suite, char comps[][96], int nc,const char *signed_by, size_t sblen) {@@ -197,7 +201,7 @@ static void parse_deb822(const char *buf, size_t len, Source *src, int *ns, conselse if (d822_is(&f, "URIs")) nu = words(f.value, f.vlen, uris, 8);else if (d822_is(&f, "Suites")) nsu = words(f.value, f.vlen, suites, 8);else if (d822_is(&f, "Components")) nc = words(f.value, f.vlen, comps, 16);- else if (d822_is(&f, "Architectures")) na = words(f.value, f.vlen, archs, 8);+ else if (d822_is(&f, "Architectures")) na = words_sep(f.value, f.vlen, archs, 8, 1);else if (d822_is(&f, "Enabled") && f.vlen >= 2 && !strncasecmp(f.value, "no", 2)) enabled = 0;else if (d822_is(&f, "Signed-By")) { sb = f.value; sbl = f.vlen; }}diff --git a/server/src/pkg/sources_admin.c b/server/src/pkg/sources_admin.cindex 8ab5806..7b0184e 100644--- a/server/src/pkg/sources_admin.c+++ b/server/src/pkg/sources_admin.c@@ -6,6 +6,12 @@* /usr/share/keyrings/lordos-<id>.asc* pkg-source-remove <id> removes both*+ * A vendor whose package always writes its own source (Cursor: cursor.sources, Signed-By+ * /usr/share/keyrings/anysphere.gpg) would leave two entries for one repository with different+ * Signed-By, which makes apt refuse every source. Its catalog entry names those files+ * ("files": {"sources": "cursor", "keyring": "anysphere.gpg"}) and the same text is written there+ * instead, the key dearmored when the name ends in .gpg, so the package's own write changes nothing.+ ** Nothing comes from the caller but the id: the repository, suite, components, architectures and key* come from the catalog the lordos package ships (<LordOS dir>/apt/catalog.json and apt/keys/, root's,* not writable by others), every field is checked against a strict character set, the key file must@@ -122,7 +128,26 @@ static int write_atomic(const char *path, const char *data, size_t n) {}/* the catalog entry for id, as the fields of its .sources and its key; 0 or an error already sent */-typedef struct { char name[80], url[201], suites[128], comps[128], arches[64], keypath[PATH_MAX]; uint8_t fpr[20]; } Repo;+typedef struct { char name[80], url[201], suites[128], comps[128], arches[64], keypath[PATH_MAX], sname[48], kname[64]; uint8_t fpr[20]; } Repo;++/* a keyring file name: lowercase letters, digits and ._-, ending in .asc or .gpg */+static int good_keyname(const char *s) {+ size_t n = s ? strlen(s) : 0;+ if (n < 5 || n > 63 || s[0] == '.' || s[0] == '-' || (strcmp(s + n - 4, ".asc") && strcmp(s + n - 4, ".gpg"))) return 0;+ for (size_t i = 0; i < n; i++) if (!islower((unsigned char)s[i]) && !isdigit((unsigned char)s[i]) && !strchr(".-_", s[i])) return 0;+ return 1;+}++/* the paths of id's .sources and keyring: the vendor's names from the catalog, else lordos-<id> */+static void repo_paths(const char *id, const Repo *r, char *spath, size_t scap, char *kpath, size_t kcap) {+ if (r && r->sname[0]) {+ snprintf(spath, scap, SOURCES_DIR "/%s.sources", r->sname);+ snprintf(kpath, kcap, KEYRINGS "/%s", r->kname);+ } else {+ snprintf(spath, scap, SOURCES_DIR "/lordos-%s.sources", id);+ snprintf(kpath, kcap, KEYRINGS "/lordos-%s.asc", id);+ }+}static int find_repo(const char *id, Repo *r) {char dir[PATH_MAX], path[PATH_MAX];if (lordos_dir(dir, sizeof dir)) { admin_err("pkg.catalogMissing", NULL); return -1; }@@ -155,6 +180,14 @@ static int find_repo(const char *id, Repo *r) {snprintf(r->name, sizeof r->name, "%s", name ? name : id);for (char *p = r->name; *p; p++) if ((unsigned char)*p < 0x20 || *p == '#') *p = ' ';if ((size_t)snprintf(r->keypath, sizeof r->keypath, "%s/apt/keys/%s", dir, kb) >= sizeof r->keypath) { admin_err("pkg.catalogBad", NULL); goto out; }+ r->sname[0] = r->kname[0] = 0;+ const JVal *files = json_get(src, "files");+ if (files) {+ const char *sn = json_str(files, "sources"), *kn = json_str(files, "keyring");+ if (!good_id(sn) || !good_keyname(kn) || !strncmp(sn, "lordos", 6)) { admin_err("pkg.catalogBad", NULL); goto out; }+ snprintf(r->sname, sizeof r->sname, "%s", sn);+ snprintf(r->kname, sizeof r->kname, "%s", kn);+ }rc = 0;out:json_free(&doc);@@ -182,11 +215,16 @@ void pkg_act_source_add(const AdminReq *req, const char *arg, size_t len) {pgp_keyring_free(&kr);if (!match) { free(key); admin_err("pkg.keyMismatch", "id", id, NULL); return; }char kpath[PATH_MAX], spath[PATH_MAX], text[1200];- snprintf(kpath, sizeof kpath, KEYRINGS "/lordos-%s.asc", id);- snprintf(spath, sizeof spath, SOURCES_DIR "/lordos-%s.sources", id);+ repo_paths(id, &r, spath, sizeof spath, kpath, sizeof kpath);mkdir(KEYRINGS, 0755);mkdir(SOURCES_DIR, 0755);- int bad = write_atomic(kpath, key, klen);+ int bad;+ if (!strcmp(kpath + strlen(kpath) - 4, ".gpg")) {+ uint8_t *bin = NULL;+ long blen = pgp_dearmor(key, klen, &bin);+ bad = blen <= 0 || write_atomic(kpath, (const char *)bin, (size_t)blen);+ free(bin);+ } else bad = write_atomic(kpath, key, klen);free(key);if (bad) { admin_err("sys.writeFailed", "path", kpath, NULL); return; }int n = snprintf(text, sizeof text,@@ -205,9 +243,10 @@ void pkg_act_source_remove(const AdminReq *req, const char *arg, size_t len) {memcpy(id, arg, len);id[len] = 0;if (!good_id(id)) { admin_err("admin.invalidArgument", NULL); return; }+ Repo r;+ if (find_repo(id, &r)) return;char kpath[PATH_MAX], spath[PATH_MAX];- snprintf(kpath, sizeof kpath, KEYRINGS "/lordos-%s.asc", id);- snprintf(spath, sizeof spath, SOURCES_DIR "/lordos-%s.sources", id);+ repo_paths(id, &r, spath, sizeof spath, kpath, sizeof kpath);if ((unlink(spath) && errno != ENOENT) || (unlink(kpath) && errno != ENOENT)) { admin_err("sys.writeFailed", "path", spath, NULL); return; }admin_ok("pkg.sourceRemoved", "id", id, NULL);}diff --git a/tools/iso/mkdeb.sh b/tools/iso/mkdeb.shindex c559253..fdb1fbe 100755--- a/tools/iso/mkdeb.sh+++ b/tools/iso/mkdeb.sh@@ -91,6 +91,10 @@ strip --strip-unneeded "$L/bin/lord-server" "$L/bin/lord-sessiond" "$L/bin/lord-# lord-fetch (0.8.5): downloads the subscribed blocklists over HTTPS, sandboxed (docs/FIREWALL.md, "Blocklists")[ -x server/build/lord-fetch ] && install -m 755 server/build/lord-fetch "$L/bin/lord-fetch"[ -x "$L/bin/lord-fetch" ] && { strip --strip-unneeded "$L/bin/lord-fetch" 2>/dev/null || true; }+# the app catalog (0.8.5, apt/): Store → Artificial Intelligence; pkg-source-add reads it as root+install -d "$L/apt/keys"+install -m 644 apt/catalog.json "$L/apt/catalog.json"+for k in apt/keys/*.asc; do install -m 644 "$k" "$L/apt/keys/"; done# lord-tls (0.8.5): HTTPS for the package engine's downloads, sandboxed (docs/PACKAGES.md, "HTTPS")[ -x server/build/lord-tls ] && install -m 755 server/build/lord-tls "$L/bin/lord-tls"[ -x "$L/bin/lord-tls" ] && { strip --strip-unneeded "$L/bin/lord-tls" 2>/dev/null || true; }diff --git a/tools/release/apt-repo.sh b/tools/release/apt-repo.shindex 0cc76e5..1e17eda 100755--- a/tools/release/apt-repo.sh+++ b/tools/release/apt-repo.sh@@ -1,7 +1,7 @@#!/bin/sh# apt-repo.sh — the signed LordOS APT repository on lordos.org (docs/UPDATES.md, docs/RELEASING.md).#-# tools/release/apt-repo.sh build <target> [--notes VERSION=SECTION]… [--rpi] <file.deb>…+# tools/release/apt-repo.sh build <target> [--notes VERSION=SECTION]… [--rpi] [--catalog] <file.deb>…# tools/release/apt-repo.sh publish <target># tools/release/apt-repo.sh verify <target># tools/release/apt-repo.sh rpi-fetch <target> (only fetches and verifies the --rpi packages)@@ -27,6 +27,14 @@# packages (MPL-2.0 kms++) go to pool/rpi/source/<letter>/<name>/, checked the same way against the# signed Sources index, so their source is offered next to the binaries.#+# --catalog also adds the curated apps of apt/catalog.json that LordOS mirrors (apt/README.md): it runs+# `apt/build.sh fetch`, which downloads every pinned vendor file, verifies it (pinned SHA-256, sigstore,+# a vendor's signed APT index) and builds LordOS's own packages from apt/recipes/ in debian:trixie+# containers (amd64 and arm64), keeping everything in $WORKDIR/catalog-cache. Those .debs go to+# pool/catalog/<letter>/<name>/ and into the indexes of their architectures, like pool/main. Apps whose+# vendor has its own signed APT repository ("delivery": "direct") are only checked, never mirrored: the+# user's system installs them from the vendor (docs/UPDATES.md, "Mirrored apps (catalog)").+## --notes VERSION=SECTION takes the notes of lordos VERSION from CHANGELOG.md section SECTION (for# example 0.8.1~staging1=Unreleased). By default the section is "VERSION" or "VERSION-<suffix>".#@@ -219,12 +227,13 @@ rpi_src_import() {is_rpi_pkg() { grep -v '^#' "$RPI_LIST" | awk -v n="$1" '$1 == n { f = 1 } END { exit !f }'; }do_build() {- NOTES_MAP=""; RPI=0+ NOTES_MAP=""; RPI=0; CATALOG=0; cats=while [ $# -gt 0 ]; docase "$1" in--notes) [ $# -ge 2 ] || die "--notes needs VERSION=SECTION"; NOTES_MAP="$NOTES_MAP $2"; shift ;;--notes=*) NOTES_MAP="$NOTES_MAP ${1#*=}" ;;--rpi) RPI=1 ;;+ --catalog) CATALOG=1 ;;-*) die "unknown option $1" ;;*) break ;;esac@@ -237,6 +246,13 @@ do_build() {# shellcheck disable=SC2086set -- "$@" $rpisfi+ if [ "$CATALOG" = 1 ]; then+ cats=$(LORDOS_APT_DIR=$WORKDIR "$ROOT/apt/build.sh" fetch) || die "apt/build.sh fetch failed"+ echo " catalog packages verified: $(echo "$cats" | grep -c .)"+ # shellcheck disable=SC2086+ set -- "$@" $cats+ cats=" $(echo $cats) "+ fimkdir -p "$TREE/pool/main"# the pool is append-only: start from what is published (old versions stay installable)if [ -z "${LORDOS_APT_OFFLINE:-}" ]; then@@ -253,6 +269,7 @@ do_build() {case "$name" in lib?*) dir=$(printf %s "$name" | cut -c1-4) ;; *) dir=$(printf %s "$name" | cut -c1) ;; esaccomp=mainis_rpi_pkg "$name" && comp=rpi+ case "$cats" in *" $deb "*) comp=catalog ;; esacdest="pool/$comp/$dir/$name/${name}_${ver#*:}_$arch.deb"if [ -f "$TREE/$dest" ] && ! cmp -s "$TREE/incoming/$b" "$TREE/$dest"; thendie "$dest is already published with different contents: a version is never replaced (bump it)"@@ -287,6 +304,10 @@ do_build() {if [ "$a" = arm64 ] && [ -d "$TREE/pool/rpi" ]; thendebtool apt-ftparchive --arch "$a" packages pool/rpi >> "$TREE/$D/main/binary-$a/Packages"fi+ # the mirrored catalog apps (pool/catalog), for each architecture like pool/main+ if [ -d "$TREE/pool/catalog" ]; then+ debtool apt-ftparchive --arch "$a" packages pool/catalog >> "$TREE/$D/main/binary-$a/Packages"+ fixz -9 -k -f "$TREE/$D/main/binary-$a/Packages"gzip -9 -n -k -f "$TREE/$D/main/binary-$a/Packages"printf 'Archive: %s\nOrigin: LordOS\nLabel: LordOS\nComponent: main\nArchitecture: %s\n' "$SUITE" "$a" > "$TREE/$D/main/binary-$a/Release"