Anki 2 was released a couple of days ago. It has loads of improvements over v1, so it would be awesome if it could be added to the tree
I looked at this today and Anki-2 is not distutils based anymore. It comes as-is with bundled python dependencies. Any comments on how to proceed are welcome.
Created attachment 326244 [details] ebuild for anki 2 I have made an ebuild for anki 2. Its probaly not great, as this is only the second one Ive made, but I'm happy to modify anything that needs to be changed. The ebuild doesnt have any use flags, as there is no way to actually configure/build anki. All of ankis dependecies (including the ones in libanki/thirdparty and the ones that anki can run without) are included. I also recomend we file bugs upstream for an usuable makefile, and for the removal of libanki/thirdparty, or at least the removal of dependency on it. Otherwise anki installs, and seems to runs without any errors, although I havent yet tested it extensivly.
Hi. Thanks for this. I know that we can just copy all the stuff using the ebuild, but this is prune to break. For instance if python-3 is the main python interpreter, then anki will not run, even if python-2 is installed. The wrapper script "anki" needs to be rewritten for Gentoo. It would be really great if you could start to inquire upstream about a more distro friendly distribution. Judging from the traffic on the mailing list it is probably not their top priority, though... For everybody coming to this bug to find out about Anki in gentoo, until there is an ebuild you can just unpack it in your home directory and run it from there. I mean, if no installation is necessary, then we don't really need an ebuild.
Created attachment 326348 [details] ebuild for anki 2 I realized anki does not actually depend on the libs in libanki/thirdparty, they are just added to the system path, and so with propper dependencies (specifically >beautifulsoup-4) it doesn't need them at all, hence the ebuild does not install them anymore. The use flags now control the dependecies anki could do without (ie. if you dont have pyaudio then when you try to record it tells you you need pyaudio to record instead of crashing) A simple sed replaces makes anki work equally well with ethier python2 or python3 set as the default python The exec instalation directory has been changed from /usr/local/bin to /usr/bin, as thats where almost all of the binarys go, and at least on my system anki was the only binary installed in /usr/lcoal/bin And lastly the src_install still uses eutil functions to copy the files to the right places, but its not like theres a whole lot of files that need moving, so its fairly simple. Upstream git has already updated the Makefile to support DISTDIR, so when they make a new release we can update our ebuild to use their makefile
Hi Nathan, thanks for your efforts. I have put an updated version into my overlay: https://github.com/tom111/TomOverlay/blob/master/app-misc/anki/anki-2.0.0.ebuild I still want to fix the python install in a better way (maybe using python eclass) before adding it to the tree. (In reply to comment #4) > I realized anki does not actually depend on the libs in libanki/thirdparty, > they are just added to the system path, and so with propper dependencies > (specifically >beautifulsoup-4) it doesn't need them at all, hence the > ebuild does not install them anymore. Do you mean beautifulsoup:python-2 ? Also the dependencie in the ebuild were all explicit (like forbidding versions that are not in the tree anyway). This is not needed, I made them more generic. httplib2 was too low. > The use flags now control the dependecies anki could do without (ie. if you > dont have pyaudio then when you try to record it tells you you need pyaudio > to record instead of crashing) OK > A simple sed replaces makes anki work equally well with ethier python2 or > python3 set as the default python This should probably be done with python.eclass > The exec instalation directory has been changed from /usr/local/bin to > /usr/bin, as thats where almost all of the binarys go, and at least on my > system anki was the only binary installed in /usr/lcoal/bin yes, sure. > And lastly the src_install still uses eutil functions to copy the files to > the right places, but its not like theres a whole lot of files that need > moving, so its fairly simple. Upstream git has already updated the Makefile > to support DISTDIR, so when they make a new release we can update our ebuild > to use their makefile OK. I used some functions from eutils, check it out. Feel free to e-mail me if you have questions about the changes...
(In reply to comment #5) > Do you mean beautifulsoup:python-2 ? I believe that beatfiulsoup4 have a different import header (beautifulsoup4 is called bs4, while beautifulsoup3 is called BeautifulSoup), as well as some other incompatibilities. It may be though that BeautifulSoup4 does not support python2, which would in fact make beautifulsoup3 beautifulsoup:python-2 https://anki.lighthouseapp.com/projects/100923/tickets/90-anki-should-use-beautiful-soup-4
OK, we are almost there. I changed the overlay ebuild again to use python.eclass. Can somebody try it out and give feedback if it works before we expose it to the public? Regarding beautifulsoup, I think beautifulsoup:python-2 is the right slot (in Gentoo).
Just tested your ebuild.. on my system it installs the anki and aqt folders into "/usr/lib64/python3.2/site-packages", which causes the anki binary not to be able to find them, and therefore not be able to run
that is with my default python set to python3, when I changed my default python to python2 and reinstalled it worked. Probably "$(python_get_sitedir)" needs to be changed to its python2 equivalent
Just tested the new Anki ebuild, and I can confirm I have the same problem as Nathan. Running "anki" fails with the following error: Traceback (most recent call last): File "/usr/bin/anki", line 14, in <module> import anki, aqt ImportError: No module named anki Anki installs files in /usr/lib64/python3.2/site-packages/, but I think it's a Python-2 application.
(In reply to comment #10) > Just tested the new Anki ebuild, and I can confirm I have the same problem > as Nathan. Running "anki" fails with the following error: > > Traceback (most recent call last): > File "/usr/bin/anki", line 14, in <module> > import anki, aqt > ImportError: No module named anki > > Anki installs files in /usr/lib64/python3.2/site-packages/, but I think it's > a Python-2 application. OK, I think I fixed that now. Can you try again please. Thanks!
The updated ebuild seems to work for me now, even when my default python is python-3
Now files are correctly put in /usr/lib64/python2.7/site-packages/. I can launch Anki just fine. Beside installation, uninstallation works fine, too. I have yet to learn how to write ebuilds, so I can't help on properly reviewing it. Another thing. I used flags -sound -recording -latex, but icons for inserting recordings and LaTeX formulas are still present in Anki's interface. I'm new to Anki, so I don't know if it's expected behaviour.
(In reply to comment #13) > Now files are correctly put in /usr/lib64/python2.7/site-packages/. I can > launch Anki just fine. Beside installation, uninstallation works fine, too. > I have yet to learn how to write ebuilds, so I can't help on properly > reviewing it. > > Another thing. I used flags -sound -recording -latex, but icons for > inserting recordings and LaTeX formulas are still present in Anki's > interface. I'm new to Anki, so I don't know if it's expected behaviour. Yes that is expected. If you don't have the dependencies than certain parts of Anki will just not work. The developers did not implement hiding them from you or actually deactivating them. Anki-2 is now in tree and should hit the mirrors soon. Please open new bugs for further issues. Thanks everybody. + + 23 Oct 2012; Thomas Kahle <tomka@gentoo.org> +anki-2.0.0.ebuild: + Bump to Anki2. Thanks to all contributors in bug 437548