Skip to content

Port libs - #355

Merged
kloptops merged 4 commits into
PortsMaster:mainfrom
kloptops:port-libs
Oct 21, 2026
Merged

kloptops merged 4 commits into
PortsMaster:mainfrom
kloptops:port-libs

Conversation

@kloptops

Copy link
Copy Markdown
Member

Some ports need common libraries that some CFWs don't ship. The love runtime, for example, is built against libtheoradec. This gives PortMaster one place to keep them, available to every port.

How it works

  • PortMaster/libs.aarch64, libs.armhf and libs.x86_64 hold the libraries. libs/ stays the runtimes' .squashfs folder.
  • funcs.txt, which every control.txt sources, exports PM_LIBRARY_PATH and adds it to the end of LD_LIBRARY_PATH. So it only fills in what the system is missing. A port that wants these libraries first can put "$PM_LIBRARY_PATH:" in front itself.
  • aarch64 devices also get the armhf folder, for 32-bit ports. The loader skips libraries of the wrong architecture, so this works even though ports set PORT_32BIT after sourcing control.txt. When it's set before, armhf comes first.
  • An empty LD_LIBRARY_PATH doesn't get an empty entry, which would make the loader search the current folder.
  • PM_FUNCS_VERSION is now 5.

libtheoradec.so.1 (aarch64)

  • libtheora 1.1.1, built from Xiph's release tarballs (sha256 checked) with --disable-telemetry. Distro builds, such as Debian's libtheora0, have telemetry turned on, which needs libcairo.so.2. Most CFWs don't have cairo, so those builds don't load at all.
  • This build needs only libc.so.6 (GLIBC 2.17), and exports the same symbols as Debian's. It's 76 KB stripped.
  • The recipe is in BUILDING_STUFF.md, and the license is in PortMaster/licenses/LICENSE-libtheora.txt (Xiph's COPYING, plus On2's VP3 patent statement).
  • armhf and x86_64 builds aren't included yet. The same recipe should produce them.

Testing

  • tests/test_funcs.py covers PM_LIBRARY_PATH and the LD_LIBRARY_PATH ordering. The full suite passes merged into current main (1,606 tests).
  • Test build 2026-10-21_0069 on AmberELEC (RG351MP): after sourcing control.txt, PM_LIBRARY_PATH is set, and libtheoradec.so.1 loads by name and reports "Xiph.Org libtheora 1.1 20090822 (Thusnelda)".
  • Not yet tried with a port that uses it.

Also fixed: on JELOS, UnofficialOS and AmberELEC, control.txt added :/usr/lib32 to an empty LD_LIBRARY_PATH. The empty entry made the loader search the current folder, which is the port's folder for most ports. Both appends are guarded now, and test_funcs.py checks that no shipped shell file appends the unguarded way.

kloptops and others added 4 commits October 18, 2026 11:34
PortMaster/libs.aarch64, libs.armhf and libs.x86_64 hold libraries
ports often need that some CFWs don't ship (libtheora, which the love
runtime is built against). funcs.txt, which every control.txt sources,
exports PM_LIBRARY_PATH and adds it to the end of LD_LIBRARY_PATH: it
only fills in what the system lacks, and a port that wants it first can
put "$PM_LIBRARY_PATH:" in front itself.

aarch64 devices get the armhf folder too, for 32-bit ports. The loader
skips libraries of the other architecture, so it works although ports
set PORT_32BIT after sourcing control.txt; when it's set before, armhf
comes first. An empty LD_LIBRARY_PATH gets no empty entry (which would
search the current folder).

libs/ stays the runtimes' .squashfs folder. PM_FUNCS_VERSION 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
COPYING (BSD-style) and LICENSE (On2's VP3 patent statement), as they are
in xiph/theora at v1.1.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
libtheora 1.1.1, built from Xiph's release tarball with --disable-telemetry:
distro builds need libcairo.so.2 for it, which most CFWs lack, so they don't
load at all. This one needs only libc.so.6 (GLIBC_2.17), and exports the same
symbols as Debian's. The recipe is in BUILDING_STUFF.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
`LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib32` with it empty made it
":/usr/lib32", and an empty entry makes the loader search the current folder
(the port's, for most ports). Both appends use ${LD_LIBRARY_PATH:+...:} now.

test_funcs.py: no shipped shell file appends to LD_LIBRARY_PATH the bare way,
and the guarded form gives no empty entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
@kloptops
kloptops merged commit efaef9b into PortsMaster:main Oct 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant