Add python-setuptools-git
Signed-off-by: Naveen M K <naveen@syrusdark.website>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
diff --git a/setuptools_git/__init__.py b/setuptools_git/__init__.py
|
||||
index 24c9b8c..5a31b04 100644
|
||||
--- a/setuptools_git/__init__.py
|
||||
+++ b/setuptools_git/__init__.py
|
||||
@@ -64,13 +64,17 @@ def gitlsfiles(dirname=''):
|
||||
|
||||
try:
|
||||
topdir = check_output(
|
||||
- ['git', 'rev-parse', '--show-toplevel'], cwd=dirname or None,
|
||||
+ ['git', 'rev-parse', '--show-prefix'], cwd=dirname or None,
|
||||
stderr=PIPE).strip()
|
||||
|
||||
if sys.platform == 'win32':
|
||||
cwd = ntfsdecode(topdir)
|
||||
else:
|
||||
cwd = topdir
|
||||
+ dirname = os.path.abspath(dirname)
|
||||
+ cwd = cwd.strip()[:-1] # remove the trailing pathsep
|
||||
+ assert dirname.replace("\\", "/").endswith(cwd)
|
||||
+ cwd = dirname[: -len(cwd)]
|
||||
|
||||
filenames = check_output(
|
||||
['git', 'ls-files', '-z'], cwd=cwd, stderr=PIPE)
|
||||
44
mingw-w64-python-setuptools-git/PKGBUILD
Normal file
44
mingw-w64-python-setuptools-git/PKGBUILD
Normal file
@@ -0,0 +1,44 @@
|
||||
# Maintainer: @naveen521kk on Github, Naveen M K <naveen@syrusdark.website>
|
||||
_pyname=setuptools-git
|
||||
_realname=setuptools-git
|
||||
pkgbase=mingw-w64-python-${_realname}
|
||||
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
||||
pkgver=1.2
|
||||
pkgrel=1
|
||||
pkgdesc="Setuptools revision control system plugin for Git (mingw-w64)"
|
||||
url="https://pypi.org/project/setuptools-git/"
|
||||
arch=('any')
|
||||
license=('BSD')
|
||||
depends=("${MINGW_PACKAGE_PREFIX}-python"
|
||||
'git')
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
|
||||
source=(
|
||||
"${_pyname}-${pkgver}.tar.gz::https://pypi.org/packages/source/${_pyname::1}/${_pyname}/${_pyname}-${pkgver}.tar.gz"
|
||||
"0001-use-git-show-prefix.patch"
|
||||
)
|
||||
sha512sums=('c070911618b6b92c862fb0bd40f1daeaf79e2ba10389fa1e69e4c50cfdd39c8e57a612082cbc7d932f8cea12a769e13451e35e1c8fe34f170d4817fd0d44f156'
|
||||
'99d8cfe019f610a82af8ce69a83a08cb754d7ff40b55e7545aef35308486353a22a22b7057c2b39632fb59a39c396765fef0cce69149d80387657e103be8ac33')
|
||||
|
||||
prepare() {
|
||||
cd "${_pyname//_/-}-$pkgver"
|
||||
patch -p1 -i ${srcdir}/0001-use-git-show-prefix.patch
|
||||
cd "${srcdir}"
|
||||
rm -rf python-build-${CARCH}
|
||||
cp -r "${_pyname//_/-}-$pkgver" "python-build-${CARCH}"
|
||||
}
|
||||
|
||||
check(){
|
||||
cd "${srcdir}/python-build-${CARCH}/${pyname}"
|
||||
${MINGW_PREFIX}/bin/python -m unittest || true
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/python-build-${CARCH}"
|
||||
${MINGW_PREFIX}/bin/python setup.py build
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/python-build-${CARCH}"
|
||||
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
||||
${MINGW_PREFIX}/bin/python setup.py install --root=${pkgdir} --prefix=${MINGW_PREFIX} --optimize=1 --skip-build
|
||||
}
|
||||
Reference in New Issue
Block a user