diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2022-05-21 14:15:30 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-21 14:15:30 +1000 |
commit | 2e4a78fa86b5fac9d0241c1406897f19e4d03332 (patch) | |
tree | 5b7e3e79c132d0daa3fa883d4a14705e6120bf94 /tools/depends | |
parent | 43b96fc2989edbe2455155d4b735c0e9d382d0f1 (diff) | |
parent | dafbed3f6a6792a84262af62424a89494c73bac2 (diff) |
Merge pull request #21275 from fuzzard/depends_freetype2
[tools/depends][target] freetype2 migrate to cmake build system
Diffstat (limited to 'tools/depends')
7 files changed, 100 insertions, 49 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-noharfbuzz/01-darwinembedded-incorrecttoolchain.patch b/tools/depends/target/freetype2-noharfbuzz/01-darwinembedded-incorrecttoolchain.patch new file mode 100644 index 0000000000..256718e6cb --- /dev/null +++ b/tools/depends/target/freetype2-noharfbuzz/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-noharfbuzz/FREETYPE2-NOHARFBUZZ-VERSION b/tools/depends/target/freetype2-noharfbuzz/FREETYPE2-NOHARFBUZZ-VERSION new file mode 100644 index 0000000000..eba6f0e091 --- /dev/null +++ b/tools/depends/target/freetype2-noharfbuzz/FREETYPE2-NOHARFBUZZ-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-noharfbuzz/Makefile b/tools/depends/target/freetype2-noharfbuzz/Makefile index 809e8cc875..e4a9fec384 100644 --- a/tools/depends/target/freetype2-noharfbuzz/Makefile +++ b/tools/depends/target/freetype2-noharfbuzz/Makefile @@ -1,43 +1,50 @@ -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 +include ../../Makefile.include FREETYPE2-NOHARFBUZZ-VERSION ../../download-files.include +DEPS = ../../Makefile.include Makefile FREETYPE2-NOHARFBUZZ-VERSION ../../download-files.include \ + 01-darwinembedded-incorrecttoolchain.patch # Freetype has a circular dependency with harfbuzz. # To enable harfbuzz support in freetype, we build this first to bootstrap harfbuzz # and then build freetype2 again with harfbuzz support -# 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=no +CMAKE_OPTIONS=-DBUILD_SHARED_LIBS=OFF \ + -DFT_DISABLE_ZLIB=ON \ + -DFT_DISABLE_BZIP2=ON \ + -DFT_DISABLE_PNG=ON \ + -DFT_DISABLE_HARFBUZZ=ON \ + -DFT_DISABLE_BROTLI=ON -LIBDYLIB=$(PLATFORM)/objs/.libs/lib$(LIBNAME).a +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]}') -all: .installed-$(PLATFORM) + 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:: 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:: |