This commit is contained in:
nulano 2019-09-30 01:04:26 +02:00
parent 820d088115
commit a2b40f6cab
3 changed files with 126 additions and 2 deletions

View File

@ -232,7 +232,7 @@ jobs:
copy /Y /B *.h %INCLIB% copy /Y /B *.h %INCLIB%
copy /Y /B *.lib %INCLIB% copy /Y /B *.lib %INCLIB%
- name: Build dependencies / harfbuzz - name: Build dependencies / HarfBuzz
run: | run: |
set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\V7.1A\Include set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\V7.1A\Include
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
@ -242,7 +242,6 @@ jobs:
echo on echo on
echo (gc CMakeLists.txt) -replace 'enable_testing', "add_compile_options(-MT)`r`nenable_testing" ^| Out-File -encoding ASCII CMakeLists.txt > patch.ps1 echo (gc CMakeLists.txt) -replace 'enable_testing', "add_compile_options(-MT)`r`nenable_testing" ^| Out-File -encoding ASCII CMakeLists.txt > patch.ps1
powershell .\patch.ps1 powershell .\patch.ps1
type CMakeLists.txt
set CMAKE=cmake.exe -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES:BOOL=OFF set CMAKE=cmake.exe -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES:BOOL=OFF
set CMAKE=%CMAKE% -DCMAKE_BUILD_TYPE=Release set CMAKE=%CMAKE% -DCMAKE_BUILD_TYPE=Release
%CMAKE% -G "NMake Makefiles" . %CMAKE% -G "NMake Makefiles" .
@ -251,6 +250,22 @@ jobs:
copy /Y /B src\*.h %INCLIB% copy /Y /B src\*.h %INCLIB%
copy /Y /B *.lib %INCLIB% copy /Y /B *.lib %INCLIB%
- name: Build dependencies / FriBidi
run: |
set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\V7.1A\Include
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
set BUILD=%GITHUB_WORKSPACE%\winbuild\build
cd /D %BUILD%\fribidi-1.0.7
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform-vcvars }} 8.1
echo on
copy /Y /B %GITHUB_WORKSPACE%\winbuild\fribidi.cmake CMakeLists.txt
set CMAKE=cmake.exe -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES:BOOL=OFF
set CMAKE=%CMAKE% -DCMAKE_BUILD_TYPE=Release
%CMAKE% -G "NMake Makefiles" .
nmake -nologo -f Makefile clean
nmake -nologo -f Makefile fribidi
copy /Y /B lib\*.h %INCLIB%
copy /Y /B *.lib %INCLIB%
- name: Build dependencies / ghostscript - name: Build dependencies / ghostscript
if: false if: false

View File

@ -108,6 +108,11 @@ libs = {
"filename": PILLOW_DEPENDS_DIR + "harfbuzz-2.6.1.zip", "filename": PILLOW_DEPENDS_DIR + "harfbuzz-2.6.1.zip",
"dir": "harfbuzz-2.6.1", "dir": "harfbuzz-2.6.1",
}, },
"fribidi": {
"url": "https://github.com/fribidi/fribidi/archive/v1.0.7.zip",
"filename": PILLOW_DEPENDS_DIR + "fribidi-1.0.7.zip",
"dir": "fribidi-1.0.7",
},
} }
compilers = { compilers = {

104
winbuild/fribidi.cmake Normal file
View File

@ -0,0 +1,104 @@
cmake_minimum_required(VERSION 3.13)
project(fribidi)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -MT)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(lib)
function(extract_regex_1 var text regex)
string(REGEX MATCH ${regex} _ ${text})
set(${var} "${CMAKE_MATCH_1}" PARENT_SCOPE)
endfunction()
function(fribidi_conf)
file(READ configure.ac FRIBIDI_CONF)
extract_regex_1(FRIBIDI_MAJOR_VERSION "${FRIBIDI_CONF}" "\\(fribidi_major_version, ([0-9]+)\\)")
extract_regex_1(FRIBIDI_MINOR_VERSION "${FRIBIDI_CONF}" "\\(fribidi_minor_version, ([0-9]+)\\)")
extract_regex_1(FRIBIDI_MICRO_VERSION "${FRIBIDI_CONF}" "\\(fribidi_micro_version, ([0-9]+)\\)")
extract_regex_1(FRIBIDI_INTERFACE_VERSION "${FRIBIDI_CONF}" "\\(fribidi_interface_version, ([0-9]+)\\)")
extract_regex_1(FRIBIDI_INTERFACE_AGE "${FRIBIDI_CONF}" "\\(fribidi_interface_age, ([0-9]+)\\)")
extract_regex_1(FRIBIDI_BINARY_AGE "${FRIBIDI_CONF}" "\\(fribidi_binary_age, ([0-9]+)\\)")
set(FRIBIDI_VERSION "${FRIBIDI_MAJOR_VERSION}.${FRIBIDI_MINOR_VERSION}.${FRIBIDI_MICRO_VERSION}")
set(PACKAGE "fribidi")
set(PACKAGE_NAME "GNU FriBidi")
set(PACKAGE_BUGREPORT "https://github.com/fribidi/fribidi/issues/new")
set(SIZEOF_INT 4)
set(FRIBIDI_MSVC_BUILD_PLACEHOLDER "#define FRIBIDI_BUILT_WITH_MSVC")
message("detected ${PACKAGE_NAME} version ${FRIBIDI_VERSION}")
configure_file(lib/fribidi-config.h.in fribidi-config.h @ONLY)
endfunction()
fribidi_conf()
function(prepend var prefix)
set(out "")
foreach(f ${ARGN})
list(APPEND out "${prefix}${f}")
endforeach()
set(${var} "${out}" PARENT_SCOPE)
endfunction()
macro(fribidi_definitions _TGT)
target_compile_definitions(${_TGT} PUBLIC
HAVE_MEMSET
HAVE_MEMMOVE
HAVE_STRDUP
HAVE_STDLIB_H=1
HAVE_STRING_H=1
HAVE_MEMORY_H=1
#HAVE_STRINGS_H
#HAVE_SYS_TIMES_H
STDC_HEADERS=1
HAVE_STRINGIZE=1)
endmacro()
function(fribidi_gen _NAME _OUTNAME _PARAM)
set(_OUT ${CMAKE_CURRENT_BINARY_DIR}/${_OUTNAME})
prepend(_DEP "${CMAKE_CURRENT_SOURCE_DIR}/gen.tab/" ${ARGN})
add_executable(gen-${_NAME}
gen.tab/gen-${_NAME}.c
gen.tab/packtab.c)
fribidi_definitions(gen-${_NAME})
target_compile_definitions(gen-${_NAME}
PUBLIC DONT_HAVE_FRIBIDI_CONFIG_H)
add_custom_command(
COMMAND gen-${_NAME} ${_PARAM} ${_DEP} > ${_OUT}
DEPENDS ${_DEP}
OUTPUT ${_OUT})
list(APPEND FRIBIDI_SOURCES_GENERATED "${_OUT}")
set(FRIBIDI_SOURCES_GENERATED ${FRIBIDI_SOURCES_GENERATED} PARENT_SCOPE)
endfunction()
fribidi_gen(unicode-version fribidi-unicode-version.h ""
unidata/ReadMe.txt unidata/BidiMirroring.txt)
macro(fribidi_tab _NAME)
fribidi_gen(${_NAME}-tab ${_NAME}.tab.i 2 ${ARGN})
target_sources(gen-${_NAME}-tab
PRIVATE fribidi-unicode-version.h)
endmacro()
fribidi_tab(bidi-type unidata/UnicodeData.txt)
fribidi_tab(joining-type unidata/UnicodeData.txt unidata/ArabicShaping.txt)
fribidi_tab(arabic-shaping unidata/UnicodeData.txt)
fribidi_tab(mirroring unidata/BidiMirroring.txt)
fribidi_tab(brackets unidata/BidiBrackets.txt unidata/UnicodeData.txt)
fribidi_tab(brackets-type unidata/BidiBrackets.txt)
file(GLOB FRIBIDI_SOURCES lib/*.c)
file(GLOB FRIBIDI_HEADERS lib/*.h)
add_library(fribidi STATIC
${FRIBIDI_SOURCES}
${FRIBIDI_HEADERS}
fribidi-config.h
${FRIBIDI_SOURCES_GENERATED})
fribidi_definitions(fribidi)
target_compile_definitions(fribidi
PUBLIC -DFRIBIDI_ENTRY=extern)