commit 5dace9f0d0c26088d81d9ae22ca8c9b69d45aacc
parent 6c51540221476c7f32c87409d3bc478ed146752d
Author: torter <koubbamohamedrayan@gmail.com>
Date: Sat, 21 Nov 2026 21:45:14 +0000
handbook 4.6 and 4.7, source trees; base without the stage's gzip, cc and python3 links; slate only with WMREL
Diffstat:
9 files changed, 67 insertions(+), 25 deletions(-)
diff --git a/files/usr/bin/cc b/files/usr/bin/cc
@@ -1,3 +0,0 @@
-#!/bin/sh
-case " $* " in *" -c "*|*" -E "*|*" -S "*) exec clang "$@";; esac
-exec clang --rtlib=compiler-rt --unwindlib=libunwind -fuse-ld=lld "$@"
diff --git a/files/usr/bin/gunzip b/files/usr/bin/gunzip
@@ -1 +0,0 @@
-unpigz
-\ No newline at end of file
diff --git a/files/usr/bin/gzip b/files/usr/bin/gzip
@@ -1 +0,0 @@
-pigz
-\ No newline at end of file
diff --git a/files/usr/bin/python3 b/files/usr/bin/python3
@@ -1 +0,0 @@
-python3.12
-\ No newline at end of file
diff --git a/files/usr/bin/zcat b/files/usr/bin/zcat
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec unpigz -c "$@"
diff --git a/handbook/__pycache__/html.cpython-314.pyc b/handbook/__pycache__/html.cpython-314.pyc
Binary files differ.
diff --git a/handbook/handbook.md b/handbook/handbook.md
@@ -372,12 +372,13 @@ same in both systems.
mag is the package manager. It installs binary packages from the repositories in `/etc/mag/repos`, checks every index
and every package against `/etc/mag/keys`, and keeps what it installed in `/var/lib/mag`. It is one C file and runs
-nothing but the download command.
+nothing but the download command, and bash when it builds from a source tree (4.6, 4.7).
### 4.1 The commands
mag update get the index of every repo
mag install PKG... install, with what they need
+ mag build PKG... build them from a source tree: CRUX, Void or Exherbo (4.6, 4.7)
mag remove PKG... take packages off
mag upgrade install what the repos have a newer version of
mag autoremove remove what was only a dependency and is not needed now
@@ -435,6 +436,56 @@ them:
Put the public half of KEY in `/etc/mag/keys` and the repo's URL in `/etc/mag/repos`. `tools/mkpkgs` is how Chamesle's
own repo is made.
+### 4.6 CRUX ports
+
+mag also builds from CRUX's port trees. A line that starts with `crux` is a tree of ports, and its key goes next to the
+others:
+
+ echo 'crux https://crux.nu/ports/crux-3.8/opt' >> /etc/mag/repos
+ curl -o /etc/mag/keys/opt.pub https://crux.nu/ports/crux-3.8/core/ports/opt.pub
+ mag update
+ mag build foo
+
+`mag update` gets only the ports that changed, as httpup does, into `/var/cache/mag`. Every port's `.signature` is
+checked with the key, then its sources against the signature, and its `build()` runs with bash. `core`, `xorg` and
+`contrib` work the same way, with `core.pub`, `xorg.pub` and `contrib.pub`.
+
+A package the binary repos have wins over a port of the same name: `mag install` takes a port only when nothing has it
+built, `mag build` always takes the port. A port brings build-base, pkgconf and bash with it, and the `-dev` package of
+every dependency that comes built. The flags go in `/etc/mag/build.conf`, otherwise it is `-O2 -pipe` and one job per
+core:
+
+ CFLAGS="-O2 -pipe -march=native"
+ MAKEFLAGS="-j4"
+
+What a port installs is a package like any other: `mag files`, `mag remove` and `mag upgrade` work on it.
+
+### 4.7 Void and Exherbo
+
+mag builds Void's templates and Exherbo's exheres too, from their git trees:
+
+ echo 'void https://github.com/void-linux/void-packages' >> /etc/mag/repos
+ echo 'exherbo https://gitlab.exherbo.org/exherbo/arbor' >> /etc/mag/repos
+ mag update
+ mag build tmux
+
+`mag update` gets the whole tree as one tarball, about 9 MB for Void and 2 MB for arbor, and indexes it. Neither tree
+is signed: what you get is what GitHub or Exherbo's GitLab sent over https. A Void template has the sha256 of each of
+its sources, and mag checks them. An exheres has none, so its sources are as good as the connection they came over.
+
+A Void template runs with the helpers in the tree's `common/`, the way xbps-src runs it: the build style
+(`gnu-configure`, `cmake`, `meson` and the others), `vinstall`, `vmove` and the rest, and Void's patches. What Void
+splits into subpackages stays in one package here: `mag build libzstd` builds zstd. A `-devel` it needs is the `-dev`
+of the binary repos.
+
+An exheres runs on a small exheres-0 of mag's own, with the exlibs of the tree. Options are what Exherbo's profile turns
+on, without systemd and pam. Exherbo puts programs in `/usr/x86_64-...-musl/bin`; mag builds them there and moves them
+to `/usr` afterwards. Arbor is Exherbo's main tree, about 1000 packages; the others are on the same GitLab and work the
+same way.
+
+When two trees have a package, `mag build` takes the newer version. A package the binary repos split differently,
+like xz with its `xz-libs`, clashes with what is installed, and mag stops; `-f` writes over it.
+
## 5. rifle
@@ -935,7 +986,7 @@ X writes `~/.local/share/xorg/Xorg.0.log`; `grep EE` in it shows the errors.
| `/etc/fstab` | file systems |
| `/etc/sysctl.d/` | kernel settings loaded at boot (6.10) |
| `/etc/os-release` | `NAME=Chamesle`, `ID=chamesle` |
-| `/etc/mag/` | `repos`, `keys/`, `arch` |
+| `/etc/mag/` | `repos`, `keys/`, `arch`, `build.conf` |
| `/etc/mkinitfs/mkinitfs.conf` | what goes into the initramfs |
| `/boot/limine.conf` | the boot entries |
| `/boot/limine-bios.sys` | limine's BIOS stage |
@@ -944,7 +995,7 @@ X writes `~/.local/share/xorg/Xorg.0.log`; `grep EE` in it shows the errors.
| `/lib/modules/V/` | its modules |
| `/lib/firmware/` | firmware |
| `/var/lib/mag/` | what is installed, and its files |
-| `/var/cache/mag/` | indexes and downloaded packages |
+| `/var/cache/mag/` | indexes, downloaded packages and port trees |
| `/usr/share/limine/` | limine's boot files, for installing it |
| `/usr/share/doc/chamesle/handbook.md` | this book |
@@ -973,6 +1024,6 @@ X writes `~/.local/share/xorg/Xorg.0.log`; `grep EE` in it shows the errors.
chamesle-chroot DIR [COMMAND...]
chamesle-disk DISK
chamesle-boot [DIR]
- mag [-nf] update|install|remove|upgrade|autoremove|list|info|search|files|owns|deps|rdeps|fetch
+ mag [-nf] update|install|build|remove|upgrade|autoremove|list|info|search|files|owns|deps|rdeps|fetch
rifle --install DIR | --list
limine bios-install DEVICE
diff --git a/handbook/html.py b/handbook/html.py
@@ -28,7 +28,7 @@ def page(title, desc, url, body):
<meta property="og:title" content="{t} - Chamesle">
<meta property="og:description" content="{d}">
<meta property="og:url" content="https://chamesle.org/{url}">
-<link rel="stylesheet" href="style.css?19">
+<link rel="stylesheet" href="style.css?20">
<link rel="icon" href="img/logo.png">
</head>
<body>
diff --git a/tools/mkpkgs b/tools/mkpkgs
@@ -2,7 +2,7 @@
# mkpkgs ARCH OUT: Chamesle's own packages for one arch, signed with KEY, and the index of OUT.
# KEY=~/.chamesle-keys/chamesle-20261118.rsa MAG=~/src/mag/mag RIFLE=~/src/rifle/rifle mkpkgs x86_64 repo/x86_64
# RIFLE is left out where rifle does not build (it is x86_64 only for now). REL is the -rN of the base's version.
-# DOCKAPPS is what desktop/slate/dockapps built for this arch, chamesle-dockapps is left out without it
+# WMREL makes slate too, with that -rN; DOCKAPPS is what desktop/slate/dockapps built for this arch, for chamesle-dockapps
set -e
here=$(cd "$(dirname "$0")/.." && pwd)
[ $# = 2 ] && [ -f "$KEY" ] && [ -x "$MAG" ] || { echo "usage: KEY=... MAG=... [RIFLE=...] mkpkgs ARCH OUT" >&2; exit 2; }
@@ -27,7 +27,7 @@ fi
b=$tmp/base
cp -R "$here/files" "$b"
-rm -f "$b/etc/hosts" "$b/etc/services" "$b/usr/bin/cc" "$b/usr/bin/zcat"
+rm -f "$b/etc/hosts" "$b/etc/services"
mkdir -p "$b/etc/mag/keys" "$b/etc/apk" "$b/usr/bin" "$b/usr/share/doc/chamesle"
cp "$here/keys/"*.pub "$b/etc/mag/keys/"
ln -s ../mag/keys "$b/etc/apk/keys"
@@ -38,13 +38,15 @@ cp "$here/handbook/handbook.md" "$b/usr/share/doc/chamesle/handbook.md"
mkapk -n chamesle-base -v "$(date +%Y%m%d)-r${REL:-0}" -d "Winchester, the files in /etc and the tools of Chamesle" \
-D "$deps" -s "$here/pkg/chamesle-base" "$b"
-d=$tmp/slate
-DESTDIR=$d "$here/desktop/slate/install" /usr
-cp -Rp "$here/desktop/slate/chamesle/." "$d/"
-mkapk -n slate -v "$(date +%Y%m%d)-r${WMREL:-0}" -d "Window Maker with the dock apps and the NeXT look" \
- -D "windowmaker st xfe xsetroot xmessage xdm tint2 dunst xscreensaver arandr pavucontrol font-urw-base35 font-misc-misc${DOCKAPPS:+ chamesle-dockapps}" "$d"
-if [ -n "$DOCKAPPS" ]; then
- mkapk -n chamesle-dockapps -v "$(date +%Y%m%d)-r${WMREL:-0}" -d "wmclock, wmcpuload, wmmemload, wmnet, wmix, wmbattery and wmsystemtray" \
+if [ -n "$WMREL" ]; then
+ d=$tmp/slate
+ DESTDIR=$d "$here/desktop/slate/install" /usr
+ cp -Rp "$here/desktop/slate/chamesle/." "$d/"
+ mkapk -n slate -v "$(date +%Y%m%d)-r$WMREL" -d "Window Maker with the dock apps and the NeXT look" \
+ -D "windowmaker st xfe xsetroot xmessage xdm tint2 dunst xscreensaver arandr pavucontrol font-urw-base35 font-misc-misc${DOCKAPPS:+ chamesle-dockapps}" "$d"
+fi
+if [ -n "$WMREL" ] && [ -n "$DOCKAPPS" ]; then
+ mkapk -n chamesle-dockapps -v "$(date +%Y%m%d)-r$WMREL" -d "wmclock, wmcpuload, wmmemload, wmnet, wmix, wmbattery and wmsystemtray" \
-D "libx11 libxext libxpm alsa-lib upower" "$DOCKAPPS"
fi
"$here/tools/mkrepo" "$out" "$KEY"