#!/bin/sh
#
# Copyright 2026  Sasa Ostrouska <saxa@droplinegnome.org>
# Available under the terms of the GNU GPL.
#

NAME="python3-argcomplete"
VERSION="3.6.3"
REVISION="1"

PKG_SOURCEURL='https://github.com/kislyuk/argcomplete/archive/refs/tags/v$VERSION.tar.gz'

. $DLG_ROOT/etc/config
. $DLG_ROOT/lib/dl-base

# This package gets it's CFLAGS info from what was compiled into Python.
# Changing this variable is mainly a formality caused by this.
if [ "${PKG_ARCH%86}" != "$PKG_ARCH" ]; then
    PKG_ARCH=i486
fi

PKG_LOCALSTATEDIR=/var

prepare
analyzesource
        
spewdo "cd $PKG_SRCROOT"
spewdo "export SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION}"
spewdo "python3 -m build --wheel --no-isolation"
spewdo "python3 -m installer --prefix=${PKG_PREFIX} --destdir=${PKG_STAGEROOT} dist/*.whl"

tidydocumentation
analyzebinaries
finalizepackage
packagize
cleanup
