aboutsummaryrefslogtreecommitdiff
path: root/tools/depends
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2022-04-18 02:12:57 +1000
committerfuzzard <fuzzard@kodi.tv>2022-05-19 17:39:34 +1000
commitdafbed3f6a6792a84262af62424a89494c73bac2 (patch)
tree664f9427975e42a5e9f7c029b29e51aa5a3ed09c /tools/depends
parent3958a09217d7cb46e7c2aa2e65722e2dfd3c35b9 (diff)
[tools/depends][target] freetype2 migrate to cmake build system
use cmake build system
Diffstat (limited to 'tools/depends')
-rw-r--r--tools/depends/target/Makefile2
-rw-r--r--tools/depends/target/freetype2/01-darwinembedded-incorrecttoolchain.patch12
-rw-r--r--tools/depends/target/freetype2/FREETYPE2-VERSION5
-rw-r--r--tools/depends/target/freetype2/Makefile60
4 files changed, 53 insertions, 26 deletions
diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile
index a7b29eeaa4..38ffb6fc47 100644
--- a/tools/depends/target/Makefile
+++ b/tools/depends/target/Makefile
@@ -138,7 +138,7 @@ dav1d: meson-cross-file
dbus: expat
ffmpeg: $(ICONV) $(ZLIB) bzip2 gnutls dav1d $(LIBVA)
fontconfig: freetype2 expat $(ICONV) $(LIBUUID) meson-cross-file
-freetype2: harfbuzz $(ZLIB)
+freetype2: bzip2 harfbuzz $(ZLIB)
fribidi: meson-cross-file
gettext: $(ICONV)
gnutls: nettle $(ZLIB)
diff --git a/tools/depends/target/freetype2/01-darwinembedded-incorrecttoolchain.patch b/tools/depends/target/freetype2/01-darwinembedded-incorrecttoolchain.patch
new file mode 100644
index 0000000000..256718e6cb
--- /dev/null
+++ b/tools/depends/target/freetype2/01-darwinembedded-incorrecttoolchain.patch
@@ -0,0 +1,12 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -149,8 +149,7 @@
+ # iOS only uses static libraries
+ set(BUILD_SHARED_LIBS OFF)
+
+- set(CMAKE_TOOLCHAIN_FILE
+- ${CMAKE_SOURCE_DIR}/builds/cmake/iOS.cmake)
++ include(${CMAKE_SOURCE_DIR}/builds/cmake/iOS.cmake)
+ endif ()
+ else ()
+ if (DEFINED IOS_PLATFORM)
diff --git a/tools/depends/target/freetype2/FREETYPE2-VERSION b/tools/depends/target/freetype2/FREETYPE2-VERSION
new file mode 100644
index 0000000000..eba6f0e091
--- /dev/null
+++ b/tools/depends/target/freetype2/FREETYPE2-VERSION
@@ -0,0 +1,5 @@
+LIBNAME=freetype
+VERSION=2.11.1
+ARCHIVE=$(LIBNAME)-$(VERSION).tar.xz
+SHA512=0848678482fbe20603a866f02da82c91122014d6f815ba4f1d9c03601c32e3ceb781f721c2b4427b6117d7c9742018af8dbb26566faf018595c70b50f8db3f08
+BYPRODUCT=libfreetype.a
diff --git a/tools/depends/target/freetype2/Makefile b/tools/depends/target/freetype2/Makefile
index e0848c2a50..886959982d 100644
--- a/tools/depends/target/freetype2/Makefile
+++ b/tools/depends/target/freetype2/Makefile
@@ -1,39 +1,49 @@
-include ../../Makefile.include
-DEPS = ../../Makefile.include Makefile ../../download-files.include
-
-# lib name, version
-LIBNAME=freetype
-VERSION=2.11.1
-SOURCE=$(LIBNAME)-$(VERSION)
-ARCHIVE=$(SOURCE).tar.xz
-SHA512=0848678482fbe20603a866f02da82c91122014d6f815ba4f1d9c03601c32e3ceb781f721c2b4427b6117d7c9742018af8dbb26566faf018595c70b50f8db3f08
-include ../../download-files.include
-
-# configuration settings
-# force using internal libtool
-export LIBTOOL=builds/unix/libtool
-CONFIGURE=cp -f $(CONFIG_SUB) $(CONFIG_GUESS) builds/unix; \
- ./configure --prefix=$(PREFIX) --disable-shared --with-png=no --with-harfbuzz=yes
-
-LIBDYLIB=$(PLATFORM)/objs/.libs/lib$(LIBNAME).a
+include ../../Makefile.include FREETYPE2-VERSION ../../download-files.include
+DEPS = ../../Makefile.include Makefile FREETYPE2-VERSION ../../download-files.include \
+ 01-darwinembedded-incorrecttoolchain.patch
+
+# explicitly disable PNG and ZLIB due to Apple platforms causing failures
+# with pkg-config not finding zlib due to no .pc when using system zlib
+# this effects fontconfig, libbluray
+CMAKE_OPTIONS=-DBUILD_SHARED_LIBS=OFF \
+ -DFT_REQUIRE_BZIP2=ON \
+ -DFT_REQUIRE_HARFBUZZ=ON \
+ -DFT_DISABLE_BROTLI=ON \
+ -DFT_DISABLE_PNG=ON \
+ -DFT_DISABLE_ZLIB=ON
+
+ifeq ($(OS), darwin_embedded)
+ # We need SDKROOT without the /SDKs/*.sdk for IOS_DEVELOPER_ROOT
+ DEV_ROOT=$(shell awk -v sdk=$(SDKROOT) 'BEGIN{ split(sdk, a, /\/SDKs/); print a[1]}')
+
+ CMAKE_OPTIONS+= -DIOS_PLATFORM=OS \
+ -DCMAKE_AR=$(AR) \
+ -DCMAKE_OSX_ARCHITECTURES=$(CPU) \
+ -DCMAKE_IOS_DEVELOPER_ROOT=$(DEV_ROOT) \
+ -DCMAKE_IOS_SDK_ROOT=$(SDKROOT)
+endif
+
+LIBDYLIB=$(PLATFORM)/build/$(BYPRODUCT)
all: .installed-$(PLATFORM)
-
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE) $(DEPS)
- rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
+ rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
- cd $(PLATFORM); $(CONFIGURE)
+ifeq ($(OS),darwin_embedded)
+ cd $(PLATFORM); patch -p1 -i ../01-darwinembedded-incorrecttoolchain.patch
+endif
+ cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) ..
$(LIBDYLIB): $(PLATFORM)
- $(MAKE) -C $(PLATFORM)
+ $(MAKE) -C $(PLATFORM)/build
-.installed-$(PLATFORM): $(LIBDYLIB)
- $(MAKE) -C $(PLATFORM) install
+.installed-$(PLATFORM): $(PLATFORM)
+ $(MAKE) -C $(PLATFORM)/build install
touch $@
clean:
- $(MAKE) -C $(PLATFORM) clean
+ $(MAKE) -C $(PLATFORM)/build clean
rm -f .installed-$(PLATFORM)
distclean::