summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package/electron-bin/Makefile19
-rwxr-xr-xpackage/electron-bin/files/electron-bin.init27
-rw-r--r--package/electron-bin/files/electron-bin.postinst6
-rw-r--r--package/electron-bin/files/xinitrc1
4 files changed, 49 insertions, 4 deletions
diff --git a/package/electron-bin/Makefile b/package/electron-bin/Makefile
index 042f02b05..e1e31c91e 100644
--- a/package/electron-bin/Makefile
+++ b/package/electron-bin/Makefile
@@ -9,13 +9,17 @@ PKG_RELEASE:= 1
PKG_HASH:= a1b17b04de4ab4d7bdc92500abfaca7d1d53c496c2175fd685e2b84b24fbfeff
PKG_DESCR:= build cross platform desktop apps
PKG_SECTION:= x11/apps
+PKG_DEPENDS:= alsa-lib nss nspr expat pango cairo cups libxcursor
+PKG_DEPENDS+= libdbus libatk glib libxtst libgtk2 gdk-pixbuf libxcomposite
+PKG_DEPENDS+= libxscrnsaver gconf harfbuzz libpng
PKG_URL:= http://electron.atom.io
PKG_SITES:= https://github.com/electron/electron/releases/download/v$(PKG_VERSION)/
PKG_ARCH_DEPENDS:= x86_64
+EXTRACT_OVERRIDE= 1
DISTFILES:= electron-v$(PKG_VERSION)-linux-x64.zip
-WRKDIST= ${WRKDIR}/
+WRKDIST= ${WRKDIR}/electron
include $(ADK_TOPDIR)/mk/package.mk
@@ -25,9 +29,16 @@ CONFIG_STYLE:= manual
BUILD_STYLE:= manual
INSTALL_STYLE:= manual
+do-extract:
+ mkdir -p ${WRKDIST}
+ (cd ${WRKDIST}; cat $(ADK_TOPDIR)/dl/electron-v$(PKG_VERSION)-linux-x64.zip \
+ | PATH="$(HOST_PATH)" cpio -id -H zip)
+
electron-bin-install:
- $(INSTALL_DIR) $(IDIR_ELECTRON_BIN)/usr/bin
- $(INSTALL_BIN) $(WRKSRC)/electron \
- $(IDIR_ELECTRON_BIN)/usr/bin
+ $(INSTALL_DIR) $(IDIR_ELECTRON_BIN)/opt/electron
+ $(CP) $(WRKDIST)/* $(IDIR_ELECTRON_BIN)/opt/electron
+ chmod 755 $(IDIR_ELECTRON_BIN)/opt/electron/electron
+ $(INSTALL_DIR) $(IDIR_ELECTRON_BIN)/etc
+ $(CP) ./files/xinitrc $(IDIR_ELECTRON_BIN)/etc
include $(ADK_TOPDIR)/mk/pkg-bottom.mk
diff --git a/package/electron-bin/files/electron-bin.init b/package/electron-bin/files/electron-bin.init
new file mode 100755
index 000000000..0191a2f3e
--- /dev/null
+++ b/package/electron-bin/files/electron-bin.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#PKG electron-bin
+#INIT 98
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${electron_bin:-NO}" = x"NO" && exit 0
+ test x"$electron_bin" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
+ exec sh $0 start
+ ;;
+start)
+ startx -- -nocursor
+ ;;
+stop)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/electron-bin/files/electron-bin.postinst b/package/electron-bin/files/electron-bin.postinst
new file mode 100644
index 000000000..37857f7b2
--- /dev/null
+++ b/package/electron-bin/files/electron-bin.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf electron_bin NO
+gid=$(get_next_gid)
+add_group electron $gid
+add_user electron $(get_next_uid) $gid /opt/electron /bin/sh
diff --git a/package/electron-bin/files/xinitrc b/package/electron-bin/files/xinitrc
new file mode 100644
index 000000000..c890e982e
--- /dev/null
+++ b/package/electron-bin/files/xinitrc
@@ -0,0 +1 @@
+exec /opt/electron/electron /opt/electron/electron-wbt