From d0843fba04c775c970128701d091017eaa031696 Mon Sep 17 00:00:00 2001 From: David Brochero Date: Wed, 7 Sep 2022 12:54:59 -0300 Subject: [PATCH] Update version, patches and build script --- packages/nala/build.sh | 29 ++---------------- packages/nala/nala-__init__.py.patch | 18 ++++++----- packages/nala/nala-config.py.patch | 11 ------- packages/nala/nala-constants.py.patch | 44 --------------------------- packages/nala/nala-error.py.patch | 11 ------- packages/nala/nala-utils.py.patch | 11 ------- packages/nala/pyproject.toml.diff | 2 +- packages/nala/setup.py.patch | 23 -------------- 8 files changed, 15 insertions(+), 134 deletions(-) delete mode 100644 packages/nala/nala-config.py.patch delete mode 100644 packages/nala/nala-constants.py.patch delete mode 100644 packages/nala/nala-error.py.patch delete mode 100644 packages/nala/nala-utils.py.patch delete mode 100644 packages/nala/setup.py.patch diff --git a/packages/nala/build.sh b/packages/nala/build.sh index 85d45eac3694942..a4647a83c4d6393 100644 --- a/packages/nala/build.sh +++ b/packages/nala/build.sh @@ -2,9 +2,9 @@ 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_VERSION=0.11.0 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=b88fcadce2e0c6b2557302265813928235be043a3e710a4d006748e355dd23f6 TERMUX_PKG_DEPENDS="python-apt" TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_BUILD_IN_SRC=true @@ -32,26 +32,11 @@ termux_step_pre_configure() { ${_CROSSENV_PREFIX} popd . ${_CROSSENV_PREFIX}/bin/activate - - build-pip install tomli } termux_step_make_install() { - python setup.py install --force - export PYTHONPATH=$TERMUX_PREFIX/lib/python${_PYTHON_VERSION}/site-packages - python setup.py install --force --prefix $TERMUX_PREFIX - - pushd $PYTHONPATH - _NALA_EGG= - for f in nala-${TERMUX_PKG_VERSION##*:}-py${_PYTHON_VERSION}.egg; do - if [ -e "$f" ]; then - _NALA_EGG="$f" - break - fi - done - test -n "${_NALA_EGG}" - popd + python -m pip install . --force --prefix $TERMUX_PREFIX install -Dm600 -t $TERMUX_PREFIX/etc/nala debian/nala.conf } @@ -59,15 +44,7 @@ termux_step_make_install() { termux_step_create_debscripts() { cat <<- EOF > ./postinst #!$TERMUX_PREFIX/bin/sh - echo "./${_NALA_EGG}" >> $TERMUX_PREFIX/lib/python${_PYTHON_VERSION}/site-packages/easy-install.pth mkdir -p $TERMUX_PREFIX/var/lib/nala mkdir -p $TERMUX_PREFIX/var/log/nala - echo "Installing dependencies through pip..." - pip3 install anyio httpx jsbeautifier pexpect rich - EOF - - cat <<- EOF > ./prerm - #!$TERMUX_PREFIX/bin/sh - sed -i "/\.\/${_NALA_EGG//./\\.}/d" $TERMUX_PREFIX/lib/python${_PYTHON_VERSION}/site-packages/easy-install.pth EOF } diff --git a/packages/nala/nala-__init__.py.patch b/packages/nala/nala-__init__.py.patch index 6f499d8bdd03bac..c502008010c7308 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 747408a89d115d5..000000000000000 --- 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 75509305b33de85..000000000000000 --- 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 06b91517fb5da83..000000000000000 --- 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 18fd804e0e4a840..000000000000000 --- 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 index 4272ce545d0cc9e..084686481289c21 100644 --- a/packages/nala/pyproject.toml.diff +++ b/packages/nala/pyproject.toml.diff @@ -3,7 +3,7 @@ @@ -1,6 +1,6 @@ [tool.poetry] name = "nala" --version = "0.7.1" +-version = "0.11.0" +version = "@TERMUX_PKG_VERSION@" description = "Commandline frontend for the apt package manager" authors = [ diff --git a/packages/nala/setup.py.patch b/packages/nala/setup.py.patch deleted file mode 100644 index 4d53c21beb2e3a9..000000000000000 --- 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={