Skip to content

Commit

Permalink
patch 8.0.1385: Python 3.5 is getting old
Browse files Browse the repository at this point in the history
Problem:    Python 3.5 is getting old.
Solution:   Make Python 3.6 the default. (Ken Takata, closes vim#2429)
  • Loading branch information
brammool committed Dec 10, 2017
1 parent 74240d3 commit 59eb016
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 11 deletions.
4 changes: 2 additions & 2 deletions runtime/doc/if_pyth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,8 @@ or 'pythonthreedll' option can be also used to specify the Python DLL.

The name of the DLL should match the Python version Vim was compiled with.
Currently the name for Python 2 is "python27.dll", that is for Python 2.7.
That is the default value for 'pythondll'. For Python 3 it is python35.dll
(Python 3.5). To know for sure edit "gvim.exe" and search for
That is the default value for 'pythondll'. For Python 3 it is python36.dll
(Python 3.6). To know for sure edit "gvim.exe" and search for
"python\d*.dll\c".


Expand Down
34 changes: 30 additions & 4 deletions src/INSTALLpc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -438,18 +438,31 @@ You will end up with a Python-enabled, Win32 version. Enjoy!
================================

For building with MSVC 2008 the "Windows Installer" from www.python.org
works fine. Python 3.4 is recommended.
works fine. Python 3.6 is recommended.

When building, you need to set the following variables at least:

PYTHON3: Where Python3 is installed. E.g. C:\Python34
PYTHON3: Where Python3 is installed. E.g. C:\Python36
DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
PYTHON3_VER: Python3 version. E.g. 34 for Python 3.4.X.
PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X.

E.g. When using MSVC (as one line):

nmake -f Make_mvc.mak
PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34
PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36


When using msys2 and link with Python3 bundled with msys2 (as one line):

mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64
PYTHON3_HOME=c:/msys64/mingw64
PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m
DYNAMIC_PYTHON3=yes
PYTHON3_VER=36
DYNAMIC_PYTHON3_DLL=libpython3.6m.dll
STATIC_STDCPLUS=yes

(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)


8. Building with Racket or MzScheme support
Expand Down Expand Up @@ -684,21 +697,33 @@ config.h and Ruby's DLL name. Here are the steps for working around them:
There is no need to build whole Ruby, just config.h is needed.
If you use 32-bit MSVC 2015, the config.h is generated in the
.ext\include\i386-mswin32_140 directory.
If you use 64-bit MSVC 2015, the config.h is generated in the
.ext\include\x64-mswin64_140 directory.

3) Install the generated config.h.

For 32-bit version:

xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0

For 64-bit version:

xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0

Note that 2.4.0 is Ruby API version of Ruby 2.4.X.
You may need to close the console and reopen it to pick up the new $PATH.

4) Build Vim. Note that you need to adjust some variables (as one line):

For 32-bit version:

nmake -f Make_mvc.mak
RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
RUBY_MSVCRT_NAME=msvcrt
WINVER=0x501

For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64.

If you set WINVER explicitly, it must be set to >=0x500, when building
with Ruby 2.1 or later. (Default is 0x501.)
When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
Expand All @@ -713,6 +738,7 @@ After you install RubyInstaller, just type this (as one line):
RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
WINVER=0x501

For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64.
If you set WINVER explicitly, it must be set to >=0x500, when building with
Ruby 2.1 or later. (Default is 0x501.)

Expand Down
4 changes: 2 additions & 2 deletions src/Make_cyg_ming.mak
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ endif
# Python3 interface:
# PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak)
# DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
# PYTHON3_VER=[Python3 version, eg 31, 32] (default is 35)
# PYTHON3_VER=[Python3 version, eg 31, 32] (default is 36)
ifdef PYTHON3
ifndef DYNAMIC_PYTHON3
DYNAMIC_PYTHON3=yes
endif

ifndef PYTHON3_VER
PYTHON3_VER=35
PYTHON3_VER=36
endif
ifndef DYNAMIC_PYTHON3_DLL
DYNAMIC_PYTHON3_DLL=python$(PYTHON3_VER).dll
Expand Down
4 changes: 2 additions & 2 deletions src/Make_mvc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
# Python3 interface:
# PYTHON3=[Path to Python3 directory]
# DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
# PYTHON3_VER=[Python3 version, eg 30, 31] (default is 35)
# PYTHON3_VER=[Python3 version, eg 30, 31] (default is 36)
#
# Ruby interface:
# RUBY=[Path to Ruby directory]
Expand Down Expand Up @@ -906,7 +906,7 @@ PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
# PYTHON3 interface
!ifdef PYTHON3
!ifndef PYTHON3_VER
PYTHON3_VER = 35
PYTHON3_VER = 36
!endif
!message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)"
!if "$(DYNAMIC_PYTHON3)" == "yes"
Expand Down
2 changes: 1 addition & 1 deletion src/bigvim.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:: command to build big Vim with OLE, Lua, Perl, Python, Racket, Ruby and Tcl
SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\"
SET TOOLDIR=E:\
%VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes LUA=%TOOLDIR%lua53 DYNAMIC_LUA=yes LUA_VER=53 PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 MZSCHEME=%TOOLDIR%Racket DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_a36fs8 RUBY=%TOOLDIR%ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%ActiveTcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL_DLL=tcl86t.dll %1 IME=yes CSCOPE=yes DIRECTX=yes
%VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes LUA=%TOOLDIR%lua53 DYNAMIC_LUA=yes LUA_VER=53 PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36 MZSCHEME=%TOOLDIR%Racket DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_a36fs8 RUBY=%TOOLDIR%ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%ActiveTcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL_DLL=tcl86t.dll %1 IME=yes CSCOPE=yes DIRECTX=yes

2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1385,
/**/
1384,
/**/
Expand Down

0 comments on commit 59eb016

Please sign in to comment.