Skip to content

Commit

Permalink
Ugrade freetype 2.9.1 -> 2.10.4
Browse files Browse the repository at this point in the history
hence
- remove the now useless patch
- rebuild the win64 dll (same makefile as win32) rather than download from files.pharo.org
  • Loading branch information
nicolas-cellier-aka-nice committed Jan 6, 2021
1 parent 836cba1 commit 07aad2f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 51 deletions.
1 change: 0 additions & 1 deletion build.win32x86/third-party/Makefile.freetype2
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ $(FREETYPE2ARCHIVE):

$(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME): $(FREETYPE2ARCHIVE)
tar x -f $(FREETYPE2ARCHIVE) -C $(THIRDPARTYDIR)
patch -p1 -d $(FREETYPE2DIR) < ../../third-party/freetype291.patch
cp ../third-party/Toolchain-cross-mingw32-cygwin.cmake $(FREETYPE2DIR)
test -d $(FREETYPE2DIR)/build || mkdir $(FREETYPE2DIR)/build
cd $(FREETYPE2DIR)/build \
Expand Down
42 changes: 30 additions & 12 deletions build.win64x64/third-party/Makefile.freetype2
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
# Instead build, copy dependency from mingw distribution

ifndef THIRDPARTYDIR
include ../common/Makefile.lib.extra
endif
include ../../third-party/freetype2.spec
include ../../third-party/freetype2.spec.win64

EXTERNALFILESURL:=https://files.pharo.org/vm/pharo-spur64/win/third-party
FREETYPE2LIBNAME:=$(freetype2_spec_download_artifact_name_windows)
FREETYPE2LIBINSTALLNAME:=$(freetype2_spec_product_name_windows)
FREETYPE2LIB:=$(THIRDPARTYINSTALLDIR)/$(FREETYPE2LIBINSTALLNAME)
# plugin definitions
FREETYPE2URL:=$(freetype2_spec_download_url)
FREETYPE2LIBNAME:=$(freetype2_spec_product_name_windows)
FREETYPE2DIR:=$(THIRDPARTYDIR)/$(freetype2_spec_unpack_dir_name)
FREETYPE2ARCHIVE:=$(THIRDPARTYCACHEDIR)/$(freetype2_spec_archive_name)
FREETYPE2LIB:=$(THIRDPARTYINSTALLDIR)/$(FREETYPE2LIBNAME)

$(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME):
echo
$(WGET) -O $(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME) $(EXTERNALFILESURL)/$(FREETYPE2LIBNAME)
# ensure third-party library is built and recognised by plugins
INCDIRS:=$(INCDIRS) $(THIRDPARTYINCLUDEDIR) $(THIRDPARTYINCLUDEDIR)/freetype2
EXTRALIBS:=$(EXTRALIBS) $(FREETYPE2LIB)
PLUGINREQS:=$(PLUGINREQS) $(THIRDPARTYLIBS)

$(FREETYPE2ARCHIVE):
$(WGET) -O $(FREETYPE2ARCHIVE) $(FREETYPE2URL)

$(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME): $(FREETYPE2ARCHIVE)
tar x -f $(FREETYPE2ARCHIVE) -C $(THIRDPARTYDIR)
cp ../third-party/Toolchain-cross-mingw32-cygwin.cmake $(FREETYPE2DIR)
test -d $(FREETYPE2DIR)/build || mkdir $(FREETYPE2DIR)/build
cd $(FREETYPE2DIR)/build \
&& cmake ..\
-DCMAKE_TOOLCHAIN_FILE=../Toolchain-cross-mingw32-cygwin.cmake \
-DCMAKE_INSTALL_PREFIX=$(THIRDPARTYOUTDIR) \
-DWITH_PNG=OFF \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_C_FLAGS="$(THIRDPARTY_CFLAGS)" \
&& make \
&& make install \
&& cp libfreetype.dll $(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME)

$(FREETYPE2LIB): pkgconfig libpng $(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME)
cp -f $(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME) $(FREETYPE2LIB)

cp -f $(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME) $(THIRDPARTYINSTALLDIR)
freetype2: $(FREETYPE2LIB)
10 changes: 3 additions & 7 deletions cmake/FreeType2.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
set(FreeType2_Spec_URL "http://ftp.igh.cnrs.fr/pub/nongnu/freetype/freetype-2.9.1.tar.gz")
set(FreeType2_Spec_ArchiveName freetype-2.9.1.tar.gz)
set(FreeType2_Spec_ArchiveHash "SHA256=ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce")
set(FreeType2_Spec_URL "https://download.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.xz")
set(FreeType2_Spec_ArchiveName freetype-2.10.4.tar.xz)
set(FreeType2_Spec_ArchiveHash "SHA256=86a854d8905b19698bbc8f23b860bc104246ce4854dcea8e3b0fb21284f75784")

set(FreeType2_Spec_MacLibraries libfreetype.6.dylib)
set(FreeType2_Spec_MacLibrariesSymlinks libfreetype*.dylib)
set(FreeType2_Spec_WindowsDLLs libfreetype.dll)

set(FreeType2_Spec_Patch "${CMAKE_CURRENT_SOURCE_DIR}/third-party/freetype291.patch")

if(WIN32)
add_thirdparty_with_cmake(FreeType2
DOWNLOAD_URL ${FreeType2_Spec_URL}
ARCHIVE_NAME ${FreeType2_Spec_ArchiveName}
ARCHIVE_HASH ${FreeType2_Spec_ArchiveHash}
PATCH ${FreeType2_Spec_Patch}
CMAKE_EXTRA_ARGS -DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE -DBUILD_SHARED_LIBS=ON
MAC_LIBRARIES ${FreeType2_Spec_MacLibraries}
MAC_LIBRARIES_SYMLINK_PATTERNS ${FreeType2_Spec_MacLibrariesSymlinks}
Expand All @@ -27,7 +24,6 @@ else()
DOWNLOAD_URL ${FreeType2_Spec_URL}
ARCHIVE_NAME ${FreeType2_Spec_ArchiveName}
ARCHIVE_HASH ${FreeType2_Spec_ArchiveHash}
PATCH ${FreeType2_Spec_Patch}
AUTOCONF_EXTRA_ARGS --without-png --without-bzip2
MAC_LIBRARIES ${FreeType2_Spec_MacLibraries}
MAC_LIBRARIES_SYMLINK_PATTERNS ${FreeType2_Spec_MacLibrariesSymlinks}
Expand Down
6 changes: 3 additions & 3 deletions third-party/freetype2.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
freetype2_spec_download_url:=http://ftp.igh.cnrs.fr/pub/nongnu/freetype/freetype-2.9.1.tar.gz
freetype2_spec_archive_name:=freetype-2.9.1.tar.gz
freetype2_spec_unpack_dir_name:=freetype-2.9.1
freetype2_spec_download_url:=https://download.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.xz
freetype2_spec_archive_name:=freetype-2.10.4.tar.xz
freetype2_spec_unpack_dir_name:=freetype-2.10.4
freetype2_spec_product_name_macOS:=libfreetype.6.dylib
freetype2_spec_product_name_linux:=
freetype2_spec_product_name_windows:=libfreetype.dll
Expand Down
28 changes: 0 additions & 28 deletions third-party/freetype291.patch

This file was deleted.

0 comments on commit 07aad2f

Please sign in to comment.