From owner-freebsd-ports@freebsd.org Thu Dec 13 09:35:10 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A47731312E99 for ; Thu, 13 Dec 2018 09:35:10 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E11576CE3; Thu, 13 Dec 2018 09:35:10 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from atuin.in.mat.cc (unknown [IPv6:2a01:678:42:ffff:3e15:c2ff:fec4:452e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: mat/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D2F0BDC46; Thu, 13 Dec 2018 09:35:09 +0000 (UTC) (envelope-from mat@FreeBSD.org) Date: Thu, 13 Dec 2018 10:35:04 +0100 From: Mathieu Arnold To: John Baldwin Cc: Michael Gmelin , FreeBSD Ports Subject: Re: Best way to deal with .pyc files? Message-ID: <20181213093504.vwene4mp5cy5ehgd@atuin.in.mat.cc> References: <8D6D9096-468D-4E69-A6F2-79142C52395C@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="774jyfxxesn4kttv" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 6E11576CE3 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-0.67 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.67)[-0.667,0]; NEURAL_HAM_SHORT(-0.00)[-0.001,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2018 09:35:10 -0000 --774jyfxxesn4kttv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 10, 2018 at 11:22:49AM -0800, John Baldwin wrote: > On 12/7/18 10:17 AM, John Baldwin wrote: > > On 12/6/18 11:17 AM, Michael Gmelin wrote: > >> > >> > >>> On 6. Dec 2018, at 19:21, John Baldwin wrote: > >>> > >>> The devel/gdb port installs python scripts into /usr/local/share/gdb<= ver>/python. > >>> If you then run kgdb as root (not that unusual), it will generate .py= c files in > >>> those directories that are not deleted by 'pkg delete'. What is the = best way to > >>> handle this case? Should the pkg-plist include @rmtry entries for ea= ch pyc > >>> file or is there a better way? > >>> > >> > >> Pre-generate the pyc files on package build and install them with the = port, so they become part of plist (there are examples of that in the ports= tree, whenever possible for both py27 and py3x). > >=20 > > Ok. One follow-up question. GDB's python bindings work with both py2 = and > > py3, but the bindings are optional. Right now PYTHON is a port option > > (but on by default). If I wanted to add flavors I would probably want = them > > to be conditional on the option, so the results would be 'gdb' and > > 'gdb-py3' packages by default, but if someone was using poudriere local= ly > > and disabled python, I would only want to build a single 'gdb' without > > python. So, can I make the flavors conditional on an option or is it t= oo > > late to define flavors after including bsd.ports.options.mk? > >=20 > > That is, can I do something this: > >=20 > > OPTIONS_DEFINE=3D PYTHON > > OPTIONS_DEFAULT=3D PYTHON > >=20 > > .include > >=20 > > .if ${PORT_OPTIONS:MPYTHON} > > USES_PYTHON=3D flavors > > .endif >=20 > FYI, this worked: All things considered, it does not matter when you set USE_PYTHON=3Dflavors because it does nothing if USES does not contain pytho= n. --=20 Mathieu Arnold --774jyfxxesn4kttv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEOraXidLtEhBkQLpbOkUW81GDzkgFAlwSJ8hfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNB QjY5Nzg5RDJFRDEyMTA2NDQwQkE1QjNBNDUxNkYzNTE4M0NFNDgACgkQOkUW81GD zkiowQ/9FTHeiVGw+h5Sh2niekymCawZVIH35SZv+WWsl+qjsj/xIMatXo9olJUq rPjAz/LTx/3Yc7I37yVVvj63k6q6MEHfvFyPijRyBGmpWvxk1ENWhk7xCk1SAP1i Vss7qN97oYqCN1HBcQ+hDtAMcX2F9L+XitQzFpZMhKOeGIpzhj3uEB+dLB5E/LdJ hXNXgg9Ajky9biNoa9rj9bXPheIlPKOh//IcYPAqh6IBuz9oOavY5efrvb4fCR4o ZQd4LShQpQP+8TBxLdiqLurAXLStMlUkZRsXxTqE64hrNdU+O31givnONMp+txXJ txy70drC/q7yaoL9aHftvoPxBxjdSi2xaS3mP9m04trtXXCPu8+rWbajEq/e4qeh Qyutp7dHGk75Miz/HWUYcpvUu30esqcRH05hlAMlwlQsurB6T29ph+TjGjeJP4YY 104dEvLJYFc2xpTastPL7oKkXKLrxNg/tBpDNE3BdFMCkGGKngv4L7qzkgeFpVrH V3raGLXnY66GKuwIv+H8gJ3QMOlV5XcGVUPw/yQAnsFo4HmjLprkaSR3BpNm0bHY rluuvo2ru4+Ic7n3Cv3mxtn19kSjAOJwHHh9Wc7KC7JbmcLtdBjgwkf81DMmej7d Xgf0eQsqBNBkADg13LxxaUowJf19/Vd/TsYTxAse3LJVSBPFFVM= =HkMz -----END PGP SIGNATURE----- --774jyfxxesn4kttv--