diff options
Diffstat (limited to 'dev-util/emscripten')
-rw-r--r-- | dev-util/emscripten/Manifest | 1 | ||||
-rw-r--r-- | dev-util/emscripten/emscripten-1.36.7.ebuild | 75 | ||||
-rw-r--r-- | dev-util/emscripten/files/1.36.7/emcc.patch | 16 | ||||
-rw-r--r-- | dev-util/emscripten/files/1.36.7/emcmake.patch | 16 |
4 files changed, 108 insertions, 0 deletions
diff --git a/dev-util/emscripten/Manifest b/dev-util/emscripten/Manifest index bd7e7b664..2e06b1493 100644 --- a/dev-util/emscripten/Manifest +++ b/dev-util/emscripten/Manifest @@ -1,3 +1,4 @@ DIST emscripten-1.34.11.tar.gz 31637704 SHA256 4b2790279372ea016dbe64eda95cfde3f2a695e369c5f7cd9a62e2f69991ceb7 SHA512 8ecd3972b6ea3ccf27a8ab2532716910cf1d0425e3708a3a4b9808182c2662591b6389cbf27bc98a2b96ecb8948fc1e0bc3204cb3c88bb349f29c0ba55758088 WHIRLPOOL 266782cdbc44c3ccb036ea8f02dafc2d7fe3f5d1ea1aa5fe8d2deff30c73b08a95dd1d22251df9d4f666277ea73da5bc88ade3b5ce1531b7158b112be05e3b2e DIST emscripten-1.35.2.tar.gz 31758712 SHA256 56feaa3037ec72e2d5299b0a92d7e3b9e1da164db32338c1fe02fe3ca68d8adb SHA512 a7391424a8a0845062360c0ccecda30030e32cb6732009b83a781baef0f7cfd6890fe1ad95531380221b728d707cb315157f2717597e1ca74aedc5e8a73e64e6 WHIRLPOOL 092f8d98d2571b18422a2fde48802520b74739be9ad9402ff317176a3260f72695cee5e84eef9644e9659bc503c9d8b75b5a510f67a71f4b78545fc5c45db4b3 DIST emscripten-1.36.4.tar.gz 31955402 SHA256 bb4b224467829bc14e26ec7f5603e36312e2edb8a4a33267dde67c6f0e33e260 SHA512 3e68b557ac941f63fcb8dd01bf87d0f656fa3f7494172175de2a66352b1161e080a0c8c952930e1a65e56fb40797e2b5efa9008f7374db07373cda67530dd96b WHIRLPOOL 2d7c1a710b0782844b3e4593e43b02c4ad81449423289efaa4179b08661f6a97828d6aa3f03cdeb7d5a4f7739199306cb24c2a56056c8474ccee53fa6a43deba +DIST emscripten-1.36.7.tar.gz 31986467 SHA256 62848a2d1b0618c63f2c1d7295803204a7a07637c3a91623e3b1f1ebe459abe4 SHA512 8381f1531b6439a3ede86d98a1488f6b4d05734d637a45ea04285e7c2551ce59cf625f5867e7faf611aa71af3194eb34bd702528ea2655c70d39272c311e9e48 WHIRLPOOL 67ac47b2365bf072f89919d225ecdcd3d3d5c11df5b9dbe76576a7e548c75c1c44f5ae8e0c8da00b21a17561e274d7dfd599ea2b458945056b5ea8a831b41137 diff --git a/dev-util/emscripten/emscripten-1.36.7.ebuild b/dev-util/emscripten/emscripten-1.36.7.ebuild new file mode 100644 index 000000000..e3734db1b --- /dev/null +++ b/dev-util/emscripten/emscripten-1.36.7.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +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-${PV} + >=net-libs/nodejs-0.12.6" +RDEPEND="${DEPEND}" + +DEST="/usr/share/" +TEST="${WORKDIR}/test/" + +prepare_file() { + cp "${FILESDIR}/${1}" "${S}/" || die "could not copy '${1}'" + sed -i "s/\${PV}/${PV}/g" "${S}/${1}" || \ + die "could not adjust path for '${1}'" +} + +src_prepare() { + prepare_file "99emscripten" + prepare_file "emscripten.config" + eapply "${FILESDIR}/${PV}/emcc.patch" + eapply "${FILESDIR}/${PV}/emcmake.patch" + eapply_user +} + +src_test() { + mkdir "${TEST}" || die "Could not create test directory!" + cp "${FILESDIR}/hello_world.cpp" "${TEST}" || die "Could not copy example file" + cp "${S}/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') || 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/1.36.7/emcc.patch b/dev-util/emscripten/files/1.36.7/emcc.patch new file mode 100644 index 000000000..49bf9fd0b --- /dev/null +++ b/dev-util/emscripten/files/1.36.7/emcc.patch @@ -0,0 +1,16 @@ +--- a/emcc.orig 2016-05-13 02:59:24.977645718 +0200 ++++ b/emcc 2016-05-13 03:00:22.778643301 +0200 +@@ -4,6 +4,7 @@ + + + import sys ++import os + + + +@@ -14,4 +15,4 @@ + else: + import os, subprocess + if __name__ == '__main__': +- sys.exit(subprocess.call(['python2', os.path.join(os.path.dirname(__file__), 'emcc.py')] + sys.argv[1:])) ++ sys.exit(subprocess.call(['python2', os.path.join(os.path.dirname(os.environ['EM_CONFIG']), 'emcc.py')] + sys.argv[1:])) diff --git a/dev-util/emscripten/files/1.36.7/emcmake.patch b/dev-util/emscripten/files/1.36.7/emcmake.patch new file mode 100644 index 000000000..02ce70321 --- /dev/null +++ b/dev-util/emscripten/files/1.36.7/emcmake.patch @@ -0,0 +1,16 @@ +--- a/emcmake.orig 2016-05-13 02:59:31.244645456 +0200 ++++ b/emcmake 2016-05-13 03:03:54.995634425 +0200 +@@ -4,6 +4,7 @@ + + + import sys ++import os + + + +@@ -14,4 +15,4 @@ + else: + import os, subprocess + if __name__ == '__main__': +- sys.exit(subprocess.call(['python2', os.path.join(os.path.dirname(__file__), 'emcmake.py')] + sys.argv[1:])) ++ sys.exit(subprocess.call(['python2', os.path.join(os.path.dirname(os.environ['EM_CONFIG']), 'emcmake.py')] + sys.argv[1:])) |