diff --git a/packages/nala/build.sh b/packages/nala/build.sh index 6d769254156215..878f11adc7e014 100644 --- a/packages/nala/build.sh +++ b/packages/nala/build.sh @@ -2,23 +2,21 @@ TERMUX_PKG_HOMEPAGE=https://gitlab.com/volian/nala TERMUX_PKG_DESCRIPTION="Commandline frontend for the apt package manager" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=0.7.2 -TERMUX_PKG_REVISION=2 +TERMUX_PKG_VERSION=0.11.1 TERMUX_PKG_SRCURL=https://gitlab.com/volian/nala/-/archive/v${TERMUX_PKG_VERSION}/nala-v${TERMUX_PKG_VERSION}.tar.bz2 -TERMUX_PKG_SHA256=0ac394ab2bd924c28c513a8e8bfc9e899a21f2f8fa5e5d77366cb20e0be8676e +TERMUX_PKG_SHA256=4ce87d75e785e45b1638817077797a3fcd4a15059615455fc1af0127c70cf5cd TERMUX_PKG_DEPENDS="python-apt" TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_AUTO_UPDATE=true -_PYTHON_VERSION=$(. $TERMUX_SCRIPTDIR/packages/python/build.sh; echo $_MAJOR_VERSION) +termux_step_pre_configure() { + _PYTHON_VERSION=$(. $TERMUX_SCRIPTDIR/packages/python/build.sh; echo $_MAJOR_VERSION) -termux_step_post_get_source() { - sed 's:@TERMUX_PKG_VERSION@:'${TERMUX_PKG_VERSION##*:}':g' \ - ${TERMUX_PKG_BUILDER_DIR}/pyproject.toml.diff | \ - patch --silent -p1 -} + TERMUX_PKG_RM_AFTER_INSTALL=" + lib/python${_PYTHON_VERSION}/site-packages/nala/__pycache__ + " -termux_step_pre_configure() { termux_setup_python_crossenv pushd $TERMUX_PYTHON_CROSSENV_SRCDIR _CROSSENV_PREFIX=$TERMUX_PKG_BUILDDIR/python-crossenv-prefix @@ -28,13 +26,11 @@ termux_step_pre_configure() { popd . ${_CROSSENV_PREFIX}/bin/activate - build-pip install wheel tomli + build-pip install poetry } termux_step_make_install() { - export PYTHONPATH=$TERMUX_PREFIX/lib/python${_PYTHON_VERSION}/site-packages - pip install --no-deps . --prefix $TERMUX_PREFIX - + python${_PYTHON_VERSION} -m pip install . --no-deps --prefix $TERMUX_PREFIX install -Dm600 -t $TERMUX_PREFIX/etc/nala debian/nala.conf } @@ -43,7 +39,8 @@ termux_step_create_debscripts() { #!$TERMUX_PREFIX/bin/sh mkdir -p $TERMUX_PREFIX/var/lib/nala mkdir -p $TERMUX_PREFIX/var/log/nala + mkdir -p $TERMUX_PREFIX/var/lock echo "Installing dependencies through pip..." - pip3 install anyio httpx jsbeautifier pexpect rich + pip3 install anyio httpx jsbeautifier pexpect python-debian rich tomli typer typing-extensions EOF } diff --git a/packages/nala/nala-__init__.py.patch b/packages/nala/nala-__init__.py.patch index 6f499d8bdd03ba..c502008010c730 100644 --- a/packages/nala/nala-__init__.py.patch +++ b/packages/nala/nala-__init__.py.patch @@ -1,11 +1,15 @@ --- a/nala/__init__.py +++ b/nala/__init__.py -@@ -29,7 +29,7 @@ +@@ -30,9 +30,9 @@ + # ROOT = "@TERMUX_PREFIX@" + # USR = "@TERMUX_PREFIX@" + # TERMUX = True +-ROOT = "" +-USR = "/usr" +-TERMUX = False ++ROOT = "@TERMUX_PREFIX@" ++USR = "@TERMUX_PREFIX@" ++TERMUX = True + # Before we import anything else we need to make sure that this is in our path # Else apt_pkg will give an import error. Conda is an example of this breaking - # pylint: disable=wrong-import-position --PY_PATH = "/usr/lib/python3/dist-packages" -+PY_PATH = "@TERMUX_PREFIX@/lib/python3/dist-packages" - if PY_PATH not in sys.path: - sys.path.append(PY_PATH) - diff --git a/packages/nala/nala-config.py.patch b/packages/nala/nala-config.py.patch deleted file mode 100644 index 747408a89d115d..00000000000000 --- a/packages/nala/nala-config.py.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/nala/config.py -+++ b/nala/config.py -@@ -33,7 +33,7 @@ - from nala.options import arguments - from nala.utils import eprint - --CONF_FILE = "/etc/nala/nala.conf" -+CONF_FILE = "@TERMUX_PREFIX@/etc/nala/nala.conf" - - try: - read_config_file(config, CONF_FILE) diff --git a/packages/nala/nala-constants.py.patch b/packages/nala/nala-constants.py.patch deleted file mode 100644 index 75509305b33de8..00000000000000 --- a/packages/nala/nala-constants.py.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/nala/constants.py -+++ b/nala/constants.py -@@ -37,13 +37,13 @@ - from nala import _, color - - # File Constants --LICENSE = Path("/usr/share/common-licenses/GPL-3") -+LICENSE = Path("@TERMUX_PREFIX@/share/LICENSES/GPL-3.0.txt") - """/usr/share/common-licenses/GPL-3""" --NALA_SOURCES = Path("/etc/apt/sources.list.d/nala-sources.list") -+NALA_SOURCES = Path("@TERMUX_PREFIX@/etc/apt/sources.list.d/nala-sources.list") - """/etc/apt/sources.list.d/nala-sources.list""" --NALA_DIR = Path("/var/lib/nala") -+NALA_DIR = Path("@TERMUX_PREFIX@/var/lib/nala") - """/var/lib/nala""" --NALA_LOGDIR = Path("/var/log/nala") -+NALA_LOGDIR = Path("@TERMUX_PREFIX@/var/log/nala") - """/var/log/nala""" - NALA_DEBUGLOG = NALA_LOGDIR / "nala-debug.log" - """/var/log/nala/nala.debug.log""" -@@ -51,17 +51,17 @@ - """/var/log/nala/dpkg-debug.log""" - DPKG_STATUS_LOG = NALA_LOGDIR / "dpkg-status.log" - """/var/log/nala/dpkg-status.log""" --NALA_TERM_LOG = Path("/var/log/nala/term.log") -+NALA_TERM_LOG = Path("@TERMUX_PREFIX@/var/log/nala/term.log") - """/var/log/nala/term.log""" --NALA_HISTORY = Path("/var/lib/nala/history.json") -+NALA_HISTORY = Path("@TERMUX_PREFIX@/var/lib/nala/history.json") - """/var/lib/nala/history.json""" --PACSTALL_METADATA = Path("/var/log/pacstall/metadata") -+PACSTALL_METADATA = Path("@TERMUX_PREFIX@/var/log/pacstall/metadata") - """/var/log/pacstall/metadata""" --REBOOT_REQUIRED = Path("/var/run/reboot-required") -+REBOOT_REQUIRED = Path("@TERMUX_PREFIX@/var/run/reboot-required") - """/var/run/reboot-required""" --REBOOT_PKGS = Path("/var/run/reboot-required.pkgs") -+REBOOT_PKGS = Path("@TERMUX_PREFIX@/var/run/reboot-required.pkgs") - """'/var/run/reboot-required.pkgs'""" --NEED_RESTART = Path("/var/run/needrestart") -+NEED_RESTART = Path("@TERMUX_PREFIX@/var/run/needrestart") - """/var/run/needrestart""" - - # Apt Directories diff --git a/packages/nala/nala-error.py.patch b/packages/nala/nala-error.py.patch deleted file mode 100644 index 06b91517fb5da8..00000000000000 --- a/packages/nala/nala-error.py.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/nala/error.py -+++ b/nala/error.py -@@ -58,7 +58,7 @@ - - INSTALL_FAILED = _( - "{error} Installation has failed.\n" -- "If you'd like to file a bug report please include '/var/log/nala/dpkg-debug.log'" -+ "If you'd like to file a bug report please include '@TERMUX_PREFIX@/var/log/nala/dpkg-debug.log'" - ) - NO_PROPER_ERR = _( - "{error} python-apt gave us {apt_err} This isn't a proper error as it's empty" diff --git a/packages/nala/nala-utils.py.patch b/packages/nala/nala-utils.py.patch deleted file mode 100644 index 18fd804e0e4a84..00000000000000 --- a/packages/nala/nala-utils.py.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/nala/utils.py -+++ b/nala/utils.py -@@ -169,7 +169,7 @@ - @staticmethod - def is_su() -> bool: - """Return True if we're super user and False if we're not.""" -- return os.geteuid() == 0 -+ return True - - - class DelayedKeyboardInterrupt: diff --git a/packages/nala/pyproject.toml.diff b/packages/nala/pyproject.toml.diff deleted file mode 100644 index 4272ce545d0cc9..00000000000000 --- a/packages/nala/pyproject.toml.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -1,6 +1,6 @@ - [tool.poetry] - name = "nala" --version = "0.7.1" -+version = "@TERMUX_PKG_VERSION@" - description = "Commandline frontend for the apt package manager" - authors = [ - "Blake Lee ", diff --git a/packages/nala/setup.py.patch b/packages/nala/setup.py.patch deleted file mode 100644 index 4d53c21beb2e3a..00000000000000 --- a/packages/nala/setup.py.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/setup.py -+++ b/setup.py -@@ -3,8 +3,6 @@ - from pathlib import Path - - import tomli --from DistUtilsExtra.auto import clean_build_tree --from DistUtilsExtra.command import build_extra, build_i18n - from setuptools import setup - - PYPROJECT = Path("./pyproject.toml") -@@ -16,11 +14,6 @@ - version=POETRY["version"], - author=POETRY["authors"][0].split()[0], - author_email=POETRY["authors"][0].split()[1], -- cmdclass={ -- "build": build_extra.build_extra, -- "build_i18n": build_i18n.build_i18n, -- "clean": clean_build_tree, -- }, - license=POETRY["license"], - packages=["nala"], - entry_points={