aboutsummaryrefslogtreecommitdiff
path: root/lib/addons/script.module.pil/Makefile.in
blob: 0cc40f4dbc8cb2aeb9387e4a4a72b58cc2e27e33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

OSTYPE=$(shell uname)
VERSION=1.1.7
BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
SOURCE=Imaging-$(VERSION)
ARCHIVE=$(SOURCE).tar.gz

RETRIEVE_TOOL=curl
RETRIEVE_TOOL_FLAGS=-Ls --output $(ARCHIVE)
ARCHIVE_TOOL=tar
ARCHIVE_TOOL_FLAGS=xf

ifeq ($(OSTYPE),Darwin)
include @abs_top_srcdir@/tools/darwin/depends/Makefile.include
include @abs_top_srcdir@/tools/darwin/depends/config.site.mk
export TARBALLS_LOCATION=.
export PYTHONXCPREFIX=$(PREFIX)
export LDFLAGS+=-L$(PREFIX)/lib
PYTHON=$(TOOLCHAIN)/bin/python
PYTHONCROSS=--cross-compile
else
PYTHON=@PYTHON@
endif

NO_SYSTEM_PIL=$(shell $(PYTHON) -m Image >/dev/null 2>&1 || echo "1")

DESTDIR=@abs_top_srcdir@/addons/script.module.pil/lib/PIL

CLEAN_FILES=$(ARCHIVE) $(SOURCE) $(DESTDIR)

all: $(DESTDIR)

ifeq (1,$(NO_SYSTEM_PIL))
$(ARCHIVE):
	$(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)

$(SOURCE): $(ARCHIVE)
	-rm -rf $(SOURCE)
	$(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(ARCHIVE)
	if test "$(OSTYPE)" = "Darwin"; then \
	cd $(SOURCE); \
	patch -p1 < ../Imaging-1.1.7-crosscompiling-0.1.patch; \
	patch -p1 < ../Imaging-1.1.7-setuptools-0.1.patch; \
	patch -p1 < ../Imaging-1.1.7-access.patch; \
	sed -ie "s|"darwin"|"darwinNot"|g" "setup.py"; \
	sed -ie "s|ZLIB_ROOT = None|ZLIB_ROOT = libinclude(\"${platform_sdk_path}/usr\")|" "setup.py"; \
	fi

$(DESTDIR): $(SOURCE)
	-rm -rf $(DESTDIR)
	pushd $(SOURCE) && $(PYTHON) setup.py build $(PYTHONCROSS) --build-lib $(DESTDIR); popd
else
$(DESTDIR):
	@true
endif

include ../../../Makefile.include