APKIN.json: multiple versions, same APKBUILD #5

Open
opened 2026-02-26 08:09:53 +01:00 by jane413 · 2 comments
Owner

APKIN.json is an array of objects. Those objects have the following interfaces.

interface ApkInObject {
  pkgname: string,
  pkgver: string,
  pkgrel: number,
  source?: ApkInSource[],
  // special
  bootstrap?: bool,
}

interface ApkInSource {
  /// the optional prefix part of a source so $target_file::http://example.org/abc
  target_file?: string,
  uri: string,
  sha512sum: string,
}

How is this combined into an APKBUILD?

let apkbuild_override = "APKBUILD.$pkgname-$pkgver-r$pkgrel ";
let apkbuild_path = is_file(apkbuild_override) ? apkbuild_override : "APKBUILD";

export pkgname, pkgver, pkgrel, source
source $apkbuild_path

/// the combination of the two results in the final variables.
echo "$source"

special scenarios

having two linux kernels

this assumes that changing the pkgname and rebuilding the kernel doesn't change it, so that building is reproducible. having reproducible build it not scope of this document.

[
  {
    "pkgname": "linux",
    "pkgver": "7.10",
    ...
  },
  {
    "pkgname": "linux-old"
    "pkgver": "7.9"
  }
]

bootstrapping

on reverse dependency detection and a bootstrap package being available that provides an entry into the reverse dependency:

  1. build gcc-bootstrap
  2. build gcc with gcc-bootstrap
  3. build gcc with gcc (for validation)

bootstrap=1 is set in the APKBUILD environment if bootstrap == true.
bootstrap=2 is set if gcc-bootstrap is used instead of gcc.

[
  {
    "pkgname": "gcc-bootstrap"
    "bootstrap": true,
  }
  {
    "pkgname": "gcc",
    "makedepends": "gcc"
  }
]
APKIN.json is an array of objects. Those objects have the following interfaces. ```typescript interface ApkInObject { pkgname: string, pkgver: string, pkgrel: number, source?: ApkInSource[], // special bootstrap?: bool, } interface ApkInSource { /// the optional prefix part of a source so $target_file::http://example.org/abc target_file?: string, uri: string, sha512sum: string, } ``` ## How is this combined into an APKBUILD? ```javascript let apkbuild_override = "APKBUILD.$pkgname-$pkgver-r$pkgrel "; let apkbuild_path = is_file(apkbuild_override) ? apkbuild_override : "APKBUILD"; export pkgname, pkgver, pkgrel, source source $apkbuild_path /// the combination of the two results in the final variables. echo "$source" ``` ## special scenarios ### having two linux kernels this assumes that changing the pkgname and rebuilding the kernel doesn't change it, so that building is reproducible. having reproducible build it not scope of this document. ```json [ { "pkgname": "linux", "pkgver": "7.10", ... }, { "pkgname": "linux-old" "pkgver": "7.9" } ] ``` ### bootstrapping on reverse dependency detection and a bootstrap package being available that provides an entry into the reverse dependency: 1. build gcc-bootstrap 2. build gcc with gcc-bootstrap 3. build gcc with gcc (for validation) bootstrap=1 is set in the APKBUILD environment if bootstrap == true. bootstrap=2 is set if `gcc-bootstrap` is used instead of gcc. ```json [ { "pkgname": "gcc-bootstrap" "bootstrap": true, } { "pkgname": "gcc", "makedepends": "gcc" } ] ```
Author
Owner
  • source can technically be moved to the APKBUILD with -gt pkgver gating properties. but that isn't as clean and complicates abuild checksum.
- source can technically be moved to the APKBUILD with -gt pkgver gating properties. but that isn't as clean and complicates `abuild checksum`.
Author
Owner

maybe introduce a "self-host" variable for gcc. this indicates gcc to be built with itself again. current spec defines it as implicit behavior because of bootstrap.

maybe introduce a "self-host" variable for gcc. this indicates gcc to be built with itself again. current spec defines it as implicit behavior because of bootstrap.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jane413/meta-distro#5
No description provided.