Skip to content

Commit

Permalink
Adding manylinux
Browse files Browse the repository at this point in the history
  • Loading branch information
scrgiorgio committed Nov 20, 2018
1 parent 1778bb2 commit 5ba918f
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 32 deletions.
40 changes: 23 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,36 @@ matrix:

script:
- |
chmod +x "${TRAVIS_BUILD_DIR}/CMake/build_${OS_NAME}.sh"
DEPLOY_GITHUB=0
if [[ "${TRAVIS_TAG}" != "" ]]; then
echo "Doing deploy to github..."
DEPLOY_GITHUB=1
DEPLOY_GITHUB_SUFFIX=${PYTHON_VERSION}-${OS_NAME}_${OS_VERSION}.tar.gz
fi
DEPLOY_PYPI=0
if [[ "${DEPLOY_PYPI_ENABLED}" == "1" && "${TRAVIS_TAG}" != "" ]] ; then
DEPLOY_PYPI=1
fi
cd "${TRAVIS_BUILD_DIR}"
chmod +x "./CMake/build_${OS_NAME}.sh"
if [[ ${DOCKER_IMAGE} != "" ]]; then
docker run --name mydocker -v ${TRAVIS_BUILD_DIR}:/home/OpenVisus -td ${DOCKER_IMAGE} /bin/bash
docker exec -ti mydocker /bin/bash -c "cd /home/OpenVisus && ./CMake/build_${OS_NAME}.sh"
docker stop mydocker
opt=""
opt+-" -e PYTHON_VERSION=${PYTHON_VERSION}"
opt+-" -e CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
opt+-" -e DEPLOY_GITHUB=${DEPLOY_GITHUB}"
opt+-" -e DEPLOY_PYPI=${DEPLOY_PYPI}"
opt+-" -e PYPI_USERNAME=${PYPI_USERNAME}"
opt+-" -e PYPI_PASSWORD=${PYPI_PASSWORD}"
docker run --name mydocker -v $(pwd):/home/OpenVisus ${opt} -td ${DOCKER_IMAGE} /bin/bash
docker exec -ti mydocker /bin/bash -c "cd /home/OpenVisus && ./CMake/build_${OS_NAME}.sh"
else
cd "${TRAVIS_BUILD_DIR}"
./CMake/build_${OS_NAME}.sh
fi
cd "${TRAVIS_BUILD_DIR}/build/${OS_NAME}"
if [[ "${TRAVIS_TAG}" != "" ]]; then
echo "Doing deploy to github..."
cmake --build ./ --target sdist --config ${CMAKE_BUILD_TYPE}
__file__=$(find ./install/dist -iname "*.tar.gz")
mv ${__file__} ${__file__/.tar.gz/-${PYTHON_VERSION}-${OS_NAME}_${OS_VERSION}.tar.gz}
fi
if [[ "${DEPLOY_PYPI_ENABLED}" == "1" && "${TRAVIS_TAG}" != "" ]] ; then
echo "Doing deploy to pypi..."
cmake --build ./ --target bdist_wheel --config ${CMAKE_BUILD_TYPE}
cmake --build ./ --target pypi --config ${CMAKE_BUILD_TYPE}
fi
before_deploy:
- export SDIST_FILE=$(find ${TRAVIS_BUILD_DIR}/build/${OS_NAME}/install/dist -iname "*.tar.gz")
- mv ${SDIST_FILE} ${SDIST_FILE/.tar.gz/-${PYTHON_VERSION}-${OS_NAME}_${OS_VERSION}.tar.gz}
- export SDIST_FILE=$(find ${TRAVIS_BUILD_DIR}/build/${OS_NAME}/install/dist -iname "*.tar.gz")

deploy:
provider: releases
Expand Down
16 changes: 11 additions & 5 deletions CMake/build_manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ function InstallOpenSSL {
export LD_LIBRARY_PATH=${OPENSSL_LIB_DIR}:$LD_LIBRARY_PATH
}



# //////////////////////////////////////////////////////
function InstallPython {

Expand Down Expand Up @@ -134,7 +132,6 @@ PushCMakeOption OPENSSL_ROOT_DIR ${OPENSSL_ROOT_DIR}
PushCMakeOption PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}
PushCMakeOption PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR}
PushCMakeOption PYTHON_LIBRARY ${PYTHON_LIBRARY}

PushCMakeOption PYTHON_PLAT_NAME manylinux1_x86_64
PushCMakeOption PYPI_USERNAME ${PYPI_USERNAME}
PushCMakeOption PYPI_PASSWORD ${PYPI_PASSWORD}
Expand All @@ -156,10 +153,19 @@ else
cp $(pyenv prefix)/lib/libpython* install/bin/
fi

cd install
pushd install
LD_LIBRARY_PATH=$(pwd)/bin:$(dirname ${PYTHON_LIBRARY}) PYTHONPATH=$(pwd) bin/visus && echo "Embedding working"
LD_LIBRARY_PATH=$(pwd)/bin PYTHONPATH=$(pwd) ${PYTHON_EXECUTABLE} -c "import OpenVisus" && echo "Extending working"
cd ..
popd

if (( DEPLOY_GITHUB == 1 )); then
cmake --build ./ --target sdist --config ${CMAKE_BUILD_TYPE}
fi

if (( DEPLOY_PYPI == 1 )); then
cmake --build ./ --target bdist_wheel --config ${CMAKE_BUILD_TYPE}
cmake --build ./ --target pypi --config ${CMAKE_BUILD_TYPE}
fi



Expand Down
14 changes: 9 additions & 5 deletions CMake/build_opensuse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,17 @@ cmake --build . --target test
cmake --build . --target install
cmake --build . --target deploy

cd install
pushd install
LD_LIBRARY_PATH=$(pwd):$(dirname ${PYTHON_LIBRARY}) PYTHONPATH=$(pwd) bin/visus && echo "Embedding working"
LD_LIBRARY_PATH=$(pwd) PYTHONPATH=$(pwd) ${PYTHON_EXECUTABLE} -c "import OpenVisus" && echo "Extending working"
cd ..



popd

if (( DEPLOY_GITHUB == 1 )); then
cmake --build ./ --target sdist --config ${CMAKE_BUILD_TYPE}
fi

if (( DEPLOY_PYPI == 1 )); then
cmake --build ./ --target bdist_wheel --config ${CMAKE_BUILD_TYPE}
cmake --build ./ --target pypi --config ${CMAKE_BUILD_TYPE}
fi

11 changes: 9 additions & 2 deletions CMake/build_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,19 @@ cmake --build ./ --target RUN_TESTS --config ${CMAKE_BUILD_TYPE}
cmake --build ./ --target install --config ${CMAKE_BUILD_TYPE}
cmake --build ./ --target deploy --config ${CMAKE_BUILD_TYPE}

cd install
pushd install
PYTHONPATH=$(pwd) bin/visus.app/Contents/MacOS/visus && echo "Embedding working"
PYTHONPATH=$(pwd) python -c "import OpenVisus" && echo "Extending working"
cd ..
popd

if (( DEPLOY_GITHUB == 1 )); then
cmake --build ./ --target sdist --config ${CMAKE_BUILD_TYPE}
fi

if (( DEPLOY_PYPI == 1 )); then
cmake --build ./ --target bdist_wheel --config ${CMAKE_BUILD_TYPE}
cmake --build ./ --target pypi --config ${CMAKE_BUILD_TYPE}
fi



Expand Down
12 changes: 10 additions & 2 deletions CMake/build_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,19 @@ cmake --build . --target test
cmake --build . --target install
cmake --build . --target deploy

cd install
pushd install
LD_LIBRARY_PATH=$(pwd):$(dirname ${PYTHON_LIBRARY}) PYTHONPATH=$(pwd) bin/visus && echo "Embedding working"
LD_LIBRARY_PATH=$(pwd) PYTHONPATH=$(pwd) ${PYTHON_EXECUTABLE} -c "import OpenVisus" && echo "Extending working"
cd ..
popd

if (( DEPLOY_GITHUB == 1 )); then
cmake --build ./ --target sdist --config ${CMAKE_BUILD_TYPE}
fi

if (( DEPLOY_PYPI == 1 )); then
cmake --build ./ --target bdist_wheel --config ${CMAKE_BUILD_TYPE}
cmake --build ./ --target pypi --config ${CMAKE_BUILD_TYPE}
fi



Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ if (True)
endif()



endif()


Expand Down

0 comments on commit 5ba918f

Please sign in to comment.