Skip to content

Commit

Permalink
Update version, patches and build script
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Brox committed Sep 7, 2022
1 parent e9f5719 commit d0843fb
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 134 deletions.
29 changes: 3 additions & 26 deletions packages/nala/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -32,42 +32,19 @@ 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
}

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
}
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.

2 changes: 1 addition & 1 deletion packages/nala/pyproject.toml.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
23 changes: 0 additions & 23 deletions packages/nala/setup.py.patch

This file was deleted.

0 comments on commit d0843fb

Please sign in to comment.