Skip to content
This repository has been archived by the owner on Dec 4, 2021. It is now read-only.

Commit

Permalink
pyosmium
Browse files Browse the repository at this point in the history
  • Loading branch information
dead10ck committed Mar 9, 2021
1 parent cebb7fa commit a290024
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions packages/pyosmium/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
TERMUX_PKG_HOMEPAGE=https://osmcode.org/pyosmium/
TERMUX_PKG_DESCRIPTION="Python module allows you to access some of the features of the Osmium Library from Python code"
TERMUX_PKG_LICENSE="BSD 2-Clause"
TERMUX_PKG_LICENSE_FILE="LICENSE.TXT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.1.3
TERMUX_PKG_SRCURL=https://github.com/osmcode/pyosmium/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=d9f107556de389a6b7c82e8342c5e20dc41a776dc039ef82589b0584b6f5ba60
TERMUX_PKG_DEPENDS="libosmium, libprotozero, pybind11, boost, libbz2, zlib, liblz4, libexpat, python"
TERMUX_PKG_BLACKLISTED_ARCHES=i686
TERMUX_PKG_BUILD_IN_SRC=true

_PYTHON_VERSION="3.9"
INSTALL_PREFIX="${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}"
CMAKE_LIBRARY_OUTPUT_DIRECTORY="${TERMUX_PKG_SRCDIR}/build/temp.linux-${TERMUX_ARCH}-${_PYTHON_VERSION}"

TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DOSMIUM_INCLUDE_DIR=${TERMUX_PREFIX}/include/
-DPROTOZERO_INCLUDE_DIR=${TERMUX_PREFIX}/include/
-DPROTOZERO_INCLUDE_DIR=${TERMUX_PREFIX}/include/
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
"

termux_step_configure() {
mkdir -p "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
cd "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
termux_step_configure_cmake
}

termux_step_make_install() {
cd $TERMUX_PKG_SRCDIR
export PYTHONPATH="${INSTALL_PREFIX}/lib/python${_PYTHON_VERSION}/site-packages/"
export CFLAGS=-"I$TERMUX_PREFIX/include/python${_PYTHON_VERSION}"
export OSMIUM_INCLUDE_DIR="${TERMUX_PREFIX}/usr/include/osmium/"
mkdir -p "${PYTHONPATH}"

python${_PYTHON_VERSION} setup.py install \
--prefix="${INSTALL_PREFIX}" \
--force \
--skip-build

cd ${TERMUX_PKG_MASSAGEDIR}
find . -type d -name __pycache__ -prune -exec rm -rf "{}" \;
}

0 comments on commit a290024

Please sign in to comment.