parlay

yet another gentoo overlay
git clone https://git.parazyd.org/parlay
Log | Files | Refs | README

emscripten-2.0.8.ebuild (2015B)


      1 # Copyright 1999-2021 Gentoo Authors
      2 # Distributed under the terms of the GNU General Public License v2
      3 
      4 # This is a horrible ebuild. Don't use it as an example how to write one.
      5 # TODO:
      6 # * remove network access from npm ci
      7 # * use supported versions of LLVM and binaryen (current it requires git head)
      8 # * enable tests
      9 # * use the python eclass properly
     10 # * fperms +x is wrong
     11 # * fix many QA issues
     12 
     13 EAPI=7
     14 
     15 PYTHON_COMPAT=( python3_{7..9} )
     16 inherit python-single-r1
     17 
     18 DESCRIPTION="Emscripten is a complete compiler toolchain to WebAssembly, using LLVM"
     19 HOMEPAGE="https://emscripten.org"
     20 SRC_URI="https://github.com/emscripten-core/emscripten/archive/${PV}.tar.gz -> ${P}.tar.gz"
     21 
     22 LICENSE="MIT" # TODO: or illinois one
     23 SLOT="0"
     24 KEYWORDS="~amd64"
     25 IUSE=""
     26 RESTRICT="network-sandbox test"
     27 
     28 RDEPEND="
     29 	${BDEPEND}
     30 	dev-util/binaryen
     31 	sys-devel/clang:11[llvm_targets_WebAssembly]
     32 	virtual/jre
     33 "
     34 BDEPEND="net-libs/nodejs:="
     35 
     36 PATCHES=(
     37 	"${FILESDIR}"/emscripten-2.0.8-wasm-ld.patch
     38 	"${FILESDIR}"/emscripten-2.0.8-py-runner.patch
     39 )
     40 
     41 src_prepare() {
     42 	default
     43 	npm ci || die
     44 	sed -e "s|GENTOO_PREFIX|${EPREFIX}|" -e "s|GENTOO_LIB|$(get_libdir)|" < "${FILESDIR}/config" > .emscripten || die
     45 	sed -i -e "s|GENTOO_PREFIX|${EPREFIX}|" -e "s|GENTOO_LIB|$(get_libdir)|" -e "s|GENTOO_PYTHON|${EPYTHON}|" tools/shared.py tools/run_python.sh || die
     46 }
     47 
     48 src_compile() {
     49 	:
     50 }
     51 
     52 src_install() {
     53 	dodir /usr/bin
     54 	tools/create_entry_points.py || die
     55 	insinto "/usr/$(get_libdir)/emscripten"
     56 	doins -r .
     57 	fperms +x \
     58 		"/usr/$(get_libdir)/emscripten/em++" \
     59 		"/usr/$(get_libdir)/emscripten/emar" \
     60 		"/usr/$(get_libdir)/emscripten/embuilder" \
     61 		"/usr/$(get_libdir)/emscripten/emcc" \
     62 		"/usr/$(get_libdir)/emscripten/emcmake" \
     63 		"/usr/$(get_libdir)/emscripten/em-config" \
     64 		"/usr/$(get_libdir)/emscripten/emconfigure" \
     65 		"/usr/$(get_libdir)/emscripten/emmake" \
     66 		"/usr/$(get_libdir)/emscripten/emranlib" \
     67 		"/usr/$(get_libdir)/emscripten/emrun" \
     68 		"/usr/$(get_libdir)/emscripten/emscons" \
     69 		"/usr/$(get_libdir)/emscripten/emsize"
     70 }