/[gentoo-x86]/net-libs/iojs/iojs-3.0.0.ebuild
Gentoo

Contents of /net-libs/iojs/iojs-3.0.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Wed Aug 5 02:01:48 2015 UTC (5 years ago) by patrick
Branch: MAIN
CVS Tags: HEAD
Bump

(Portage version: 2.2.20/cvs/Linux x86_64, unsigned Manifest commit)

1 patrick 1.1 # Copyright 1999-2015 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: /var/cvsroot/gentoo-x86/net-libs/iojs/iojs-2.5.0.ebuild,v 1.1 2015/07/31 02:55:51 patrick Exp $
4    
5     EAPI=5
6    
7     PYTHON_COMPAT=( python2_7 )
8    
9     MY_PV="v${PV}"
10     MY_P="${PN}-${MY_PV}"
11    
12     inherit flag-o-matic pax-utils python-single-r1 toolchain-funcs
13    
14     DESCRIPTION="An npm compatible platform originally based on node.js"
15     HOMEPAGE="http://iojs.org/"
16     SRC_URI="http://iojs.org/dist/${MY_PV}/${MY_P}.tar.xz"
17    
18     LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
19     SLOT="0"
20     KEYWORDS="~amd64 ~arm ~x86 ~x64-macos"
21     IUSE="debug icu +npm snapshot +ssl"
22    
23     RDEPEND="icu? ( dev-libs/icu )
24     ${PYTHON_DEPS}
25     >=net-libs/http-parser-2.5
26     >=dev-libs/libuv-1.6.1
27     >=dev-libs/openssl-1.0.2d[-bindist]"
28     DEPEND="${RDEPEND}
29     !!net-libs/nodejs"
30     S="${WORKDIR}/${MY_P}"
31     REQUIRED_USE="${PYTHON_REQUIRED_USE}"
32    
33     pkg_pretend() {
34     if ! test-flag-CXX -std=c++11 ; then
35     die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
36     fi
37     }
38    
39     src_prepare() {
40     tc-export CC CXX PKG_CONFIG
41     export V=1 # Verbose build
42     export BUILDTYPE=Release
43    
44     # fix compilation on Darwin
45     # http://code.google.com/p/gyp/issues/detail?id=260
46     sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
47    
48     # make sure we use python2.* while using gyp
49     sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
50     sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
51    
52     # less verbose install output (stating the same as portage, basically)
53     sed -i -e "/print/d" tools/install.py || die
54    
55     # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
56     local LIBDIR=$(get_libdir)
57     sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
58     sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die
59     sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die
60    
61     # Avoid a test that I've only been able to reproduce from emerge. It doesnt
62     # seem sandbox related either (invoking it from a sandbox works fine).
63     # The issue is that no stdin handle is openened when asked for one.
64     # It doesn't really belong upstream , so it'll just be removed until someone
65     # with more gentoo-knowledge than me (jbergstroem) figures it out.
66     rm test/parallel/test-stdout-close-unref.js || die
67    
68     # debug builds. change install path, remove optimisations and override buildtype
69     if use debug; then
70     sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
71     BUILDTYPE=Debug
72     fi
73    
74     epatch_user
75     }
76    
77     src_configure() {
78     local myarch=""
79     local myconf+=( --shared-openssl --shared-libuv --shared-http-parser --shared-zlib )
80     use npm || myconf+=( --without-npm )
81     use icu && myconf+=( --with-intl=system-icu )
82     use snapshot && myconf+=( --with-snapshot )
83     use ssl || myconf+=( --without-ssl )
84     use debug && myconf+=( --debug )
85    
86     case ${ABI} in
87     x86) myarch="ia32";;
88     amd64) myarch="x64";;
89     x32) myarch="x32";;
90     arm) myarch="arm";;
91     arm64) myarch="arm64";;
92     *) die "Unrecognized ARCH ${ARCH}";;
93     esac
94    
95     "${PYTHON}" configure \
96     --prefix="${EPREFIX}"/usr \
97     --dest-cpu=${myarch} \
98     --without-dtrace \
99     "${myconf[@]}" || die
100     }
101    
102     src_compile() {
103     emake -C out mksnapshot
104     pax-mark m "out/${BUILDTYPE}/mksnapshot"
105     emake -C out
106     }
107    
108     src_install() {
109     local LIBDIR="${ED}/usr/$(get_libdir)"
110     emake install DESTDIR="${ED}" PREFIX=/usr
111     use npm && dodoc -r "${LIBDIR}"/node_modules/npm/html
112     rm -rf "${LIBDIR}"/node_modules/npm/{doc,html} || die
113     find "${LIBDIR}"/node_modules -type f -name "LICENSE*" -or -name "LICENCE*" -delete || die
114    
115     # set up a symlink structure that npm expects..
116     dodir /usr/include/node/deps/{v8,uv}
117     dosym . /usr/include/node/src
118     for var in deps/{uv,v8}/include; do
119     dosym ../.. /usr/include/node/${var}
120     done
121    
122     pax-mark -m "${ED}"/usr/bin/iojs
123     }
124    
125     src_test() {
126     out/${BUILDTYPE}/cctest || die
127     declare -xl TESTTYPE="${BUILDTYPE}"
128     "${PYTHON}" tools/test.py --mode=${TESTTYPE} -J message parallel sequential || die
129     }
130    
131     pkg_postinst() {
132     einfo "When using node-gyp to install native modules, you can avoid"
133     einfo "having to download the full tarball by doing the following:"
134     einfo ""
135     einfo "node-gyp --nodedir /usr/include/node <command>"
136     }

  ViewVC Help
Powered by ViewVC 1.1.20