Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vuejs as kiwix-desktop dependency #442

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kiwixbuild/dependencies/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
android_ndk,
android_sdk,
aria2,
vuejs,
armhf,
docoptcpp,
flatpak,
Expand Down
2 changes: 1 addition & 1 deletion kiwixbuild/dependencies/kiwix_desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
37 changes: 37 additions & 0 deletions kiwixbuild/dependencies/vuejs.py
Original file line number Diff line number Diff line change
@@ -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')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to file the sha256sum of the file.


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')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly dislike this. vue.js is a dependency of kiwix-desktop, it cannot change its source directory.
We could think about kiwix-desktop copying the file in its source but :

  • It would be to kiwix-desktop to do it.
  • It would be to kiwix-desktop build system to do it (not kiwix-build)
  • As we build "out of source", the build system must not change the source directory. I don't know how qmake can use resource in the build directory and not in the source tree.

Honestly, If this is to complex to do (we have to check on qmake side), I would say that we keep vue.js in kiwix-desktop source tree (for now at least).

if os.path.exists(source_path) and os.path.exists(dest_path):
os.rename(source_path, dest_path)