Created
April 18, 2015 06:53
-
-
Save nidev/65c142dd82b2d9f09e5d to your computer and use it in GitHub Desktop.
dev-lang/dart-9999 standalone ebuild
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 1999-2015 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
# $Header: $ | |
EAPI=5 | |
DESCRIPTION="Dart is a cohesive, scalable platform for building apps that run on the web. (Full suite)" | |
HOMEPAGE="https://www.dartlang.org/" | |
SRC_URI="" | |
inherit subversion git-r3 eutils autotools | |
LICENSE="BSD" | |
SLOT="0" | |
KEYWORDS="~amd64 ~x86" | |
IUSE="" | |
DEPEND=" | |
dev-lang/python:2.7 | |
>=virtual/jdk-1.7.0 | |
>=sys-devel/gcc-4.6.0 | |
dev-vcs/git[subversion] | |
" | |
RDEPEND="${DEPEND}" | |
URI_DEPOT_TOOLS="https://chromium.googlesource.com/chromium/tools/depot_tools.git" | |
URI_DART_GCONFIG="http://dart.googlecode.com/svn/branches/bleeding_edge/deps/standalone.deps" | |
src_unpack() { | |
# build tools | |
einfo "Fetching depot_tools from googlesource" | |
git-r3_fetch ${URI_DEPOT_TOOLS} | |
git-r3_checkout ${URI_DEPOT_TOOLS} depot_tools | |
einfo "Fetching Dart using depot_tools" | |
depot_tools/gclient config ${URI_DART_GCONFIG} | |
depot_tools/gclient sync || die | |
mv dart ${P} | |
cd "${S}" | |
} | |
src_prepare() { | |
einfo "Start to build Dart Standalone" | |
} | |
src_compile() { | |
local option_params | |
option_params=" -m release" | |
if use amd64; then | |
option_params="${option_params} -a x64" | |
elif use x86; then | |
option_params="${option_params} -a ia32" | |
else | |
eerror "Currently this ebuild does not support any other architecture except x86/amd64." | |
die | |
fi | |
option_params="${option_params} --os=host" | |
./tools/build.py ${option_params} || die | |
} | |
src_install() { | |
elog "Clean up object files" | |
rm -rf ${S}/out/Release*/obj* | |
elog "Copying dart to image folder" | |
dodir /opt/dart | |
cp -R ${S}/out/Release*/* ${D}/opt/dart/ || "Install failed!" | |
elog "Fixing symbolic links of packages" | |
rm ${D}/opt/dart/packages/* | |
rm ${S}/third_party/pkg/*.sh | |
rm ${S}/third_party/pkg/README | |
ls ${S}/third_party/pkg/|xargs -I{} mv ${S}/third_party/pkg/{}/lib ${D}/opt/dart/packages/{} | |
} | |
pkg_postinst() { | |
einfo "Dart is installed at /opt/dart. Due to special folder structure," | |
einfo "You may need to add /opt/dart to your PATH manually." | |
ewarn "Be aware this ebuild is LIVE ebuild." | |
ewarn "Do not report build errors except the errors with ebuild" | |
} | |
pkg_preinst() { | |
ewarn "This ebuild builds dart from bleeding-edge branch." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment