aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortimeraider@gmx.at <timeraider@gmx.at>2015-10-17 01:34:59 +0200
committertimeraider@gmx.at <timeraider@gmx.at>2015-10-24 16:28:32 +0200
commita137c0a7a17e598ffaa31ae80b99b7dc0fd38393 (patch)
tree3e991e50c20363997e2c6de68da394c4d45e66e7 /dev-util
parentsci-chemistry/talosn: Version Bump (diff)
downloadsci-a137c0a7a17e598ffaa31ae80b99b7dc0fd38393.tar.gz
sci-a137c0a7a17e598ffaa31ae80b99b7dc0fd38393.tar.bz2
sci-a137c0a7a17e598ffaa31ae80b99b7dc0fd38393.zip
added emscripten and fastcomp
(fastcomp is emscripten's LLVM back-end) worked on feedback from github updated emscripten ebuils corrected dependencies
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/emscripten-fastcomp/Manifest2
-rw-r--r--dev-util/emscripten-fastcomp/emscripten-fastcomp-1.34.11.ebuild40
-rw-r--r--dev-util/emscripten-fastcomp/metadata.xml8
-rw-r--r--dev-util/emscripten/Manifest1
-rw-r--r--dev-util/emscripten/emscripten-1.34.11.ebuild66
-rw-r--r--dev-util/emscripten/files/99emscripten1
-rw-r--r--dev-util/emscripten/files/emscripten.config56
-rw-r--r--dev-util/emscripten/files/hello_world.cpp5
-rw-r--r--dev-util/emscripten/metadata.xml8
9 files changed, 187 insertions, 0 deletions
diff --git a/dev-util/emscripten-fastcomp/Manifest b/dev-util/emscripten-fastcomp/Manifest
new file mode 100644
index 000000000..f04ec8850
--- /dev/null
+++ b/dev-util/emscripten-fastcomp/Manifest
@@ -0,0 +1,2 @@
+DIST emscripten-fastcomp-1.34.11.tar.gz 20193336 SHA256 476b9b3bb6e88cf31c66a6618b1174a7b770b0c02703f8ddc37ba350c63f2f2e SHA512 53b2f91ea0c923f582300e6e73f1c9f9c830b74db165a1e01a660e0110da2229029d3283a9b38aa6a55658c492ce8e632e233ae0e3a154842fd41fcd68eebb47 WHIRLPOOL ebd3e6c833c65b0d365fd11bd668cc5d61656ae357d6ba62bd0f4eda772589241e4ad90351f343edda5659c2d957784c28f118bb502ea86e3f7549b87216cfd5
+DIST emscripten-fastcomp-clang-1.34.11.tar.gz 12055966 SHA256 4a453a90212eb8ae9ab90ea055f7072642aca4b5343ff9c33ff28d3f17759241 SHA512 2e69cc41d8ca1a632c36406a5ab42e316a09befbd5390f05ab9852b50fa38b22b719bf41e100e14c63d11d9a4848ac3f6cae4371dfb69f63a93cadbff178aca6 WHIRLPOOL 7f9bda2449bda31b030c1f582f7fde7390873fd5a2a1fb3904de883b990802c2b617e90b5d41dfae1936e7992e60f64dcd05e8647c7f05676c180c1832418ba4
diff --git a/dev-util/emscripten-fastcomp/emscripten-fastcomp-1.34.11.ebuild b/dev-util/emscripten-fastcomp/emscripten-fastcomp-1.34.11.ebuild
new file mode 100644
index 000000000..94698801d
--- /dev/null
+++ b/dev-util/emscripten-fastcomp/emscripten-fastcomp-1.34.11.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils python-single-r1
+
+DESCRIPTION="Emscripten LLVM backend - Fastcomp is the default compiler core for Emscripten"
+HOMEPAGE="http://emscripten.org/"
+SRC_URI="https://github.com/kripken/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/kripken/${PN}-clang/archive/${PV}.tar.gz -> ${PN}-clang-${PV}.tar.gz"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+LICENSE="UoI-NCSA"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="${PYTHON_DEPS}
+ net-libs/nodejs"
+RDEPEND="${DEPEND}
+ >=virtual/jre-1.5"
+
+src_configure() {
+ # create symlink to tools/clang
+ ln -s "${WORKDIR}/${PN}-clang-${PV}/" "${WORKDIR}/${P}/tools/clang" \
+ || die "Could not create symlink to tools/clang"
+ local mycmakeargs=(
+ # avoid clashes with sys-devel/llvm
+ -DCMAKE_INSTALL_PREFIX="/usr/share/${P}"
+ -DLLVM_TARGETS_TO_BUILD="X86;JSBackend"
+ -DLLVM_INCLUDE_EXAMPLES=OFF
+ -DLLVM_INCLUDE_TESTS=OFF
+ -DCLANG_INCLUDE_EXAMPLES=OFF
+ -DCLANG_INCLUDE_TESTS=OFF
+ )
+ cmake-utils_src_configure
+}
diff --git a/dev-util/emscripten-fastcomp/metadata.xml b/dev-util/emscripten-fastcomp/metadata.xml
new file mode 100644
index 000000000..c517ec517
--- /dev/null
+++ b/dev-util/emscripten-fastcomp/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>harald.weiner@jku.at</email>
+ <name>Harald Weiner</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-util/emscripten/Manifest b/dev-util/emscripten/Manifest
new file mode 100644
index 000000000..0d243047a
--- /dev/null
+++ b/dev-util/emscripten/Manifest
@@ -0,0 +1 @@
+DIST emscripten-1.34.11.tar.gz 31637704 SHA256 4b2790279372ea016dbe64eda95cfde3f2a695e369c5f7cd9a62e2f69991ceb7 SHA512 8ecd3972b6ea3ccf27a8ab2532716910cf1d0425e3708a3a4b9808182c2662591b6389cbf27bc98a2b96ecb8948fc1e0bc3204cb3c88bb349f29c0ba55758088 WHIRLPOOL 266782cdbc44c3ccb036ea8f02dafc2d7fe3f5d1ea1aa5fe8d2deff30c73b08a95dd1d22251df9d4f666277ea73da5bc88ade3b5ce1531b7158b112be05e3b2e
diff --git a/dev-util/emscripten/emscripten-1.34.11.ebuild b/dev-util/emscripten/emscripten-1.34.11.ebuild
new file mode 100644
index 000000000..1ab9f7f1c
--- /dev/null
+++ b/dev-util/emscripten/emscripten-1.34.11.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1
+
+DESCRIPTION="LLVM-to-JavaScript Compiler"
+HOMEPAGE="http://emscripten.org/"
+SRC_URI="https://github.com/kripken/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+LICENSE="UoI-NCSA"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="${PYTHON_DEPS}
+ =dev-util/emscripten-fastcomp-1.34.11
+ net-libs/nodejs"
+RDEPEND="${DEPEND}"
+
+DEST="/usr/share/"
+TEST="${WORKDIR}/test/"
+
+src_prepare() {
+ cp "${FILESDIR}/emscripten.config" "${S}/" || die "could not copy .config file"
+ cp "${FILESDIR}/99emscripten" "${S}/" || die "could not copy 99emscripten file"
+}
+
+src_test() {
+ mkdir "${TEST}" || die "Could not create test directory!"
+ cp "${FILESDIR}/hello_world.cpp" "${TEST}" || die "Could not copy example file"
+ cp "${FILESDIR}/emscripten.config" "${TEST}" || die "Could not copy config file"
+ sed -i -e "/^EMSCRIPTEN_ROOT/s|/usr/share/|${S}|" \
+ "${TEST}/emscripten.config" || die "Could not adjust path for testing"
+ export EM_CONFIG="${TEST}/emscripten.config" || die "Could not export variable"
+ ../"${P}/emcc" "${TEST}/hello_world.cpp" -o "${TEST}/hello_world.js" || \
+ die "Error during executing emcc!"
+ test -f "${TEST}/hello_world.js" || die "Could not find '${TEST}/hello_world.js'"
+ OUT=$(/usr/bin/node "${TEST}/hello_world.js") || \
+ die "Could not execute /usr/bin/node"
+ EXP=$(echo -e -n 'Hello World!\n \n') || die "Could not create expected string"
+ if [ "${OUT}" != "${EXP}" ]; then
+ die "Expected '${EXP}' but got '${OUT}'!"
+ fi
+ rm -r "${TEST}" || die "Could not clean-up '${TEST}'"
+}
+
+src_install() {
+ dodir ${DEST}/${P}
+ cp -R "${S}/" "${D}/${DEST}" || die "Could not install files"
+ dosym ../share/${P}/emcc /usr/bin/emcc
+ dosym ../share/${P}/emcmake /usr/bin/emcmake
+ doenvd 99emscripten
+ ewarn "If you consider using emscripten in an active shell,"\
+ "please execute 'source /etc/profile'"
+}
+
+pkg_postinst() {
+ elog "Running emscripten initialization, may take a few seconds..."
+ export EM_CONFIG="${DEST}/${P}/emscripten.config" || die "Could not export variable"
+ /usr/bin/emcc -v || die "Could not run emcc initialization"
+}
diff --git a/dev-util/emscripten/files/99emscripten b/dev-util/emscripten/files/99emscripten
new file mode 100644
index 000000000..505108912
--- /dev/null
+++ b/dev-util/emscripten/files/99emscripten
@@ -0,0 +1 @@
+EM_CONFIG=/usr/share/emscripten-1.34.11/emscripten.config
diff --git a/dev-util/emscripten/files/emscripten.config b/dev-util/emscripten/files/emscripten.config
new file mode 100644
index 000000000..dc56c9264
--- /dev/null
+++ b/dev-util/emscripten/files/emscripten.config
@@ -0,0 +1,56 @@
+
+# Note: If you put paths relative to the home directory, do not forget os.path.expanduser
+
+# Note: On Windows, remember to escape backslashes! I.e. EMSCRIPTEN_ROOT='c:\emscripten\' is not valid, but EMSCRIPTEN_ROOT='c:\\emscripten\\' and EMSCRIPTEN_ROOT='c:/emscripten/' are.
+
+import os
+
+# this helps projects using emscripten find it
+EMSCRIPTEN_ROOT = os.path.expanduser(os.getenv('EMSCRIPTEN') or '/usr/share/emscripten-1.34.11') # directory
+LLVM_ROOT = os.path.expanduser(os.getenv('LLVM') or '/usr/share/emscripten-fastcomp-1.34.11/bin') # directory
+
+# If not specified, defaults to sys.executable.
+#PYTHON = 'python'
+
+# Add this if you have manually built the JS optimizer executable (in Emscripten/tools/optimizer) and want to run it from a custom location.
+# Alternatively, you can set this as the environment variable EMSCRIPTEN_NATIVE_OPTIMIZER.
+# EMSCRIPTEN_NATIVE_OPTIMIZER='/path/to/custom/optimizer(.exe)'
+
+# See below for notes on which JS engine(s) you need
+NODE_JS = os.path.expanduser(os.getenv('NODE') or '/usr/bin/node') # executable
+SPIDERMONKEY_ENGINE = [os.path.expanduser(os.getenv('SPIDERMONKEY') or 'js')] # executable
+V8_ENGINE = os.path.expanduser(os.getenv('V8') or 'd8') # executable
+
+JAVA = 'java' # executable
+
+TEMP_DIR = '/tmp'
+
+CRUNCH = os.path.expanduser(os.getenv('CRUNCH') or 'crunch') # executable
+
+#CLOSURE_COMPILER = '..' # define this to not use the bundled version
+
+########################################################################################################
+
+
+# Pick the JS engine to use for running the compiler. This engine must exist, or
+# nothing can be compiled.
+#
+# Recommendation: If you already have node installed, use that. Otherwise, build v8 or
+# spidermonkey from source. Any of these three is fine, as long as it's
+# a recent version (especially for v8 and spidermonkey).
+
+COMPILER_ENGINE = NODE_JS
+#COMPILER_ENGINE = V8_ENGINE
+#COMPILER_ENGINE = SPIDERMONKEY_ENGINE
+
+
+# All JS engines to use when running the automatic tests. Not all the engines in this list
+# must exist (if they don't, they will be skipped in the test runner).
+#
+# Recommendation: If you already have node installed, use that. If you can, also build
+# spidermonkey from source as well to get more test coverage (node can't
+# run all the tests due to node issue 1669). v8 is currently not recommended
+# here because of v8 issue 1822.
+
+JS_ENGINES = [NODE_JS] # add this if you have spidermonkey installed too, SPIDERMONKEY_ENGINE]
+
diff --git a/dev-util/emscripten/files/hello_world.cpp b/dev-util/emscripten/files/hello_world.cpp
new file mode 100644
index 000000000..85daba3e4
--- /dev/null
+++ b/dev-util/emscripten/files/hello_world.cpp
@@ -0,0 +1,5 @@
+#include <iostream>
+int main(int argc, char ** argv) {
+ std::cout << "Hello World!" << std::endl;
+}
+
diff --git a/dev-util/emscripten/metadata.xml b/dev-util/emscripten/metadata.xml
new file mode 100644
index 000000000..c517ec517
--- /dev/null
+++ b/dev-util/emscripten/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>harald.weiner@jku.at</email>
+ <name>Harald Weiner</name>
+ </maintainer>
+</pkgmetadata>