Commit graph SchOS/ports/fastfetch/Makefile
Author SHA1 Message Date
Nexoniarz
25ae0cfad9 ports: fastfetch, unpatched, and /etc/os-release so it can name us
fastfetch builds and runs on SchOS:

    OS: SchOS 0.1.0 x86_64
    Kernel: SchIFT 0.1.0
    Shell: sh          Terminal: schinit
    CPU: AMD Ryzen 7 5700G
    Memory: 11.94 MiB / 1016.93 MiB (1%)
    Disk (/): 4.64 MiB / 31.25 MiB (15%) - schfs

Here because it is a good acceptance test, not because SchOS needs a fetch
tool. It is ~410 C files somebody else wrote against Linux rather than against
our bugs, and running it exercises procfs, per-process directories, uname,
statfs, getpwuid, terminal detection by walking ppid, and an ANSI renderer all
at once -- which is the shape docs/plan/roadmap.md asked for when the previous
full-stack test was removed.

patches/ is empty and should stay that way. When fastfetch cannot detect
something the answer is to give the system the thing it is looking for, because
every other program looks for the same things. Its first run reported four
misses and they are being worked in that order:

    OS:       Could not detect OS          -> /etc/os-release, this commit
    Local IP: getifaddrs() failed          -> AF_NETLINK, next
    Host:     not set by O.E.M.            -> DMI in /sys, later
    Users:    Unable to detect any users   -> utmp, a userland convention

Four things the port needs that say nothing about SchOS, recorded in the
Makefile because each cost time to find:

  * Every ENABLE_* off. All 29 files calling dlopen are optional detection
    modules, and ENABLE_THREADS=OFF removes the single pthread_create -- which
    matters, because clone() here does not share an address space.
  * -isystem the compiler's own include dir. -nostdinc removes it too, and
    cpuid.h is emitted by the compiler with no musl equivalent.
  * Linux UAPI headers. musl ships none by design; a musl toolchain is normally
    paired with a separate linux-headers install.
  * libgcc on the link line, and libc twice -- libgcc pulls symbols back out of
    it (__popcountdi2), and a static link resolves left to right.

The toolchain settings are a CMake toolchain file rather than command-line
flags because CMAKE_*_INIT variables are only honoured when the cache is first
created. Reconfiguring an existing build directory ignores them silently.

Also rebuilt musl: build/ports/musl/prefix/bin/musl-gcc had the pre-move path
/home/nexoniarz/Documents/SchOS baked in by configure. The tree does not use
that wrapper -- it links with explicit -I/-L and crt objects -- so nothing was
broken by it, but it was stale and would mislead anyone who found it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQ7Qx8E1q1M1bbCq8QLHS2
2026-09-12 19:08:53 +02:00