Skip to content

Commit

Permalink
core: introduce install-eaf.py & standardize dependency installation
Browse files Browse the repository at this point in the history
    Introduce the universal install-eaf.py to install EAF applications
    along with its dependencies, give the freedom to install any
    application as one wishes.

    Introduce dependencies.json in EAF core repo and in all
    app/foo/, to standardize dependency declaration across the
    framework.

    Developing EAF applications has never been this easier, it doesn't
    have to be within the emacs-eaf organization, you can put it in
    your own repository. Simply follow these steps:
    1. Ensure the dependencies.json in your application repo is
    following the standard in other EAF applications.
    2. Add to .gitmodules in the EAF core, also add it to the EAF core
    applications.json.
    3. Submit a PR at EAF core repo:
    https://github.com/emacs-eaf/emacs-application-framework

    Also addresses #726

Signed-off-by: Mingde (Matthew) Zeng <matthewzmd@posteo.net>
  • Loading branch information
MatthewZMD committed Aug 11, 2021
1 parent c6d9f33 commit 044b0b8
Show file tree
Hide file tree
Showing 31 changed files with 338 additions and 171 deletions.
60 changes: 60 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[submodule "app/airshare"]
path = app/airshare
url = https://github.com/emacs-eaf/eaf-airshare.git
[submodule "app/browser"]
path = app/browser
url = https://github.com/emacs-eaf/eaf-browser.git
[submodule "app/camera"]
path = app/camera
url = https://github.com/emacs-eaf/eaf-camera.git
[submodule "app/demo"]
path = app/demo
url = https://github.com/emacs-eaf/eaf-demo.git
[submodule "app/file-browser"]
path = app/file-browser
url = https://github.com/emacs-eaf/eaf-file-browser.git
[submodule "app/file-manager"]
path = app/file-manager
url = https://github.com/emacs-eaf/eaf-file-manager.git
[submodule "app/file-sender"]
path = app/file-sender
url = https://github.com/emacs-eaf/eaf-file-sender.git
[submodule "app/image-viewer"]
path = app/image-viewer
url = https://github.com/emacs-eaf/eaf-image-viewer.git
[submodule "app/js-video-player"]
path = app/js-video-player
url = https://github.com/emacs-eaf/eaf-js-video-player.git
[submodule "app/jupyter"]
path = app/jupyter
url = https://github.com/emacs-eaf/eaf-jupyter.git
[submodule "app/markdown-previewer"]
path = app/markdown-previewer
url = https://github.com/emacs-eaf/eaf-markdown-previewer.git
[submodule "app/mindmap"]
path = app/mindmap
url = https://github.com/emacs-eaf/eaf-mindmap.git
[submodule "app/music-player"]
path = app/music-player
url = https://github.com/emacs-eaf/eaf-music-player.git
[submodule "app/netease-cloud-music"]
path = app/netease-cloud-music
url = https://github.com/emacs-eaf/eaf-netease-cloud-music.git
[submodule "app/org-previewer"]
path = app/org-previewer
url = https://github.com/emacs-eaf/eaf-org-previewer.git
[submodule "app/pdf-viewer"]
path = app/pdf-viewer
url = https://github.com/emacs-eaf/eaf-pdf-viewer.git
[submodule "app/system-monitor"]
path = app/system-monitor
url = https://github.com/emacs-eaf/eaf-system-monitor.git
[submodule "app/terminal"]
path = app/terminal
url = https://github.com/emacs-eaf/eaf-terminal.git
[submodule "app/video-player"]
path = app/video-player
url = https://github.com/emacs-eaf/eaf-video-player.git
[submodule "app/vue-demo"]
path = app/vue-demo
url = https://github.com/emacs-eaf/eaf-vue-demo.git
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ If you prefer to manually call the installation script in the terminal,
```Bash
cd emacs-application-framework
chmod +x ./install-eaf.sh
./install-eaf.sh
chmod +x ./install-eaf.py
python ./install-eaf.py
```
- If you use Windows,
Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ EAF是一个可编程扩展的框架,它自带一系列丰富的应用,你
```Bash
cd emacs-application-framework
chmod +x ./install-eaf.sh
./install-eaf.sh
chmod +x ./install-eaf.py
python ./install-eaf.py
```
- Windows用户:
Expand Down
1 change: 1 addition & 0 deletions app/airshare
Submodule airshare added at 484c43
1 change: 1 addition & 0 deletions app/browser
Submodule browser added at 85ce66
1 change: 1 addition & 0 deletions app/camera
Submodule camera added at 53c267
1 change: 1 addition & 0 deletions app/demo
Submodule demo added at 947fd8
1 change: 1 addition & 0 deletions app/file-browser
Submodule file-browser added at 1d00de
1 change: 1 addition & 0 deletions app/file-manager
Submodule file-manager added at bb54dd
1 change: 1 addition & 0 deletions app/file-sender
Submodule file-sender added at 59206b
1 change: 1 addition & 0 deletions app/image-viewer
Submodule image-viewer added at b984a5
1 change: 1 addition & 0 deletions app/js-video-player
Submodule js-video-player added at fa1cef
1 change: 1 addition & 0 deletions app/jupyter
Submodule jupyter added at 07868a
1 change: 1 addition & 0 deletions app/markdown-previewer
Submodule markdown-previewer added at 538b28
1 change: 1 addition & 0 deletions app/mindmap
Submodule mindmap added at 43664a
1 change: 1 addition & 0 deletions app/music-player
Submodule music-player added at c24dab
1 change: 1 addition & 0 deletions app/netease-cloud-music
Submodule netease-cloud-music added at 7012a7
1 change: 1 addition & 0 deletions app/org-previewer
Submodule org-previewer added at 144b59
1 change: 1 addition & 0 deletions app/pdf-viewer
Submodule pdf-viewer added at dc8473
1 change: 1 addition & 0 deletions app/system-monitor
Submodule system-monitor added at bbfe20
1 change: 1 addition & 0 deletions app/terminal
Submodule terminal added at 748a9f
1 change: 1 addition & 0 deletions app/video-player
Submodule video-player added at e6c7c3
1 change: 1 addition & 0 deletions app/vue-demo
Submodule vue-demo added at bb5088
22 changes: 22 additions & 0 deletions applications.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"airshare": "EAF Airshare",
"browser": "EAF Browser",
"camera": "EAF Camera",
"demo": "EAF Demo",
"file-browser": "EAF File Browser",
"file-manager": "EAF File Manager",
"file-sender": "EAF File Sender",
"image-viewer": "EAF Image Viewer",
"js-video-player": "EAF Video Player (JS)",
"jupyter": "EAF Jupyter",
"markdown-previewer": "EAF Markdown Previewer",
"mindmap": "EAF Mindmap",
"music-player": "EAF Music Player",
"netease-cloud-music": "EAF NetEase Cloud Music",
"org-previewer": "EAF Org Previewer",
"pdf-viewer": "EAF PDF Viewer",
"system-monitor": "EAF System Monitor",
"terminal": "EAF Terminal",
"video-player": "EAF Video Player",
"vue-demo": "EAF Vue Demo"
}
48 changes: 48 additions & 0 deletions dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"pacman": [
"wmctrl",
"python-pyqt5",
"python-pyqt5-sip",
"python-pyqtwebengine"
],
"apt": [
"wmctrl",
"nodejs",
"npm",
"libglib2.0-dev",
"python3-pyqt5",
"python3-sip",
"python3-pyqt5.qtwebengine",
"python3-pygit2"
],
"dnf": [
"wmctrl",
"nodejs",
"npm",
"glib2-devel",
"python3-qt5",
"python3-pyqt5-sip",
"pyqtwebengine-devel",
"python3-pygit2"
],
"pkg": [
"wmctrl",
"node",
"npm",
"glib",
"py38-qt5-sip",
"py38-qt5-webengine"
],
"pip": {
"linux": [
"epc",
"lxml"
],
"win32": [
"pyqt5",
"pyqt5-sip",
"pyqtwebengine",
"pygetwindow"
]
}
}
45 changes: 23 additions & 22 deletions eaf.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; Copyright (C) 2018, Andy Stewart, all rights reserved.
;; Created: 2018-06-15 14:10:12
;; Version: 0.5
;; Last-Updated: Tue Aug 10 21:46:49 2021 (-0400)
;; Last-Updated: Wed Aug 11 16:05:48 2021 (-0400)
;; By: Mingde (Matthew) Zeng
;; URL: https://github.com/manateelazycat/emacs-application-framework
;; Keywords:
Expand Down Expand Up @@ -166,17 +166,16 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
(eaf-add-subdirs-to-load-path)))

(eaf-add-app-dirs-to-load-path)

(require 'eaf-epc)

;;;###autoload
(defun eaf-install-dependencies ()
"An interactive function that run install-eaf.sh or install-eaf-win32.js or install-eaf-mac.sh for Linux or Windows or macOS respectively."
"An interactive function that run install-eaf.py or install-eaf-win32.js or install-eaf-mac.sh for Linux or Windows or macOS respectively."
(interactive)
(let* ((eaf-dir (file-name-directory (locate-library "eaf")))
(default-directory eaf-dir))
(cond ((eq system-type 'gnu/linux)
(shell-command (concat "./install-eaf.sh" "&")))
(shell-command (concat "python " "install-eaf.py" "&")))
((memq system-type '(cygwin windows-nt ms-dos))
(shell-command (format "node %s" (concat "install-eaf-win32.js" "&"))))
((eq system-type 'darwin)
Expand Down Expand Up @@ -1578,24 +1577,26 @@ It currently identifies PDF, videos, images, and mindmap file extensions."
(advice-add #'dired-find-file :around #'eaf--dired-find-file-advisor)
(advice-add #'dired-find-alternate-file :around #'eaf--dired-find-file-advisor)

(require 'eaf-browser)
(require 'eaf-pdf-viewer)
(require 'eaf-markdown-previewer)
(require 'eaf-js-video-player)
(require 'eaf-video-player)
(require 'eaf-image-viewer)
(require 'eaf-org-previewer)
(require 'eaf-mindmap)
(require 'eaf-mail)
(require 'eaf-terminal)
(require 'eaf-camera)
(require 'eaf-jupyter)
(require 'eaf-netease-cloud-music)
(require 'eaf-music-player)
(require 'eaf-system-monitor)
(require 'eaf-file-manager)
(require 'eaf-file-browser)
(require 'eaf-vue-demo)
(ignore-errors (require 'eaf-airshare))
(ignore-errors (require 'eaf-browser))
(ignore-errors (require 'eaf-camera))
(ignore-errors (require 'eaf-demo))
(ignore-errors (require 'eaf-file-browser))
(ignore-errors (require 'eaf-pdf-viewer))
(ignore-errors (require 'eaf-markdown-previewer))
(ignore-errors (require 'eaf-js-video-player))
(ignore-errors (require 'eaf-video-player))
(ignore-errors (require 'eaf-image-viewer))
(ignore-errors (require 'eaf-org-previewer))
(ignore-errors (require 'eaf-mindmap))
(ignore-errors (require 'eaf-mail))
(ignore-errors (require 'eaf-terminal))
(ignore-errors (require 'eaf-jupyter))
(ignore-errors (require 'eaf-netease-cloud-music))
(ignore-errors (require 'eaf-music-player))
(ignore-errors (require 'eaf-system-monitor))
(ignore-errors (require 'eaf-file-manager))
(ignore-errors (require 'eaf-vue-demo))

(provide 'eaf)

Expand Down
Loading

1 comment on commit 044b0b8

@MatthewZMD
Copy link
Member Author

Choose a reason for hiding this comment

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

For anyone reading this far, I have to make an adjustment to this commit message, which will further simplify developing your own application:

Developing EAF applications has never been this easier, it doesn't
have to be within the emacs-eaf organization, you can put it in
your own repository. Simply follow these steps:

  1. Ensure the dependencies.json in your application repo is following the standard in other EAF applications.
  2. Add your repo's description and Git URL to the EAF core applications.json.
  3. Submit a PR at EAF core repo:
    https://github.com/emacs-eaf/emacs-application-framework

Please sign in to comment.