# HG changeset patch # User Oleksandr Gavenko # Date 1499466060 -10800 # Node ID ebba66b977b6567e7f52872664aabbbece50f490 # Parent 1355b4b6cadc6ba0bd60b6294d78d330371f9cad Ported Anki decks build to Cygwin+Windows. Added corresponding docs. diff -r 1355b4b6cadc -r ebba66b977b6 Makefile --- a/Makefile Sat Jul 08 01:19:51 2017 +0300 +++ b/Makefile Sat Jul 08 01:21:00 2017 +0300 @@ -112,6 +112,10 @@ LATEX2PDF := pdflatex +ifeq '$(ANKI_PY_DIR)' '' + ANKI_PY_DIR := /usr/share/anki +endif + ################################################################ # Install paths. @@ -618,17 +622,17 @@ # Specific rules (due to renames or other customization). dist/anki/gadict.apkg: gadict.gadict $(GADICT_DEL_FILE) py/gadict.py py/gadict_srs_anki.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/ - PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py -name="gadict_en-ru+uk" -rich $(GADICT_DEL_OPT) $(FREQLIST_OPT) $< $@ + PYTHONPATH=$(ANKI_PY_DIR): python -B py/gadict_srs_anki.py -name="gadict_en-ru+uk" -rich $(GADICT_DEL_OPT) $(FREQLIST_OPT) $< $@ dist/anki/gadict_voa.apkg: gadict_voa.gadict py/gadict.py py/gadict_srs_anki.py $(VOA_FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/ - PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py -name="gadict_voa" $(VOA_FREQLIST_OPT) $< $@ + PYTHONPATH=$(ANKI_PY_DIR): python -B py/gadict_srs_anki.py -name="gadict_voa" $(VOA_FREQLIST_OPT) $< $@ # General rules. dist/anki/%.apkg: %.gadict %.del py/gadict.py py/gadict_srs_anki.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/ - PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py -name=$* -rich -delfile=$*.del $(FREQLIST_OPT) $< $@ + PYTHONPATH=$(ANKI_PY_DIR): python -B py/gadict_srs_anki.py -name=$* -rich -delfile=$*.del $(FREQLIST_OPT) $< $@ dist/anki/%.apkg: %.gadict py/gadict.py py/gadict_srs_anki.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/ - PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py -name=$* -rich $(FREQLIST_OPT) $< $@ + PYTHONPATH=$(ANKI_PY_DIR): python -B py/gadict_srs_anki.py -name=$* -rich $(FREQLIST_OPT) $< $@ .PHONY: tab tab: $(SRS_TAB_FILES) diff -r 1355b4b6cadc -r ebba66b977b6 www/HACKING.rst --- a/www/HACKING.rst Sat Jul 08 01:19:51 2017 +0300 +++ b/www/HACKING.rst Sat Jul 08 01:21:00 2017 +0300 @@ -37,6 +37,31 @@ https://sourceforge.net/p/gadict/code/ Sourceforge Allure interface (not primary, a mirror). +Building project +================ + +``gadict`` project provides dictionaries encoded in custom format. In order to +precess them you need GNU Make and Python 2.7 and possibly other tools. + +To produce dictionaries in ``dictd`` format you need to install ``dictd`` +dictribution with ``dictfmt`` and ``dictzip`` utilities and run:: + + $ make dict + +To produce Anki decks install Anki v... on Linux or get Anki sources at specific +version (before port to Python 3):: + + $ git clone https://github.com/dae/anki.git + $ git co 15b349e3^ + +and put path to Anki project source dir inside ``Makefile.config``:: + + ANKI_PY_DIR := $(HOME)/devel/anki + +Build command to make Anki deks is:: + + $ make anki + Dictionary source file format =============================