test-windows.yml raqm

This commit is contained in:
nulano 2019-09-30 10:37:46 +02:00
parent a2b40f6cab
commit ae8fd7446f
4 changed files with 78 additions and 11 deletions

View File

@ -76,7 +76,6 @@ jobs:
xcopy /s c:\pillow-depends\test_images\* $env:GITHUB_WORKSPACE\tests\images\ xcopy /s c:\pillow-depends\test_images\* $env:GITHUB_WORKSPACE\tests\images\
cd $env:GITHUB_WORKSPACE/winbuild/ cd $env:GITHUB_WORKSPACE/winbuild/
python.exe $env:GITHUB_WORKSPACE\winbuild\build_dep.py python.exe $env:GITHUB_WORKSPACE\winbuild\build_dep.py
# .\build_deps.cmd
env: env:
EXECUTABLE: bin\python.exe EXECUTABLE: bin\python.exe
shell: pwsh shell: pwsh
@ -233,17 +232,20 @@ jobs:
copy /Y /B *.lib %INCLIB% copy /Y /B *.lib %INCLIB%
- name: Build dependencies / HarfBuzz - name: Build dependencies / HarfBuzz
if: "!contains(matrix.python-version, 'pypy')"
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
set BUILD=%GITHUB_WORKSPACE%\winbuild\build set BUILD=%GITHUB_WORKSPACE%\winbuild\build
set INCLUDE=%INCLUDE%;%INCLIB%
set LIB=%LIB%;%INCLIB%
cd /D %BUILD%\harfbuzz-2.6.1 cd /D %BUILD%\harfbuzz-2.6.1
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform-vcvars }} 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform-vcvars }} 8.1
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
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% -DHB_HAVE_FREETYPE:BOOL=ON -DCMAKE_BUILD_TYPE=Release
%CMAKE% -G "NMake Makefiles" . %CMAKE% -G "NMake Makefiles" .
nmake -nologo -f Makefile clean nmake -nologo -f Makefile clean
nmake -nologo -f Makefile harfbuzz nmake -nologo -f Makefile harfbuzz
@ -251,6 +253,7 @@ jobs:
copy /Y /B *.lib %INCLIB% copy /Y /B *.lib %INCLIB%
- name: Build dependencies / FriBidi - name: Build dependencies / FriBidi
if: "!contains(matrix.python-version, 'pypy')"
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
@ -267,8 +270,28 @@ jobs:
copy /Y /B lib\*.h %INCLIB% copy /Y /B lib\*.h %INCLIB%
copy /Y /B *.lib %INCLIB% copy /Y /B *.lib %INCLIB%
# failing with PyPy3
- name: Build dependencies / Raqm
if: "!contains(matrix.python-version, 'pypy')"
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
set INCLUDE=%INCLUDE%;%INCLIB%
set LIB=%LIB%;%INCLIB%
cd /D %BUILD%\libraqm-0.7.0
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\raqm.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 libraqm
copy /Y /B src\*.h %INCLIB%
copy /Y /B libraqm.dll %INCLIB%
- name: Build dependencies / ghostscript - name: Build dependencies / ghostscript
if: false
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
@ -295,21 +318,21 @@ jobs:
set INCLUDE=%INCLIB%;%GITHUB_WORKSPACE%\depends\tcl86\include;%INCLUDE% set INCLUDE=%INCLIB%;%GITHUB_WORKSPACE%\depends\tcl86\include;%INCLUDE%
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform-vcvars }} 8.1 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform-vcvars }} 8.1
%PYTHON%\python.exe setup.py build_ext install %PYTHON%\python.exe setup.py build_ext install
rem Add GhostScript and Raqm binaries (copied to INCLIB) to PATH.
path %INCLIB%;%PATH%
%PYTHON%\python.exe selftest.py --installed %PYTHON%\python.exe selftest.py --installed
- name: Test Pillow - name: Test Pillow
run: | run: |
set PYTHON=%pythonLocation% set PYTHON=%pythonLocation%
set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32 set INCLIB=%GITHUB_WORKSPACE%\winbuild\depends\msvcr10-x32
rem Add GhostScript executables (copied to INCLIB) to PATH. rem Add GhostScript and Raqm binaries (copied to INCLIB) to PATH.
path %INCLIB%;%PATH% path %INCLIB%;%PATH%
cd /D %GITHUB_WORKSPACE% cd /D %GITHUB_WORKSPACE%
%PYTHON%\python.exe -m pytest -vx --cov PIL --cov-report term --cov-report xml Tests %PYTHON%\python.exe -m pytest -vx --cov PIL --cov-report term --cov-report xml Tests
- name: Upload coverage - name: Upload coverage
run: 'codecov --file "%GITHUB_WORKSPACE%\coverage.xml" --name "%pythonLocation%"' run: 'codecov --file "%GITHUB_WORKSPACE%\coverage.xml" --name "%pythonLocation%"'
env:
CODECOV: Scripts\codecov.exe
- name: Build wheel - name: Build wheel
id: wheel id: wheel

View File

@ -113,6 +113,11 @@ libs = {
"filename": PILLOW_DEPENDS_DIR + "fribidi-1.0.7.zip", "filename": PILLOW_DEPENDS_DIR + "fribidi-1.0.7.zip",
"dir": "fribidi-1.0.7", "dir": "fribidi-1.0.7",
}, },
"libraqm": {
"url": "https://github.com/HOST-Oman/libraqm/archive/v0.7.0.zip",
"filename": PILLOW_DEPENDS_DIR + "libraqm-0.7.0.zip",
"dir": "libraqm-0.7.0",
},
} }
compilers = { compilers = {

View File

@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.13)
project(fribidi) project(fribidi)
add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -MT) add_compile_options(-MT)
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(lib) include_directories(lib)
@ -29,7 +29,7 @@ function(fribidi_conf)
set(SIZEOF_INT 4) set(SIZEOF_INT 4)
set(FRIBIDI_MSVC_BUILD_PLACEHOLDER "#define FRIBIDI_BUILT_WITH_MSVC") set(FRIBIDI_MSVC_BUILD_PLACEHOLDER "#define FRIBIDI_BUILT_WITH_MSVC")
message("detected ${PACKAGE_NAME} version ${FRIBIDI_VERSION}") message("detected ${PACKAGE_NAME} version ${FRIBIDI_VERSION}")
configure_file(lib/fribidi-config.h.in fribidi-config.h @ONLY) configure_file(lib/fribidi-config.h.in lib/fribidi-config.h @ONLY)
endfunction() endfunction()
fribidi_conf() fribidi_conf()
@ -57,7 +57,7 @@ macro(fribidi_definitions _TGT)
endmacro() endmacro()
function(fribidi_gen _NAME _OUTNAME _PARAM) function(fribidi_gen _NAME _OUTNAME _PARAM)
set(_OUT ${CMAKE_CURRENT_BINARY_DIR}/${_OUTNAME}) set(_OUT lib/${_OUTNAME})
prepend(_DEP "${CMAKE_CURRENT_SOURCE_DIR}/gen.tab/" ${ARGN}) prepend(_DEP "${CMAKE_CURRENT_SOURCE_DIR}/gen.tab/" ${ARGN})
add_executable(gen-${_NAME} add_executable(gen-${_NAME}
gen.tab/gen-${_NAME}.c gen.tab/gen-${_NAME}.c
@ -80,7 +80,7 @@ fribidi_gen(unicode-version fribidi-unicode-version.h ""
macro(fribidi_tab _NAME) macro(fribidi_tab _NAME)
fribidi_gen(${_NAME}-tab ${_NAME}.tab.i 2 ${ARGN}) fribidi_gen(${_NAME}-tab ${_NAME}.tab.i 2 ${ARGN})
target_sources(gen-${_NAME}-tab target_sources(gen-${_NAME}-tab
PRIVATE fribidi-unicode-version.h) PRIVATE lib/fribidi-unicode-version.h)
endmacro() endmacro()
fribidi_tab(bidi-type unidata/UnicodeData.txt) fribidi_tab(bidi-type unidata/UnicodeData.txt)
@ -97,7 +97,6 @@ file(GLOB FRIBIDI_HEADERS lib/*.h)
add_library(fribidi STATIC add_library(fribidi STATIC
${FRIBIDI_SOURCES} ${FRIBIDI_SOURCES}
${FRIBIDI_HEADERS} ${FRIBIDI_HEADERS}
fribidi-config.h
${FRIBIDI_SOURCES_GENERATED}) ${FRIBIDI_SOURCES_GENERATED})
fribidi_definitions(fribidi) fribidi_definitions(fribidi)
target_compile_definitions(fribidi target_compile_definitions(fribidi

40
winbuild/raqm.cmake Normal file
View File

@ -0,0 +1,40 @@
cmake_minimum_required(VERSION 3.13)
project(libraqm)
find_library(fribidi NAMES fribidi)
find_library(harfbuzz NAMES harfbuzz)
find_library(freetype NAMES freetype)
add_definitions(-DFRIBIDI_ENTRY=extern)
add_compile_options(-MT)
function(raqm_conf)
file(READ configure.ac RAQM_CONF)
string(REGEX MATCH "\\[([0-9]+)\\.([0-9]+)\\.([0-9]+)\\]," _ "${RAQM_CONF}")
set(RAQM_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(RAQM_VERSION_MINOR "${CMAKE_MATCH_2}")
set(RAQM_VERSION_MICRO "${CMAKE_MATCH_3}")
set(RAQM_VERSION "${RAQM_VERSION_MAJOR}.${RAQM_VERSION_MINOR}.${RAQM_VERSION_MICRO}")
message("detected libraqm version ${RAQM_VERSION}")
configure_file(src/raqm-version.h.in src/raqm-version.h @ONLY)
endfunction()
raqm_conf()
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(RAQM_SOURCES
src/raqm.c)
set(RAQM_HEADERS
src/raqm.h
src/raqm-version.h)
add_library(libraqm SHARED
${RAQM_SOURCES}
${RAQM_HEADERS})
target_link_libraries(libraqm
${fribidi}
${harfbuzz}
${freetype})