1
0
mirror of synced 2024-12-23 13:20:22 +01:00

98 lines
2.4 KiB
Bash
Raw Normal View History

2015-02-02 17:07:55 +01:00
# Copyright 1999-2014 Gentoo Foundation
2014-08-17 00:33:24 +02:00
# Distributed under the terms of the GNU General Public License v2
2015-02-02 17:07:55 +01:00
# $Header: $
2014-08-17 00:33:24 +02:00
EAPI=5
PYTHON_COMPAT=( python2_7 )
2015-02-02 17:07:55 +01:00
inherit git-r3 flag-o-matic python-any-r1 eutils
2014-08-17 00:33:24 +02:00
2015-02-02 17:07:55 +01:00
DESCRIPTION="A hackable text editor for the 21st Century"
HOMEPAGE="https://atom.io"
2014-08-17 00:33:24 +02:00
SRC_URI=""
2015-02-02 17:07:55 +01:00
EGIT_REPO_URI="git://github.com/atom/atom"
2014-08-17 00:33:24 +02:00
LICENSE="MIT"
2015-02-02 17:07:55 +01:00
SLOT="0"
if [[ ${PV} == *9999 ]];then
KEYWORDS=""
else
KEYWORDS="~amd64"
EGIT_COMMIT="v${PV}"
fi
IUSE=""
2014-08-17 00:33:24 +02:00
DEPEND="
2015-02-02 17:07:55 +01:00
${PYTHON_DEPS}
dev-util/atom-shell:0/19
>=net-libs/nodejs-0.10.30[npm]
media-fonts/inconsolata
2014-08-17 00:33:24 +02:00
"
2015-02-02 17:07:55 +01:00
RDEPEND="${DEPEND}"
2014-08-17 00:33:24 +02:00
2015-02-02 17:07:55 +01:00
QA_PRESTRIPPED="
/usr/share/atom/node_modules/symbols-view/vendor/ctags-linux
2014-08-17 00:33:24 +02:00
"
2015-02-02 17:07:55 +01:00
pkg_setup() {
python-any-r1_pkg_setup
npm config set python $PYTHON
}
src_unpack() {
git-r3_src_unpack
}
src_prepare() {
# Skip atom-shell download
sed -i -e "s/defaultTasks = \['download-atom-shell', /defaultTasks = [/g" \
./build/Gruntfile.coffee \
|| die "Failed to fix Gruntfile"
# Skip atom-shell copy
epatch "${FILESDIR}/0002-skip-atom-shell-copy.patch"
# Fix atom location guessing
sed -i -e 's/ATOM_PATH="$USR_DIRECTORY\/share\/atom/ATOM_PATH="$USR_DIRECTORY\/../g' \
./atom.sh \
|| die "Fail fixing atom-shell directory"
}
2014-08-17 00:33:24 +02:00
src_compile() {
2015-02-02 17:07:55 +01:00
./script/build --verbose --build-dir "${T}" || die "Failed to compile"
"${T}/Atom/resources/app/apm/node_modules/atom-package-manager/bin/apm" rebuild || die "Failed to rebuild native module"
2014-08-17 00:33:24 +02:00
}
src_install() {
2015-02-02 17:07:55 +01:00
into /usr
insinto /usr/share/applications
insinto /usr/share/${PN}/resources/app
exeinto /usr/bin
2014-08-17 00:33:24 +02:00
2015-02-02 17:07:55 +01:00
cd "${T}/Atom/resources/app"
doicon resources/atom.png
dodoc LICENSE.md
# Installs everything in Atom/resources/app
doins -r .
# Fixes permissions
fperms +x /usr/share/${PN}/resources/app/atom.sh
fperms +x /usr/share/${PN}/resources/app/apm/node_modules/.bin/apm
fperms +x /usr/share/${PN}/resources/app/apm/node_modules/atom-package-manager/bin/node
fperms +x /usr/share/${PN}/resources/app/apm/node_modules/atom-package-manager/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
# Symlinking to /usr/bin
dosym ../share/${PN}/resources/app/atom.sh /usr/bin/atom
dosym ../share/${PN}/resources/app/apm/node_modules/atom-package-manager/bin/apm /usr/bin/apm
make_desktop_entry "/usr/bin/atom %U" "Atom" "atom" "GNOME;GTK;Utility;TextEditor;Development;" "MimeType=text/plain;\nStartupNotify=true\nStartupWMClass=Atom"
}