compile ledger with Python support (#7007)

* compile ledger with Python support

This adds a compile-time configuration option to compile ledger with Python 3 support and adds python to the list of dependencies. Not sure if the dependency should be written as `python` or `python3`. Any corrections welcome
This commit is contained in:
Randy 2021-06-15 14:00:29 +08:00 committed by GitHub
parent c6a9f4af56
commit c1d58f98de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -0,0 +1,13 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 30d97cb9..341e782e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -335,7 +335,7 @@ if (USE_PYTHON)
$<TARGET_FILE:libledger> "${CMAKE_BINARY_DIR}/${_ledger_python_module_name}")
install(
FILES "${CMAKE_BINARY_DIR}/${_ledger_python_module_name}"
- DESTINATION ${Python_SITEARCH})
+ DESTINATION @TERMUX_PREFIX@/lib/python3.9/site-packages/)
else()
message(WARNING "Python_SITEARCH not set. Will not install python module.")
endif()

View File

@ -3,15 +3,16 @@ TERMUX_PKG_DESCRIPTION="Powerful, double-entry accounting system"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.2.1
TERMUX_PKG_REVISION=3
TERMUX_PKG_REVISION=4
TERMUX_PKG_SRCURL=https://github.com/ledger/ledger/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=92bf09bc385b171987f456fe3ee9fa998ed5e40b97b3acdd562b663aa364384a
TERMUX_PKG_DEPENDS="boost, libc++, libedit, libmpfr, libgmp"
TERMUX_PKG_DEPENDS="boost, libc++, libedit, libmpfr, libgmp, python"
TERMUX_PKG_BREAKS="ledger-dev"
TERMUX_PKG_REPLACES="ledger-dev"
TERMUX_PKG_BUILD_DEPENDS="utf8cpp"
# See https://gitlab.kitware.com/cmake/cmake/issues/18865:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DBoost_NO_BOOST_CMAKE=ON
-DUSE_PYTHON=ON
-DUTFCPP_PATH=$TERMUX_PREFIX/include/utf8cpp
"