Created attachment 188766 [details]
Hi. This is a work-in-progress update of the LibreOffice port to version 6.0, which is now in beta.
Installation/packaging doesn't work right now, I'm seeing weird C parsing errors:
/usr/include/signal.h:90: syntax error, unexpected RESTRICT, expecting ')' or ',' in 'int sigwait(const sigset_t * _Nonnull restrict,' at 'restrict'
/usr/include/signal.h:91: syntax error, unexpected ')', expecting identifier or '(' or '*' or ';' in ' int * _Nonnull restrict);' at ')'
/usr/include/signal.h:110: syntax error, unexpected identifier, expecting ')' in 'void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);' at 'sigset'
/usr/include/signal.h:110: syntax error, unexpected ')', expecting ',' or ';' in 'void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);' at ')'
/usr/include/pthread.h:154: syntax error, unexpected RESTRICT, expecting ')' or ',' in ' const pthread_attr_t * _Nonnull restrict,' at 'restrict'
But I can run it directly from the stage directory like this:
$ work/stage/usr/local/lib/libreoffice/program/soffice --writer
And it works — actually, it works natively under Wayland! :)
Can someone help me with the install problem? I'm not sure how this error even happens, just running the C preprocessor on these headers of course works fine…
- pdfium is disabled. We have patches for that in www/chromium but I'm not sure how to best apply them (pdfium is extracted in the build process, after the normal patch step);
- I put system cppunit in there, but upgrading the system cppunit (bug 224286) would break other ports, since cppunit dropped the cppunit-config binary. Might make sense to use bundled cppunit here, but I'll look into unbreaking these ports;
- GTK3 is no longer experimental. Ubuntu has been shipping GTK3 LibreOffice since 16.10. I made it default;
- enabled NSS by default in the xmlsec port (bug 224282), using system NSS.
Created attachment 190227 [details]
IT'S RELEASE TIME!
The distro-install-desktop-integration went away. The package builds successfully! cppunit is bundled again.
This still depends on bug 224282 and bug 224284.
I try to build it with patch in bug 224284, it seems doesn't find python:
I do see it has USE= python but I haven't looked into it. May I suggest you try to setup a poudriere instance and try to test port in it?
Som other few points:
- textproc/libqxp00 needs to be added to LIB_DEPENDS
- bug 224286 is closed, do we still need cppunit bundled in this port?
- There seems a unneed comment after "DISTFILES+=" section
If upgrading to major version 6, this should probably go to 6.0.1 instead of 6.0.0 per bug 225797. I haven't attempted to build this change on my test system yet, but if I do I may try updating the patch accordingly. Just wanted to get it on the record in the meantime though.
(In reply to Li-Wen Hsu from comment #2)
I got the Python error with my test build as well. Looks like the issue is that solenv/bin/pack_images.py uses #!/usr/bin/env python. I could patch it to use python2, but I instead added python:lang/python to BUILD_DEPENDS, with this it builds cleanly for me.
I would suggest using USES=shebangfix
Created attachment 190865 [details]
Here's 6.0.1 with shebangfix, libqxp00, system cppunit.
The pdfium comment is kind of a note that we might like to have pdfium built in the future…
BTW, stage-qa complains about unstripped libraries under lib/libreoffice/program.
This is the commit that removed distro-pack-install-strip: https://github.com/LibreOffice/core/commit/0ba869fc5c13a29599fda7eb976b2e7959706e04
Looking at the Arch Linux PKGBUILD, they are just using distro-pack-install and not stripping anything…
(In reply to Greg V from comment #6)
Heh, you and I were working on this at the same time. The only issue I see is that, per bug 224284, LIB_DEPENDS needs port directory names libqxp00 changed to libqxp and libepubgen01 changed to libepubgen.
Running a test build now with your updated patch and the above two changes from mine. Looks good so far, but my test system is not the fastest so it won't finish for a while...
Created attachment 190866 [details]
(In reply to Greg Veldman from comment #7)
Oh they were actually renamed, okay.
Thanks and I'm testing it at my side. In the mean time, please don't forget we also need to update the langpack packages, also note that some of them are not in the editors/ directory.
It doesn't build on 10: https://gist.github.com/7a2c8775094fb949591f9ddc87e523e4
Is there any chance if we can fix this? I guess specify newer compiler may work.
Created attachment 190897 [details]
change disto-pack-install target to use the already-present install-strip target
As a further tweak, I update patch-Makefile.in to make the disto-pack-install target use install-strip instead of install, since it was still there. This undoes the upstream change the other Greg mentioned in comment #6. I'm posting this as a separate patch so as to not obsolete the current version of the larger patch, in case there's a cleaner way to do this.
With v4 of the larger patch, and my followup patch, 6.0.1 builds and installs cleanly on 11.1-RELEASE, and the installed binaries are stripped in accordance with FreeBSD ports guidelines.
(In reply to Li-Wen Hsu from comment #10)
If I'm reading the macros correctly, adding USES=compiler:c++14-lang should trigger it to build with ports llvm (currently set to llvm50 as of r457360) on 10, yes?
(In reply to Greg Veldman from comment #12)
Yes and I just completed a build test with it on 10.4-R i386 and amd64.
I think next step is updating i18n packages, and call for wider testing.
(In reply to Li-Wen Hsu from comment #13)
OK, there may be one other issue. In doing some functional testing of the new build on a fresh 11.1-RELEASE install, running throws some X11 errors and some UI elements don't render correctly. Everything looks good on my main desktop system however (also 11.1-RELEASE). So I think there may be some missing run depends in the new version. I'll try to get those figured out today or tomorrow. If I do, I'll upload a new patch with those added, the USES=compiler option, and the updated patch-Makefile.in (since nobody has objected to that) to strip the binaries.
(In reply to Greg Veldman from comment #14)
Thanks, I'll also do tests on my -CURRENT laptop.
I keep my personal WIP is here: https://github.com/lwhsu/freebsd-ports-libreoffice
You can also check out some modifications there. I am happy to open write access to you if you want. Of course we can use this interface and I will integrate patches and keep here posted.
This update will fix CVE-2018-6871
(In reply to Greg Veldman from comment #14)
So it appears there may have been something in my individual environment that was causing the runtime failures, I do not think this is a general-case problem. Unless any of the other people on copy on this bug see issues, I would agree this is probably ready for broader testing.
Would you like me to submit an updated patch with my tweaks to the other Greg's v4 patch?
(In reply to Greg Veldman from comment #17)
> Would you like me to submit an updated patch with my tweaks to the other Greg's v4 patch?
That will be great, of course.
I have integrated the patches from both of you, with minor tweaks from me, available here: https://github.com/lwhsu/freebsd-ports-libreoffice
If all your changes are in there, then you don't have to go through the whole patching process again. I would like all of us can work on the same base so if you like to write to that repository, let me know and I am happy to config so.
Thanks for verifying it works on 11.1-R (amd64 I guess?) I tested on my -CURRENT laptop but found some UI doesn't work. I cannot check again in this weekend.
So, what the tasks left now:
- test on other supported released version and tier 1 arches.
- update language packages (I found there is new "hsb" package)
- try to upstream local patches (not block updating in the ports tree)
(In reply to Li-Wen Hsu from comment #18)
Yes, amd64 for my desktop. Looks like everything I have is in your working copy at GitHub. If you want to give me write access in case I find anything else, that would be great, my GitHub username is gregsv. I'll continue testing as I have time this weekend, and maybe try to tackle the i18n stuff.
I18n packages updated, built fine in poudriere but haven't tested in X yet.
(In reply to Li-Wen Hsu from comment #18)
> I tested on my -CURRENT laptop but found some UI doesn't work.
Interesting, I wonder if we're seeing the same issue here. In my testing one of the fairly obvious UI elements that was missing was the main menu bar. Is this what you're seeing as well? I'm only able to reproduce this in a specific test case, and after digging into it some more this weekend, I now know what is breaking, though I'm still not sure why. This is the issue I'm seeing:
In vcl/unx/gtk3/gtk3gtkframe.cxx in function ensure_dbus_setup(), there's a call to g_bus_get_sync() to connect to the login session message bus if not already connected (this is on line 601). For some reason this call is failing in one specific test case. If unable to connect to the session bus, ensure_dbus_setup() returns FALSE on line 604. Further down in this function, beginning on line 607, is the code to set up the menus, which is never called in this case.
So the good news is this appears to be a dbus issue and not a problem with this Libreoffice update. I still haven't had time to figure out what's different about this one test case that's causing this issue though.
(In reply to Greg Veldman from comment #21)
I am not sure if we are seeing the same issue. I found some drop-down menu doesn't work, like this:
There should be a button next to "style", "font" and "font", as in 5.x:
I think it's abnormal, at least it is not like 6.x in OSX:
Still need more time to check this issue.
(In reply to Li-Wen Hsu from comment #22)
OK, I can reproduce this one as well. In addition, the scrollbar in my test is also missing (from what I can see in your screenshots, looks like that's the case for you as well).
In the limited time I've had to test this morning, it looks like it's related to the default options switch from GTK2 to GTK3. I can work around the issue. Start libreoffice with the environment variable GTK_DEBUG set to "interactive". In addition to the libreoffice window, this will bring up a GTK debug window. In the objects listing, select the last instance of GtkWindow, then GtkEventBox, then OOoFixed. Select the "Visible" button at the top of the debugger. Change the GTK+ Theme to Raleigh. It doesn't look "good", but at least it restores the missing functionality. It seems to also improve the button decorations in the menus, dialogs, etc.
I have not done a lot of GTK3 debugging, so this is kind of new territory for me personally. If someone else sees this that has more experience and this at least points them in the right direction, that'd be great. Otherwise I'll continue to explore it as I have time. I'm rebuilding LO with internal debug flags turned on now to see if I can get anything more out of it, but I'm not sure if that's really the right place to look at this point.
As an aside, I also have a Debian unstable system, and I installed LO 6 on it (from the Debian repo) and it appears they're shipping it with GTK2. I haven't looked on any other distros.
As at least an interim fix, perhaps we can change the default options back to GTK2 for now. If it works that way, it'd at least get LO 6 into ports (which would be a Good Thing (tm)) now, and we can explore the change to GTK3 later. I think that's my next step on my test VM when my debug build finishes. Greg V, since you opened this initially, care to weigh in at all on this?
(In reply to Greg Veldman from comment #23)
I personally like the idea of fallback to GTK2, and we probably need to keep "experimental" note with GTK3. We can call for help on -x11 and/or -gnome lists.
Updating this port solves CVE-2018-6871 so it's really good to have a working one in the ports tree and on pkg.freebsd.org.
(In reply to Li-Wen Hsu from comment #24)
> Updating this port solves CVE-2018-6871 so it's really good to have a working one in the ports tree and on pkg.freebsd.org.
Yes, I agree completely. I have a new build with GTK2 running now. If it looks like this solves the issues, I'll commit that change to your working copy on GitHub (the build should be done and I should be ready to test later this evening). If it looks like it's going to be too much work to get 6 working, I'll probably open another PR to get 5 updated to the latest patch to fix this vulnerability. But I'd like to get to 6 if we can.
Yeah, I always had the thing with the no borders/background on dropdowns/buttons/checkboxes/etc on GTK3. It's not a problem for me, I actually like the accidental flat design :D
But I wonder if there's something in LibreOffice that sets some GTK property and it's ifdef'd to Linux…
I started this whole patch specifically because I wanted GTK3 — because Wayland.
Sure, you can go ahead with GTK2 for now. Maybe gtk 2 and 3 flavors?
(In reply to Greg V from comment #26)
Yeah, I wouldn't propose taking GTK3 out completely, just making it the non-default option. Since the v5 port currently uses GTK2, this would be the minimal change for the most people, probably good in the interest of getting this updated quickly to patch the WEBSERVICE bug. If we can get the GTK3 stuff figured out, I'm all for changing the default at some point in the future. And if you want it, you'd always be able to set it in your personal ports config and build. ;-)
If both GTK3 and GTK2 are enabled, GTK3 is selected by default. You can manually select it via SAL_USE_VCLPLUGIN environment variable.
Reverting to GTK2 as the default option seems to fix all previously documented issues on 11.1-R, including the dbus issue I found in comment #21. I pushed this change to Li-Wen's staging area on GitHub.
My question is: Is this Bug #197071 included, or is this PR out of time.
Same for this PR Bug#203776.
testbuild on 11.1a looks fine, simple run-test looks fine.
Request for systray in bug #225828.
A commit references this bug:
Date: Sat Mar 17 06:31:20 UTC 2018
New revision: 464758
- Update LibreOffice to 6.0.2 
- Build offline help when DOCS option enabled 
- Fix bad symlink and add missing dependencies 
PR: 224288  197071  226344 
Submitted by: Greg V <email@example.com> 
Reported by: joneum 
Helped & tested by: Daniel Ebdrup
Greg Veldman <firstname.lastname@example.org>
Per olof Ljungmark <email@example.com>