summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge2020-11-06 23:12:13 +0100
committerDavid Runge2020-11-06 23:12:13 +0100
commitd0dae2414083539ad0d9141dd8b1b2fe80fbd4b3 (patch)
tree21162b5e285700393791d660865d3f4da9f77ba9
parent0feb2e48894ae74fef8cdcc9c1f4571fd75e85e5 (diff)
downloadaur-d0dae2414083539ad0d9141dd8b1b2fe80fbd4b3.tar.gz
Move python-gilt back to the AUR
PKGBUILD: The package is no longer required in the official repositories. Upstream is also rather dead.
-rw-r--r--PKGBUILD81
-rw-r--r--python-gilt-1.2.1-ls_path.patch32
2 files changed, 66 insertions, 47 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 56ee7a7dc2f6..8acdd0a45f23 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,61 +1,48 @@
-# Maintainer: Morten Linderud <morten@linderud.pw>
+# Maintainer: David Runge <dvzrv@archlinux.org>
-pkgbase="python-gilt"
-pkgname=("python-gilt" "python2-gilt")
-_pkgname='gilt'
-pkgver=1.2.1
+pkgname=python-gilt
+pkgver=1.2.2
pkgrel=2
-pkgdesc='A GIT layering tool'
-url='https://github.com/metacloud/gilt'
+pkgdesc="A GIT layering tool"
arch=('any')
+url="https://github.com/retr0h/gilt"
license=('MIT')
-makedepends=('python' 'python-setuptools' 'python-pbr'
- 'python2' 'python2-setuptools' 'python2-pbr')
-checkdepends=('python' 'python-click' 'python-colorama'
- 'python-fasteners' 'python-yaml' 'python-sh'
- 'python-giturlparse' 'python2' 'python2-click'
- 'python2-colorama' 'python2-fasteners' 'python2-yaml'
- 'python2-sh' 'python2-giturlparse' 'python-tox')
-source=("${pkgname}-${pkgver}.tar.gz::https://github.com/metacloud/gilt/archive/${pkgver}.tar.gz")
-sha256sums=('f5e37e0e50bd88579e721a992f7a24bb1a3b119f2b71d511f38cf9fb802adbbc')
+depends=('python-click' 'python-colorama' 'python-fasteners'
+'python-git-url-parse' 'python-pbr' 'python-yaml' 'python-sh')
+makedepends=('python-setuptools')
+checkdepends=('git' 'python-pytest' 'python-pytest-cov'
+'python-pytest-helpers-namespace' 'python-pytest-mock' 'python-requests'
+'yapf')
+source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${pkgname}-${pkgver}.tar.gz"
+ "${pkgname}-1.2.1-ls_path.patch")
+sha512sums=('34ac5d5ef5a8bc052fa41ac464b7dd4efa15f323ea5c95a6c280ab39a99ac0335707ef98449436122715cc2b44682100989dd31253e96395a087d5d1db3a7c7b'
+ '8b0090f7374499b603bf383ea48f313f5baa7a8215f504c87350432873da557af07204c7f948aab4c05033c11ce10f2137f1912be6db5d6887b3d8a7c3f0dcbb')
prepare() {
- cp -a ${_pkgname}-$pkgver{,-py2}
+ cd "$pkgname-$pkgver"
+ # fixing issues with hardcoded paths
+ # https://github.com/retr0h/gilt/issues/76
+ patch -Np1 -i "../${pkgname}-1.2.1-ls_path.patch"
}
build() {
- export PBR_VERSION="${pkgver}"
- cd "${srcdir}/${_pkgname}-${pkgver}"
- python setup.py build
-
- cd "${srcdir}/${_pkgname}-${pkgver}-py2"
- python2 setup.py build
-}
-
-check(){
- cd "${srcdir}/${_pkgname}-${pkgver}"
- tox -e py3
-
- cd "${srcdir}/${_pkgname}-${pkgver}-py2"
- tox -e py2,py3
+ cd "$pkgname-$pkgver"
+ python setup.py build
}
-package_python-gilt() {
- depends=('python' 'python-click' 'python-colorama'
- 'python-fasteners' 'python-yaml' 'python-sh'
- 'python-giturlparse')
- cd "${srcdir}/${_pkgname}-${pkgver}"
- export PBR_VERSION="${pkgver}"
- python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+check() {
+ cd "$pkgname-$pkgver"
+ export PYTHONPATH="build:${PYTHONPATH}"
+ pytest -v
}
-package_python2-gilt() {
- depends=('python2' 'python2-click' 'python2-colorama'
- 'python2-fasteners' 'python2-yaml' 'python2-sh'
- 'python2-giturlparse')
- cd "${srcdir}/${_pkgname}-${pkgver}-py2"
- export PBR_VERSION="${pkgver}"
- python2 setup.py install --root="${pkgdir}" --optimize=1 --skip-build
- mv "${pkgdir}/usr/bin/gilt" "${pkgdir}/usr/bin/gilt2"
+package() {
+ cd "$pkgname-$pkgver"
+ python setup.py install --skip-build \
+ --optimize=1 \
+ --prefix=/usr \
+ --root="${pkgdir}"
+ install -vDm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -vDm 644 {AUTHORS,CHANGELOG,CONTRIBUTING,README}.rst -t \
+ "${pkgdir}/usr/share/doc/${pkgname}"
}
-# vim:set ft=sh ts=2 sw=2 et:
diff --git a/python-gilt-1.2.1-ls_path.patch b/python-gilt-1.2.1-ls_path.patch
new file mode 100644
index 000000000000..4606f52bcf5f
--- /dev/null
+++ b/python-gilt-1.2.1-ls_path.patch
@@ -0,0 +1,32 @@
+diff -ruN a/test/test_util.py b/test/test_util.py
+--- a/test/test_util.py 2020-02-22 22:17:38.000000000 +0100
++++ b/test/test_util.py 2020-03-18 23:01:37.713174667 +0100
+@@ -106,17 +106,20 @@
+
+
+ def test_build_sh_cmd_simple_command():
+- cmd = util.build_sh_cmd('ls')
+- assert b'/bin/ls' == cmd._path
++ ls = sh.ls.bake()
++ cmd = util.build_sh_cmd("ls")
++ assert ls == cmd._path.decode()
+
+
+ def test_build_sh_cmd_command_with_args():
+- cmd = util.build_sh_cmd('ls /tmp')
+- assert b'/bin/ls' == cmd._path
+- assert [b'/tmp'] == cmd._partial_baked_args
++ ls = sh.ls.bake()
++ cmd = util.build_sh_cmd("ls /tmp")
++ assert ls == cmd._path.decode()
++ assert [b"/tmp"] == cmd._partial_baked_args
+
+
+ def test_build_sh_cmd_command_with_cwd(temp_dir):
+- cmd = util.build_sh_cmd('ls', cwd=temp_dir)
+- assert b'/bin/ls' == cmd._path
+- assert temp_dir == cmd._partial_call_args['cwd']
++ ls = sh.ls.bake()
++ cmd = util.build_sh_cmd("ls", cwd=temp_dir)
++ assert ls == cmd._path.decode()
++ assert temp_dir == cmd._partial_call_args["cwd"]