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, 27 May 2016 14:15:32 +0000 (UTC)	[thread overview]
Message-ID: <1464356857.dd47bfc852882b48eb465dcde3ba90b4857a0964.monsieurp@gentoo> (raw)

commit:     dd47bfc852882b48eb465dcde3ba90b4857a0964
Author:     Elvis Pranskevichus <elvis <AT> magic <DOT> io>
AuthorDate: Wed May 25 15:11:17 2016 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Fri May 27 13:47:37 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd47bfc8

app-editors/atom: Fix apm under Node 5+.

apm monkey-patches Node's module system to add support for module loading
from "asar" archives.  Add a case to make this work under Node 5+.

Gentoo-Bug: https://bugs.gentoo.org/584000
Package-Manager: portage-2.2.28
Closes: https://github.com/gentoo/gentoo/pull/1539

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

 .../{atom-1.7.4.ebuild => atom-1.7.4-r1.ebuild}    |  1 +
 app-editors/atom/files/asar-require.patch          | 45 ++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/app-editors/atom/atom-1.7.4.ebuild b/app-editors/atom/atom-1.7.4-r1.ebuild
similarity index 99%
rename from app-editors/atom/atom-1.7.4.ebuild
rename to app-editors/atom/atom-1.7.4-r1.ebuild
index c408132..c45728c 100644
--- a/app-editors/atom/atom-1.7.4.ebuild
+++ b/app-editors/atom/atom-1.7.4-r1.ebuild
@@ -279,6 +279,7 @@ src_prepare() {
 	cd "${S}" || die
 
 	epatch "${FILESDIR}/atom-apm-path.patch"
+	epatch "${FILESDIR}/asar-require.patch"
 
 	sed -i -e "s|{{ATOM_SUFFIX}}|${suffix}|g" \
 		"${S}/build/app.asar/src/config-schema.js" || die

diff --git a/app-editors/atom/files/asar-require.patch b/app-editors/atom/files/asar-require.patch
new file mode 100644
index 0000000..a00169b
--- /dev/null
+++ b/app-editors/atom/files/asar-require.patch
@@ -0,0 +1,45 @@
+diff --git a/usr/share/atom/resources/app/apm/node_modules/asar-require/lib/require.js b/usr/share/atom/resources/app/apm/node_modules/asar-require/lib/require.js
+index 47cb1bb..67895d5 100644
+--- a/usr/share/atom/resources/app/apm/node_modules/asar-require/lib/require.js
++++ b/usr/share/atom/resources/app/apm/node_modules/asar-require/lib/require.js
+@@ -1,5 +1,7 @@
+ (function() {
+-  var asar, asarStatsToFsStats, fakeTime, fs, gid, nextInode, path, readFileSync, realpathSync, splitPath, statSync, uid;
++  var asar, asarStatsToFsStats, fakeTime, fs, gid, nextInode, path, readFileSync, realpathSync, splitPath, statSync, uid;
++
++  var module, module_findPath, _e;
+
+   asar = require('asar');
+
+@@ -7,6 +9,12 @@
+
+   path = require('path');
+
++  try {
++    module = require('module');
++  } catch (_e) {
++    module = null;
++  }
++
+   splitPath = function(p) {
+     var index;
+     if (typeof p !== 'string') {
+@@ -124,5 +132,18 @@
+     }
+     return path.join(realpathSync(asarPath), filePath);
+   };
++
++  if (module && module._findPath) {
++    module_findPath = module._findPath;
++
++    module._findPath = function(request, paths, isMain) {
++      var asarPath, filePath, isAsar, _ref;
++      _ref = splitPath(request), isAsar = _ref[0], asarPath = _ref[1], filePath = _ref[2];
++      if (isAsar) {
++        return request;
++      }
++      return module_findPath.apply(this, arguments);
++    }
++  }
+
+ }).call(this);


             reply	other threads:[~2016-05-27 14:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27 14:15 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-06-10 16:50 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=1464356857.dd47bfc852882b48eb465dcde3ba90b4857a0964.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