vym icon indicating copy to clipboard operation
vym copied to clipboard

Fix: do not install manpage in doc dir

Open hoexter opened this issue 1 year ago • 4 comments

This solves two issues: a) Avoids adding the manpage also to the ${CMAKE_INSTALL_DOCDIR} while it only belongs into the manpage folder. b) Does not create a "doc" subfolder inside the ${CMAKE_INSTALL_DOCDIR}. E.g. when CMAKE_INSTALL_DOCDIR=/usr/share/doc/vym the documentation pdfs end up in /usr/share/doc/vym/doc/ which is not checked for by the in application Menu item to access the user guide.

Drawback: the file list has to be updated when new files appear in the doc folder in the source tree.

Alternative, if you do not consider b) or want to not do b) at all, could be: install(DIRECTORY doc DESTINATION ${CMAKE_INSTALL_DOCDIR} FILES_MATCHING PATTERN "*.pdf") which would just avoid a) from happening.

hoexter avatar May 04 '24 14:05 hoexter

Thanks, I'd prefer the latter option with matching only *.pdf. Not sure if anybody soon creates another translation, but it would be better not to overlook the installation then. Can you adapt that?

Nice catch btw with doc within doc, never noticed that...

insilmaril avatar May 04 '24 19:05 insilmaril

Ok I think I finally found a nice solution to tackle both issues. There is the option to use a trailing / at the src folder which instructs cmake to only copy the directory contents, but not the directory itself. That is of course a behaviour change and I don't know if that will break workarounds someone else might have added to his packaging.

hoexter avatar May 05 '24 09:05 hoexter

Thanks! I'll check this for the packages I build in OBS, I am going to merge here soon

insilmaril avatar May 05 '24 11:05 insilmaril

Took a look at the .deb package on OBS and now I see why you'll likely prefer a solution without the trailing /. Since you're building for /usr/local you put a lot of architecture independent data into /usr/local/share/vym and there the doc subdirectory makes sense. The build result is currently the following:

drwxr-xr-x root/root         0 2023-08-29 19:18 ./usr/local/share/vym/doc/
-rw-r--r-- root/root      1082 2023-08-29 16:22 ./usr/local/share/vym/doc/vym.1.gz
-rw-r--r-- root/root   1902995 2023-08-29 16:22 ./usr/local/share/vym/doc/vym.pdf
-rw-r--r-- root/root    774886 2023-08-29 16:22 ./usr/local/share/vym/doc/vym_es.pdf
-rw-r--r-- root/root    990732 2023-08-29 16:22 ./usr/local/share/vym/doc/vym_fr.pdf

At least in Debian we ship documentation in /usr/share/doc/vym thus I need to modify that slightly in my packaging, but that is ok. So really the "improvement" to gain is to not ship the manpage twice.

Beside of that I peaked into the logic of how and when the pdf files are opened from the menu and I found a special handling for the spanish translation in https://github.com/insilmaril/vym/blob/release/src/mainwindow.cpp#L7010, but it seems a similar handling for the french translation is missing. Not sure if that is intentional or not since I don't know the history of the translation efforts.

hoexter avatar May 05 '24 13:05 hoexter

Good catch with the french pdf, thanks!

Just added that in 201ca770d7bfe214515f408df2a8ae358e9be6d1

insilmaril avatar May 10 '24 15:05 insilmaril