summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
-rw-r--r--.config/guix/personal-channel.scm110
1 files changed, 110 insertions, 0 deletions
diff --git a/.config/guix/personal-channel.scm b/.config/guix/personal-channel.scm
new file mode 100644
index 0000000..5a9fcba
--- /dev/null
+++ b/.config/guix/personal-channel.scm
@@ -0,0 +1,110 @@
+(define-module personal-channel)
+
+
+(define-public anki
+ (package
+ (name "anki")
+ ;; Later versions have dependencies on npm packages not yet in Guix.
+ (version "2.1.16")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://apps.ankiweb.net/downloads/archive/anki-"
+ version "-source.tgz"))
+ (sha256
+ (base32 "1gfr51rnllkyzli73p4r51h5ypzfa3m7lic3m3rzpywmqwrxs07k"))
+ (patches (search-patches "anki-mpv-args.patch"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags (list (string-append "PREFIX=" %output))
+ #:tests? #f ;no check target
+ #:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (ice-9 match))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'disable-update-check
+ ;; Don't ‘phone home’ unasked to check for updates.
+ (lambda _
+ (substitute* "aqt/update.py"
+ (("requests\\.post")
+ "throw.an.exception.instead"))
+ #t))
+ (delete 'configure) ;no configure script
+ (add-after 'install 'wrap
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
+ ;; List of paths to the site-packages directories of Python
+ ;; library inputs.
+ (site-packages
+ (map (lambda (pyinput)
+ (string-append
+ (cdr pyinput)
+ "/lib/python"
+ ;; Calculate the python version to avoid breaking
+ ;; with future 3.X releases.
+ ,(version-major+minor
+ (package-version python-wrapper))
+ "/site-packages"))
+ (filter (match-lambda
+ ((label . _)
+ (string-prefix? "python-" label)))
+ inputs)))
+ (qtwebengineprocess
+ (search-input-file inputs
+ "lib/qt5/libexec/QtWebEngineProcess")))
+ ;; The program fails to find the QtWebEngineProcess program, so
+ ;; we set QTWEBENGINEPROCESS_PATH to help it. PYTHONPATH is
+ ;; wrapped to avoid declaring Python libraries as propagated
+ ;; inputs.
+ (for-each (lambda (program)
+ (wrap-program program
+ `("QTWEBENGINEPROCESS_PATH" =
+ (,qtwebengineprocess))
+ `("PATH" prefix (,(string-append
+ (assoc-ref inputs "mpv")
+ "/bin")))
+ `("GUIX_PYTHONPATH" = ,site-packages)))
+ (find-files bin ".")))
+ #t)))))
+ (native-inputs
+ (list xdg-utils))
+ (inputs
+ `(("lame" ,lame)
+ ("mpv" ,mpv)
+ ("python" ,python-wrapper)
+ ("python-beautifulsoup4" ,python-beautifulsoup4)
+ ("python-decorator" ,python-decorator)
+ ("python-distro" ,python-distro)
+ ("python-jsonschema" ,python-jsonschema)
+ ("python-markdown" ,python-markdown)
+ ("python-pyaudio" ,python-pyaudio)
+ ;; `python-pyqtwebengine' must precede `python-pyqt' in PYTHONPATH.
+ ("python-pyqtwebengine" ,python-pyqtwebengine)
+ ("python-pyqt" ,python-pyqt-without-qtwebkit)
+ ("python-requests" ,python-requests)
+ ("python-send2trash" ,python-send2trash)
+ ("python-sip" ,python-sip)
+ ;; `qtwebengine-5' is included in `pyqtwebengine', included here for easy
+ ;; wrapping.
+ ("qtwebengine-5" ,qtwebengine-5)))
+ (home-page "https://apps.ankiweb.net/")
+ (synopsis "Powerful, intelligent flash cards")
+ (description "Anki is a program which makes remembering things
+easy. Because it's 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:
+@itemize
+@item Learning a language
+@item Studying for medical and law exams
+@item Memorizing people's names and faces
+@item Brushing up on geography
+@item Mastering long poems
+@item Even practicing guitar chords!
+@end itemize")
+ (license license:agpl3+)))