summaryrefslogtreecommitdiffstats
path: root/tools/depends/native/python3/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /tools/depends/native/python3/Makefile
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/depends/native/python3/Makefile')
-rw-r--r--tools/depends/native/python3/Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/tools/depends/native/python3/Makefile b/tools/depends/native/python3/Makefile
new file mode 100644
index 0000000..74ebe06
--- /dev/null
+++ b/tools/depends/native/python3/Makefile
@@ -0,0 +1,46 @@
+include ../../Makefile.include PYTHON3-VERSION ../../download-files.include
+PLATFORM=$(NATIVEPLATFORM)
+DEPS = ../../Makefile.include Makefile PYTHON3-VERSION ../../download-files.include \
+ 01-distutil-flags.patch
+
+CONFIGURE=./configure --prefix=$(NATIVEPREFIX) \
+ --disable-shared \
+ --disable-framework \
+ --without-pymalloc \
+ --with-system-ffi
+
+NATIVE_SITEPACKAGES=$(NATIVEPREFIX)/lib/python$(PYTHON_VERSION)/site-packages
+
+ifeq ($(OS),linux)
+ CONFIGURE += --with-system-expat
+endif
+
+LIBDYLIB=$(PLATFORM)/python
+ifeq ($(NATIVE_OS), osx)
+ # Case insensitive FS will add .exe to buildexe regardless of --with-suffix=no
+ LIBDYLIB=$(PLATFORM)/python.exe
+endif
+
+all: .installed-$(PLATFORM)
+
+$(PLATFORM): $(DEPS) | $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE)
+ rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
+ cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ cd $(PLATFORM); $(CONFIGURE)
+
+$(LIBDYLIB): $(PLATFORM)
+ cd $(PLATFORM); $(MAKE)
+
+.installed-$(PLATFORM): $(LIBDYLIB)
+ cd $(PLATFORM); patch -p1 -i ../01-distutil-flags.patch
+ cd $(PLATFORM); $(MAKE) install
+# Sed patch setuptools that is installed via ensurepip as we cant patch the source
+ cd $(NATIVE_SITEPACKAGES); sed -ie "s|cflags = cflags + ' ' + os.environ\['CFLAGS'\]|cflags = os.environ\['CFLAGS'\]|" setuptools/_distutils/sysconfig.py
+ touch $(LIBDYLIB)
+ touch $@
+
+clean:
+ rm -rf $(PLATFORM) .installed-$(PLATFORM)
+
+distclean::
+ rm -rf $(PLATFORM) .installed-$(PLATFORM)