public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: dev-util/emscripten/files/1.36.7/, dev-util/emscripten-fastcomp/, ...
@ 2016-08-14 19:25 Justin Lecher
  0 siblings, 0 replies; only message in thread
From: Justin Lecher @ 2016-08-14 19:25 UTC (permalink / raw
  To: gentoo-commits

commit:     79a942d7c6b2338405a2b054afc096ddd69a7199
Author:     Harald Weiner <timeraider4u <AT> users <DOT> noreply <DOT> github <DOT> com>
AuthorDate: Fri Aug 12 11:02:17 2016 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Fri Aug 12 11:02:17 2016 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=79a942d7

dev-util/emscripten: version bump to 1.36.7 (#657)

Package manager: portage-2.2.28

 .../emscripten-fastcomp-1.36.7.ebuild              | 53 +++++++++++++++
 .../files/1.36.7/CMakeLists.txt.patch              | 10 +++
 .../files/1.36.7/Version.cpp.patch                 | 14 ++++
 dev-util/emscripten/emscripten-1.36.7.ebuild       | 75 ++++++++++++++++++++++
 dev-util/emscripten/files/1.36.7/emcc.patch        | 16 +++++
 dev-util/emscripten/files/1.36.7/emcmake.patch     | 16 +++++
 6 files changed, 184 insertions(+)

diff --git a/dev-util/emscripten-fastcomp/emscripten-fastcomp-1.36.7.ebuild b/dev-util/emscripten-fastcomp/emscripten-fastcomp-1.36.7.ebuild
new file mode 100644
index 0000000..33146ef
--- /dev/null
+++ b/dev-util/emscripten-fastcomp/emscripten-fastcomp-1.36.7.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+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}"
+
+MY_DEPEND="${PYTHON_DEPS}
+	>=net-libs/nodejs-0.12.6"
+DEPEND="${MY_DEPEND}
+	>=dev-util/cmake-3.4.3"
+RDEPEND="${MY_DEPEND}
+	>=virtual/jre-1.5"
+
+src_prepare() {
+	eapply "${FILESDIR}/${PV}/CMakeLists.txt.patch"
+	cd "${S}/../${PN}-clang-${PV}" || \
+		die "Could not change to directory '${S}/../${PN}-clang-${PV}'"
+	eapply "${FILESDIR}/${PV}/Version.cpp.patch"
+	cd "${S}" || die "Could not change to directory '${S}'"
+	eapply_user
+}
+
+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
+		-DCLANG_INCLUDE_DOCS=OFF
+		-DLLVM_INCLUDE_DOCS=OFF
+	)
+	cmake-utils_src_configure
+}

diff --git a/dev-util/emscripten-fastcomp/files/1.36.7/CMakeLists.txt.patch b/dev-util/emscripten-fastcomp/files/1.36.7/CMakeLists.txt.patch
new file mode 100644
index 0000000..d053132
--- /dev/null
+++ b/dev-util/emscripten-fastcomp/files/1.36.7/CMakeLists.txt.patch
@@ -0,0 +1,10 @@
+--- a/CMakeLists.txt.orig       2016-05-12 13:26:02.739443914 +0200
++++ b/CMakeLists.txt    2016-05-12 13:26:26.448733236 +0200
+@@ -175,7 +175,7 @@
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+
+ if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
++    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL|GENTOO)$")
+   message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+ endif()

diff --git a/dev-util/emscripten-fastcomp/files/1.36.7/Version.cpp.patch b/dev-util/emscripten-fastcomp/files/1.36.7/Version.cpp.patch
new file mode 100644
index 0000000..291a1ea
--- /dev/null
+++ b/dev-util/emscripten-fastcomp/files/1.36.7/Version.cpp.patch
@@ -0,0 +1,14 @@
+--- a/lib/Basic/Version.cpp       2016-03-17 23:31:35.160129074 +0100
++++ b/lib/Basic/Version.cpp       2016-03-17 23:32:07.722127712 +0100
+@@ -135,9 +135,9 @@
+
+   // XXX EMSCRIPTEN: show our versions
+   OS <<  " (emscripten "
+-#include "../../../../emscripten-version.txt"
++#include "../../emscripten-version.txt"
+          " : "
+-#include "../../../../tools/clang/emscripten-version.txt"
++#include "../../emscripten-version.txt"
+          ")";
+
+   return OS.str();

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 0000000..e3734db
--- /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 0000000..49bf9fd
--- /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 0000000..02ce703
--- /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:]))


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-14 19:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-14 19:25 [gentoo-commits] proj/sci:master commit in: dev-util/emscripten/files/1.36.7/, dev-util/emscripten-fastcomp/, Justin Lecher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox