pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/py-google-cloud-sdk py-google-cloud-sdk: Choose a ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f6ee730e8e74
branches:  trunk
changeset: 310234:f6ee730e8e74
user:      leot <leot%pkgsrc.org@localhost>
date:      Sun Jul 08 12:22:56 2018 +0000

description:
py-google-cloud-sdk: Choose a safe fallback for Python interpreter

The logic to find a Python executable can be summarized as:
 - CLOUDSDK_PYTHON environment variable defined:
    + If it matches `*python2*', use it
 - Otherwise:
    + Try `python2'
    + Fallback to `python'

Substitute the latter fallback to ${PYTHONBIN} in order to have a
safe choice.

Should fix PR pkg/52122 reported by <jklos>.
This patch is based on the one proposed by <maya> (but restricted
to CLOUDSDK_PYTHON lines and the fallback `python').

Bump PKGREVISION.

diffstat:

 net/py-google-cloud-sdk/Makefile |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 1e1132d97a97 -r f6ee730e8e74 net/py-google-cloud-sdk/Makefile
--- a/net/py-google-cloud-sdk/Makefile  Sun Jul 08 11:17:58 2018 +0000
+++ b/net/py-google-cloud-sdk/Makefile  Sun Jul 08 12:22:56 2018 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2016/04/02 08:26:49 jperkin Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/08 12:22:56 leot Exp $
 
 GCLOUDVER=     96.0.0
 DISTNAME=      google-cloud-sdk-${GCLOUDVER}-linux-x86
 PKGNAME=       ${PYPKGPREFIX}-google-cloud-sdk-${GCLOUDVER}
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/
 
@@ -23,6 +24,13 @@
 PLIST_SUBST+=          PYPKGPREFIX=${PYPKGPREFIX}
 MESSAGE_SUBST+=                PYPKGPREFIX=${PYPKGPREFIX}
 
+SUBST_CLASSES+=                python
+SUBST_STAGE.python=    pre-configure
+SUBST_MESSAGE.python=  Replacing hard coded python executable name
+SUBST_FILES.python=    lib/googlecloudsdk/core/*
+SUBST_FILES.python+=   bin/*
+SUBST_SED.python=      -e "/CLOUDSDK_PYTHON=/ s,python$$,${PYTHONBIN},"
+
 INSTALLATION_DIRS=     ${PKGBASE}
 
 do-install:



Home | Main Index | Thread Index | Old Index