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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20