Skip to content

Commit 659de03

Browse files
committed
WIP: Add endless-key-kolibri-home to build output
To enable this, we need to install `kolibri` in the build systme. It is used to generate a Kolibri home with content from a provided content manifest. Helps: endlessm/endless-key-content-private#97
1 parent 7be6c07 commit 659de03

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ CLEAN_DEPS = \
5757
clean-kolibri \
5858
clean-apps-bundle \
5959
clean-collections \
60+
clean-endless-key-kolibri-home \
6061
clean-local-kolibri-explore-plugin \
6162
clean-loadingScreen
6263
CLEAN_FILES = \
@@ -145,6 +146,20 @@ clean-apps-bundle:
145146
src/apps-bundle: clean-apps-bundle apps-bundle.zip
146147
unzip -qo apps-bundle.zip -d src/apps-bundle
147148

149+
.PHONY: clean-endless-key-kolibri-home
150+
clean-endless-key-kolibri-home:
151+
- rm -rf src/kolibri/dist/home
152+
153+
# This is phony because we are replacing existing files inside src/kolibri :(
154+
.PHONY: src/kolibri/dist/home
155+
src/kolibri/dist/home: export KOLIBRI_HOME = src/kolibri/dist/home
156+
src/kolibri/dist/home: src/collections src/kolibri
157+
rm -rf $@
158+
kolibri manage migrate
159+
cat src/collections/artist-0001.json | jq '.channels[] | .id' | xargs -n1 kolibri manage importchannel network
160+
cat src/collections/artist-0001.json | jq '.channels[] | .id' | xargs -n1 kolibri manage importcontent --manifest=src/collections/artist-0001.json network
161+
yes 'yes' | kolibri manage deprovision
162+
148163
.PHONY: collections.zip
149164
collections.zip:
150165
wget -N https://github.com/endlessm/endless-key-collections/releases/latest/download/collections.zip
@@ -193,6 +208,7 @@ DIST_DEPS = \
193208
src/kolibri \
194209
src/apps-bundle \
195210
src/collections \
211+
src/kolibri/dist/home \
196212
assets/loadingScreen \
197213
needs-version \
198214
dist/version.json

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
cython~=0.29
22
virtualenv
33
git+https://github.com/endlessm/python-for-android@v2022.09.04-endless10#egg=python-for-android
4+
https://github.com/learningequality/kolibri/releases/download/v0.16.0-beta5/kolibri-0.16.0b5-py2.py3-none-any.whl

src/kolibri_android/kolibri_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,17 @@ def _init_kolibri_env():
8181

8282
os.environ["KOLIBRI_CHERRYPY_THREAD_POOL"] = "2"
8383

84+
os.environ["KOLIBRI_CONTENT_FALLBACK_DIRS"] = SCRIPT_PATH.joinpath(
85+
"kolibri", "dist", "home", "content"
86+
).as_posix()
87+
8488
os.environ["KOLIBRI_APPS_BUNDLE_PATH"] = SCRIPT_PATH.joinpath(
8589
"apps-bundle", "apps"
8690
).as_posix()
8791
os.environ["KOLIBRI_CONTENT_COLLECTIONS_PATH"] = SCRIPT_PATH.joinpath(
8892
"collections"
8993
).as_posix()
94+
os.environ["KOLIBRI_HIDE_DISCOVERY_TAB"] = "yes"
9095

9196
node_id = get_android_node_id()
9297

0 commit comments

Comments
 (0)