Skip to content

Commit

Permalink
[FIX] packaging: compute winpython path with package.py args
Browse files Browse the repository at this point in the history
When building the MS Windows package, the PYTHON_VERSION variable is not
used and the WinPython path is hard coded in the Makefile and NSI file.
This prevent the usage of a newer version of Python.

With this commit, the PYTHON_VERSION is used to compute the WinPython
Python directory. That way, this directory can be derived from
package.py command line argument --vm-winxp-python-version.

Also the less windows binaries are not packaged anymore.

closes odoo#39821

X-original-commit: ac90d85
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
  • Loading branch information
d-fence authored and fw-bot committed Nov 5, 2019
1 parent 0a3ca7d commit 7ce07a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions setup/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def run(self):
with open(os.path.join(self.args.build_dir, 'setup/win32/Makefile.version'), 'w') as f:
f.write("VERSION=%s\n" % VERSION.replace('~', '_').replace('+', ''))
with open(os.path.join(self.args.build_dir, 'setup/win32/Makefile.python'), 'w') as f:
f.write("PYTHON_VERSION=%s\n" % self.args.vm_winxp_python_version.replace('.', ''))
f.write("PYTHON_VERSION=%s\n" % self.args.vm_winxp_python_version)
with open(os.path.join(self.args.build_dir, 'setup/win32/Makefile.servicename'), 'w') as f:
f.write("SERVICENAME=%s\n" % nt_service_name)

Expand Down Expand Up @@ -494,7 +494,7 @@ def parse_args():
ap.add_argument("--vm-winxp-image", default='/home/odoo/vm/win1036/win10_winpy36.qcow2', help="%(default)s")
ap.add_argument("--vm-winxp-ssh-key", default='/home/odoo/vm/win1036/id_rsa', help="%(default)s")
ap.add_argument("--vm-winxp-login", default='Naresh', help="Windows login %(default)s")
ap.add_argument("--vm-winxp-python-version", default='3.6', help="Windows Python version installed in the VM (default: %(default)s)")
ap.add_argument("--vm-winxp-python-version", default='3.7.4', help="Windows Python version installed in the VM (default: %(default)s)")

ap.add_argument("-t", "--test", action="store_true", default=False, help="Test built packages")
ap.add_argument("-s", "--sign", action="store_true", default=False, help="Sign Debian package / generate Rpm repo")
Expand Down
4 changes: 2 additions & 2 deletions setup/win32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ include Makefile.servicename
SERVER_DIRECTORY=../..
FILES_DIRECTORY=release

MAKENSIS_ARGUMENTS=/DVERSION=$(VERSION) /DSERVICENAME=${SERVICENAME}
MAKENSIS_ARGUMENTS=/DVERSION=$(VERSION) /DSERVICENAME=${SERVICENAME} /DPYTHONVERSION=${PYTHON_VERSION}

LAUNCH_MAKENSIS=/cygdrive/c/tools/cygwin/makensis $(MAKENSIS_ARGUMENTS) setup.nsi
WINPY_DIR=/cygdrive/c/odoobuild/WinPython/python-3.6.2
WINPY_DIR=/cygdrive/c/odoobuild/WinPython/python-${PYTHON_VERSION}

default: allinone

Expand Down
3 changes: 1 addition & 2 deletions setup/win32/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Section $(TITLE_OpenERP_Server) SectionOpenERP_Server

# Installing winpython
SetOutPath "$INSTDIR\python"
File /r /x "__pycache__" "..\..\..\WinPython\python-3.6.2\*"
File /r /x "__pycache__" "..\..\..\WinPython\python-${PYTHONVERSION}\*"

SetOutPath "$INSTDIR\nssm"
File /r /x "src" "..\..\..\nssm-2.24\*"
Expand All @@ -229,7 +229,6 @@ Section $(TITLE_OpenERP_Server) SectionOpenERP_Server

SetOutPath "$INSTDIR\thirdparty"
File /r "${STATIC_PATH}\wkhtmltopdf\*"
File /r "${STATIC_PATH}\less\*"

# If there is a previous install of the OpenERP Server, keep the login/password from the config file
WriteIniStr "$INSTDIR\server\odoo.conf" "options" "db_host" $TextPostgreSQLHostname
Expand Down

0 comments on commit 7ce07a7

Please sign in to comment.