Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: "S. Lockwood-Childs" <sjl@vctlabs.com>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-python][master][pyro][PATCH] python-cython: mangle scripts to use /usr/bin/env python
Date: Fri, 19 May 2017 15:27:57 -0700	[thread overview]
Message-ID: <20170519222757.GA22446@vctlabs.com> (raw)
In-Reply-To: <20170513063415.GQ9767@vctlabs.com>

This prevents runtime failure "bad interpreter: No such file or directory"
from running native cython when the native python is installed
at a long path, exceeding the 128-character limit for shebang lines
on linux. Exceeding the limit was already possible when using a long
path for topdir, but it got easier to exceed after the switch to per-recipe
sysroots.

Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com>
---
 meta-python/recipes-devtools/python/python-cython.inc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta-python/recipes-devtools/python/python-cython.inc b/meta-python/recipes-devtools/python/python-cython.inc
index 1ecdcc9..66383bf 100644
--- a/meta-python/recipes-devtools/python/python-cython.inc
+++ b/meta-python/recipes-devtools/python/python-cython.inc
@@ -17,3 +17,10 @@ RDEPENDS_${PN}_class-target += "\
     ${PYTHON_PN}-subprocess \
     ${PYTHON_PN}-shell \
 "
+
+do_install_append() {
+	# Make sure we use /usr/bin/env python
+	for PYTHSCRIPT in `grep -rIl '^!#.*python' ${D}${bindir}`; do
+		sed -i -e '1s|^#!.*|#!/usr/bin/env ${PYTHON_PN}|' $PYTHSCRIPT
+	done
+}
-- 
1.9.4



  parent reply	other threads:[~2017-05-19 22:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13  6:34 meta-python: outrageously long cython shebang with pyro S. Lockwood-Childs
2017-05-15 11:58 ` Alexander Kanavin
2017-05-19 22:27 ` S. Lockwood-Childs [this message]
2017-05-19 23:45   ` [meta-python][master][pyro][PATCH, v2] python-cython: mangle scripts to use /usr/bin/env python S. Lockwood-Childs
2017-05-20  0:13   ` [meta-python][master][pyro][PATCH, v3] " S. Lockwood-Childs

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=20170519222757.GA22446@vctlabs.com \
    --to=sjl@vctlabs.com \
    --cc=openembedded-devel@lists.openembedded.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