NetBSD Problem Report #52742

From www@NetBSD.org  Mon Nov 20 19:43:36 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 27BB47A170
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 20 Nov 2017 19:43:36 +0000 (UTC)
Message-Id: <20171120194335.4C5407A1F1@mollari.NetBSD.org>
Date: Mon, 20 Nov 2017 19:43:35 +0000 (UTC)
From: jonthn+pkgsrc@pinacea.com
Reply-To: jonthn+pkgsrc@pinacea.com
To: gnats-bugs@NetBSD.org
Subject: vim package can't use Python3
X-Send-Pr-Version: www-1.0

>Number:         52742
>Category:       pkg
>Synopsis:       vim package can't use Python3
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 20 19:45:00 +0000 2017
>Closed-Date:    Sun Dec 10 15:48:58 +0000 2017
>Last-Modified:  Sun Dec 10 15:48:58 +0000 2017
>Originator:     Jonathan Buschmann
>Release:        trunk
>Organization:
>Environment:
macOS High Sierra 10.13
>Description:
If you set the current default Python to a 3.x version, Vim doesn't have the ability to use Python3 binding

example set in mk.conf

PYTHON_VERSION_DEFAULT= 36

examine vim --version output it wouldn't list python

Also even though Vim can be linked to both Python2 and Python3 at the same time, I don't see how it would package in 'pkgsrc'

The fix below allow to link to Python3 it may not be the prettiest change but it gets the work done, feel free to modify it.
>How-To-Repeat:

>Fix:
diff --git i/editors/vim-share/options.mk w/editors/vim-share/options.mk
index d4956b41ec5..8d412e1da8a 100644
--- i/editors/vim-share/options.mk
+++ w/editors/vim-share/options.mk
@@ -13,9 +13,14 @@ CONFIGURE_ENV+=		vi_cv_path_ruby=${RUBY}

 .if !empty(PKG_OPTIONS:Mpython)
 .include "../../lang/python/pyversion.mk"
+.if !empty(_PYTHON_VERSION:M3*)
+CONFIGURE_ARGS+=	--enable-python3interp
+CONFIGURE_ENV+=		vi_cv_path_python3=${PYTHONBIN}
+.else
 CONFIGURE_ARGS+=	--enable-pythoninterp
 CONFIGURE_ENV+=		vi_cv_path_python=${PYTHONBIN}
 .endif
+.endif

 .if !empty(PKG_OPTIONS:Mperl)
 .include "../../lang/perl5/buildlink3.mk"

>Release-Note:

>Audit-Trail:
From: "Adam Ciarcinski" <adam@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52742 CVS commit: pkgsrc/editors/vim-share
Date: Sun, 10 Dec 2017 12:39:47 +0000

 Module Name:	pkgsrc
 Committed By:	adam
 Date:		Sun Dec 10 12:39:47 UTC 2017

 Modified Files:
 	pkgsrc/editors/vim-share: options.mk

 Log Message:
 vim-share: fix building with Python 3.x (PR 52742)


 To generate a diff of this commit:
 cvs rdiff -u -r1.6 -r1.7 pkgsrc/editors/vim-share/options.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: adam@NetBSD.org
State-Changed-When: Sun, 10 Dec 2017 15:48:58 +0000
State-Changed-Why:
Fixed. Thank you


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.