From owner-freebsd-python@freebsd.org Sat Dec 5 02:47:07 2015 Return-Path: Delivered-To: freebsd-python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D67FDA4069A; Sat, 5 Dec 2015 02:47:07 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x22a.google.com (mail-pf0-x22a.google.com [IPv6:2607:f8b0:400e:c00::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7481CAF; Sat, 5 Dec 2015 02:47:07 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by pfu207 with SMTP id 207so34933542pfu.2; Fri, 04 Dec 2015 18:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=XQ0Lsqklcuonp0fvEC2WL1KMrCeg0+r8EA7yCHu1Pwo=; b=JIgE/k61S/chWtBXZ7l5aoWpqiPWYxr8wYZtS9eIvUUqLm8icpFwfJGMduRev6Sxem LSZQlyxNSP/6klnBse9jKBVWHygKTvHU1K2BUFBBVJH8XVbL48lkZ847a5aWN2Xff+Fh TJxz52TJ5AKa4MZgE0buJxaA7k/l4GMUe7E18aN3QRZ2rBwf5x3h9a2Gzz15NqfVQHsf 5H8v6i6cy2pqmLxCO8gcp5L2J6nU9U+MOXmv1zhBjKRimSZ4C3Lef9mjhvOmlPGATRyU bX63ZY9OPoQHa2/tk4RbfttthVYgXQBfkjzLKdEuZiom3ztgoHnBbuip0VUfyWGoXQSM VjSA== X-Received: by 10.98.69.197 with SMTP id n66mr26202463pfi.42.1449283627056; Fri, 04 Dec 2015 18:47:07 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01::2? (2001-44b8-31ae-7b01-0000-0000-0000-0002.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01::2]) by smtp.gmail.com with ESMTPSA id r26sm19722959pfa.45.2015.12.04.18.47.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Dec 2015 18:47:06 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: Python and SWIG support in ports? References: <56624F9B.30508@FreeBSD.org> To: Craig Rodrigues , ports , freebsd-python@freebsd.org From: Kubilay Kocak Message-ID: <5662501F.10403@FreeBSD.org> Date: Sat, 5 Dec 2015 13:46:55 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: <56624F9B.30508@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2015 02:47:08 -0000 On 5/12/2015 1:44 PM, Kubilay Kocak wrote: > On 5/12/2015 9:40 AM, Craig Rodrigues wrote: >> Hi, >> >> I am working with the upstream maintainer of M2Crypto ( >> https://gitlab.com/m2crypto/m2crypto ). >> >> In the distutils that comes with Python, the swig binary is harcoded >> to "swig" if on a POSIX system: >> >> https://hg.python.org/cpython/file/v2.6.2/Lib/distutils/command/build_ext.py#l635 > > Short-term, swig20 could provide a symlink to the versioned binary until > a 'more correct' and permanent fix can be made. > > I'm not sure what to do about those ports that depend on swig30 in the > presence of swig20 also being installed, given they don't appear to > CONFLICT_INSTALL on each other. They both can't provide the swig > symlink. Supporting swig in DEFAULT_VERSIONS doesn't sound right and is > probably overkill. > >> In our ports, we name our swig binaries things like >> "/usr/local/bin/swig2.0" or >> "/usr/local/bin/swig3.0". How do we deal with this in Python ports which >> use >> SWIG? > > If this is the case, it would mean all swig dependent things are also > broken. How are other ports dealing with it, or working? This might > provide some insight. > > The if os.name == "posix": branch could do the same swig > version-suffixed binary checking that the elif os.name == "nt": > condition branch does. > > A smarter way might *also* be to add functionality to that swig method > to allow the system to provide the binary path/name via envvars or > command line argument to (build,build_ext) commands explicitly. > > I suggest creating an upstream issue. By upstream I mean @ Python. >> If possible, I'd like to push a fix upstream for FreeBSD, if the upstream >> maintainer >> is OK with it. Also, another temporary workaround/option might be to implement a custom build_ext command in M2Crypto that does a smarter find_swig > Hit us up on IRC (#freebsd-python) if you'd like to talk more, or have > questions > >> Thanks. >> >> -- >> Craig > > > >