index.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <!doctype html>
  2. <html lang="en-nz">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>USM — Astrologue Developer</title>
  7. <meta name="description" content="USM — the Universal Source Manifest package manager: a project declares what it provides and needs in a MANIFEST.usm, and usm acquires, builds, tests, packages and deploys it. Free software, GPL-3.0-or-later.">
  8. <meta name="color-scheme" content="light dark">
  9. <meta name="theme-color" content="#f2ebda" media="(prefers-color-scheme: light)">
  10. <meta name="theme-color" content="#0a0a12" media="(prefers-color-scheme: dark)">
  11. <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='27' fill='none' stroke='%23a8801f' stroke-width='4'/%3E%3Cpath d='M32 8l6 18 18 6-18 6-6 18-6-18-18-6 18-6z' fill='%23a8801f'/%3E%3Ccircle cx='32' cy='32' r='4' fill='%23003078'/%3E%3C/svg%3E">
  12. <meta property="og:title" content="USM — Astrologue Developer">
  13. <meta property="og:description" content="The Universal Source Manifest: a project declares what it provides and needs in a MANIFEST.usm, and usm acquires, builds, tests, packages and deploys it.">
  14. <meta property="og:type" content="website">
  15. <link rel="stylesheet" href="../../assets/css/style.css">
  16. </head>
  17. <body>
  18. <a class="skip-link" href="#main">Skip to content</a>
  19. <header class="masthead">
  20. <div class="container masthead__inner">
  21. <a class="brand" href="../../">
  22. <img class="brand__logo brand__logo--light" src="../../assets/img/astrologue-light.png" width="392" height="89" alt="Astrologue">
  23. <img class="brand__logo brand__logo--dark" src="../../assets/img/astrologue-dark.png" width="392" height="89" alt="Astrologue">
  24. </a>
  25. <nav class="site-nav" aria-label="Primary">
  26. <ul class="site-nav__list">
  27. <li><a href="../../">Home</a></li>
  28. <li><a href="../../#news">News</a></li>
  29. <li><a href="../../#download">Download</a></li>
  30. <li><a href="../" aria-current="page">Developer</a></li>
  31. <li><a class="nav-cta" href="../../#download">Get Astrologue</a></li>
  32. </ul>
  33. </nav>
  34. </div>
  35. </header>
  36. <main id="main">
  37. <nav class="breadcrumb" aria-label="Breadcrumb">
  38. <div class="container">
  39. <ol>
  40. <li><a href="../../">Astrologue</a></li>
  41. <li><a href="../">Developer</a></li>
  42. <li aria-current="page">USM</li>
  43. </ol>
  44. </div>
  45. </nav>
  46. <section class="docs-header">
  47. <div class="container">
  48. <p class="kicker"><span>Packaging · How it all ships</span></p>
  49. <h1>USM</h1>
  50. <p class="lede">The Universal Source Manifest: a project declares what it provides and what it needs in one JSON file, and <code>usm</code> acquires, builds, tests, packages and deploys it. It is the package manager that ships the Astrologue stack — and any project you care to point it at.</p>
  51. <dl class="docs-facts">
  52. <div><dt>Version</dt> <dd><code>0.1</code></dd></div>
  53. <div><dt>Licence</dt> <dd>GPL-3.0-or-later</dd></div>
  54. <div><dt>Package</dt> <dd><code>usm&nbsp;install&nbsp;usm</code></dd></div>
  55. <div><dt>Language</dt> <dd>Vala</dd></div>
  56. </dl>
  57. </div>
  58. </section>
  59. <section class="band band--plain" id="docs">
  60. <div class="container docs-layout">
  61. <nav class="docs-toc" aria-label="On this page">
  62. <h2>On this page</h2>
  63. <ul>
  64. <li><a href="#overview">Overview</a></li>
  65. <li><a href="#features">Features</a></li>
  66. <li><a href="#installation">Installation</a></li>
  67. <li><a href="#usage">Usage &amp; documentation</a></li>
  68. <li><a href="#package">Package &amp; source</a></li>
  69. </ul>
  70. </nav>
  71. <div class="docs-prose">
  72. <header class="section-head" id="overview">
  73. <p class="kicker"><span>Overview</span></p>
  74. <h2>Why it exists</h2>
  75. </header>
  76. <p>USM — the Universal Source Manifest — is a source-first package manager. A package is a directory with a <code>MANIFEST.usm</code> at its root: one JSON document naming the package, its version, its licences, every resource it provides (libraries, headers, vapis, GIRs, typelibs, pkg-config files, binaries, data) and every resource it depends on at runtime, at build time, and to manage it. From that single declaration, the <code>usm</code> command derives the whole lifecycle: acquire the sources, resolve the dependencies, build, test, install, package, publish, deploy.</p>
  77. <p>Every library on this site ships as a USM source package — the <code>usm install</code> line on each page is the whole ceremony. The stack bootstraps from its own foundations: USM is written in Vala against <a href="../invercargill/">Invercargill</a> and <a href="../invercargill-json/">Invercargill-Json</a>, validates its own manifest with its own validator, and — since the packaging work of this release — runs its own test suite through its own <code>test</code> exec. The package manager packages itself.</p>
  78. <p>Source-first is the point: what you install is what was built from the sources you can read, with binary-artifact repositories (DCBA) available as a cache layer rather than a chain to hold you.</p>
  79. <header class="section-head" id="features">
  80. <p class="kicker"><span>Features</span></p>
  81. <h2>What it hands you</h2>
  82. </header>
  83. <ul class="docs-features">
  84. <li><strong>One manifest, one truth.</strong> <code>MANIFEST.usm</code> declares provides and depends over a rich resource vocabulary — <code>lib:</code>, <code>inc:</code>, <code>vapi:</code>, <code>gir:</code>, <code>typelib:</code>, <code>pc:</code>, <code>bin:</code>, <code>res:</code>, <code>app:</code> and more — with version constraints where they matter.</li>
  85. <li><strong>Signed source repositories.</strong> A repository is a directory with a descriptor, ed25519 keys and a signed <code>PACKAGES.usml</code> listing; <code>usm repository init/add/publish/verify</code> tends it, and every package is checksummed.</li>
  86. <li><strong>DCBA artifact repositories.</strong> Distribute pre-built build artifacts as <code>.dcba</code> files alongside the sources — same layout, same signing, used automatically by <code>usm install</code> when a client's platform matches, with local builds always winning.</li>
  87. <li><strong>Validation that builds.</strong> <code>usm manifest validate</code> builds the package, installs to a temporary directory and checks that every declared resource actually appeared — a manifest cannot claim what the build never produced.</li>
  88. <li><strong>Tests in the lifecycle.</strong> A <code>test</code> exec in the manifest gives <code>usm manifest test</code> a suite to run against the built package — the whole stack's suites run this way.</li>
  89. <li><strong>System package manager bridges.</strong> Missing resources can delegate to the native manager before USM repositories are tried; five reference helpers ship (<code>usm-spm-dnf</code>, <code>-apt</code>, <code>-apk</code>, <code>-emerge</code>, <code>-pacman</code>) behind one stable JSON contract.</li>
  90. <li><strong>Container deployment.</strong> <code>usm manifest deploy</code> builds a container image that installs the package in-container, with the SPM bridge of your distro wired in.</li>
  91. </ul>
  92. <header class="section-head" id="installation">
  93. <p class="kicker"><span>Installation</span></p>
  94. <h2>Getting the manager</h2>
  95. </header>
  96. <p>USM installs itself like anything else it manages:</p>
  97. <figure class="code-plate">
  98. <pre><code>usm install usm</code></pre>
  99. <figcaption>Acquires the sources, builds with meson/ninja, runs the test exec, installs.</figcaption>
  100. </figure>
  101. <p>From source it is the stack's one-build discipline — the manifest's build exec meson-sets-up <code>src/</code>:</p>
  102. <figure class="code-plate">
  103. <pre><code>git clone &lt;the usm repository&gt;
  104. cd usm
  105. meson setup src build
  106. ninja -C build
  107. ninja -C build install</code></pre>
  108. <figcaption>Needs valac, meson, ninja, GLib/GObject/GIO, <code>invercargill-1</code>, <code>invercargill-json</code>, json-glib and gobject-introspection.</figcaption>
  109. </figure>
  110. <p>Its own libraries are usable directly, not just through the command:</p>
  111. <figure class="code-plate">
  112. <pre><code>valac --pkg usm-0.1 my-tool.vala</code></pre>
  113. <figcaption>The manifest's <code>provides</code> lists <code>libusm-0.1.so</code>, <code>usm-0.1.h</code>, the vapi + <code>.deps</code>, GIR and typelib — USM ships as a library too.</figcaption>
  114. </figure>
  115. <header class="section-head" id="usage">
  116. <p class="kicker"><span>Usage &amp; documentation</span></p>
  117. <h2>The manifest, the verbs, the bridges</h2>
  118. </header>
  119. <p>A manifest names the package, its version, its licences, what it provides and what it depends on — this is the README's own example, trimmed to the shape:</p>
  120. <figure class="code-plate">
  121. <pre><code>{
  122. "name": "my-package",
  123. "version": "1.0.5+2",
  124. "summary": "A sample package",
  125. "licences": [ {"name": "GPLv3", "category": "libre", "text": "src/LICENSE"} ],
  126. "provides": {
  127. "bin:hello-world": "hello-world",
  128. "res:usr/share/icons/hicolor/scalable/hello-world.svg": "icons/hello-world.svg"
  129. },
  130. "depends": {
  131. "runtime": [ "lib:libgtk-4.so.1" ],
  132. "build": [ "bin:valac", "bin:meson", "inc:gtk-4.0" ],
  133. "manage": [ "bin:bash" ]
  134. },
  135. "execs": {
  136. "build": "usm-scripts/build",
  137. "install": "usm-scripts/install",
  138. "test": "usm-scripts/test"
  139. }
  140. }</code></pre>
  141. <figcaption>From the README. Every <code>provides</code> path is checked against what the build actually installed.</figcaption>
  142. </figure>
  143. <h3>The verbs</h3>
  144. <p>One command, grouped verbs — the descriptions below are lifted from <code>usm --help</code>:</p>
  145. <figure class="code-plate">
  146. <pre><code>usm install &lt;packages&gt; Install packages (plan + confirm; -y to skip)
  147. usm update [packages] Update installed packages (or all if none named)
  148. usm remove &lt;packages&gt; Remove packages (cascades + sweeps orphaned deps)
  149. usm search &lt;query&gt; Search repositories and installed packages
  150. usm provides &lt;resource&gt; Find which package provides a resource
  151. usm repository add &lt;pkg&gt; Add a package (.usmc) to this repository
  152. usm manifest validate Validate a manifest
  153. usm manifest test Run package tests
  154. usm manifest package Create a .usmc archive
  155. usm manifest deploy Deploy a package as a container image</code></pre>
  156. <figcaption>A selection — <code>usm --help</code> lists the full set, including <code>dcba</code>, <code>scaffold</code> and <code>manifest bump</code>.</figcaption>
  157. </figure>
  158. <h3>Repositories and signatures</h3>
  159. <p>A source repository is a directory with a <code>.usmr</code> descriptor, a <code>keys/</code> pair and a <code>public/</code> package directory; the listing is signed with the repository's ed25519 key and every package carries a SHA-512. Publishing is two commands:</p>
  160. <figure class="code-plate">
  161. <pre><code>usm repository init my-repo
  162. usm repository add my-package-1.0.0.usmc
  163. usm repository publish /srv/www/my-repo</code></pre>
  164. <figcaption>On a client: <code>usm add-repo &lt;url&gt;</code>, then <code>usm install my-package</code>.</figcaption>
  165. </figure>
  166. <h3>The self-referential bit</h3>
  167. <p>USM's own manifest declares the same execs every other package in the stack declares — <code>build</code>, <code>install</code>, <code>test</code> — so <code>usm manifest validate</code> on the usm repository builds USM with USM's build exec and <code>usm manifest test</code> runs USM's own suite (manifest parsing, <code>.usmignore</code> semantics, data-package validation, <code>usm.config</code> handling) through USM's test exec. The manager is managed.</p>
  168. <p>The repository carries the full references: <code>README.md</code> for commands and repository formats, <code>SPECIFICATION.md</code> for the manifest JSON schema, and <code>PACKAGING_GUIDE.md</code> for how to package a project well — including the classic pitfall of trusting <code>ldd</code> when declaring runtime dependencies.</p>
  169. <header class="section-head" id="package">
  170. <p class="kicker"><span>Package &amp; source</span></p>
  171. <h2>The ledger</h2>
  172. </header>
  173. <dl class="docs-package">
  174. <div><dt>Version</dt><dd><code>0.1</code> (from <code>MANIFEST.usm</code>)</dd></div>
  175. <div><dt>Licence</dt><dd>GPL-3.0-or-later — free to run, study, share and improve. A package manager is infrastructure for everyone; this one stays strongly copyleft.</dd></div>
  176. <div><dt>Package</dt><dd><code>usm install usm</code></dd></div>
  177. <div><dt>Provides</dt><dd><code>usm</code> the binary, <code>libusm-0.1.so</code>, <code>usm-0.1.h</code>, <code>usm-0.1.vapi</code> + <code>.deps</code>, <code>usm-0.1.gir</code>, <code>usm-0.1.typelib</code>, <code>usm-0.1.pc</code>, the five SPM bridge binaries (<code>usm-spm-dnf</code>, <code>usm-spm-apt</code>, <code>usm-spm-apk</code>, <code>usm-spm-emerge</code>, <code>usm-spm-pacman</code>), and its manifest documentation under <code>slopdocs/</code></dd></div>
  178. <div><dt>Needs at runtime</dt><dd>GLib, GObject, GIO, <code>libinvercargill-1.so</code>, <code>libinvercargill-json.so</code>, json-glib, and the usual GObject platform libraries. Build time adds valac, meson, ninja and gobject-introspection.</dd></div>
  179. <div><dt>Source</dt><dd>The repository <code>Tilo15/usm</code> on the Astrologue forge (git over ssh, port 222). Free software: the licence guarantees your right to the source.</dd></div>
  180. </dl>
  181. <nav class="docs-siblings" aria-label="Related in the catalogue">
  182. <p>Its neighbours:</p>
  183. <ul>
  184. <li><a href="../invercargill/">Invercargill</a></li>
  185. <li><a href="../invercargill-json/">Invercargill-Json</a></li>
  186. <li><a href="../locksmith/">Locksmith</a></li>
  187. </ul>
  188. </nav>
  189. <nav class="docs-pager" aria-label="Project pages">
  190. <a class="docs-pager__link docs-pager__link--prev" href="../vallama/">
  191. <span>Previous</span>
  192. <strong>Vallama</strong>
  193. </a>
  194. <p class="docs-pager__up"><a href="../">All eleven</a></p>
  195. <a class="docs-pager__link docs-pager__link--next" href="../">
  196. <span>End of the catalogue</span>
  197. <strong>All projects</strong>
  198. </a>
  199. </nav>
  200. </div>
  201. </div>
  202. </section>
  203. </main>
  204. <footer class="site-footer">
  205. <div class="container">
  206. <div class="footer-grid">
  207. <div class="foot-brand">
  208. <img class="brand__logo brand__logo--dark" src="../../assets/img/astrologue-dark.png" width="392" height="89" alt="Astrologue">
  209. <p>An operating system for change — kept for self sufficiency, resilience, and software freedom, so regular people can hold the power of general purpose computers in their own hands.</p>
  210. </div>
  211. <nav aria-label="The four freedoms">
  212. <p class="foot-title">The Four Freedoms</p>
  213. <ol class="freedoms">
  214. <li><strong>Run</strong> the software as you wish, for any purpose.</li>
  215. <li><strong>Study</strong> the source and change it to do your computing as you wish.</li>
  216. <li><strong>Share</strong> copies so you can help others.</li>
  217. <li><strong>Modify</strong> and publish your versions so everyone benefits.</li>
  218. </ol>
  219. </nav>
  220. <nav aria-label="Site">
  221. <p class="foot-title">Site</p>
  222. <ul class="foot-list">
  223. <li><a href="../../">Home</a></li>
  224. <li><a href="../../#news">News</a></li>
  225. <li><a href="../../#download">Download</a></li>
  226. <li><a href="../">Developer</a></li>
  227. </ul>
  228. </nav>
  229. </div>
  230. <p class="colophon">Set in Cinzel and EB Garamond (SIL Open Font License). Astrologue is free software, licensed GPL-3.0-or-later: take it, tend it, pass it on. The libraries are LGPL-3.0-or-later, so they remain free to link.</p>
  231. </div>
  232. </footer>
  233. </body>
  234. </html>