Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 579054 - app-dicts/myspell-ru-20150711: should create ru_RU.{dic,aff} symlinks
Summary: app-dicts/myspell-ru-20150711: should create ru_RU.{dic,aff} symlinks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Perfect Gentleman
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-04 22:31 UTC by Igor Poboiko
Modified: 2016-05-10 06:19 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
myspell-ru-20150711-r1.ebuild (myspell-ru-20150711.ebuild,950 bytes, text/plain)
2016-05-01 22:18 UTC, Perfect Gentleman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Poboiko 2016-04-04 22:31:32 UTC
Currently app-dicts/myspell-ru installs "russian-aot.dic" and "russian-aot.aff" files into /usr/share/myspell/ directory. With that setup hunspell cannot find it by default:
> Can't open affix or dictionary files for dictionary named "ru_RU".

Hunspell is not the only one who is affected with that; e.g. app-office/libreoffice-5.1.1.3 cannot find it too; neither does app-office/lyx-2.1.4. 
Making ru_RU.{dic,aff} symlinks fixes the problem for everyone. 
I believe ebuild should do this.


hunspell does, however, find it via "hunspell -D":
> AVAILABLE DICTIONARIES (path is not mandatory for -d option):
> [...]
> /usr/share/myspell/russian-aot

Also KDE software does find it too (e.g kde-apps/kwrite-15.12.3).
Pretty weird though.
Comment 1 Perfect Gentleman 2016-04-05 09:46:37 UTC
(In reply to Igor Poboiko from comment #0)
> Currently app-dicts/myspell-ru installs "russian-aot.dic" and
> "russian-aot.aff" files into /usr/share/myspell/ directory. With that setup
> hunspell cannot find it by default:
> > Can't open affix or dictionary files for dictionary named "ru_RU".
> 
> Hunspell is not the only one who is affected with that; e.g.
> app-office/libreoffice-5.1.1.3 cannot find it too; neither does
> app-office/lyx-2.1.4. 
> Making ru_RU.{dic,aff} symlinks fixes the problem for everyone. 
> I believe ebuild should do this.
> 
> 
> hunspell does, however, find it via "hunspell -D":
> > AVAILABLE DICTIONARIES (path is not mandatory for -d option):
> > [...]
> > /usr/share/myspell/russian-aot
> 
> Also KDE software does find it too (e.g kde-apps/kwrite-15.12.3).
> Pretty weird though.

where should be symlinks created?
Comment 2 Igor Poboiko 2016-04-05 11:56:05 UTC
Creating symlinks in "/usr/share/myspell" did the trick for me.
Comment 3 Perfect Gentleman 2016-04-05 16:12:48 UTC
(In reply to Igor Poboiko from comment #2)
> Creating symlinks in "/usr/share/myspell" did the trick for me.

honestly, i don't know how to implement that feature. it is needed to modify myspell-r2.eclass because creating symlink is implemented there
Comment 4 Sam Jorna (wraeth) gentoo-dev 2016-04-06 01:04:16 UTC
(In reply to Perfect Gentleman from comment #3)
> (In reply to Igor Poboiko from comment #2)
> > Creating symlinks in "/usr/share/myspell" did the trick for me.
> 
> honestly, i don't know how to implement that feature. it is needed to modify
> myspell-r2.eclass because creating symlink is implemented there

You can create symlinks during src_install() using dosym [0] which operates effectively the same as `ln -s`.

0: https://devmanual.gentoo.org/function-reference/install-functions/
Comment 5 Perfect Gentleman 2016-04-06 02:19:55 UTC
(In reply to Sam Jorna (wraeth) from comment #4)
> (In reply to Perfect Gentleman from comment #3)
> > (In reply to Igor Poboiko from comment #2)
> > > Creating symlinks in "/usr/share/myspell" did the trick for me.
> > 
> > honestly, i don't know how to implement that feature. it is needed to modify
> > myspell-r2.eclass because creating symlink is implemented there
> 
> You can create symlinks during src_install() using dosym [0] which operates
> effectively the same as `ln -s`.
> 
> 0: https://devmanual.gentoo.org/function-reference/install-functions/

I tried that, but the symlinks were the only things installed.
Comment 6 Sam Jorna (wraeth) gentoo-dev 2016-04-06 02:35:28 UTC
(In reply to Perfect Gentleman from comment #5)
> I tried that, but the symlinks were the only things installed.

When not defined, src_install() calls a default definition for the phase. If you then define src_install() in the ebuild, you overwrite that default and then need to either write a manual install process in src_install() or (preferrably) call the relevant 'default' install function in addition to the bits you're adding:

> src_install() {
>     default
>     dosym /my_path /my_link
> }

Note that which default you use depends on the build system and eclasses - 'default' calls src_install() as defined by PMS [0] whereas eclasses often export an '${eclass_name}-src_install' phase function.

0: https://projects.gentoo.org/pms/6/pms.html#x1-1030009.1.9
Comment 7 Perfect Gentleman 2016-04-06 02:40:36 UTC
(In reply to Sam Jorna (wraeth) from comment #6)
> (In reply to Perfect Gentleman from comment #5)
> > I tried that, but the symlinks were the only things installed.
> 
> When not defined, src_install() calls a default definition for the phase. If
> you then define src_install() in the ebuild, you overwrite that default and
> then need to either write a manual install process in src_install() or
> (preferrably) call the relevant 'default' install function in addition to
> the bits you're adding:
> 
> > src_install() {
> >     default
> >     dosym /my_path /my_link
> > }
> 
> Note that which default you use depends on the build system and eclasses -
> 'default' calls src_install() as defined by PMS [0] whereas eclasses often
> export an '${eclass_name}-src_install' phase function.
> 
> 0: https://projects.gentoo.org/pms/6/pms.html#x1-1030009.1.9

tried that too, the result was the same as in message above.
Comment 8 Perfect Gentleman 2016-04-06 02:45:24 UTC
(In reply to Perfect Gentleman from comment #7)
> (In reply to Sam Jorna (wraeth) from comment #6)
> > (In reply to Perfect Gentleman from comment #5)
> > > I tried that, but the symlinks were the only things installed.
> > 
> > When not defined, src_install() calls a default definition for the phase. If
> > you then define src_install() in the ebuild, you overwrite that default and
> > then need to either write a manual install process in src_install() or
> > (preferrably) call the relevant 'default' install function in addition to
> > the bits you're adding:
> > 
> > > src_install() {
> > >     default
> > >     dosym /my_path /my_link
> > > }
> > 
> > Note that which default you use depends on the build system and eclasses -
> > 'default' calls src_install() as defined by PMS [0] whereas eclasses often
> > export an '${eclass_name}-src_install' phase function.
> > 
> > 0: https://projects.gentoo.org/pms/6/pms.html#x1-1030009.1.9
> 
> tried that too, the result was the same as in message above.

src_install() {
	default
	dosym /usr/share/hunspell/russian-aot.dic /usr/share/myspell/ru_RU.dic
	dosym /usr/share/hunspell/russian-aot.aff /usr/share/myspell/ru_RU.aff
}

$ sudo ls /tmp/portage/app-dicts/myspell-ru-20150711/image/usr/share/myspell
ru_RU.aff  ru_RU.dic
Comment 9 Ian Delaney (RETIRED) gentoo-dev 2016-04-14 12:24:36 UTC
It is not clear what your previous comment is illustrating here.  It appears to me that these are proving the links were in fact created.

What is the current state here?
Comment 10 Perfect Gentleman 2016-04-14 12:27:05 UTC
(In reply to Ian Delaney from comment #9)
> It is not clear what your previous comment is illustrating here.  It appears
> to me that these are proving the links were in fact created.
> 
> What is the current state here?

as i wrote above, the symlinks are the only instances that are created with modified ebuild, i.e. no files at all, only these two symlinks.
Comment 11 Sam Jorna (wraeth) gentoo-dev 2016-04-26 00:36:13 UTC
(In reply to Sam Jorna (wraeth) from comment #6)
> Note that which default you use depends on the build system and eclasses -
> 'default' calls src_install() as defined by PMS [0] whereas eclasses often
> export an '${eclass_name}-src_install' phase function.

(In reply to Perfect Gentleman from comment #10)
> as i wrote above, the symlinks are the only instances that are created with
> modified ebuild, i.e. no files at all, only these two symlinks.

It seems I gave some incorrect information here - my apologies.

The `default` keyword calls the PMS defined default implementation of a phase function, which in this case is not what you want. Instead, src_install() should call `myspell-r2_src_install` to perform the normal installation that would be done if src_install() wasn't defined at all, and then create the symlinks.

In short, replace `default` with `myspell-r2_src_install`.
Comment 12 Perfect Gentleman 2016-05-01 22:17:22 UTC
correct ebuild
Comment 13 Perfect Gentleman 2016-05-01 22:18:09 UTC
Created attachment 432884 [details]
myspell-ru-20150711-r1.ebuild

myspell-ru-20150711-r1.ebuild
Comment 14 Ian Delaney (RETIRED) gentoo-dev 2016-05-10 06:19:28 UTC
commit 4b734c15c4edb28f5baaacc9dfd0828e85ab6151
Author: Ian Delaney <idella4@gentoo.org>
Date:   Tue May 10 14:10:16 2016 +0800

    app-dicts/myspell-ru: rebump -> myspell-ru-20150711-r1.ebuild
    
    upgrade src_install, add symlinks to the dictionary files
    patch supplied by proxied maintainer via the gentoo bug
    
    Gentoo-bug: #579054