[Bug 298242] editors/libreoffice: 26.2.5.2_2: packaged libreoffice/soffice symlinks fail to resolve

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 06 Sep 2026 13:10:11 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298242

            Bug ID: 298242
           Summary: editors/libreoffice: 26.2.5.2_2: packaged
                    libreoffice/soffice symlinks fail to resolve
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: office@FreeBSD.org
          Reporter: p5B2EA84B3@t-online.de
          Assignee: office@FreeBSD.org
             Flags: maintainer-feedback?(office@FreeBSD.org)

NOTE: This is NOT a new introduced Problem. It is VERY old. There was a PR on
that before, but NOBODY cared. 

The libreoffice-26.2.5.2_2 package installs /usr/local/bin/libreoffice and
/usr/local/bin/soffice as symlinks to ../lib/libreoffice/program/soffice.

Invoking either symlink fails, whereas the package-installed
/usr/local/bin/loffice wrapper works.

This also prevents the LibreOffice applications from starting from the XFCE
application menu, because the desktop files use commands such as:

Exec=libreoffice --writer %U


Installed launchers:

/usr/local/bin/libreoffice -> ../lib/libreoffice/program/soffice
/usr/local/bin/soffice     -> ../lib/libreoffice/program/soffice

/usr/local/bin/loffice is a shell wrapper containing:

#!/bin/sh
/usr/local/lib/libreoffice/program/soffice "$@"

The actual target exists and is executable:

-rwxr-xr-x  root wheel ... /usr/local/lib/libreoffice/program/soffice

Reproduction:

# /usr/local/bin/libreoffice --writer
cd: lrwxr-xr-x  1 root wheel 34 Aug 11 19:02 libreoffice ->
../lib/libreoffice/program: No such file or directory

Likewise:

# /usr/local/bin/soffice --writer
cd: lrwxr-xr-x  1 root wheel 34 Aug 11 19:02 soffice ->
../lib/libreoffice/program: No such file or directory

However:

# /usr/local/bin/loffice --writer

successfully starts LibreOffice Writer.

The LibreOffice soffice script contains symlink-resolution code based on $0,
including:

sd_res="$0"
while [ -h "$sd_res" ] ; do
    sd_dirname=$(dirname "$sd_res")
    cd "$sd_dirname" || exit $?
    sd_basename=$(basename "$sd_res")
    sd_res=$(ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g")
done

The installed package owns /usr/local/bin/libreoffice and
/usr/local/bin/soffice.

As a workaround, replacing /usr/local/bin/libreoffice with a symlink to the
working loffice wrapper makes the XFCE LibreOffice menu entries work:

/usr/local/bin/libreoffice -> loffice

This workaround has to be reapplied after upgrading/reinstalling the
LibreOffice package.

Expected result:

The package-installed libreoffice and soffice launchers should start
LibreOffice normally.

Actual result:

Both package-installed symlinks fail during the symlink-resolution code in
program/soffice.

The behavior above is reproducible with the files as installed by the package.

-- 
You are receiving this mail because:
You are the assignee for the bug.