Page MenuHomeFreeBSD

editors/openoffice-devel fails to build with libreoffice installed
ClosedPublic

Authored by truckman on Feb 24 2015, 6:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jan 22, 2:17 PM
Unknown Object (File)
Jan 13 2025, 4:02 PM
Unknown Object (File)
Dec 5 2024, 6:31 PM
Unknown Object (File)
Dec 5 2024, 10:36 AM
Unknown Object (File)
Nov 22 2024, 3:11 PM
Unknown Object (File)
Nov 22 2024, 3:11 PM
Unknown Object (File)
Nov 22 2024, 3:11 PM
Unknown Object (File)
Nov 22 2024, 2:51 PM
Subscribers
None

Details

Summary

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195967

The problem is that libreoffice installs its own copy of unopkg in
${PREFIX}/bin and that the openoffice build attempts to use this copy
of unopkg instead of the openoffice version which is in subdirectory
of ${WRKSRC}.

The reason is that the openoffice build expects to find its own copy
of unopkg by depending on having "." in its $PATH, but its $PATH has
${PREFIX}/bin before ".". Openoffice attempts to do the right thing
by first constructing $PATH by prepending "." and a small number of
other directories where it stashes executables used during the build
to the value of $PATH that it inherits from the environment. Things
go wrong when it tries to add the paths for ${CC}, perl, and java
to $PATH. If $PATH has /usr/bin before ${PREFIX}/bin, the openoffice
build finds the perl symlink in /usr/bin before it finds perl in
${PREFIX}/bin, so it prepends ${PREFIX}/bin to $PATH to try to ensure
that the correct version of perl will be found first. This moves
${PREFIX}/bin earlier in $PATH than ".".

The operation to put the path to ${CC} in $PATH has a different
problem. It uses the variable COMPATH for this, which is the dirname
of the patch to $CC, with the trailing /bin stripped off. That
results in /usr/local being added to $PATH, which is nonsensical,
though mostly harmless.

There are three fixes here:

  • Always keep the parts of $PATH for the directories under ${WRKSRC},

including "." at the beginning of the path.

  • Ignore symlinks to executables when deciding to prepend a directory

to the path.

  • Append "/bin" when using COMPATH so that the result points to

the directory where ${CC} actually resides. There is actually
another variable CC_PATH, but it has an extra trailing "/", so it
doesn't match ${PREFIX}/bin.

Test Plan

Add libreoffice to BUILD_DEPENDS and build the port with poudriere.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

truckman retitled this revision from to editors/openoffice-devel fails to build with libreoffice installed.
truckman updated this object.
truckman edited the test plan for this revision. (Show Details)
truckman added reviewers: mat, pfg.
mat edited edge metadata.

You could do only one code review for both -4 and -devel ports, in these cases :-)

This revision is now accepted and ready to land.Feb 24 2015, 4:16 PM
pfg edited edge metadata.
truckman updated this revision to Diff 3971.

Closed by commit rP379874 (authored by @truckman).