2013-09-22 18:22:49 +01:00
|
|
|
{ stdenv, lib, fetchurl, lame, mplayer, pulseaudio, portaudio
|
2013-01-04 03:48:47 +00: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;
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2013-09-22 18:22:49 +01:00
|
|
|
name = "anki-2.0.12";
|
2013-01-04 03:48:47 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://ankisrs.net/download/mirror/${name}.tgz";
|
2013-09-22 18:22:49 +01:00
|
|
|
sha256 = "1pccws3rgfpyxdx5xph5x72c4a46is0alfz73icn9ppgjdizzipr";
|
2013-01-04 03:48:47 +00:00
|
|
|
};
|
|
|
|
|
2013-09-22 18:22:49 +01:00
|
|
|
pythonPath = [ pyqt4 py.pysqlite py.sqlalchemy py.pyaudio ]
|
2013-01-04 03:48:47 +00:00
|
|
|
++ lib.optional plotsSupport py.matplotlib;
|
|
|
|
|
2013-09-22 18:22:49 +01:00
|
|
|
buildInputs = [ python py.wrapPython lame mplayer pulseaudio ];
|
2013-01-04 03:48:47 +00: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 18:22:49 +01:00
|
|
|
mkdir -p "$out/lib/${python.libPrefix}/site-packages"
|
|
|
|
ln -s $out/share/anki/* $out/lib/${python.libPrefix}/site-packages/
|
|
|
|
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
|
2013-01-04 03:48:47 +00:00
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://ankisrs.net/;
|
|
|
|
description = "Spaced repetition flashcard program";
|
|
|
|
# Copy-pasted from the homepage
|
|
|
|
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
|
|
|
|
Anki. Since it is content-agnostic and supports images, audio, videos and
|
|
|
|
scientific markup (via LaTeX), the possibilities are endless. For example:
|
|
|
|
|
|
|
|
* learning a language
|
|
|
|
* studying for medical and law exams
|
|
|
|
* memorizing people's names and faces
|
|
|
|
* brushing up on geography
|
|
|
|
* mastering long poems
|
|
|
|
* even practicing guitar chords!
|
|
|
|
'';
|
|
|
|
license = "GPLv3";
|
2013-10-07 16:36:47 +01:00
|
|
|
platforms = stdenv.lib.platforms.mesaPlatforms;
|
2013-01-04 03:48:47 +00:00
|
|
|
};
|
|
|
|
}
|