[Pkg-javascript-commits] [node-xterm] 01/01: Initial build rules

Ximin Luo infinity0 at debian.org
Fri May 19 19:30:23 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository node-xterm.

commit f630081b1405ca8d56877dc22803be574404dba8
Author: Ximin Luo <infinity0 at debian.org>
Date:   Fri May 19 21:30:04 2017 +0200

    Initial build rules
---
 debian/changelog                                |  2 +-
 debian/compat                                   |  1 +
 debian/control                                  | 45 +++++++++++++++++++---
 debian/copyright                                |  9 ++++-
 debian/libjs-xterm.install                      |  1 +
 debian/node-xterm.install                       |  2 +
 debian/node-xterm.links                         |  2 +
 debian/patches/series                           |  1 +
 debian/patches/workaround-browserify-lite.patch | 23 +++++++++++
 debian/rules                                    | 51 +++++++++++++++++++++++++
 10 files changed, 129 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index d6a5b41..4cd0020 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,5 @@
 node-xterm (2.5.0+ds1-1) UNRELEASED; urgency=low
 
-  * Initial release. (Closes: #XXXXXX)
+  * Initial release. (Closes: #859879)
 
  -- Ghislain Antony Vaillant <ghisvail at gmail.com>  Tue, 18 Apr 2017 18:59:37 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
index 8fe7e4d..af30569 100644
--- a/debian/control
+++ b/debian/control
@@ -1,11 +1,15 @@
 Source: node-xterm
 Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
-Uploaders: Ghislain Antony Vaillant <ghisvail at gmail.com>
+Uploaders: Ghislain Antony Vaillant <ghisvail at gmail.com>, Ximin Luo <infinity0 at debian.org>
 Section: web
 Priority: optional
 Build-Depends: debhelper (>= 10),
                nodejs,
-               node-typescript
+               node-browserify-lite,
+               node-typescript,
+               node-typescript-types,
+               chai <!nocheck>,
+               mocha <!nocheck>
 Standards-Version: 3.9.8
 Vcs-Browser: https://anonscm.debian.org/git/pkg-javascript/node-xterm.git
 Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-xterm.git
@@ -13,9 +17,9 @@ Homepage: https://xtermjs.org
 
 Package: node-xterm
 Architecture: all
-Depends: ${misc:Depends},
-         nodejs
-Description: terminal front-end component for the browser
+Depends: ${misc:Depends}, libjs-xterm
+Suggests: nodejs
+Description: terminal front-end component for the browser - NodeJS modules
  Xterm.js is a terminal front-end component written in JavaScript that works in
  the browser.
  .
@@ -38,4 +42,33 @@ Description: terminal front-end component for the browser
      any external libraries like jQuery or React to work
    - **Modular, event-based API**: Lets you build addons and themes with ease
  .
- Node.js is an event-based server-side JavaScript engine.
+ This package contains the unpacked individual xterm CommonJS modules.
+
+Package: libjs-xterm
+Architecture: all
+Depends: ${misc:Depends}
+Description: terminal front-end component for the browser - browser library
+ Xterm.js is a terminal front-end component written in JavaScript that works in
+ the browser.
+ .
+ It enables applications to provide fully featured terminals to their users and
+ create great development experiences.
+ .
+ Features:
+ .
+   - **Text-based application support**: Use xterm.js to work with applications
+     like `bash`, `git` etc.
+   - **Curses-based application support**: Use xterm.js to work with
+     applications like `vim`, `tmux` etc.
+   - **Mouse events support**: Xterm.js captures mouse events like click and
+     scroll and passes them to the terminal's back-end controlling process
+   - **CJK (Chinese, Japanese, Korean) character support**: Xterm.js renders
+     CJK characters seamlessly
+   - **IME support**: Insert international (including CJK) characters using IME
+     input with your keyboard
+   - **Self-contained library**: Xterm.js works on its own. It does not require
+     any external libraries like jQuery or React to work
+   - **Modular, event-based API**: Lets you build addons and themes with ease
+ .
+ This package contains the standalone packed library suitable for running in
+ a web browser.
diff --git a/debian/copyright b/debian/copyright
index 7909772..8e04f79 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -5,11 +5,18 @@ Files-Excluded: dist/*
 
 Files: *
 Copyright: 2014-2016 SourceLair Private Company <https://www.sourcelair.com>
- 2012-2013 Christopher Jeffrey <https://github.com/chjj>
+           2012-2013 Christopher Jeffrey <https://github.com/chjj>
+License: Expat
+
+Files: src/xterm.css src/xterm.js
+Copyright: 2014-2016 SourceLair Private Company <https://www.sourcelair.com>
+           2012-2013 Christopher Jeffrey <https://github.com/chjj>
+           2011 Fabrice Bellard <http://bellard.org/jslinux/>
 License: Expat
 
 Files: debian/*
 Copyright: 2017 Ghislain Antony Vaillant <ghisvail at gmail.com>
+           2017 Ximin Luo <infinity0 at debian.org>
 License: Expat
 
 License: Expat
diff --git a/debian/libjs-xterm.install b/debian/libjs-xterm.install
new file mode 100644
index 0000000..55fd477
--- /dev/null
+++ b/debian/libjs-xterm.install
@@ -0,0 +1 @@
+dist/* /usr/share/javascript/xterm
diff --git a/debian/node-xterm.install b/debian/node-xterm.install
new file mode 100644
index 0000000..bf2bc3a
--- /dev/null
+++ b/debian/node-xterm.install
@@ -0,0 +1,2 @@
+lib          /usr/lib/nodejs/xterm
+package.json /usr/lib/nodejs/xterm
diff --git a/debian/node-xterm.links b/debian/node-xterm.links
new file mode 100644
index 0000000..b2f5a91
--- /dev/null
+++ b/debian/node-xterm.links
@@ -0,0 +1,2 @@
+/usr/share/javascript/xterm             /usr/lib/nodejs/xterm/dist
+/usr/share/javascript/xterm/addons      /usr/lib/nodejs/xterm/lib/addons
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..89ef3b7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+workaround-browserify-lite.patch
diff --git a/debian/patches/workaround-browserify-lite.patch b/debian/patches/workaround-browserify-lite.patch
new file mode 100644
index 0000000..363115e
--- /dev/null
+++ b/debian/patches/workaround-browserify-lite.patch
@@ -0,0 +1,23 @@
+Description: Work around browserify-lite not being as smart as browserify
+ This gets undone in the end result, see d/rules
+Author: Ximin Luo <infinity0 at debian.org>
+Forwarded: not-needed
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: node-xterm/src/xterm.js
+===================================================================
+--- node-xterm.orig/src/xterm.js
++++ node-xterm/src/xterm.js
+@@ -729,10 +729,10 @@ Terminal.prototype.open = function(paren
+ Terminal.loadAddon = function(addon, callback) {
+   if (typeof exports === 'object' && typeof module === 'object') {
+     // CommonJS
+-    return require('./addons/' + addon + '/' + addon);
++    return REQUIRE_NO_BROWSERIFY('./addons/' + addon + '/' + addon);
+   } else if (typeof define == 'function') {
+     // RequireJS
+-    return require(['./addons/' + addon + '/' + addon], callback);
++    return REQUIRE_NO_BROWSERIFY(['./addons/' + addon + '/' + addon], callback);
+   } else {
+     console.error('Cannot load a module without a CommonJS or RequireJS environment.');
+     return false;
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..8761c68
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,51 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+	dh $@
+
+override_dh_auto_configure:
+	mkdir -p node_modules/@types
+	set -e; for i in chai jquery jsdom mocha node; do \
+		ln -sf /usr/lib/nodejs/@types/$$i node_modules/@types/$$i; done
+
+COPY_AUX_FILES = \
+	cp -a $(1)/addons $(2) && \
+	cd $(1) && find -name *.css -exec cp --parents '{}' ../$(2) \; \
+
+override_dh_auto_build:
+# Recreate upstream's bullshit buildscript plus bullshit entire buildsystem in 6 lines of shell
+	tsc --project .
+	$(call COPY_AUX_FILES,src,lib)
+# Otherwise browserify-lite complains
+	touch lib/addons/index.js
+	mkdir -p dist
+	cd dist && browserify-lite ../lib/xterm.js --outfile xterm.js --standalone Terminal
+	$(call COPY_AUX_FILES,lib,dist)
+# Undo browserify-lite workarounds
+	sed -i -e 's/REQUIRE_NO_BROWSERIFY/require/g' dist/xterm.js
+	rm -f dist/addons/index.js
+
+override_dh_auto_test:
+# These tests depend on jsdom which can't (yet) be installed in Debian
+# They pass when run locally though
+	rm -f lib/Linkifier.test.js lib/utils/CharMeasure.test.js
+	mocha lib/
+
+# Upstream does not have tests for the browserified version, but you can test
+# that manually by running this:
+run-demo:
+	test -e build || ln -sf dist build
+	python -m SimpleHTTPServer & x=$$!; \
+	chromium --temp-profile 'http://localhost:8000/demo/index.html'; kill $$!
+
+override_dh_auto_clean:
+	dh_auto_clean
+	rm -rf node_modules lib dist build
+
+override_dh_link:
+# Deduplicate, link via dh_link
+	rm -rf debian/node-xterm/usr/lib/nodejs/xterm/lib/addons
+	dh_link

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-xterm.git



More information about the Pkg-javascript-commits mailing list