summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Pranskevichus <elvis@magic.io>2017-02-01 10:31:09 -0500
committerMikhail Pukhlikov <cynede@gentoo.org>2017-02-08 16:40:37 +0400
commit2614f489c95624b45b9c5e573887a4a6baeb3326 (patch)
treed158f23f803490a3113121742fa7065ab11ac3b9 /app-editors
parentdev-util/electron: Fix compilation with cups-2.2, bump to 1.3.13. (diff)
downloadgentoo-2614f489c95624b45b9c5e573887a4a6baeb3326.tar.gz
gentoo-2614f489c95624b45b9c5e573887a4a6baeb3326.tar.bz2
gentoo-2614f489c95624b45b9c5e573887a4a6baeb3326.zip
app-editors/atom: Version bump to 1.12.7, 1.13.1
Package-Manager: portage-2.3.3 Closes: https://github.com/gentoo/gentoo/pull/3761
Diffstat (limited to 'app-editors')
-rw-r--r--app-editors/atom/Manifest6
-rw-r--r--app-editors/atom/atom-1.12.7.ebuild (renamed from app-editors/atom/atom-1.12.2.ebuild)5
-rw-r--r--app-editors/atom/atom-1.13.1.ebuild407
-rw-r--r--app-editors/atom/files/atom-1.13-apm-path.patch16
-rw-r--r--app-editors/atom/files/atom-fix-app-restart.patch12
5 files changed, 442 insertions, 4 deletions
diff --git a/app-editors/atom/Manifest b/app-editors/atom/Manifest
index 0e8e0bf35e32..0186079974c9 100644
--- a/app-editors/atom/Manifest
+++ b/app-editors/atom/Manifest
@@ -1,8 +1,10 @@
DIST asar-0.12.1.tar.gz 1016626 SHA256 731714f0036318fe0878b517391a01977954bb088d4dbc7dd98682ff1e03c0e7 SHA512 fc64be9b11215426d405f7acd7adf6c0eead3135b0012baf6d168a13c77675058a4e2c60682928ac014e4bef4538d452ad745d1e87dd315387997a19e04718a7 WHIRLPOOL d73b8bb459724bb3b011de312171519c1f1954a94ce1bb0a20eb9877c168baa82a15786d3ab420d5b3d32ce8a11333e85f844b43c21cbd56c3b019e73774388e
-DIST atom-1.12.2.rpm 84876214 SHA256 bcf95d7a8f4105c016d2940540d7c8db9bf0948a7dc8b5411294bd0fac48ec15 SHA512 a63af5e0da6ce0e9cc70c47da55b13fe463903c27a7df4e7ce311f08ed16fb4e04712678479661febcdf70afa400e3a8235d540bacaf4078e92b1e3d42fdfc11 WHIRLPOOL 4d6793741496cc240da18540bb74751b193e293a2df14c365c8fed2a2672422f87b36c5faf324790cc45951c8006a4b482656e8c8d3fd46d723c12c8ca073b4e
+DIST atom-1.12.7.rpm 84755598 SHA256 8eaa5426c9209efc91969e3f3b1535f2c1895daf6259c07cbd595dd0a599553f SHA512 f2d582eb916e95373a08a1e56b89492f52547ab853fae7975b8193ee5d0a23dfc86bcaf9de5b53bc0dbd955c784abfede5b162fb6ef5ee0f7424fc0882da848c WHIRLPOOL aa029e8ef519f475b0a9a9f592cb685b4f15f4c257774c7ca644ed69bf50128bce4c382581b133e7c43438f690ed6b3d791ad379109b96a8ef9893ef93e0ad98
+DIST atom-1.13.1.rpm 86119349 SHA256 593fa81abb3a3a8c89713de1fb9d7d3dd4e4b34211de69fee67469b63be98f01 SHA512 57e587441fbc5ed7864d54f067386a54e854c761b3ad577e07d58253d693c90de934af98e1dc16bf1b645a7b87e9169d0a869509c0192103ddede51a1d8b95d6 WHIRLPOOL 51b8ce72c4b9b01ca8afc3ae5a548e0dbf437fc629305acf357c6de44a05b20a7d8736c89d78cd1cb84fe22109445e5d9d773e0d50e321fcdabca015f64a55a7
+DIST atom-buffer-offset-index-9588080533c9d0a8a71ee1cfd98596f485940e91.tar.gz 5558 SHA256 ea940264e4d6f2b5ad319c50e7e4ece64e1fd4d1f790c847dedf0a5bc4e9b2c9 SHA512 ebcfa7057c9db85a7884cbb19fa561821fc883bbd6a5d0186fcf68782697a7c7677e019334b44b3477d26e1febccb3a7690dc3390dcb55ca838e176f390b11b7 WHIRLPOOL 1c438ec18c2fcf1c7b1a11421eb9944a2fd90f920dc4dc5cf0b8c5300f9f285cc993689312a23b9882f13316956077bf9994173c0b1c9cd54c6f5ccdd667d16f
DIST atom-cached-run-in-this-context-0.4.1.tar.gz 3855 SHA256 5487e7641d5031e652deeef8bebe2d3af4e4d2b89989dd8700bf14e33843ce89 SHA512 dca2a6c77bb94e704aa99b405ae017bf0c56ce536a7246a8feaf133722556d444fb684cd6b9b475abcd0b946a42073a9fc0d61f5141b564320ac023ab2fbf79d WHIRLPOOL 573d0f703989f31109854f0eb324d6b1364e93cd057c4cfe20409415dee3101964cacabc246d4df43124dad881d8fec8575c6bbb23ba98698e6c73cf3c5614d4
DIST atom-git-utils-4.1.2.tar.gz 36492 SHA256 fd627647742359946d3b8f88bc91dd4d68a047dcba5bfafbd690e1a20afeb908 SHA512 d1f0a5bbd6b059131ccf4ab92174d80caddbb254ea6d0676a5ce71d7dba55d60c86ed1c412862b9d104a5f6deb2671facad84841f9644afb9b37416b743e917a WHIRLPOOL 4ee4620b0208a30f848167fffce05c5999d38bf5a3e50567e6bcf295fdafc7861e870346cfeb28a61392e7a737e100f90ae1dbd25066469926e3148006e02937
-DIST atom-keyboard-layout-2.0.1.tar.gz 18561 SHA256 057d01745b5cfb47381aa89d64344d4c1576d3b490756a25e3f616bfc68f6516 SHA512 f5b90c1c83574cd2cb49c82d11fabadb58ec41d34b5b6ea17b28b8a34b22ed9ce1afb1602cf1d3d28ba79e3cebcb60d8659201eea4c5294e0db2b29d7632b07a WHIRLPOOL a859b0d364b9059f4482b52f049e9a420bf356e00a5cfe5b657fbd0e1868fd6cd2bf39846560b88c9763e1ebc54fb7acb025a67af21182b00c3f83b380f4443f
+DIST atom-keyboard-layout-2.0.7.tar.gz 18687 SHA256 3fb6c702c07d4d7116d73e5ed457f8dd2b07a99eafb7da830c032545d6da1f1e SHA512 96a10dad193d2e870e518eb863e4bf758e1efa86c4e377a3dcb818b5f51d42eaab9211732eddac106b7d4dddf6d9ebe80fb4a16ca24c647a0599a3a92e2c4591 WHIRLPOOL 01c28f7dadb8961ed6480a6ca2f9fab6c7e78436317b12f2731e130af405a456ea21719c0a409aa87248eaee956792fc37dcb040d900e2acc5005917c0f4666c
DIST atom-marker-index-4.0.1.tar.gz 18433 SHA256 ecb6a5294088feb2a2b8ae71845dc262e1ab551a6a75e9ac99b05807b62b2d4a SHA512 2f5639ac0fef1a9d735dc10b464a046ee78f8cf7ecd8a6705232c319958a46056146bd91a0bf421aa0c6da39106f6deacaedaa40c442c0c08f0e6fbfd938b3ea WHIRLPOOL ccbd0f6a515b97a1fcf460f13388206ab3ccee364264203fa6d6ad3d6e68a4e06bad5f38ce19008d2a5f79d2becb14a459cbd016f0daaea48c5387c21ad1bb77
DIST atom-node-ctags-3.0.0.tar.gz 15062 SHA256 40605012d06d4dcbfc369862b57900b6963613e2e4ee3b37fea21693b2b418a7 SHA512 6f7277a0ff872991c365f811c635fd881c3e466c20219d8a7bdaf6fec7c26c5feaa7ae2118691a8d52ceb3ecfda6d795bf39dfda7f8df5a6d02388575a010f87 WHIRLPOOL 2cff81d2ca405a615e5c7d284785f129f8fcd968998c68a42af1ca2e6d76a6fcb404a92f3c0d20220567b28593448b91657db6df8bce19de1f2eedbfe2959140
DIST atom-node-keytar-3.0.2.tar.gz 5718 SHA256 16af03d2a7876e3008f82d35e913753384655bc181e93cb771639b6d5a2439bf SHA512 f08ec6e50071e6e8995244607144009eaa8fd61a1724c80c40ccfb497e2b4682b30d6a091de9480b78f49ceb11f1a655e12ccb6b43d3df34f7e089585381697a WHIRLPOOL 69b10619531bedb839c61c1b29d18d1a0bf4e468ed05ebd58db349010b8de555673f45bdf98c4ad252aaa960b47faa00d952470e9b3545a0e1e189bbb3e49ded
diff --git a/app-editors/atom/atom-1.12.2.ebuild b/app-editors/atom/atom-1.12.7.ebuild
index 4c9b026e9592..19991e71997e 100644
--- a/app-editors/atom/atom-1.12.2.ebuild
+++ b/app-editors/atom/atom-1.12.7.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -34,7 +34,7 @@ MARKER_INDEX_V=4.0.1
NODE_KEYTAR_V=3.0.2
# atom-keymap dependency
-KEYBOARD_LAYOUT_V=2.0.1
+KEYBOARD_LAYOUT_V=2.0.7
# symbols-view dependency
NODE_CTAGS_V=3.0.0
@@ -265,6 +265,7 @@ src_prepare() {
eapply "${FILESDIR}/atom-apm-path.patch"
eapply "${FILESDIR}/atom-license-path.patch"
+ eapply "${FILESDIR}/atom-fix-app-restart.patch"
sed -i -e "s|{{ATOM_SUFFIX}}|${suffix}|g" \
"${S}/build/app/src/config-schema.js" || die
diff --git a/app-editors/atom/atom-1.13.1.ebuild b/app-editors/atom/atom-1.13.1.ebuild
new file mode 100644
index 000000000000..84c2ee311ffb
--- /dev/null
+++ b/app-editors/atom/atom-1.13.1.ebuild
@@ -0,0 +1,407 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 multiprocessing rpm
+
+DESCRIPTION="A hackable text editor for the 21st Century"
+HOMEPAGE="https://atom.io"
+MY_PV="${PV//_/-}"
+
+ELECTRON_V=1.3.5
+ELECTRON_SLOT=1.3
+
+# All binary packages depend on this
+NAN_V=2.4.0
+
+# Keep dep versions in sync with atom/package.json
+CACHED_RUN_IN_THIS_CONTEXT_V=0.4.1
+GIT_UTILS_V=4.1.2
+NODE_NSLOG_V=3.0.0
+NODE_ONIGURUMA_V=6.1.0
+NODE_PATHWATCHER_V=6.5.0
+NODE_RUNAS_V=3.1.1
+SCROLLBAR_STYLE_V=3.2.0
+SPELL_CHECK_V=0.68.5
+
+# text-buffer dependencies
+BUFFER_OFFSET_INDEX_V=9588080533c9d0a8a71ee1cfd98596f485940e91
+MARKER_INDEX_V=4.0.1
+
+# apm dependency
+NODE_KEYTAR_V=3.0.2
+
+# atom-keymap dependency
+KEYBOARD_LAYOUT_V=2.0.7
+
+# symbols-view dependency
+NODE_CTAGS_V=3.0.0
+
+# spell-check dependency
+NODE_SPELLCHECKER_V=3.2.3
+
+ASAR_V=0.12.1
+
+# The x86_64 arch below is irrelevant, as we will rebuild all binary packages.
+SRC_URI="
+ https://github.com/${PN}/${PN}/releases/download/v${MY_PV}/atom.x86_64.rpm -> atom-${MY_PV}.rpm
+ https://github.com/elprans/asar/releases/download/v${ASAR_V}-gentoo/asar-build.tar.gz -> asar-${ASAR_V}.tar.gz
+ https://github.com/nodejs/nan/archive/v${NAN_V}.tar.gz -> nodejs-nan-${NAN_V}.tar.gz
+ https://github.com/atom/cached-run-in-this-context/archive/v${CACHED_RUN_IN_THIS_CONTEXT_V}.tar.gz -> atom-cached-run-in-this-context-${CACHED_RUN_IN_THIS_CONTEXT_V}.tar.gz
+ https://github.com/atom/node-ctags/archive/v${NODE_CTAGS_V}.tar.gz -> atom-node-ctags-${NODE_CTAGS_V}.tar.gz
+ https://github.com/atom/git-utils/archive/v${GIT_UTILS_V}.tar.gz -> atom-git-utils-${GIT_UTILS_V}.tar.gz
+ https://github.com/atom/keyboard-layout/archive/v${KEYBOARD_LAYOUT_V}.tar.gz -> atom-keyboard-layout-${KEYBOARD_LAYOUT_V}.tar.gz
+ https://github.com/atom/buffer-offset-index/archive/${BUFFER_OFFSET_INDEX_V}.tar.gz -> atom-buffer-offset-index-${BUFFER_OFFSET_INDEX_V}.tar.gz
+ https://github.com/atom/marker-index/archive/v${MARKER_INDEX_V}.tar.gz -> atom-marker-index-${MARKER_INDEX_V}.tar.gz
+ https://github.com/atom/node-keytar/archive/v${NODE_KEYTAR_V}.tar.gz -> atom-node-keytar-${NODE_KEYTAR_V}.tar.gz
+ https://github.com/atom/node-nslog/archive/v${NODE_NSLOG_V}.tar.gz -> atom-node-nslog-${NODE_NSLOG_V}.tar.gz
+ https://github.com/atom/node-oniguruma/archive/v${NODE_ONIGURUMA_V}.tar.gz -> atom-node-oniguruma-${NODE_ONIGURUMA_V}.tar.gz
+ https://github.com/atom/node-pathwatcher/archive/v${NODE_PATHWATCHER_V}.tar.gz -> atom-node-pathwatcher-${NODE_PATHWATCHER_V}.tar.gz
+ https://github.com/atom/node-runas/archive/v${NODE_RUNAS_V}.tar.gz -> atom-node-runas-${NODE_RUNAS_V}.tar.gz
+ https://github.com/atom/scrollbar-style/archive/v${SCROLLBAR_STYLE_V}.tar.gz -> atom-scrollbar-style-${SCROLLBAR_STYLE_V}.tar.gz
+ https://github.com/atom/node-spellchecker/archive/v${NODE_SPELLCHECKER_V}.tar.gz -> atom-node-spellchecker-${NODE_SPELLCHECKER_V}.tar.gz
+"
+
+BINMODS="
+ cached-run-in-this-context
+ node-ctags
+ git-utils
+ keyboard-layout
+ node-nslog
+ node-oniguruma
+ node-pathwatcher
+ node-runas
+ node-keytar
+ scrollbar-style
+ node-spellchecker
+ marker-index
+ buffer-offset-index
+"
+
+RESTRICT="mirror"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="
+ ${PYTHON_DEPS}
+ >=app-text/hunspell-1.3.3:=
+ >=dev-libs/libgit2-0.23:=[ssh]
+ >=gnome-base/libgnome-keyring-3.12:=
+ >=dev-libs/oniguruma-5.9.5:=
+ >=dev-util/ctags-5.8
+ >=dev-util/electron-1.3.5:${ELECTRON_SLOT}
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-apps/apmd
+"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+}
+
+get_install_suffix() {
+ local c=(${SLOT//\// })
+ local slot=${c[0]}
+ local suffix
+
+ if [[ "${slot}" == "0" ]]; then
+ suffix=""
+ else
+ suffix="-${slot}"
+ fi
+
+ echo -n "${suffix}"
+}
+
+get_install_dir() {
+ echo -n "/usr/$(get_libdir)/atom$(get_install_suffix)"
+}
+
+get_electron_dir() {
+ echo -n "/usr/$(get_libdir)/electron-${ELECTRON_SLOT}"
+}
+
+get_electron_nodedir() {
+ echo -n "/usr/include/electron-${ELECTRON_SLOT}/node/"
+}
+
+enode_electron() {
+ "$(get_electron_dir)"/node $@
+}
+
+enodegyp_atom() {
+ local apmpath="/usr/share/atom/resources/app/apm"
+ local nodegyp="${S}/${apmpath}/node_modules/node-gyp/bin/node-gyp.js"
+
+ PATH="$(get_electron_dir):${PATH}" \
+ enode_electron "${nodegyp}" \
+ --nodedir="$(get_electron_nodedir)" $@ || die
+}
+
+easar() {
+ local asar="${WORKDIR}/$(package_dir asar)/node_modules/asar/bin/asar"
+ echo "asar" $@
+ enode_electron "${asar}" $@ || die
+}
+
+package_dir() {
+ local binmod="${1//-/_}"
+ local binmod_v="${binmod^^}_V"
+ echo -n ${1}-${!binmod_v}
+}
+
+_unpack_npm_package() {
+ local a="${1}" basename suffix
+
+ basename=${a%.*}
+ suffix=${basename##*.}
+ if [[ "${suffix}" == "tar" ]]; then
+ basename=${basename%.*}
+ fi
+
+ unpack ${a}
+ mv package "${basename}" || die
+}
+
+_have_patches_for() {
+ local _patches="${1}-*.patch" _find
+ _find=$(find "${FILESDIR}" -maxdepth 1 -name "${_patches}" -print -quit)
+ test -n "$_find"
+}
+
+src_unpack() {
+ local a
+
+ for a in ${A} ; do
+ case ${a} in
+ *.rpm) srcrpm_unpack "${a}" ;;
+ *) unpack "${a}" ;;
+ esac
+ done
+
+ mkdir "${WORKDIR}/atom-${MY_PV}" || die
+ mv "${WORKDIR}/usr" "${WORKDIR}/atom-${MY_PV}" || die
+}
+
+src_prepare() {
+ local install_dir="$(get_install_dir)"
+ local suffix="$(get_install_suffix)"
+ local patch binmod _s nan_s="${WORKDIR}/nan-${NAN_V}"
+
+ cd "${S}/usr/share/atom/resources/app" || die
+ eapply "${FILESDIR}/${PN}-python.patch"
+ eapply "${FILESDIR}/${PN}-unbundle-electron.patch"
+
+ sed -i -e "s|{{NPM_CONFIG_NODEDIR}}|$(get_electron_nodedir)|g" \
+ ./atom.sh \
+ || die
+
+ sed -i -e "s|{{ATOM_PATH}}|$(get_electron_dir)/electron|g" \
+ ./atom.sh \
+ || die
+
+ sed -i -e "s|{{ATOM_RESOURCE_PATH}}|${install_dir}/app.asar|g" \
+ ./atom.sh \
+ || die
+
+ local env="export NPM_CONFIG_NODEDIR=$(get_electron_nodedir)"
+ sed -i -e \
+ "s|\"\$binDir/\$nodeBin\"|${env}\nexec $(get_electron_dir)/node|g" \
+ apm/bin/apm || die
+
+ sed -i -e \
+ "s|^\([[:space:]]*\)node[[:space:]]\+|\1\"$(get_electron_dir)/node\" |g" \
+ apm/node_modules/npm/bin/node-gyp-bin/node-gyp || die
+
+ rm apm/bin/node || die
+
+ sed -i -e "s|/usr/share/atom/atom|/usr/bin/atom|g" \
+ "${S}/usr/share/applications/atom.desktop" || die
+
+ cd "${S}" || die
+
+ for binmod in ${BINMODS}; do
+ _s="${WORKDIR}/$(package_dir ${binmod})"
+ cd "${_s}" || die
+ if _have_patches_for "${binmod}"; then
+ for patch in "${FILESDIR}"/${binmod}-*.patch; do
+ eapply "${patch}"
+ done
+ fi
+ done
+
+ # Unbundle bundled libs from modules
+
+ _s="${WORKDIR}/$(package_dir git-utils)"
+ ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \
+ --inplace --unbundle "git;libgit2;git2" \
+ "${_s}/binding.gyp" || die
+
+ _s="${WORKDIR}/$(package_dir node-oniguruma)"
+ ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \
+ --inplace --unbundle "onig_scanner;oniguruma;onig" \
+ "${_s}/binding.gyp" || die
+
+ _s="${WORKDIR}/$(package_dir node-spellchecker)"
+ ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \
+ --inplace --unbundle "spellchecker;hunspell;hunspell" \
+ "${_s}/binding.gyp" || die
+
+ for binmod in ${BINMODS}; do
+ _s="${WORKDIR}/$(package_dir ${binmod})"
+ mkdir -p "${_s}/node_modules" || die
+ ln -s "${nan_s}" "${_s}/node_modules/nan" || die
+ done
+
+ # Unpack app.asar
+ easar extract "${S}/usr/share/atom/resources/app.asar" "${S}/build/app"
+
+ cd "${S}" || die
+
+ eapply "${FILESDIR}/atom-1.13-apm-path.patch"
+ eapply "${FILESDIR}/atom-license-path.patch"
+ eapply "${FILESDIR}/atom-fix-app-restart.patch"
+
+ sed -i -e "s|{{ATOM_SUFFIX}}|${suffix}|g" \
+ "${S}/build/app/src/config-schema.js" || die
+
+ eapply_user
+}
+
+src_configure() {
+ local binmod _s
+
+ for binmod in ${BINMODS}; do
+ einfo "Configuring ${binmod}..."
+ _s="${WORKDIR}/$(package_dir ${binmod})"
+ cd "${_s}" || die
+ enodegyp_atom configure
+ done
+}
+
+src_compile() {
+ local binmod _s x
+ local ctags_d="node_modules/symbols-view/vendor"
+ local jobs=$(makeopts_jobs) gypopts
+
+ gypopts="--verbose"
+
+ if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
+ gypopts+=" --jobs ${jobs}"
+ fi
+
+ mkdir -p "${S}/build/modules/" || die
+
+ for binmod in ${BINMODS}; do
+ einfo "Building ${binmod}..."
+ _s="${WORKDIR}/$(package_dir ${binmod})"
+ cd "${_s}" || die
+ enodegyp_atom ${gypopts} build
+ x=${binmod##node-}
+ mkdir -p "${S}/build/modules/${x}" || die
+ cp build/Release/*.node "${S}/build/modules/${x}" || die
+ done
+
+ # Put compiled binary modules in place
+ _fix_binmods "${S}/build" "app"
+ _fix_binmods "${S}/usr/share/atom/resources" "app"
+
+ # Remove non-Linux vendored ctags binaries
+ rm "${S}/build/app/${ctags_d}/ctags-darwin" \
+ "${S}/build/app/${ctags_d}/ctags-win32.exe" || die
+
+ # Re-pack app.asar
+ # Keep unpack rules in sync with build/tasks/generate-asar-task.coffee
+ cd "${S}/build" || die
+ x="--unpack={*.node,ctags-config,ctags-linux,**/node_modules/spellchecker/**,**/resources/atom.png}"
+ easar pack "${x}" "app" "app.asar"
+ cd "${S}" || die
+}
+
+_fix_binmods() {
+ local _dir="${2}" _prefix="${1}" path relpath modpath mod depth link f d
+ local cruft
+
+ (find "${_prefix}/${_dir}" -name '*.node' -print || die) \
+ | while IFS= read -r path; do
+ f=$(basename "${path}")
+ d=$(dirname "${path}")
+ relpath=${path#${_prefix}}
+ relpath=${relpath##/}
+ relpath=${relpath#W${_dir}}
+ modpath=$(dirname ${relpath})
+ modpath=${modpath%build/Release}
+ mod=$(basename ${modpath})
+
+ # must copy here as symlinks will cause the module loading to fail
+ cp -f "${S}/build/modules/${mod}/${f}" "${path}" || die
+ cruft=$(find "${d}" -name '*.a' -print)
+ if [[ -n "${cruft}" ]]; then
+ rm ${cruft} || die
+ fi
+ done
+}
+
+_fix_executables() {
+ local _dir="${1}" _node_sb="#!$(get_electron_dir)"/node
+
+ (find -L "${ED}/${_dir}" -maxdepth 1 -mindepth 1 -type f -print || die) \
+ | while IFS= read -r f; do
+ IFS= read -r shebang < "${f}"
+
+ if [[ ${shebang} == '#!'* ]]; then
+ fperms +x "${f#${ED}}"
+ if [[ "${shebang}" == "#!/usr/bin/env node" || "${shebang}" == "#!/usr/bin/node" ]]; then
+ einfo "Fixing node shebang in ${f#${ED}}"
+ sed --follow-symlinks -i \
+ -e "1s:${shebang}$:${_node_sb}:" "${f}" || die
+ fi
+ fi
+ done || die
+}
+
+src_install() {
+ local install_dir="$(get_install_dir)"
+ local suffix="$(get_install_suffix)"
+ local ctags_d="node_modules/symbols-view/vendor"
+
+ cd "${S}" || die
+
+ # Replace vendored ctags with a symlink to system ctags
+ rm "${S}/build/app.asar.unpacked/${ctags_d}/ctags-linux" || die
+ ln -s "/usr/bin/ctags" \
+ "${S}/build/app.asar.unpacked/${ctags_d}/ctags-linux" || die
+
+ insinto "${install_dir}"
+
+ doins build/app.asar
+ doins -r build/app.asar.unpacked
+ doins -r usr/share/atom/resources/app
+
+ insinto /usr/share/applications/
+ newins usr/share/applications/atom.desktop "atom${suffix}.desktop"
+
+ insinto /usr/share/icons/
+ doins -r usr/share/icons/hicolor
+
+ exeinto "${install_dir}"
+ newexe usr/share/atom/resources/app/atom.sh atom
+ insinto /usr/share/licenses/"${PN}${suffix}"
+ doins usr/share/atom/resources/LICENSE.md
+ dosym "${install_dir}/atom" "/usr/bin/atom${suffix}"
+ dosym "${install_dir}/app/apm/bin/apm" "/usr/bin/apm${suffix}"
+
+ _fix_executables "${install_dir}/app/apm/bin"
+ _fix_executables "${install_dir}/app/apm/node_modules/.bin"
+ _fix_executables "${install_dir}/app/apm/node_modules/npm/bin"
+ _fix_executables "${install_dir}/app/apm/node_modules/npm/bin/node-gyp-bin"
+ _fix_executables "${install_dir}/app/apm/node_modules/node-gyp/bin"
+}
diff --git a/app-editors/atom/files/atom-1.13-apm-path.patch b/app-editors/atom/files/atom-1.13-apm-path.patch
new file mode 100644
index 000000000000..0dcb7914c669
--- /dev/null
+++ b/app-editors/atom/files/atom-1.13-apm-path.patch
@@ -0,0 +1,16 @@
+diff --git a/build/app/src/config-schema.js b/build/app/src/config-schema.js
+index 1307db6..d6a1ba4 100644
+--- a/build/app/src/config-schema.js
++++ b/build/app/src/config-schema.js
+@@ -21,6 +21,11 @@ var configSchema = {
+ core: {
+ type: 'object',
+ properties: {
++ apmPath: {
++ type: 'string',
++ 'default': '/usr/bin/apm{{ATOM_SUFFIX}}',
++ description: 'Path to apm executable.'
++ },
+ ignoredNames: {
+ type: 'array',
+ 'default': ['.git', '.hg', '.svn', '.DS_Store', '._*', 'Thumbs.db'],
diff --git a/app-editors/atom/files/atom-fix-app-restart.patch b/app-editors/atom/files/atom-fix-app-restart.patch
new file mode 100644
index 000000000000..1bfa1ed429a0
--- /dev/null
+++ b/app-editors/atom/files/atom-fix-app-restart.patch
@@ -0,0 +1,12 @@
+diff --git a/atom-application.js.orig b/atom-application.js
+index 92d985f..9a120e6 100644
+--- a/build/app/src/main-process/atom-application.js
++++ b/build/app/src/main-process/atom-application.js
+@@ -1178,6 +1178,7 @@
+ AtomApplication.prototype.restart = function() {
+ var args;
+ args = [];
++ args.push("--app=" + this.resourcePath);
+ if (this.safeMode) {
+ args.push("--safe");
+ }