Re: libreoffice

From: Edward Sanford Sutton, III <mirror176_at_hotmail.com>
Date: Fri, 30 May 2025 09:05:22 UTC
On 4/9/25 15:19, ax disroo wrote:
> On Apr 9, 2025, at 10:12 AM, ax disroo wrote:
>> On Apr 9, 2025, at 9:02 AM, ax disroo wrote:
>>>>> On Apr 8, 2025, at 9:02 AM, LuMiWa wrote:
>>>>
>>>> On FreeBSD 14.2-RELEASE-p1, use binary packages. Why libreoffice
>>>> install openjdk17 and openjdk8, please?
>>> …
>>> Same is happening here. When checked, only found that openjdk8 is a dependency of libreoffice. Will look again …
>>
>> “openjdk8” is (“libjawt.so” via “pkg info -r openjdk8”) in {build,run}-depend list
> 
> Correction: “openjdk8” comes up only as build time dependency (“pretty-print-build-depends-list”), not in “*-run-depends-*”.

openjdk8 is brought in to satisfy build dependency of apache-ant (now 
behind releases by almost 2 years but an update won't address this 
issue). libreoffice build log has

"checking for JAWT lib... -L/usr/local/openjdk17/lib/ -ljawt"

and later in the build it occurs once more as

S=/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-25.2.3.2 && 
I=$S/instdir && W=$S/workdir &&  cc  -shared -Wl,-z,noexecstack 
-Wl,-z,origin '-Wl,-rpath,$ORIGIN' -Wl,-rpath-link,$I/program 
-fstack-protector-strong -Wl,-rpath-link,/lib:/usr/lib -Wl,-z,combreloc 
-Wl,--hash-style=gnu  -Wl,-Bsymbolic-functions 
-L$W/LinkTarget/StaticLibrary -L$I/sdk/lib  -L$I/program  -L$I/program 
-L/usr/local/lib -Wl,--undefined-version -Wl,--undefined-version 
-fstack-protector-strong -L/usr/local/lib    -L/usr/local/lib 
$W/CObject/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.o 
        -Wl,--start-group  -pthread -L/usr/local/openjdk17/lib/ -ljawt 
-Wl,--end-group -Wl,--no-as-needed   -o $I/program/libofficebean.s

Reviewing ldd -a output I find:

/usr/local/lib/libreoffice/program/libofficebean.so:
         libjawt.so => /usr/local/openjdk8/lib/amd64/libjawt.so 
(0x11c8a2ff0000)
         libthr.so.3 => /lib/libthr.so.3 (0x11c8a47ac000)
         libc.so.7 => /lib/libc.so.7 (0x11c8a545f000)

which I presume is related to

[build LNK] Library/libofficebean.so
S=/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-25.2.3.2 && 
I=$S/instdir && W=$S/workdir &&  cc  -shared -Wl,-z,noexecstack 
-Wl,-z,origin '-Wl,-rpath,$ORIGIN' -Wl,-rpath-link,$I/program 
-fstack-protector-strong -Wl,-rpath-link,/lib:/usr/lib -Wl,-z,combreloc 
-Wl,--hash-style=gnu  -Wl,-Bsymbolic-functions 
-L$W/LinkTarget/StaticLibrary -L$I/sdk/lib  -L$I/program  -L$I/program 
-L/usr/local/lib -Wl,--undefined-version -Wl,--undefined-version 
-fstack-protector-strong -L/usr/local/lib    -L/usr/local/lib 
$W/CObject/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.o 
        -Wl,--start-group  -pthread -L/usr/local/openjdk17/lib/ -ljawt 
-Wl,--end-group -Wl,--no-as-needed   -o $I/program/libofficebean.so

I'm too inexperienced in compiling/linking to say why it gets the other 
path or how to fix it but would like to learn. Knowing how to force such 
sequencing is necessary to try to get some ports to build properly 
despite being build without a clean build environment such as poudriere 
or synth provides; some compile against local code, libraries, and even 
run locally installed executables when different ones exist in the work 
directory.

Workarounds could be either getting apache-ant to not depend on a single 
version of java for its dependency if we can control the dependency 
order so java is installed first or create flavors of apache-ant per 
java version.

>> (on FreeBSD stable/14 “m270477-860c84bc7618”) for “editors/libreoffice” port v25.2.2.2.
> 
>