From 5172654b3ca053108d33cb33f851b709d5526663 Mon Sep 17 00:00:00 2001 From: Daniel Olivier Date: Mon, 23 Oct 2017 13:08:42 -0400 Subject: [PATCH] Adding Freetype-GL port --- .../0001-Use-external-Glew-and-Freetype.patch | 24 +++++++ ports/freetype-gl/CONTROL | 4 ++ ports/freetype-gl/portfile.cmake | 63 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 ports/freetype-gl/0001-Use-external-Glew-and-Freetype.patch create mode 100644 ports/freetype-gl/CONTROL create mode 100644 ports/freetype-gl/portfile.cmake diff --git a/ports/freetype-gl/0001-Use-external-Glew-and-Freetype.patch b/ports/freetype-gl/0001-Use-external-Glew-and-Freetype.patch new file mode 100644 index 0000000000..6c33f9e0e5 --- /dev/null +++ b/ports/freetype-gl/0001-Use-external-Glew-and-Freetype.patch @@ -0,0 +1,24 @@ +From 653dae652bac66e4e96a94ba8ebfabb2227738b7 Mon Sep 17 00:00:00 2001 +From: Daniel Olivier +Date: Thu, 19 Oct 2017 21:26:09 -0400 +Subject: [PATCH] Use external Glew and Freetype + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4eb55e9..2546de6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -74,13 +74,6 @@ if(NOT HAVE_M_PI) + endif() + endif() + +-if(NOT MINGW AND (WIN32 OR WIN64)) +- set(GLEW_ROOT_DIR +- ${CMAKE_CURRENT_SOURCE_DIR}/windows/glew) +- set(ENV{FREETYPE_DIR} +- ${CMAKE_CURRENT_SOURCE_DIR}/windows/freetype) +-endif() +- + find_package(OpenGL REQUIRED) + find_package(Freetype REQUIRED) + \ No newline at end of file diff --git a/ports/freetype-gl/CONTROL b/ports/freetype-gl/CONTROL new file mode 100644 index 0000000000..e8b324f20a --- /dev/null +++ b/ports/freetype-gl/CONTROL @@ -0,0 +1,4 @@ +Source: freetype-gl +Version: +Description: +Build-Depends: glew, freetype diff --git a/ports/freetype-gl/portfile.cmake b/ports/freetype-gl/portfile.cmake new file mode 100644 index 0000000000..2cf27c447c --- /dev/null +++ b/ports/freetype-gl/portfile.cmake @@ -0,0 +1,63 @@ +# Common Ambient Variables: +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} +# PORT = current port name (zlib, etc) +# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) +# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) +# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) +# VCPKG_ROOT_DIR = +# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/freetype-gl) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO rougier/freetype-gl + REF 82fb152a74f01b1483ac80d15935fbdfaf3ed836 + SHA512 4842d9e66fd25dbb3a4e3f4bf597a0c1fc3c3c30e0cb1baae1c3306ddcb663ff9108d8fc01bde539fea7cb03a6329054f66166d9e448086358ab7b05953f5884 + HEAD_REF master +) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Use-external-Glew-and-Freetype.patch" +) + +# make sure that no "internal" libraries are used by removing them +file(REMOVE_RECURSE ${SOURCE_PATH}/windows/freetype) +file(REMOVE_RECURSE ${SOURCE_PATH}/windows/AntTweakBar) +file(REMOVE_RECURSE ${SOURCE_PATH}/windows/glew) +file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindGLEW.cmake) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + #PREFER_NINJA + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 + OPTIONS + -Dfreetype-gl_BUILD_APIDOC=OFF + -Dfreetype-gl_BUILD_DEMOS=OFF + -Dfreetype-gl_BUILD_TESTS=OFF +) + +# We may soon install using a modified cmake process with install target +#vcpkg_install_cmake() +vcpkg_build_cmake(LOGFILE_ROOT install) + +file(GLOB HEADER_FILES "${SOURCE_PATH}/*.h") +file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/freetype-gl) + +# DLL & LIB +file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/freetype-gl.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/freetype-gl.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +#file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/makefont.exe DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +#file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/makefont.exe DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +vcpkg_copy_pdbs() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/freetype-gl RENAME copyright)