How to properly install a Linux desktop app?

Tijl Coosemans tijl at FreeBSD.org
Fri Jun 19 08:52:32 UTC 2020


On Fri, 19 Jun 2020 00:00:43 -0400 "Mikhail T." <mi+t at aldan.algebra.com>
wrote:
> Hello!
> 
> I'm preparing a port of a Linux application (Zoom conferencing client).
> 
> The vendor (zoom.us) offers RPMs for both x86_64 and i686, which makes 
> it tempting to just USE_LINUX_RPM. However, that knob unconditionally 
> turns on the USE_LINUX_PREFIX, which bsd.port.mk says /not/ to use "for 
> leaf ports (e.g. a game or program)".
> 
> Not using the USE_LINUX_PREFIX, poses another challenge. Zoom comes with 
> quite a few Linux libraries of its own, which are all dumped into a 
> non-standard location. My port is installing a 
> /compat/linux/etc/ld.so.conf.d/zoom.conf listing that location, but that 
> will be ignored unless ldconfig -- a Linux one -- is invoked, wouldn't 
> it be?
> 
> Finally, if I do rely USE_LINUX_PREFIX and the bulk of the port gets 
> installed under /compat/linux/opt/zoom, there is a problem with the 
> DESKTOP_ENTRIES -- because they would be under /compat/linux too, 
> instead of under ${LOCALBASE}.
> 
>     usr/share/applications/Zoom.desktop
>     usr/share/mime/packages/zoom.xml
>     usr/share/pixmaps/Zoom.png
>     usr/share/pixmaps/application-x-zoom.png
> 
> (I think, the current setting of DESKTOPDIR based on PREFIX is incorrect 
> -- it should be under LOCALBASE instead. But that's a separate story.)
> 
> What are my options with this new port?
> 
>  1. Follow the examples of existing ports (like citrix_ica):
>      1. Do not use the USE_LINUX_RPM.
>      2. Do not bother with Linux' ldconfig.
>      3. Instead of ${LINUXBASE}/etc/ld.so.conf.d/zoom.conf, create the
>         ${PREFIX}/bin/zoom script with LD_LIBRARY_PATH setting. (This
>         will keep the libraries bundled with Zoom unavailable to other
>         Linux programs.)
>  2. An alternative method:
>      1. Do declare the USE_LINUX_RPM (and set the SRC_DISTFILES to empty).
>      2. Install the ${LINUXBASE}/etc/ld.so.conf.d/zoom.conf and declare
>         the USE_LDCONFIG. (This will make the Zoom-libraries available
>         to other Linux apps.)
>      3. Explicitly set DESKTOPDIR based on LOCALBASE.
> 
> Opinions? Thank you! Yours,

You should not use USE_LINUX_RPM.  It's meant for infrastructure ports.
You can look at astro/google-earth as an example.  It also installs an
rpm with an /opt directory.

Basically the /opt directory goes to ${STAGEDIR}${LINUXBASE} and
everything else goes to ${STAGEDIR}${PREFIX}.  You should not need an ld
conf file or ldconfig or LD_LIBRARY_PATH.  The google-earth rpm installs
a symlink from /usr/bin to a script in /opt I believe.  The port
replaces that with a little script in ${PREFIX}/bin that executes the
script in /opt with ${LINUXBASE}/bin/sh.  If Zoom installs a symlink in
/usr/bin you can do something similar.  If it installs a real script
in /usr/bin you can probably install that in ${PREFIX}/bin if you replace
the shebang at the top with ${LINUXBASE}/bin/sh (using REINPLACE_CMD).


More information about the freebsd-emulation mailing list