From c93167816a32a23834c55243e5e7679ccb53a9bc Mon Sep 17 00:00:00 2001 From: w-v <wtv@protonmail.ch> Date: Sun, 20 Sep 2020 21:34:39 +0200 Subject: [PATCH] add dockerfile and script to build wheels for manylinux2014 --- Dockerfile | 5 +++++ build.sh | 15 +++++++++------ buildall.sh | 10 ++++++++++ pyproject.toml | 2 ++ 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 Dockerfile create mode 100755 buildall.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4648fd1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM quay.io/pypa/manylinux2014_x86_64 + +COPY . /fbxsdkpy + +CMD ./buildall.sh diff --git a/build.sh b/build.sh index 1b5578e..1887403 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,8 @@ set -x -which auditwheel +which python +python --version origdir=$(pwd) scdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" @@ -17,16 +18,18 @@ ls -1 *.tar.gz|while read a;do tar -xvzf "$a" -C "$builddir";done rm fbx*.tar.gz # install fbxsdk -[ -d "$fbxsdkdir" ] || mkdir "$fbxsdkdir" -printf "yes\nn\n" |"$builddir"/fbx*fbxsdk_linux "$fbxsdkdir" +[ -d "$fbxsdkdir" ] || (mkdir "$fbxsdkdir" && printf "yes\nn\n" |"$builddir"/fbx*fbxsdk_linux "$fbxsdkdir") # install fbxsdk python bindings -[ -d "$fbxpydir" ] || mkdir "$fbxpydir" -printf "yes\nn\n" |"$builddir"/fbx*fbxpythonbindings_linux "$fbxpydir" +[ -d "$fbxpydir" ] || (mkdir "$fbxpydir" && printf "yes\nn\n" |"$builddir"/fbx*fbxpythonbindings_linux "$fbxpydir") # patch sip files and library headers so that they compile with sip5 patch -p0 < patch +# patch libfbxsdk.so because it is not linked against libxml2 and libz for some reason +patchelf --add-needed libz.so.1 ${fbxsdkdir}/lib/gcc/x64/release/libfbxsdk.so +patchelf --add-needed libxml2.so.2 ${fbxsdkdir}/lib/gcc/x64/release/libfbxsdk.so + sip-wheel --verbose -auditwheel repair build/fbx/fbx*.whl +LD_LIBRARY_PATH=$(pwd)/build/fbxsdk/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 0000000..80a1e6b --- /dev/null +++ b/buildall.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +ifss="$IFS" +IFS=$'\n' +for a in $(ls -d /opt/python/cp3*/);do + PATH=${a}bin/:$PATH python -m pip install sip + PATH=${a}bin/:$PATH ./build.sh +done + +IFS="$ifss" diff --git a/pyproject.toml b/pyproject.toml index 9e9edcd..b5b0922 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,7 @@ build-backend = "sipbuild.api" # Specify the PEP 566 metadata for the project. [tool.sip.metadata] name = "fbxsdkpy" +version = "2020.1" # Configure the building of the fib bindings. [tool.sip.bindings.fbx_module] @@ -17,3 +18,4 @@ library-dirs = ["build/fbxsdk/lib/gcc/x64/release"] [tool.sip.project] sip-files-dir = "build/fbxpy/sip" wheel-includes = ["build/fbxpy/common/FbxCommon.py"] +mum-glibc-version = "2.17" -- GitLab