From owner-freebsd-ports@FreeBSD.ORG Wed Feb 19 16:01:26 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 217BE4E4 for ; Wed, 19 Feb 2014 16:01:26 +0000 (UTC) Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.31.42]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D12F41667 for ; Wed, 19 Feb 2014 16:01:25 +0000 (UTC) Received: from [80.67.16.121] (helo=webmailfront01.ispgateway.de) by smtprelay04.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1WG9UC-0001h5-IG for freebsd-ports@freebsd.org; Wed, 19 Feb 2014 16:55:00 +0100 Received: from his1.his.de (his1.his.de [192.124.237.237]) by webmail.df.eu (Horde Framework) with HTTP; Wed, 19 Feb 2014 16:55:00 +0100 Date: Wed, 19 Feb 2014 16:55:00 +0100 Message-ID: <20140219165500.Horde.vg_cyo2bAuxp6Rlju1rQeQ1@webmail.df.eu> From: Marcus von Appen To: freebsd-ports@freebsd.org Subject: Re: What should be in scripts shebangs for python2? References: <254945186.20140219190201@serebryakov.spb.ru> In-Reply-To: <254945186.20140219190201@serebryakov.spb.ru> User-Agent: Internet Messaging Program (IMP) H5 (6.0.4) Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-Df-Sender: ZnJlZWJzZEBzeXNmYXVsdC5vcmc= X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: mva@freebsd.org List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 16:01:26 -0000 Lev Serebryakov : > Hello, Freebsd-ports. > > My port uses some pythons scripts to configure (it is not pythonn-related > by itself, only authors of this software use python scripts on build > stage). > > How should I patch these scripts to work? It looks like > /usr/local/bin/python2 is installed by devel/python2 port, and > USE_PYTHON_BUILD=yes doesn't depends on this port, but on python27, which USE_PYTHON_BUILD=yes indicates that the port supports any python version, no matter, if the user chooses python2.X or python3.x as the default for the system. If your port is compatible with any python version and only uses python for configuring some bits, but does *not* need python at run-time, you should patch the scripts to use ${PYTHON_CMD}, via a ${REINPLACE_CMD} or the proper python_CMD= ${PYTHON_CMD} command for the shebang USES. If your port is only compatible for a specific branch (either 2.x OR 3.x), use the proper major number for USE_PYTHON_BUILD, e.g. USE_PYTHON_BUILD=2. If the port is only compatible with a specific release (e.g. 3.2), use USE_PYTHON_BUILD=X.Y. For those cases, you also can rely on ${PYTHON_CMD}, which points to whatever is the most appropriate version. In short: * Use ${PYTHON_CMD} to replace the shebang lines or references of the python command * Use the proper supported python version (yes for any, 2 or 3 for a branch, X.Y for a release) for USE_PYTHON_BUILD > could be changed in future or by users's request, so I don't want to > hardcode /usr/local/bin/python2.7, too... Indeed, do not do this. Cheers Marcus