<pre style='margin:0'>
Ken (kencu) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/7ed881c76b4fd02e5637ac36c61eaa825038e406">https://github.com/macports/macports-ports/commit/7ed881c76b4fd02e5637ac36c61eaa825038e406</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 7ed881c76b4 mozjs60: arm64: Code sign virtualenv python on arm64.
</span>7ed881c76b4 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 7ed881c76b4fd02e5637ac36c61eaa825038e406
</span>Author: Rob Gowin <robgowin@gmail.com>
AuthorDate: Mon Feb 1 22:31:53 2021 -0600
<span style='display:block; white-space:pre;color:#404040;'> mozjs60: arm64: Code sign virtualenv python on arm64.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This port uses an embedded copy of virtualenv to create a python2.7
</span><span style='display:block; white-space:pre;color:#404040;'> virtual environment. On arm64, the created (copied?) python has an
</span><span style='display:block; white-space:pre;color:#404040;'> invalid code signature and is killed when run. This commit adds
</span><span style='display:block; white-space:pre;color:#404040;'> a patch to ad-hoc code sign the created python executable on arm64.
</span>---
lang/mozjs60/Portfile | 3 ++-
lang/mozjs60/files/patch-virtualenv-arm64-codesign.diff | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/mozjs60/Portfile b/lang/mozjs60/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index df4590d9649..00f41f72eff 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/mozjs60/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/mozjs60/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -45,7 +45,8 @@ if { ${os.platform} eq "darwin" && ${os.major} < 11 } {
</span> }
patchfiles patch-js.pc.in.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- patch-js-config.in.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-js-config.in.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-virtualenv-arm64-codesign.diff
</span>
# Use absolute path for install_name
post-patch {
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/mozjs60/files/patch-virtualenv-arm64-codesign.diff b/lang/mozjs60/files/patch-virtualenv-arm64-codesign.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..b3edd73fa67
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/mozjs60/files/patch-virtualenv-arm64-codesign.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,17 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- third_party/python/virtualenv/virtualenv.py.orig 2021-02-01 22:20:21.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ third_party/python/virtualenv/virtualenv.py 2021-02-01 22:28:31.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1339,6 +1339,14 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "have Apple's development tools installed")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ raise
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # For macOS on arm64, the copied binary needs to be ad-hoc codesigned.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if os.uname()[4] == 'arm64':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ codesign_cmd = ["codesign", "--sign", "-", "--force",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "--preserve-metadata=entitlements,requirements,flags,runtime", py_executable]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ subprocess.call(codesign_cmd)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if not is_win:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Ensure that 'python', 'pythonX' and 'pythonX.Y' all exist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ py_exe_version_major = 'python%s' % sys.version_info[0]
</span></pre><pre style='margin:0'>
</pre>