Re: Building a Linuxulator userland from source

From: Felix Palmen <zirias_at_freebsd.org>
Date: Fri, 01 Sep 2023 14:55:46 UTC
* Felix Palmen <zirias@freebsd.org> [20230820 12:35]:
> Just a little update on this [...]

Posting yet another status update because I'm about to reach a
"milestone": I just had the first successful build of ffmpeg. I focused
on ffmpeg because that's a requirement for MakeMKV which I now intend to
use as a first PoC for the new userland. Before proceeding there, doing
test builds now on all supported architectures and FreeBSD versions, so
I'll have to wait quite a while ;)

The new Linux ffmpeg port has almost everything enabled that's in the
default options of the FreeBSD ffmpeg port. I just left out very few
things that seemed *too* complex right now, like e.g. Vulkan.

To get there, I created a total of 150 ports now. Still, test-building
this ffmpeg "only" wants to build 124 ports, probably because of Xorg
libraries, once I noticed I need them, I created ports for *all* of
them.

A selection of what I added:

* Languages: TCL, Python, Perl
* Build systems: autoreconf, cmake, meson, ninja (all usable with their
  standard USES, my new USES adjusts what's needed to do Linux builds)
* Lots of "codec" libs: lame, opus, ogg/vorbis, vpx, x264, x265, ...
* Infrastructure libs like libdrm, libglvnd, alsa, v4l, ...

A first takeaway could be that indeed, this will be kind of yet another
Linux distribution, as mentioned in sceptical responses so far. I still
hope it will be possible to limit the scope, we'd only need ports
providing shared libraries that (closed-source or otherwise not
portable) Linux software would need to run in Linuxulator. That said,
there's probably still a lot missing, like e.g mesa-dri (for games and
similar), gtk3/gtk4/qt5 (for GUI apps that aren't statically linked),
and so on.

On the plus side, a lot of ports could be created by just copying the
original port and doing adjustments, and most of the time, the result
was simpler than the original (e.g. almost all patches could be
dropped). I also removed all port options, still unsure whether they
*might* make sense later, but for a first PoC, they just add unnecessary
complexity.

There were almost no surprising build issues so far (so, I guess
accidentally pulling in things from FreeBSD base really isn't a thing,
at least not when building in poudriere), except for one: It seems a
"relative" rpath (using $ORIGIN) doesn't work. To work around this with
one port using that during build, I had to add some explicit
LD_LIBRARY_PATH.

Cheers, Felix

-- 
 Felix Palmen <zirias@FreeBSD.org>     {private}   felix@palmen-it.de
 -- ports committer --                     {web}  http://palmen-it.de
 {pgp public key}  http://palmen-it.de/pub.txt
 {pgp fingerprint} 6936 13D5 5BBF 4837 B212  3ACC 54AD E006 9879 F231