pkgsrc-Bugs archive

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

Re: pkg/52122 (net/py-google-cloud-sdk can't find python)



The following reply was made to PR pkg/52122; it has been noted by GNATS.

From: Leonardo Taccari <leot%NetBSD.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/52122 (net/py-google-cloud-sdk can't find python)
Date: Thu, 07 Jun 2018 09:41:22 +0200

 Hello John,
 
 John Klos writes:
 > [...] 
 > By default it is not:
 > 
 > /usr/local/py27-google-cloud-sdk/bin/gsutil
 > python: not found
 > 
 > Making a symlink to python27 allows it to run, though. Tested by 
 > authenticating to Google Cloud. Thanks :)
 
 Can you please try the following patch (the complete rationale is
 in the candidate commit message):
 
  <https://www.NetBSD.org/~leot/pkgsrc-patches/py-google-cloud-sdk-52122.patch>
 
 (TLDR; it seems that just `python' was used if no CLOUDSDK_PYTHON
 nor `python2' could not be found, so we can just SUBST_SED accordingly)
 
 
 For completeness the patch is also attached here inline.
 
 ----------------------- 8< ----------------- 8< ------------------------
 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.
 
 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/net/py-google-cloud-sdk/Makefile,v
 retrieving revision 1.3
 diff -u -p -r1.3 Makefile
 --- Makefile	2 Apr 2016 08:26:49 -0000	1.3
 +++ Makefile	7 Jun 2018 07:22:33 -0000
 @@ -3,6 +3,7 @@
  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 @@ REPLACE_PYTHON+=	bin/bootstrapping/*
  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