[beast: 69/70] EBEAST: bundle and install ebeast-<VERSION> under libexec/



commit a54ccfdbe5191f0c9c88973459072dc72eefbeac
Author: Tim Janik <timj gnu org>
Date:   Mon Mar 27 23:23:06 2017 +0200

    EBEAST: bundle and install ebeast-<VERSION> under libexec/
    
    Signed-off-by: Tim Janik <timj gnu org>

 ebeast/.gitignore      |    3 +++
 ebeast/Makefile.am     |   35 +++++++++++++++++++++++++++++++++--
 ebeast/package.json.in |    1 +
 3 files changed, 37 insertions(+), 2 deletions(-)
---
diff --git a/ebeast/.gitignore b/ebeast/.gitignore
index f170282..eb466da 100644
--- a/ebeast/.gitignore
+++ b/ebeast/.gitignore
@@ -1,4 +1,7 @@
+/.appstamp
+/.bundlestamp
 /config.log
+/ebeast-[0-9].[0-9][0-9].[0-9]/
 /package.json
 /node_modules/
 /objects/
diff --git a/ebeast/Makefile.am b/ebeast/Makefile.am
index 4b29cb5..bb15f5a 100644
--- a/ebeast/Makefile.am
+++ b/ebeast/Makefile.am
@@ -15,7 +15,9 @@ all: with_npm
        @echo " make run        # run the electron app in the current directory"
        @echo " make clean      # remove build files"
 if WITH_NPM
-with_npm: app
+with_npm:              .bundlestamp
+install-exec-local:    install-exec-bundle
+uninstall-local:       uninstall-bundle
 else
 with_npm:
 endif
@@ -27,10 +29,31 @@ package.json: package.json.in ../config.status
        $(Q) npm install
 clean-local: clean-node_modules
 clean-node_modules: ; rm -rf node_modules/ package.json
+MOSTLYCLEANFILES += config.log # created by config.status
+
+# == ebeast bundle ==
+INSTALL_VERSION = @MAJOR@.@MINOR@.@MICRO@
+BUNDLEDIR       = ebeast-$(INSTALL_VERSION)
+.bundlestamp: .appstamp
+       $(AM_V_GEN)
+       $(Q) rm -rf .bundlestamp "./$(BUNDLEDIR)" ebeast-bundle/
+       $(Q) mkdir ebeast-bundle/
+       $(Q) ./node_modules/.bin/electron-packager . ebeast --out=ebeast-bundle/
+       $(Q) mv "`echo ebeast-bundle/*`" $(BUNDLEDIR) # rename <appname>-<platform>-<arch>/
+       $(Q) rmdir ebeast-bundle/
+       $(Q) test -x $(BUNDLEDIR)/ebeast
+       $(Q) touch $@
+clean-local: clean-ebeast-bundle
+clean-ebeast-bundle:
+       rm -rf .bundlestamp "./$(BUNDLEDIR)" ebeast-bundle/
 
 # == app ==
-app:   package.json xlint-html xlint-js objects/app.css objects/gradient-01.png
+app: .appstamp
+.appstamp: package.json xlint-html xlint-js objects/app.css objects/gradient-01.png
        $(Q) $(MAKE) $(AM_MAKEFLAGS) -C v8bse v8bse.node
+       $(Q) rm -rf .bundlestamp "./$(BUNDLEDIR)" # avoid electron picking up stale resources
+       $(Q) touch $@
+MOSTLYCLEANFILES += .appstamp
 
 # == run ==
 run: app
@@ -88,3 +111,11 @@ xlint-js: $(JS_LINT_FILES) package.json
        done
        $(Q) touch $@
 MOSTLYCLEANFILES += xlint-js
+
+# == install ==
+install-exec-bundle: .bundlestamp
+       $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)"
+       rm -rf "$(DESTDIR)$(pkglibexecdir)/$(BUNDLEDIR)"
+       cp -RP $(BUNDLEDIR) "$(DESTDIR)$(pkglibexecdir)/"
+uninstall-bundle:
+       rm -rf "$(DESTDIR)$(pkglibexecdir)/$(BUNDLEDIR)"
diff --git a/ebeast/package.json.in b/ebeast/package.json.in
index c8041c3..fa79581 100644
--- a/ebeast/package.json.in
+++ b/ebeast/package.json.in
@@ -6,6 +6,7 @@
   "dependencies":    { "electron": "^1.4.15", "mithril": "^1.0.1",
                       "jquery": "^3.1.1", "font-awesome": "^4.7.0" },
   "devDependencies": { "node-gyp": "^3.5.0", "less": "^2.7.2",
+                      "electron-packager": "^8.6.0",
                       "eslint": "^3.16.1", "eslint-plugin-html": "^2.0.1" },
   "license":         "LGPL-3.0",
   "scripts": {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]