Browse Source

Merge branch 'feature/debian-package' into develop

upgrade-electron
William Petit 4 years ago
parent
commit
3880805bca
8 changed files with 69 additions and 3 deletions
  1. 22
    0
      Makefile
  2. 5
    0
      debian/changelog
  3. 1
    0
      debian/compat
  4. 13
    0
      debian/control
  5. 17
    0
      debian/rules
  6. 1
    0
      debian/source/format
  7. 2
    2
      package.json
  8. 8
    1
      src/components/common/app-icon.js

+ 22
- 0
Makefile View File

@@ -0,0 +1,22 @@
1
+DESTDIR=./
2
+INSTALL_LOCATION=$(DESTDIR)/opt/pitaya
3
+ELECTRON_ARCH=x64
4
+
5
+ifeq ($(DEB_TARGET_ARCH), i386)
6
+	ELECTRON_ARCH=ia32
7
+endif
8
+
9
+all: build
10
+
11
+build:
12
+	apt-get install --yes --no-install-recommends curl ca-certificates
13
+	curl --silent --location https://deb.nodesource.com/setup_0.12 | bash -
14
+	apt-get install --yes nodejs
15
+	npm install --ignore-scripts
16
+	npm run clean
17
+	npm run compile
18
+	npm run package -- --arch=$(ELECTRON_ARCH)
19
+
20
+install:
21
+	mkdir -p $(INSTALL_LOCATION)
22
+	cp -r build/pitaya-linux-$(ELECTRON_ARCH)/* $(INSTALL_LOCATION)/

+ 5
- 0
debian/changelog View File

@@ -0,0 +1,5 @@
1
+pitaya (0.0.0) unstable; urgency=low
2
+
3
+  * Initial release (Closes: #nnnn)  <nnnn is the bug number of your ITP>
4
+
5
+ -- William Petit <wpetit@cadoles.com>  Fri, 16 Oct 2015 15:57:03 +0200

+ 1
- 0
debian/compat View File

@@ -0,0 +1 @@
1
+9

+ 13
- 0
debian/control View File

@@ -0,0 +1,13 @@
1
+Source: pitaya
2
+Section: unknown
3
+Priority: optional
4
+Maintainer: William Petit <wpetit@cadoles.com>
5
+Build-Depends: debhelper (>= 8.0.0)
6
+Standards-Version: 3.9.4
7
+Homepage:
8
+Vcs-Git: https://forge.cadoles.com/wpetit/pitaya.git
9
+Vcs-Browser: https://forge.cadoles.com/wpetit/pitaya
10
+
11
+Package: pitaya
12
+Architecture: any
13
+Description: Lanceur d'application pour GNU/Linux

+ 17
- 0
debian/rules View File

@@ -0,0 +1,17 @@
1
+#!/usr/bin/make -f
2
+# -*- makefile -*-
3
+
4
+# Uncomment this to turn on verbose mode.
5
+export DH_VERBOSE=1
6
+
7
+%:
8
+	dh $@
9
+
10
+override_dh_makeshlibs:
11
+	# Disabled
12
+
13
+override_dh_shlibdeps:
14
+	# Disabled
15
+
16
+override_dh_strip:
17
+	# Disabled

+ 1
- 0
debian/source/format View File

@@ -0,0 +1 @@
1
+3.0 (quilt)

+ 2
- 2
package.json View File

@@ -13,9 +13,9 @@
13 13
   "scripts": {
14 14
     "test": "./node_modules/.bin/nodeunit test",
15 15
     "start": "./node_modules/.bin/electron .",
16
-    "compile": "./node_modules/.bin/jsx -x js src dist",
16
+    "compile": "./node_modules/.bin/jsx -x js --no-cache-dir src dist",
17 17
     "clean": "rm -rf dist/* build/*",
18
-    "package": "./node_modules/.bin/electron-packager ./ pitaya --prune --ignore=res/ --platform=linux --arch=ia32,x64 --version=0.33.6 --out=build --overwrite --app-version 0.0.0",
18
+    "package": "./node_modules/.bin/electron-packager ./ pitaya --out=./build --app-version 0.0.0 --version=0.33.6 --prune --ignore='/res(/|$)' --ignore='/debian(/|$)' --ignore='/scripts(/|$)' --ignore='/build(/|$)' --ignore='/test(/|$)' --ignore='/electron-packager(/|$)' --ignore='/electron-tmp-.+(/|$)' --platform=linux --overwrite",
19 19
     "build": "npm run clean && npm run compile && npm run package"
20 20
   },
21 21
   "dependencies": {

+ 8
- 1
src/components/common/app-icon.js View File

@@ -2,6 +2,7 @@ var React = require('react');
2 2
 var Util = require('../../util');
3 3
 var LazyLoad = require('../mixins/lazy-load');
4 4
 var debug = Util.Debug('common:app-icon');
5
+var _ = require('lodash');
5 6
 
6 7
 var LOADING_ICON = 'img/hourglass.svg';
7 8
 var DEFAULT_ICON = 'img/default-icon.svg';
@@ -10,6 +11,12 @@ module.exports = React.createClass({
10 11
 
11 12
   mixins: [LazyLoad],
12 13
 
14
+  componentWillMount: function() {
15
+    if(!this._findIconDebounced) {
16
+      this._findIconDebounced = _.debounce(this._findIcon, 250);
17
+    }
18
+  },
19
+
13 20
   getInitialState: function() {
14 21
     return { icon: DEFAULT_ICON, iconPath: DEFAULT_ICON, currentTheme: '' };
15 22
   },
@@ -33,7 +40,7 @@ module.exports = React.createClass({
33 40
 
34 41
     this.setState({ icon: newIcon, iconPath: LOADING_ICON, currentTheme: newTheme });
35 42
 
36
-    this._findIcon(newIcon, newTheme);
43
+    this._findIconDebounced(newIcon, newTheme);
37 44
 
38 45
   },
39 46
 

Loading…
Cancel
Save