summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2013-01-04 03:48:47 +0000
committerJan Malakhovski <oxij@oxij.org>2013-01-04 03:48:47 +0000
commite00c03101f8d052473fee17e5f7a6a975dc5edb4 (patch)
treef922ead86b224411cc70ba2df8df9c95c6659c63 /pkgs
parentef926f21e635fa8ce7be385f11ffdf108eeea91b (diff)
downloadnixpkgs-e00c03101f8d052473fee17e5f7a6a975dc5edb4.tar
nixpkgs-e00c03101f8d052473fee17e5f7a6a975dc5edb4.tar.gz
nixpkgs-e00c03101f8d052473fee17e5f7a6a975dc5edb4.tar.bz2
nixpkgs-e00c03101f8d052473fee17e5f7a6a975dc5edb4.tar.lz
nixpkgs-e00c03101f8d052473fee17e5f7a6a975dc5edb4.tar.xz
nixpkgs-e00c03101f8d052473fee17e5f7a6a975dc5edb4.tar.zst
nixpkgs-e00c03101f8d052473fee17e5f7a6a975dc5edb4.zip
anki: add version 2.0.3
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/games/anki/default.nix67
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix
new file mode 100644
index 00000000000..d2e438dfa7b
--- /dev/null
+++ b/pkgs/games/anki/default.nix
@@ -0,0 +1,67 @@
+{ stdenv, lib, fetchurl
+, 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 {
+    name = "anki-2.0.3";
+    src = fetchurl {
+      url = "http://ankisrs.net/download/mirror/${name}.tgz";
+      sha256 = "f40ee4ef29c91101cf9978ce7bd4c513f13ca7c77497a3fb50b8128adf3a5178";
+    };
+
+    pythonPath = [ pyqt4 py.pysqlite py.sqlalchemy ]
+              ++ lib.optional plotsSupport py.matplotlib;
+
+    buildInputs = [ python py.wrapPython ];
+
+    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 = ''
+      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";
+    };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ff1c4ab177e..df1a4e1f5fc 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -8166,6 +8166,8 @@ let
 
   andyetitmoves = if stdenv.isLinux then callPackage ../games/andyetitmoves {} else null;
 
+  anki = callPackage ../games/anki { };
+
   asc = callPackage ../games/asc {
     lua = lua5;
     libsigcxx = libsigcxx12;