# HG changeset patch
# User Markus Mützel <markus.muetzel@gmx.de>
# Date 1593944513 -7200
#      Sun Jul 05 12:21:53 2020 +0200
# Node ID 06b1aa021c6cb7249b0e11d62bf4b92a4c1f8eae
# Parent  a4d521672b9c2ea5490b849c82d4de39da975ccd
Add build rule for python3 (bug #58689).

* src/build-python3.mk: Add build rule for python3 version 3.8.3.
* dist-files.mk: Add new file to list.
* index.html: Add new package to list.
* src/build-setuptools.mk: Update to version 49.1.0. Depend on and use python3.
Set installation prefix.
* src/build-mako.mk: Depend on and use python3. Set installation prefix.
* src/build-markupsafe.mk: Depend on and use python3. Set installation prefix.
* src/nsis.mk: Depend on python and scons. Use python2.

diff -r a4d521672b9c -r 06b1aa021c6c dist-files.mk
--- a/dist-files.mk	Sat Jul 04 12:14:29 2020 -0400
+++ b/dist-files.mk	Sun Jul 05 12:21:53 2020 +0200
@@ -42,6 +42,7 @@
   build-pkg-config-1-fixes.patch \
   build-pkg-config.mk \
   build-python.mk \
+  build-python3.mk \
   build-scons.mk \
   build-sed.mk \
   build-setuptools.mk \
diff -r a4d521672b9c -r 06b1aa021c6c index.html
--- a/index.html	Sat Jul 04 12:14:29 2020 -0400
+++ b/index.html	Sun Jul 05 12:21:53 2020 +0200
@@ -1051,7 +1051,11 @@
     </tr>
     <tr>
         <td class="package">build-python</td>
-        <td class="website"><a href="http://www.python.org">python</a></td>
+        <td class="website"><a href="https://www.python.org/dev/peps/pep-0373/">python2</a></td>
+    </tr>
+    <tr>
+        <td class="package">build-python3</td>
+        <td class="website"><a href="http://www.python.org">python3</a></td>
     </tr>
     <tr>
         <td class="package">build-scons</td>
diff -r a4d521672b9c -r 06b1aa021c6c src/build-mako.mk
--- a/src/build-mako.mk	Sat Jul 04 12:14:29 2020 -0400
+++ b/src/build-mako.mk	Sun Jul 05 12:21:53 2020 +0200
@@ -8,7 +8,7 @@
 $(PKG)_SUBDIR   := Mako-$($(PKG)_VERSION)
 $(PKG)_FILE     := Mako-$($(PKG)_VERSION).tar.gz
 $(PKG)_URL      := https://pypi.python.org/packages/eb/f3/67579bb486517c0d49547f9697e36582cd19dafb5df9e687ed8e22de57fa/$($(PKG)_FILE)
-$(PKG)_DEPS     := build-python build-markupsafe build-setuptools
+$(PKG)_DEPS     := build-python3 build-markupsafe build-setuptools
 
 define $(PKG)_UPDATE
     echo 'Warning: Updates are temporarily disabled for package $(PKG).' >&2;
@@ -16,5 +16,5 @@
 endef
 
 define $(PKG)_BUILD
-    cd '$(1)' && python setup.py install
+    cd '$(1)' && $(PYTHON3) setup.py install --prefix='$(BUILD_TOOLS_PREFIX)'
 endef
diff -r a4d521672b9c -r 06b1aa021c6c src/build-markupsafe.mk
--- a/src/build-markupsafe.mk	Sat Jul 04 12:14:29 2020 -0400
+++ b/src/build-markupsafe.mk	Sun Jul 05 12:21:53 2020 +0200
@@ -8,7 +8,7 @@
 $(PKG)_SUBDIR   := MarkupSafe-$($(PKG)_VERSION)
 $(PKG)_FILE     := MarkupSafe-$($(PKG)_VERSION).tar.gz
 $(PKG)_URL      := https://pypi.python.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/$($(PKG)_FILE)
-$(PKG)_DEPS     := build-python build-setuptools
+$(PKG)_DEPS     := build-python3 build-setuptools
 
 define $(PKG)_UPDATE
     echo 'Warning: Updates are temporarily disabled for package $(PKG).' >&2;
@@ -16,6 +16,6 @@
 endef
 
 define $(PKG)_BUILD
-    cd '$(1)' && python setup.py install
+    cd '$(1)' && $(PYTHON3) setup.py install --prefix='$(BUILD_TOOLS_PREFIX)'
 endef
 
diff -r a4d521672b9c -r 06b1aa021c6c src/build-python3.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/build-python3.mk	Sun Jul 05 12:21:53 2020 +0200
@@ -0,0 +1,27 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := build-python3
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 3.8.3
+$(PKG)_CHECKSUM := 3bafa40df1cd069c112761c388a9f2e94b5d33dd
+$(PKG)_SUBDIR   := Python-$($(PKG)_VERSION)
+$(PKG)_FILE     := Python-$($(PKG)_VERSION).tar.xz
+$(PKG)_URL      := http://www.python.org/ftp/python/$($(PKG)_VERSION)/$($(PKG)_FILE)
+$(PKG)_DEPS     := 
+ifneq ($(USE_SYSTEM_GCC),yes)
+    $(PKG)_DEPS     += build-gcc
+endif
+
+define $(PKG)_UPDATE
+    echo 'Warning: Updates are temporarily disabled for package $(PKG).' >&2;
+    echo $($(PKG)_VERSION)
+endef
+
+define $(PKG)_BUILD
+    mkdir '$(1)/.build'
+    cd    '$(1)/.build' && '$(1)/configure' \
+        --prefix='$(BUILD_TOOLS_PREFIX)'
+    $(MAKE) -C '$(1)/.build' -j '$(JOBS)'
+    $(MAKE) -C '$(1)/.build' -j 1 install
+endef
diff -r a4d521672b9c -r 06b1aa021c6c src/build-setuptools.mk
--- a/src/build-setuptools.mk	Sat Jul 04 12:14:29 2020 -0400
+++ b/src/build-setuptools.mk	Sun Jul 05 12:21:53 2020 +0200
@@ -3,12 +3,12 @@
 
 PKG             := build-setuptools
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 36.5.0
-$(PKG)_CHECKSUM := 4edca327d0666d6956d05cef8fd6dfcce6e701db
+$(PKG)_VERSION  := 49.1.0
+$(PKG)_CHECKSUM := 83bd58e73c61112d3db1d6b6f4f29daf0bb32597
 $(PKG)_SUBDIR   := setuptools-$($(PKG)_VERSION)
 $(PKG)_FILE     := setuptools-$($(PKG)_VERSION).zip
-$(PKG)_URL      := https://pypi.python.org/packages/a4/c8/9a7a47f683d54d83f648d37c3e180317f80dc126a304c45dc6663246233a/$($(PKG)_FILE)
-$(PKG)_DEPS     := build-python
+$(PKG)_URL      := https://files.pythonhosted.org/packages/8b/0f/5f135746c4d0c95fcc3c9a30ac942330bbdf092879ccaae7e3dcba6ea214/$($(PKG)_FILE)
+$(PKG)_DEPS     := build-python3
 
 define $(PKG)_UPDATE
     echo 'Warning: Updates are temporarily disabled for package $(PKG).' >&2;
@@ -16,5 +16,5 @@
 endef
 
 define $(PKG)_BUILD
-    cd '$(1)' && python setup.py install
+    cd '$(1)' && $(PYTHON3) setup.py install --prefix='$(BUILD_TOOLS_PREFIX)'
 endef
diff -r a4d521672b9c -r 06b1aa021c6c src/nsis.mk
--- a/src/nsis.mk	Sat Jul 04 12:14:29 2020 -0400
+++ b/src/nsis.mk	Sun Jul 05 12:21:53 2020 +0200
@@ -8,7 +8,7 @@
 $(PKG)_SUBDIR   := nsis-$($(PKG)_VERSION)-src
 $(PKG)_FILE     := nsis-$($(PKG)_VERSION)-src.tar.bz2
 $(PKG)_URL      := https://$(SOURCEFORGE_MIRROR)/project/nsis/NSIS 3/$($(PKG)_VERSION)/$($(PKG)_FILE)
-$(PKG)_DEPS     :=
+$(PKG)_DEPS     := build-scons
 
 define $(PKG)_UPDATE
     $(WGET) -q -O- 'https://nsis.sourceforge.io/Download' | \
@@ -26,7 +26,7 @@
 
 define $(PKG)_BUILD
     $($(PKG)_PREBUILD)
-    cd '$(1)' && scons VERBOSE=1 \
+    cd '$(1)' && python2 $(shell which scons) VERBOSE=1 \
         PATH='$(PATH)' \
         XGCC_W32_PREFIX='$(MXE_TOOL_PREFIX)' \
         PREFIX='$(BUILD_TOOLS_PREFIX)' \
