Skip to content

Commit

Permalink
Merge pull request #327 from bencoman/win-freetype291-patch
Browse files Browse the repository at this point in the history
Fix Freetype 2.9.1 third-party build
  • Loading branch information
nicolas-cellier-aka-nice committed Dec 30, 2018
2 parents 1ab12fb + 525b421 commit 35b266c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
6 changes: 4 additions & 2 deletions build.win32x86/third-party/Makefile.freetype2
Expand Up @@ -20,6 +20,7 @@ $(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 All @@ -30,9 +31,10 @@ $(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME): $(FREETYPE2ARCHIVE)
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_C_FLAGS="$(THIRDPARTY_CFLAGS)" \
&& make \
&& make install
&& make install \
&& cp libfreetype.dll $(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME)

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

freetype2: $(FREETYPE2LIB)
freetype2: $(FREETYPE2LIB)
5 changes: 3 additions & 2 deletions scripts/installCygwin.bat
Expand Up @@ -69,6 +69,7 @@ echo Installing cygwin for architecture %CYG_INSTALL_ARCH% at %CYG_INSTALL_ROOT%
-P mingw64-%CYG_INSTALL_ARCH%-libssh2^
-P mingw64-%CYG_INSTALL_ARCH%-libgit2^
-P mingw64-%CYG_INSTALL_ARCH%-cairo^
-P unzip
-P unzip^
-P patch

REM unzip and curl are not needed for the VM build but is needed for the VMMaker image building. Thus I add it in this script so that people can use it when building VMMaker on their computer.
REM unzip and curl are not needed for the VM build but is needed for the VMMaker image building. Thus I add it in this script so that people can use it when building VMMaker on their computer.
28 changes: 28 additions & 0 deletions third-party/freetype291.patch
@@ -0,0 +1,28 @@
Freetype 2.9.1 release is broken for Windows CMake build.
It was fixed two commits later but not re-released.
This patch cherry-picks the fix from http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=660afb5
Next time Freetype is updated, remove this from build.win*/third-party/Makefile.freetype2

Upstream bug report https://savannah.nongnu.org/bugs/?func=detailitem&item_id=54846
says "CMake fails to install on Windows - Don't worry, it's not your fault. I broke
it myself and found out after the release, but didn't bug Werner to release a 2.9.1.1"

Our discussion here https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/319


diff -ur freetype-2.9.1/CMakeLists.txt freetype-2.9.1.fixed/CMakeLists.txt
--- freetype-2.9.1/CMakeLists.txt 2018-05-01 18:45:45.000000000 +0800
+++ freetype-2.9.1.fixed/CMakeLists.txt 2018-12-14 18:13:46.624962900 +0800
@@ -229,9 +229,12 @@
endif ()
string(REPLACE "/undef " "#undef "
FTCONFIG_H "${FTCONFIG_H}")
- file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h"
- "${FTCONFIG_H}")
+else()
+ file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
+ FTCONFIG_H)
endif ()
+file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h"
+ "${FTCONFIG_H}")

0 comments on commit 35b266c

Please sign in to comment.