Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nala: update to 0.11.1 #11843

Merged
merged 2 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions packages/nala/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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="
D-Brox marked this conversation as resolved.
Show resolved Hide resolved
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
Expand All @@ -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
}

Expand All @@ -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
D-Brox marked this conversation as resolved.
Show resolved Hide resolved
mkdir -p $TERMUX_PREFIX/var/lock
echo "Installing dependencies through pip..."
pip3 install anyio httpx jsbeautifier pexpect rich
D-Brox marked this conversation as resolved.
Show resolved Hide resolved
pip3 install anyio httpx jsbeautifier pexpect python-debian rich tomli typer typing-extensions
EOF
}
18 changes: 11 additions & 7 deletions packages/nala/nala-__init__.py.patch
Original file line number Diff line number Diff line change
@@ -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)

11 changes: 0 additions & 11 deletions packages/nala/nala-config.py.patch

This file was deleted.

44 changes: 0 additions & 44 deletions packages/nala/nala-constants.py.patch

This file was deleted.

11 changes: 0 additions & 11 deletions packages/nala/nala-error.py.patch

This file was deleted.

11 changes: 0 additions & 11 deletions packages/nala/nala-utils.py.patch

This file was deleted.

10 changes: 0 additions & 10 deletions packages/nala/pyproject.toml.diff

This file was deleted.

23 changes: 0 additions & 23 deletions packages/nala/setup.py.patch

This file was deleted.