From 7778cdf9682d18fb44ebf0eba403511e653fa59b Mon Sep 17 00:00:00 2001 From: Lynn Leichtle Date: Sun, 25 Aug 2024 17:31:08 +0200 Subject: [PATCH] old version of anki to build off of for 24.06.3 --- artoria/packages/education.scm | 130 +++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 artoria/packages/education.scm diff --git a/artoria/packages/education.scm b/artoria/packages/education.scm new file mode 100644 index 0000000..3c7e32c --- /dev/null +++ b/artoria/packages/education.scm @@ -0,0 +1,130 @@ +(define-module (artoria packages education) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system python) + #:use-module (guix build-system qt) + #:use-module (guix build-system gnu) + #:use-module (gnu packages qt) + #:use-module (guix utils) + #:use-module (gnu packages audio) + #:use-module (gnu packages video) + #:use-module (gnu packages mp3) ; lame + #:use-module (gnu packages freedesktop) ; xdg-utils + #:use-module (gnu packages python) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module ((guix licenses) #:prefix license:)) +(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")) + (modules '((guix build utils))) + ;; Fix preferences error: . + (snippet '(substitute* "aqt/preferences.py" + (("qc\\['collapseTime']/60\\.0" x) + (format #f "int(~a)" x)) + (("qc\\['timeLim']/60\\.0" x) + (format #f "int(~a)" x)))))) + ;(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 + (list lame + mpv + python-wrapper + python-beautifulsoup4 + python-decorator + python-distro + python-jsonschema + python-markdown + python-pyaudio + ;; `python-pyqtwebengine' must precede `python-pyqt' in PYTHONPATH. + python-pyqtwebengine + python-pyqt + python-requests + python-send2trash + python-sip + ;; `qtwebengine-5' is included in `pyqtwebengine', included here for easy + ;; wrapping. + 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+)))