aboutsummaryrefslogtreecommitdiffstats
path: root/testing/emscripten
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-04-03 21:21:32 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-04-03 21:25:49 +0200
commit3446bcba8c283bf883d34942a1ffd1e307847a0a (patch)
tree3ace9ddfe897c7bb79fcbe2f36b1f292490d5114 /testing/emscripten
parent40f878f0f32688048ed3702e44104e2084a5bb35 (diff)
downloadaports-3446bcba8c283bf883d34942a1ffd1e307847a0a.tar.bz2
aports-3446bcba8c283bf883d34942a1ffd1e307847a0a.tar.xz
testing/emscripten: add support for global cache
Diffstat (limited to 'testing/emscripten')
-rw-r--r--testing/emscripten/APKBUILD6
-rw-r--r--testing/emscripten/add-global-cache.patch33
-rw-r--r--testing/emscripten/emscripten.cfg3
3 files changed, 40 insertions, 2 deletions
diff --git a/testing/emscripten/APKBUILD b/testing/emscripten/APKBUILD
index eec4c2ef29..0d04fe4a61 100644
--- a/testing/emscripten/APKBUILD
+++ b/testing/emscripten/APKBUILD
@@ -6,7 +6,7 @@
pkgname=emscripten
# Keep with sync with pkg emscrypten-fastcomp!
pkgver=1.37.9
-pkgrel=2
+pkgrel=3
pkgdesc="An LLVM-to-JavaScript Compiler"
url="https://kripken.github.io/emscripten-site/"
arch="all"
@@ -27,6 +27,7 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/kripken/$pkgname/archive/$pk
closurecompiler-language_in-es6.patch
embuilder-fix-task-all-for-wasm.patch
embuilder-omit-provided.patch
+ add-global-cache.patch
emscripten.cfg"
builddir="$srcdir/$pkgname-$pkgver"
@@ -175,7 +176,8 @@ a2a2c9b56e8d655b06fdbac2e297e07a0bbcdc3e3df7c913b5caac8ddf20f66b91ed77ac46275adc
5b63f42e4934c7c6d5eedb9e46636a488bc0723618dd0b5d5b720d58cf9d1f6a6e6a768fe1ce1188f86bbb931b6881dfdfc36f8c0584775cb66a9d9e8a2cbb9a closurecompiler-language_in-es6.patch
53bb9b64222dd445e8aefbb5a4b87bc6d562ea578a6f7a04c2605703f0235633583144fe478031e650a7346ba89f6e0aaf6c435aedb8398131fa02940356bc17 embuilder-fix-task-all-for-wasm.patch
3d2fb817ea3e1dd661900df1e27bd135f39076723494b7ffbbe9e1561ae0a0e62a4ed0058301cf3e6b9a13f75adafe58dc902d4a32ade2cb16754a7fd5e542af embuilder-omit-provided.patch
-579140e22c086129190026f8d2bcb4ac9bc5783f056c6a9704a74613b17483817ab9cc869c263630cd5b83a347c9d5d26cb67ef74720dbaafe709eb21aa52851 emscripten.cfg
+8d02f598df12ecbebab151a9d9e6972164bddf4da586e5a3070f2a5b35248b622a663a513295c1bf79fcf13523940ea5e47f8ab1def86e28b260dba8bfef7bac add-global-cache.patch
+42142064f828c39fbeb04e65c13c0eae8d843ee8541e67db361086b2d44ad896604d561220363f71aa8aa9f07ae6c285a39f49d9078f5a56e022879ed987c020 emscripten.cfg
3922486816cf7d99ee02c3c1ef63d94290e8ed304016dd9927137d04206e7674d9df8773a4abb7bb57783d0a5107ad0f893aa87acfb34f7b316eec22ca55a536 emscripten-port-Bullet-version_1-zip
0d0b1280ba0501ad0a23cf1daa1f86821c722218b59432734d3087a89acd22aabd5c3e5e1269700dcd41e87073046e906060f167c032eb91a3ac8c5808a02783 emscripten-port-FreeType-version_1-zip
a19ede8a4339f2745a490c22f3893899e1a5eae9d2b270e49d88d3a85239fbbaa26c9a352d0e6fb8bb69b4f45bd00c1ae9eff29b60cf03e79c5df45a4409992f emscripten-port-libpng-version_1-zip
diff --git a/testing/emscripten/add-global-cache.patch b/testing/emscripten/add-global-cache.patch
new file mode 100644
index 0000000000..710d842e47
--- /dev/null
+++ b/testing/emscripten/add-global-cache.patch
@@ -0,0 +1,33 @@
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Mon, 3 Apr 2017 20:49:00 +0200
+Subject: [PATCH] Add support for global r/o cache of prebuilt libraries
+
+--- a/tools/cache.py
++++ b/tools/cache.py
+@@ -29,9 +29,12 @@
+
+ if use_subdir:
+ if os.environ.get('EMCC_WASM_BACKEND') and os.environ.get('EMCC_WASM_BACKEND') != '0':
+- dirname = os.path.join(dirname, 'wasm')
++ self.subdir = 'wasm'
+ else:
+- dirname = os.path.join(dirname, 'asmjs')
++ self.subdir = 'asmjs'
++ dirname = os.path.join(dirname, self.subdir)
++ else:
++ self.subdir = ''
+ self.dirname = dirname
+ self.debug = debug
+
+@@ -90,6 +93,11 @@
+ if what is None:
+ if shortname.endswith(('.bc', '.so', '.a')): what = 'system library'
+ else: what = 'system asset'
++ if shared.GLOBAL_CACHE_DIR and os.getenv('EM_USE_GLOBAL_CACHE') == '1' and not force:
++ path = os.path.join(shared.GLOBAL_CACHE_DIR, self.subdir, shortname)
++ if os.path.exists(path):
++ logging.info('using %s: %s from global cache: %s' % (what, shortname, path))
++ return path
+ message = 'generating ' + what + ': ' + shortname + '... (this will be cached in "' + cachename + '" for subsequent builds)'
+ logging.info(message)
+ self.ensure()
diff --git a/testing/emscripten/emscripten.cfg b/testing/emscripten/emscripten.cfg
index dbfc07185e..9888ce606c 100644
--- a/testing/emscripten/emscripten.cfg
+++ b/testing/emscripten/emscripten.cfg
@@ -16,3 +16,6 @@ TEMP_DIR = '/tmp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]
+
+# Define environment variable EM_USE_GLOBAL_CACHE=1 to look into this cache.
+GLOBAL_CACHE_DIR = '/usr/share/emscripten/cache'