diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..445240a8977d8ff7af3101393427f48acd9081ee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM quay.io/pypa/manylinux2014_x86_64 + +ARG pass + +VOLUME /build + +WORKDIR /build + +CMD ./buildall.sh diff --git a/build_wheels.bat b/build_wheels.bat new file mode 100644 index 0000000000000000000000000000000000000000..e1f780a0f9f4c66c21f93207e5bca7958f24e247 --- /dev/null +++ b/build_wheels.bat @@ -0,0 +1,54 @@ +pushd %~dp0 +SET "CURRENTDIR=%cd%" +SET "BUILDDIR=%CURRENTDIR%\build" +SET "BUILDTOOLSDIR=%BUILDDIR%\buildtools" +SET "VCVARSBAT=%BUILDTOOLSDIR%\VC\Auxiliary\Build\vcvars64.bat" +SET "SIPDIR=%BUILDDIR%\sip-4.19.3" +SET "SIPINSTALLDIR=%BUILDDIR%\sipinstall" +SET "vs_buildtoolsexe=%BUILDDIR%\vs_buildtools.exe" +SET "FBXSDKDIR=%BUILDDIR%\fbxsdk" +SET "FBXSDKPYTHONDIR=%BUILDDIR%\fbxsdkpy" +:: PYTHONVERSION=$(python -c [...]) #lol +for /f %%i in ('python -c "import sys; print(''.join(sys.version.split(' ')[0].split('.')[:2]))"') do set PYTHONVERSION=%%i +SET "FBXDIR=%CURRENTDIR%\fbxsdkpy-cp%PYTHONVERSION%-win_x64" +mkdir "%BUILDDIR%" +mkdir "%BUILDTOOLSDIR%" +mkdir "%SIPINSTALLDIR%" +mkdir "%FBXSDKDIR%" +mkdir "%FBXSDKPYTHONDIR%" +mkdir "%FBXDIR%" + +echo "Download and install Visual Studio Build Tools (nmake, MSVC, link, etc.)" + +curl -L -o %vs_buildtoolsexe% https://aka.ms/vs/16/release/vs_buildtools.exe + +%vs_buildtoolsexe% --quiet --wait --norestart --nocache --installPath "%BUILDTOOLSDIR%" --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 --remove Microsoft.VisualStudio.Component.Windows81SDK --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK|| IF "%ERRORLEVEL%"=="3010" EXIT 0 + + +echo "Load environment variables to use Build Tools from this script" +call %VCVARSBAT% + +for /F "tokens=1,2 delims=;" %%i in (reqs_win.txt) do ( + curl -L -o "%BUILDDIR%\%%i.exe" %%j + "%BUILDDIR%\%%i.exe" /S /D=%BUILDDIR%\%%i +) + +::curl -L -O "https://gitlab.inria.fr/radili/fbxsdk_python/uploads/12002ae82d20e4d6b60107dacb5abe4b/sip-4.19.3.tar.gz" + +tar xvf sip-4.19.3.tar.gz -C "%BUILDDIR%" +cd "%BUILDDIR%"\sip-* +python "configure.py" -b "%SIPINSTALLDIR%" -d "%SIPINSTALLDIR%" -e "%SIPINSTALLDIR%" --pyidir="%SIPINSTALLDIR%" --sip-module="fbxsip" +nmake +nmake install +cd %CURRENTDIR% + +copy "PythonBindings.py" "%FBXSDKPYTHONDIR%\PythonBindings.py" +SET "FBXSDK_ROOT=%FBXSDKDIR%" +SET "SIP_ROOT=%SIPDIR%" +python "%FBXSDKPYTHONDIR%"\PythonBindings.py Python3_x64 +copy "%FBXSDKPYTHONDIR%\build\Distrib\site-packages\fbx\*" "%FBXDIR%" +copy "%SIPINSTALLDIR%\fbxsip.pyd" "%FBXDIR%" + +%vs_buildtoolsexe% uninstall --quiet --wait --norestart --nocache --installPath "%BUILDTOOLSDIR%" --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 --remove Microsoft.VisualStudio.Component.Windows81SDK --remove Microsoft.VisualStudio.Workload.VCTools --remove Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --remove Microsoft.VisualStudio.Component.Windows10SDK || IF "%ERRORLEVEL%"=="3010" EXIT 0 +popd +pause diff --git a/build_wheels.sh b/build_wheels.sh new file mode 100755 index 0000000000000000000000000000000000000000..c59b766e2c9dc6bfda93537df5a31dea392a0643 --- /dev/null +++ b/build_wheels.sh @@ -0,0 +1,5 @@ +./pull_reqs.sh + +pip --verbose wheel . + +LD_LIBRARY_PATH=${fbxsdkdir}/lib/gcc/x64/release/:$LD_LIBRARY_PATH auditwheel -v repair $(ls -1t fbx*.whl|head -1) diff --git a/buildall.sh b/buildall.sh new file mode 100755 index 0000000000000000000000000000000000000000..d50a5e0494bb180a8bb98c4ca00c332b17bab77c --- /dev/null +++ b/buildall.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +ifss="$IFS" +IFS=$'\n' +for a in $(ls -d /opt/python/cp3*/);do + PATH=${a}bin/:$PATH ./build_wheels.sh +done + +IFS="$ifss" diff --git a/pyproject.toml b/pyproject.toml index 5f63183e24a6ddc815a9df9fedc6eb5b581fc344..6c7fcda9134898b60c52d3783a9c6442c4511f12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "sipbuild.api" # Specify the PEP 566 metadata for the project. [tool.sip.metadata] name = "fbxsdkpy" -version = "2020.1-rev1" +version = "2020.1.post1" # Configure the building of the fib bindings. [tool.sip.bindings.fbx_module]