From c44a2a4d7d27cdfe130e85e49e36c2757a20e3cc Mon Sep 17 00:00:00 2001 From: luddens Date: Mon, 18 May 2020 09:50:49 +0200 Subject: [PATCH] add vuejs as kiwix-desktop dependency --- kiwixbuild/dependencies/__init__.py | 1 + kiwixbuild/dependencies/base.py | 1 - kiwixbuild/dependencies/kiwix_desktop.py | 2 +- kiwixbuild/dependencies/vuejs.py | 35 ++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 kiwixbuild/dependencies/vuejs.py 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/base.py b/kiwixbuild/dependencies/base.py index 0015c199..4b5863dc 100644 --- a/kiwixbuild/dependencies/base.py +++ b/kiwixbuild/dependencies/base.py @@ -299,7 +299,6 @@ def build(self): def make_dist(self): pass - class MakeBuilder(Builder): configure_option_template = "{dep_options} {static_option} {env_option} --prefix {install_dir} --libdir {libdir}" configure_option = "" 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..ca2a8fdd --- /dev/null +++ b/kiwixbuild/dependencies/vuejs.py @@ -0,0 +1,35 @@ +import os +from .base import ( + Dependency, + # SimpleDownload, + 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): + os.rename(pj(neutralEnv('archive_dir'), 'vue.js'), pj(neutralEnv('source_dir'), 'kiwix-desktop', 'resources', 'js', 'vue.js')) \ No newline at end of file