public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Patrice Clement" <monsieurp@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/atom/, app-editors/atom/files/
Date: Fri, 10 Jun 2016 16:50:51 +0000 (UTC)	[thread overview]
Message-ID: <1465575763.16c842dc06be668d6b9491eba9bf5c234fc2c00a.monsieurp@gentoo> (raw)

commit:     16c842dc06be668d6b9491eba9bf5c234fc2c00a
Author:     Elvis Pranskevichus <elvis <AT> magic <DOT> io>
AuthorDate: Fri Jun 10 14:35:46 2016 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Fri Jun 10 16:22:43 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16c842dc

app-editors/atom: Fix app.asar repacking. Fixes bug 585490.

Gentoo-Bug: https://bugs.gentoo.org/585490

Package-Manager: portage-2.2.28
Closes: https://github.com/gentoo/gentoo/pull/1640

Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>

 .../{atom-1.7.4-r1.ebuild => atom-1.7.4-r2.ebuild} | 57 +++++++++++++---------
 app-editors/atom/files/atom-apm-path.patch         |  4 +-
 2 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/app-editors/atom/atom-1.7.4-r1.ebuild b/app-editors/atom/atom-1.7.4-r2.ebuild
similarity index 89%
rename from app-editors/atom/atom-1.7.4-r1.ebuild
rename to app-editors/atom/atom-1.7.4-r2.ebuild
index c45728c..68fb871 100644
--- a/app-editors/atom/atom-1.7.4-r1.ebuild
+++ b/app-editors/atom/atom-1.7.4-r2.ebuild
@@ -5,7 +5,7 @@
 EAPI=6
 
 PYTHON_COMPAT=( python2_7 )
-inherit flag-o-matic python-any-r1 eutils rpm
+inherit flag-o-matic python-any-r1 eutils multiprocessing rpm
 
 DESCRIPTION="A hackable text editor for the 21st Century"
 HOMEPAGE="https://atom.io"
@@ -274,7 +274,7 @@ src_prepare() {
 	_s="${WORKDIR}/$(package_dir asar)"
 	"${_s}"/node_modules/asar/bin/asar \
 		extract "${S}/usr/share/atom/resources/app.asar" \
-				"${S}/build/app.asar" || die
+				"${S}/build/app" || die
 
 	cd "${S}" || die
 
@@ -282,7 +282,7 @@ src_prepare() {
 	epatch "${FILESDIR}/asar-require.patch"
 
 	sed -i -e "s|{{ATOM_SUFFIX}}|${suffix}|g" \
-		"${S}/build/app.asar/src/config-schema.js" || die
+		"${S}/build/app/src/config-schema.js" || die
 
 	eapply_user
 }
@@ -310,6 +310,14 @@ src_configure() {
 
 src_compile() {
 	local binmod _s x nodegyp="/usr/$(get_libdir)/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
+	local ctags_d="node_modules/symbols-view/vendor"
+	local jobs=$(makeopts_jobs) gypopts
+
+	gypopts="--nodedir=/usr/include/electron/node/ --verbose"
+
+	if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
+		gypopts+=" --jobs ${jobs}"
+	fi
 
 	mkdir -p "${S}/build/modules/" || die
 
@@ -317,17 +325,33 @@ src_compile() {
 		einfo "Building ${binmod}..."
 		_s="${WORKDIR}/$(package_dir ${binmod})"
 		cd "${_s}" || die
-		"${nodegyp}" --nodedir=/usr/include/electron/node/ --verbose build || die
+		"${nodegyp}" ${gypopts} build || die
 		x=${binmod##node-}
 		mkdir -p "${S}/build/modules/${x}"
 		cp build/Release/*.node "${S}/build/modules/${x}"
 	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
-	_s="${WORKDIR}/$(package_dir asar)"
-	"${_s}"/node_modules/asar/bin/asar \
-		pack "${S}/build/app.asar" \
-             "${S}/usr/share/atom/resources/app.asar" || die
+	# Keep unpack rules in sync with build/tasks/generate-asar-task.coffee
+	x="--unpack={*.node,ctags-config,ctags-linux,**/node_modules/spellchecker/**,**/resources/atom.png}"
+	_s="${WORKDIR}/$(package_dir asar)/node_modules/asar/bin"
+	cd "${S}/build" || die
+	echo "asar" pack "${x}" "app" "app.asar"
+	"${_s}/asar" pack "${x}" "app" "app.asar" || die
+	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
 }
 
 _fix_binmods() {
@@ -345,7 +369,7 @@ _fix_binmods() {
 		mod=$(basename ${modpath})
 
 		# must copy here as symlinks will cause the module loading to fail
-		cp "${ED}/${install_dir}/modules/${mod}/${f}" "${path}" || die
+		cp -f "${S}/build/modules/${mod}/${f}" "${path}" || die
 		cruft=$(find "${d}" -name '*.a' -print)
 		if [ -n "${cruft}" ]; then
 			rm ${cruft} || die
@@ -356,25 +380,14 @@ _fix_binmods() {
 src_install() {
 	local install_dir="$(get_install_dir)"
 	local suffix="$(get_install_suffix)"
-	local ctags_d="${ED}/${install_dir}/app.asar.unpacked/node_modules/symbols-view/vendor"
 
 	cd "${S}" || die
 
 	insinto "${install_dir}"
-	doins -r build/modules
 
-	doins usr/share/atom/resources/app.asar
+	doins build/app.asar
+	doins -r build/app.asar.unpacked
 	doins -r usr/share/atom/resources/app
-	doins -r usr/share/atom/resources/app.asar.unpacked
-
-	_fix_binmods "${ED}/${install_dir}" "app"
-	_fix_binmods "${ED}/${install_dir}" "app.asar.unpacked"
-
-	rm -r "${ED}/${install_dir}/modules" || die
-
-	# Remove vendored ctags binary and replace with a symlink to system ctags
-	rm "${ctags_d}"/* || die
-	ln -s "/usr/bin/ctags" "${ctags_d}/ctags-linux" || die
 
 	insinto /usr/share/applications/
 	newins usr/share/applications/atom.desktop "atom${suffix}.desktop"

diff --git a/app-editors/atom/files/atom-apm-path.patch b/app-editors/atom/files/atom-apm-path.patch
index 8746b95..957fed4 100644
--- a/app-editors/atom/files/atom-apm-path.patch
+++ b/app-editors/atom/files/atom-apm-path.patch
@@ -1,5 +1,5 @@
---- build/app.asar/src/config-schema.js.orig	2016-05-24 16:59:41.284449076 -0400
-+++ build/app.asar/src/config-schema.js	2016-05-24 17:01:05.685447769 -0400
+--- build/app/src/config-schema.js.orig	2016-05-24 16:59:41.284449076 -0400
++++ build/app/src/config-schema.js	2016-05-24 17:01:05.685447769 -0400
 @@ -9,6 +9,11 @@
      core: {
        type: 'object',


             reply	other threads:[~2016-06-10 16:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 16:50 Patrice Clement [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-04-29 12:45 [gentoo-commits] repo/gentoo:master commit in: app-editors/atom/, app-editors/atom/files/ Mikle Kolyada
2017-12-12 20:32 Patrice Clement
2017-04-08 21:22 Patrice Clement
2017-02-08 12:40 Mikhail Pukhlikov
2016-05-27 14:15 Patrice Clement
2016-05-12  8:30 Patrice Clement

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465575763.16c842dc06be668d6b9491eba9bf5c234fc2c00a.monsieurp@gentoo \
    --to=monsieurp@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox