aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2020-05-13 20:11:10 +1000
committerfuzzard <fuzzard@kodi.tv>2020-06-21 20:11:49 +1000
commit139909768b8cc49abcc10ab4f0d136ef1c0f5543 (patch)
tree5d9373849c93f0fbc618086549313d19e113aef8 /tools
parent43ae8da078d7e003fa94836267bd2f1d86ecc187 (diff)
[tools/depends] bump pythonmodule-pil 7.1.2
Fix ios/tvos usage rbpi requires to explicitly remove lcms, as it doesnt respect the --disable-lcms flag for some reason, and causes a build failure trying to build the _imagingcms extension when it shouldnt be building it at all. building 'PIL._imagingcms' extension /usr/bin/ccache /home/jenkins/rbpi-dev/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -pipe -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations -isystem/home/jenkins/rbpi-dev/firmware/opt/vc/include -isystem/home/jenkins/rbpi-dev/firmware/opt/vc/include/interface/vcos/pthreads -isystem/home/jenkins/rbpi-dev/firmware/opt/vc/include/interface/vmcs_host/linux -Og -g -D_DEBUG -isystem /home/jenkins/workspace/LINUX-RBPI/tools/depends/xbmc-depends/raspberry-pi2-debug/include -I/home/jenkins/workspace/LINUX-RBPI/tools/depends/xbmc-depends/raspberry-pi2-debug/include/freetype2 -I/home/jenkins/workspace/LINUX-RBPI/tools/depends/target/pythonmodule-pil/raspberry-pi2-debug/src/libImaging -I/home/jenkins/workspace/LINUX-RBPI/tools/depends/xbmc-depends/i686-linux-gnu-native/include -I/home/jenkins/workspace/LINUX-RBPI/tools/depends/xbmc-depends/raspberry-pi2-debug/include -I/home/jenkins/workspace/LINUX-RBPI/tools/depends/xbmc-depends/raspberry-pi2-debug/include/python3.7 -I/usr/local/include -I/usr/include -I/home/jenkins/workspace/LINUX-RBPI/tools/depends/xbmc-depends/i686-linux-gnu-native/include/python3.7 -c src/_imagingcms.c -o build/temp.linux-x86_64-3.7/src/_imagingcms.o In file included from /home/jenkins/workspace/LINUX-RBPI/tools/depends/xbmc-depends/raspberry-pi2-debug/include/python3.7/Python.h:11:0, from src/_imagingcms.c:29: /usr/include/limits.h:26:36: fatal error: bits/libc-header-start.h: No such file or directory #include <bits/libc-header-start.h> ^ compilation terminated. error: command '/usr/bin/ccache' failed with exit status 1 Makefile:71: recipe for target '.installed-raspberry-pi2-debug' failed
Diffstat (limited to 'tools')
-rwxr-xr-xtools/darwin/Support/CopyRootFiles-darwin_embedded.command3
-rw-r--r--tools/depends/target/pythonmodule-pil/01-rbpi-remove-lcms.patch31
-rw-r--r--tools/depends/target/pythonmodule-pil/Makefile52
-rw-r--r--tools/depends/target/pythonmodule-pil/pillow-crosscompile.patch185
4 files changed, 67 insertions, 204 deletions
diff --git a/tools/darwin/Support/CopyRootFiles-darwin_embedded.command b/tools/darwin/Support/CopyRootFiles-darwin_embedded.command
index 638ae6d1e9..34f6e7684c 100755
--- a/tools/darwin/Support/CopyRootFiles-darwin_embedded.command
+++ b/tools/darwin/Support/CopyRootFiles-darwin_embedded.command
@@ -33,6 +33,9 @@ ${SYNC} "$BUILD_ROOT/xbmc/platform/darwin/Credits.html" "$TARGET_BUILD_DIR/$EXE
${ADDONSYNC} "$BUILD_ROOT/addons" "$TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/AppData/AppHome"
${SYNC} "$BUILD_ROOT/media" "$TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/AppData/AppHome"
+# extracted eggs
+${SYNC} "$XBMC_DEPENDS/share/$APP_NAME/addons" "$TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/AppData/AppHome"
+
# sync skin.estouchy
SYNCSKIN_A=${SKINSYNC}
if [ -f "$BUILD_ROOT/addons/skin.estouchy/media/Textures.xbt" ]; then
diff --git a/tools/depends/target/pythonmodule-pil/01-rbpi-remove-lcms.patch b/tools/depends/target/pythonmodule-pil/01-rbpi-remove-lcms.patch
new file mode 100644
index 0000000000..d81570ff77
--- /dev/null
+++ b/tools/depends/target/pythonmodule-pil/01-rbpi-remove-lcms.patch
@@ -0,0 +1,31 @@
+--- a/setup.py
++++ b/setup.py
+@@ -752,17 +752,17 @@
+ )
+ )
+
+- if feature.lcms:
+- extra = []
+- if sys.platform == "win32":
+- extra.extend(["user32", "gdi32"])
+- exts.append(
+- Extension(
+- "PIL._imagingcms",
+- ["src/_imagingcms.c"],
+- libraries=[feature.lcms] + extra,
+- )
+- )
++# if feature.lcms:
++# extra = []
++# if sys.platform == "win32":
++# extra.extend(["user32", "gdi32"])
++# exts.append(
++# Extension(
++# "PIL._imagingcms",
++# ["src/_imagingcms.c"],
++# libraries=[feature.lcms] + extra,
++# )
++# )
+
+ if feature.webp:
+ libs = [feature.webp]
diff --git a/tools/depends/target/pythonmodule-pil/Makefile b/tools/depends/target/pythonmodule-pil/Makefile
index ba89ccf648..0dc330f673 100644
--- a/tools/depends/target/pythonmodule-pil/Makefile
+++ b/tools/depends/target/pythonmodule-pil/Makefile
@@ -1,37 +1,38 @@
include ../../Makefile.include
-DEPS= ../../Makefile.include Makefile pillow-crosscompile.patch
+DEPS= ../../Makefile.include Makefile pillow-crosscompile.patch 01-rbpi-remove-lcms.patch
VERSION.TXT := $(CMAKE_SOURCE_DIR)/version.txt
APP_NAME=$(shell awk '/APP_NAME/ {print tolower($$2)}' $(VERSION.TXT))
# lib name, version
-LIBNAME=pillow
-VERSION=3.0.0
+LIBNAME=Pillow
+VERSION=7.1.2
SOURCE=$(LIBNAME)-$(VERSION)
ARCHIVE=$(SOURCE).tar.gz
-CROSSFLAGS=PYTHONXCPREFIX="$(PREFIX)" CC="$(CC) $(CFLAGS)" LDSHARED="$(CC) -shared" LDFLAGS="$(LDFLAGS)" PYTHONPATH="$(PREFIX)/lib/python3.7/site-packages/"
+LIBDYLIB=$(PLATFORM)/dist/Pillow-$(VERSION)-py3.7-$(OS)-$(CPU).egg
+PYTHONPATH=$(PREFIX)/lib/python3.7/site-packages/
+LDSHARED=$(CC) -shared
+
ifeq ($(OS),android)
+LIBDYLIB=$(PREFIX)/share/$(APP_NAME)/addons/script.module.pil/lib/PIL/_imaging.so
+PILPATH=$(PREFIX)/share/$(APP_NAME)/addons/script.module.pil
+PYTHONPATH=$(PILPATH):$(PREFIX)/lib/python3.7/site-packages/
+EXTRALDFLAGS=-L$(PREFIX)/lib/dummy-lib$(APP_NAME)/ -l$(APP_NAME) -lm
+else ifeq ($(OS),darwin_embedded)
+LIBDYLIB=$(PREFIX)/share/$(APP_NAME)/addons/script.module.pil/lib/PIL/_imaging.so
PILPATH=$(PREFIX)/share/$(APP_NAME)/addons/script.module.pil
-CROSSFLAGS=PYTHONXCPREFIX="$(PREFIX)" CC="$(CC) $(CFLAGS)" LDSHARED="$(CC) -shared" LDFLAGS="$(LDFLAGS) -L$(PREFIX)/lib/dummy-lib$(APP_NAME)/ -l$(APP_NAME) -lm" PYTHONPATH="$(PILPATH):$(PREFIX)/lib/python3.7/site-packages/"
+PYTHONPATH=$(PILPATH):$(PREFIX)/lib/python3.7/site-packages/
+else ifeq ($(OS),osx)
+LIBDYLIB=$(PLATFORM)/dist/Pillow-$(VERSION)-py3.7-macosx-10.4-x86_64.egg
endif
ifeq (darwin, $(findstring darwin, $(HOST)))
-ifeq ($(OS),darwin_embedded)
-PYTHON_O=$(abs_top_srcdir)/target/python3/$(PLATFORM)/Programs/python.o
-PILPATH=$(PREFIX)/share/$(APP_NAME)/addons/script.module.pil
-endif
#ensure that only our target ldflags are passed to the python build
-LDSHARED:=$(CC) -bundle -undefined dynamic_lookup $(LDFLAGS)
-CROSSFLAGS=PYTHONXCPREFIX="$(PREFIX)" CC="$(CC) $(CFLAGS)" CCSHARED="$(CC) $(CFLAGS) $(PYTHON_O)" LDFLAGS="$(LDFLAGS)" PYTHONPATH="$(PILPATH):$(PREFIX)/lib/python3.7/site-packages/" LDSHARED="$(LDSHARED)"
+LDSHARED=$(CC) -bundle -undefined dynamic_lookup
endif
-LIBDYLIB=$(PLATFORM)/dist/Pillow-$(VERSION)-py3.7-$(OS)-$(CPU).egg
-ifeq ($(OS),android)
-LIBDYLIB=$(PREFIX)/share/$(APP_NAME)/addons/script.module.pil/lib/PIL/_imaging.so
-else ifeq (darwin, $(findstring darwin, $(HOST)))
-LIBDYLIB=$(PLATFORM)/dist/Pillow-$(VERSION)-py3.7-macosx-10.4-x86_64.egg
-endif
+CROSSFLAGS=PYTHONXCPREFIX="$(PREFIX)" CC="$(CC) $(CFLAGS)" LDSHARED="$(LDSHARED)" LDFLAGS="$(LDFLAGS) $(EXTRALDFLAGS)" PYTHONPATH="$(PYTHONPATH)"
all: .installed-$(PLATFORM)
@@ -41,23 +42,26 @@ $(TARBALLS_LOCATION)/$(ARCHIVE):
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ifeq ($(TARGET_PLATFORM),raspberry-pi)
+ cd $(PLATFORM); patch -p1 -i ../01-rbpi-remove-lcms.patch
+endif
cd $(PLATFORM); patch -p1 -i ../pillow-crosscompile.patch
$(LIBDYLIB): $(PLATFORM)
mkdir -p $(PLATFORM)/output
- cd $(PLATFORM); $(CROSSFLAGS) $(NATIVEPREFIX)/bin/python3 setup.py build_ext --plat-name $(OS)-$(CPU)
+ cd $(PLATFORM); $(CROSSFLAGS) $(NATIVEPREFIX)/bin/python3 setup.py build_ext --plat-name $(OS)-$(CPU) --disable-jpeg2000 --disable-webp --disable-imagequant --disable-tiff --disable-webp --disable-webpmux --disable-xcb --disable-lcms --disable-platform-guessing
.installed-$(PLATFORM): $(LIBDYLIB)
ifeq ($(OS),android)
- mkdir -p $(PREFIX)/share/$(APP_NAME)/addons/script.module.pil/lib
- cd $(PLATFORM); $(CROSSFLAGS) $(NATIVEPREFIX)/bin/python3 setup.py install --install-lib $(PREFIX)/share/$(APP_NAME)/addons/script.module.pil
- cd $(PREFIX)/share/$(APP_NAME)/addons/script.module.pil/lib && unzip -o ../Pillow-*.egg
- cd $(PREFIX)/share/$(APP_NAME)/addons/script.module.pil/lib/PIL && \
+ mkdir -p $(PILPATH)/lib
+ cd $(PLATFORM); $(CROSSFLAGS) $(NATIVEPREFIX)/bin/python3 setup.py install --install-lib $(PILPATH)
+ cd $(PILPATH)/lib && unzip -o ../Pillow-*.egg
+ cd $(PILPATH)/lib/PIL && \
sed -i -e 's/import sys/import os, sys /' \
-e '/__file__/ s/_imaging/lib_imaging/g' \
-e 's/pkg_resources.resource_filename(__name__,/os.path.join(os.environ["KODI_ANDROID_LIBS"], /' _imaging*.py
- cd $(PREFIX)/share/$(APP_NAME)/addons/script.module.pil && rm -rf Pillow-*.egg
-else ifeq ($(TARGET_PLATFORM),appletvos)
+ cd $(PILPATH) && rm -rf Pillow-*.egg
+else ifeq ($(OS),darwin_embedded)
mkdir -p $(PILPATH)/lib
cd $(PLATFORM); $(CROSSFLAGS) $(NATIVEPREFIX)/bin/python3 setup.py install --install-lib $(PILPATH)
cd $(PILPATH)/lib && unzip -o ../Pillow-*.egg
diff --git a/tools/depends/target/pythonmodule-pil/pillow-crosscompile.patch b/tools/depends/target/pythonmodule-pil/pillow-crosscompile.patch
index cfd7a9f261..57401a25c0 100644
--- a/tools/depends/target/pythonmodule-pil/pillow-crosscompile.patch
+++ b/tools/depends/target/pythonmodule-pil/pillow-crosscompile.patch
@@ -1,8 +1,8 @@
--- a/setup.py
+++ b/setup.py
-@@ -156,6 +156,16 @@
-
- _add_directory(include_dirs, "libImaging")
+@@ -363,6 +363,16 @@
+ if _cmd_exists(os.environ.get("PKG_CONFIG", "pkg-config")):
+ pkg_config = _pkg_config
+ compiler = os.environ.get('CC')
+ args = {}
@@ -16,8 +16,8 @@
+
#
# add configured kits
-
-@@ -187,10 +197,11 @@
+ for root_name, lib_name in dict(
+@@ -418,10 +428,11 @@
for d in os.environ[k].split(os.path.pathsep):
_add_directory(library_dirs, d)
@@ -30,178 +30,3 @@
#
# add platform directories
-@@ -202,14 +213,14 @@
-
- elif sys.platform == "darwin":
- # attempt to make sure we pick freetype2 over other versions
-- _add_directory(include_dirs, "/sw/include/freetype2")
-- _add_directory(include_dirs, "/sw/lib/freetype2/include")
-+ #_add_directory(include_dirs, "/sw/include/freetype2")
-+ #_add_directory(include_dirs, "/sw/lib/freetype2/include")
- # fink installation directories
-- _add_directory(library_dirs, "/sw/lib")
-- _add_directory(include_dirs, "/sw/include")
-+ #_add_directory(library_dirs, "/sw/lib")
-+ #_add_directory(include_dirs, "/sw/include")
- # darwin ports installation directories
-- _add_directory(library_dirs, "/opt/local/lib")
-- _add_directory(include_dirs, "/opt/local/include")
-+ #_add_directory(library_dirs, "/opt/local/lib")
-+ #_add_directory(include_dirs, "/opt/local/include")
-
- # if Homebrew is installed, use its lib and include directories
- import subprocess
-@@ -234,15 +245,15 @@
- _add_directory(library_dirs, os.path.join(ft_prefix, 'lib'))
- _add_directory(
- include_dirs, os.path.join(ft_prefix, 'include'))
-- else:
-+ #else:
- # fall back to freetype from XQuartz if
- # Homebrew's freetype is missing
-- _add_directory(library_dirs, "/usr/X11/lib")
-- _add_directory(include_dirs, "/usr/X11/include")
-+ #_add_directory(library_dirs, "/usr/X11/lib")
-+ #_add_directory(include_dirs, "/usr/X11/include")
-
- elif sys.platform.startswith("linux"):
- arch_tp = (plat.processor(), plat.architecture()[0])
-- if arch_tp == ("x86_64", "32bit"):
-+ if arch_tp == ("x86_64xxx", "32bit"):
- # 32 bit build on 64 bit machine.
- _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
- else:
-@@ -252,43 +263,43 @@
- continue
-
- if platform_ in ["x86_64", "64bit"]:
-- _add_directory(library_dirs, "/lib64")
-- _add_directory(library_dirs, "/usr/lib64")
-- _add_directory(
-- library_dirs, "/usr/lib/x86_64-linux-gnu")
-+ #_add_directory(library_dirs, "/lib64")
-+ #_add_directory(library_dirs, "/usr/lib64")
-+ #_add_directory(
-+ # library_dirs, "/usr/lib/x86_64-linux-gnu")
- break
- elif platform_ in ["i386", "i686", "32bit"]:
-- _add_directory(
-- library_dirs, "/usr/lib/i386-linux-gnu")
-+ #_add_directory(
-+ # library_dirs, "/usr/lib/i386-linux-gnu")
- break
- elif platform_ in ["aarch64"]:
-- _add_directory(library_dirs, "/usr/lib64")
-- _add_directory(
-- library_dirs, "/usr/lib/aarch64-linux-gnu")
-+ #_add_directory(library_dirs, "/usr/lib64")
-+ #_add_directory(
-+ # library_dirs, "/usr/lib/aarch64-linux-gnu")
- break
- elif platform_ in ["arm", "armv7l"]:
-- _add_directory(
-- library_dirs, "/usr/lib/arm-linux-gnueabi")
-+ #_add_directory(
-+ # library_dirs, "/usr/lib/arm-linux-gnueabi")
- break
- elif platform_ in ["ppc64"]:
-- _add_directory(library_dirs, "/usr/lib64")
-- _add_directory(
-- library_dirs, "/usr/lib/ppc64-linux-gnu")
-- _add_directory(
-- library_dirs, "/usr/lib/powerpc64-linux-gnu")
-+ #_add_directory(library_dirs, "/usr/lib64")
-+ #_add_directory(
-+ # library_dirs, "/usr/lib/ppc64-linux-gnu")
-+ #_add_directory(
-+ # library_dirs, "/usr/lib/powerpc64-linux-gnu")
- break
- elif platform_ in ["ppc"]:
-- _add_directory(library_dirs, "/usr/lib/ppc-linux-gnu")
-- _add_directory(
-- library_dirs, "/usr/lib/powerpc-linux-gnu")
-+ #_add_directory(library_dirs, "/usr/lib/ppc-linux-gnu")
-+ #_add_directory(
-+ # library_dirs, "/usr/lib/powerpc-linux-gnu")
- break
- elif platform_ in ["s390x"]:
-- _add_directory(library_dirs, "/usr/lib64")
-- _add_directory(
-- library_dirs, "/usr/lib/s390x-linux-gnu")
-+ #_add_directory(library_dirs, "/usr/lib64")
-+ #_add_directory(
-+ # library_dirs, "/usr/lib/s390x-linux-gnu")
- break
- elif platform_ in ["s390"]:
-- _add_directory(library_dirs, "/usr/lib/s390-linux-gnu")
-+ #_add_directory(library_dirs, "/usr/lib/s390-linux-gnu")
- break
- else:
- raise ValueError(
-@@ -297,18 +308,18 @@
- # XXX Kludge. Above /\ we brute force support multiarch. Here we
- # try Barry's more general approach. Afterward, something should
- # work ;-)
-- self.add_multiarch_paths()
-+ #self.add_multiarch_paths()
-
-- elif sys.platform.startswith("gnu"):
-- self.add_multiarch_paths()
-+ #elif sys.platform.startswith("gnu"):
-+ # self.add_multiarch_paths()
-
-- elif sys.platform.startswith("netbsd"):
-- _add_directory(library_dirs, "/usr/pkg/lib")
-- _add_directory(include_dirs, "/usr/pkg/include")
-+ #elif sys.platform.startswith("netbsd"):
-+ #_add_directory(library_dirs, "/usr/pkg/lib")
-+ #_add_directory(include_dirs, "/usr/pkg/include")
-
-- elif sys.platform.startswith("sunos5"):
-- _add_directory(library_dirs, "/opt/local/lib")
-- _add_directory(include_dirs, "/opt/local/include")
-+ #elif sys.platform.startswith("sunos5"):
-+ #_add_directory(library_dirs, "/opt/local/lib")
-+ #_add_directory(include_dirs, "/opt/local/include")
-
- # FIXME: check /opt/stuff directories here?
-
-@@ -350,11 +361,11 @@
- _add_directory(include_dirs, tcl_dir)
-
- # standard locations
-- _add_directory(library_dirs, "/usr/local/lib")
-- _add_directory(include_dirs, "/usr/local/include")
-+ #_add_directory(library_dirs, "/usr/local/lib")
-+ #_add_directory(include_dirs, "/usr/local/include")
-
-- _add_directory(library_dirs, "/usr/lib")
-- _add_directory(include_dirs, "/usr/include")
-+ #_add_directory(library_dirs, "/usr/lib")
-+ #_add_directory(include_dirs, "/usr/include")
-
- # on Windows, look for the OpenJPEG libraries in the location that
- # the official installer puts them
-@@ -389,12 +400,7 @@
- feature = self.feature
-
- if feature.want('zlib'):
-- if _find_include_file(self, "zlib.h"):
-- if _find_library_file(self, "z"):
-- feature.zlib = "z"
-- elif (sys.platform == "win32" and
-- _find_library_file(self, "zlib")):
-- feature.zlib = "zlib" # alternative name
-+ feature.zlib = "z"
-
- if feature.want('jpeg'):
- if _find_include_file(self, "jpeglib.h"):
-@@ -552,7 +558,7 @@
-
- if feature.freetype:
- exts.append(Extension(
-- "PIL._imagingft", ["_imagingft.c"], libraries=["freetype"]))
-+ "PIL._imagingft", ["_imagingft.c"], libraries=["freetype", "bz2", "z"]))
-
- if os.path.isfile("_imagingtiff.c") and feature.tiff:
- exts.append(Extension(