2015-05-27 21:42:15 +02:00
|
|
|
{ stdenv, lib, fetchurl, lame, mplayer, libpulseaudio, portaudio
|
2013-01-04 04:48:47 +01:00
|
|
|
, python, pyqt4, pythonPackages
|
|
|
|
# This little flag adds a huge number of dependencies, but we assume that
|
|
|
|
# everyone wants Anki to draw plots with statistics by default.
|
|
|
|
, plotsSupport ? true }:
|
|
|
|
|
|
|
|
let
|
|
|
|
py = pythonPackages;
|
2015-03-28 10:29:22 +01:00
|
|
|
version = "2.0.32";
|
2013-01-04 04:48:47 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2014-02-08 19:17:18 +01:00
|
|
|
name = "anki-${version}";
|
2013-01-04 04:48:47 +01:00
|
|
|
src = fetchurl {
|
2014-10-23 12:54:15 +02:00
|
|
|
urls = [
|
|
|
|
"http://ankisrs.net/download/mirror/${name}.tgz"
|
|
|
|
"http://ankisrs.net/download/mirror/archive/${name}.tgz"
|
|
|
|
];
|
2015-03-28 10:29:22 +01:00
|
|
|
sha256 = "0g5rmg0yqh40a3g8ci3y3if7vw4jl5nrpq8ki1a13a3xmgch13rr";
|
2013-01-04 04:48:47 +01:00
|
|
|
};
|
|
|
|
|
2015-05-11 23:29:19 +02:00
|
|
|
pythonPath = [ pyqt4 py.pysqlite py.sqlalchemy9 py.pyaudio ]
|
2013-01-04 04:48:47 +01:00
|
|
|
++ lib.optional plotsSupport py.matplotlib;
|
|
|
|
|
2015-05-27 21:42:15 +02:00
|
|
|
buildInputs = [ python py.wrapPython lame mplayer libpulseaudio ];
|
2013-01-04 04:48:47 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace anki \
|
|
|
|
--replace /usr/share/ $out/share/
|
|
|
|
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace PREFIX=/usr PREFIX=$out \
|
|
|
|
--replace /local/bin/ /bin/
|
|
|
|
|
|
|
|
sed -i '/xdg-mime/ d' Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
mkdir -p $out/share/man/man1
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2013-09-22 19:22:49 +02:00
|
|
|
mkdir -p "$out/lib/${python.libPrefix}/site-packages"
|
2015-05-11 23:30:15 +02:00
|
|
|
ln -s "$out/share/anki/"* $out/lib/${python.libPrefix}/site-packages/
|
2013-09-22 19:22:49 +02:00
|
|
|
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
|
2013-01-04 04:48:47 +01:00
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://ankisrs.net/;
|
|
|
|
description = "Spaced repetition flashcard program";
|
2015-05-11 23:30:50 +02:00
|
|
|
license = stdenv.lib.licenses.gpl3;
|
|
|
|
|
2013-01-04 04:48:47 +01:00
|
|
|
longDescription = ''
|
|
|
|
Anki is a program which makes remembering things easy. Because it is a lot
|
|
|
|
more efficient than traditional study methods, you can either greatly
|
|
|
|
decrease your time spent studying, or greatly increase the amount you learn.
|
|
|
|
|
|
|
|
Anyone who needs to remember things in their daily life can benefit from
|
2014-02-08 19:17:18 +01:00
|
|
|
Anki. Since it is content-agnostic and supports images, audio, videos and
|
2013-01-04 04:48:47 +01:00
|
|
|
scientific markup (via LaTeX), the possibilities are endless. For example:
|
2015-05-11 23:30:50 +02:00
|
|
|
learning a language, studying for medical and law exams, memorizing
|
|
|
|
people's names and faces, brushing up on geography, mastering long poems,
|
|
|
|
or even practicing guitar chords!
|
2013-01-04 04:48:47 +01:00
|
|
|
'';
|
2015-05-11 23:30:50 +02:00
|
|
|
|
2013-12-09 01:16:42 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
|
2013-10-07 17:36:47 +02:00
|
|
|
platforms = stdenv.lib.platforms.mesaPlatforms;
|
2013-01-04 04:48:47 +01:00
|
|
|
};
|
|
|
|
}
|