diff --git a/kiwixbuild/dependencies/__init__.py b/kiwixbuild/dependencies/__init__.py index 81a90fff..42a3b46e 100644 --- a/kiwixbuild/dependencies/__init__.py +++ b/kiwixbuild/dependencies/__init__.py @@ -5,6 +5,7 @@ android_ndk, android_sdk, aria2, + vuejs, armhf, docoptcpp, flatpak, diff --git a/kiwixbuild/dependencies/kiwix_desktop.py b/kiwixbuild/dependencies/kiwix_desktop.py index 73d8edee..30c1a84d 100644 --- a/kiwixbuild/dependencies/kiwix_desktop.py +++ b/kiwixbuild/dependencies/kiwix_desktop.py @@ -12,7 +12,7 @@ class Source(GitClone): git_dir = "kiwix-desktop" class Builder(QMakeBuilder): - dependencies = ["qt", "qtwebengine", "kiwix-lib", "aria2", "kiwix-tools"] + dependencies = ["qt", "qtwebengine", "kiwix-lib", "aria2", "kiwix-tools", "vuejs"] make_install_target = 'install' configure_env = None diff --git a/kiwixbuild/dependencies/vuejs.py b/kiwixbuild/dependencies/vuejs.py new file mode 100644 index 00000000..fb80fa46 --- /dev/null +++ b/kiwixbuild/dependencies/vuejs.py @@ -0,0 +1,37 @@ +import os +from .base import ( + Dependency, + Builder, + Source +) +from kiwixbuild.utils import Remotefile, run_command +from kiwixbuild._global import neutralEnv + +pj = os.path.join + +class VueJs(Dependency): + name = "vuejs" + + class Source(Source): + archive = Remotefile('vue.js', '', 'https://vuejs.org/js/vue.js') + + def _download(self, context): + context.try_skip(neutralEnv('archive_dir'), self.name) + neutralEnv('download')(self.archive) + + def prepare(self): + self.command('download', self._download) + + + class Builder(Builder): + def build(self): + self.command('configure', self._configure) + + def make_dist(self): + pass + + def _configure(self, context): + source_path = pj(neutralEnv('archive_dir'), 'vue.js') + dest_path = pj(neutralEnv('source_dir'), 'kiwix-desktop', 'resources', 'js', 'vue.js') + if os.path.exists(source_path) and os.path.exists(dest_path): + os.rename(source_path, dest_path) \ No newline at end of file