summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Wild2020-04-14 22:13:07 -0400
committerAllen Wild2020-04-14 22:13:07 -0400
commit781f11068e928900d268f479ac201e582534c7b4 (patch)
tree81c89ecde46b7cd33cc4bb25b9724167ccf15e81
parentb7a13430b31e4d6f613f234859601b661ade2d14 (diff)
downloadaur-781f11068e928900d268f479ac201e582534c7b4.tar.gz
update to 2.26.0-1, switch to setuptools
There's now a setup.py file, so we can use that. Unfortunately we have to patch it since it uses setuptools-scm for the version, which only works in a git clone, but the manpage is only distributed in release tarballs.
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD26
-rw-r--r--version.patch10
3 files changed, 31 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1bd93d82627b..9da5eee39a37 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,18 @@
pkgbase = git-filter-repo
pkgdesc = Quickly rewrite git repository history (filter-branch replacement)
- pkgver = 2.25.0
+ pkgver = 2.26.0
pkgrel = 1
url = https://github.com/newren/git-filter-repo
arch = any
license = MIT
checkdepends = python-coverage
+ makedepends = python-setuptools
depends = git
depends = python
- source = https://github.com/newren/git-filter-repo/releases/download/v2.25.0/git-filter-repo-2.25.0.tar.xz
- sha256sums = ea8cdb7dca68111e819d141fc4d302b811c1e5362c12de7403882ba9908be29c
+ source = https://github.com/newren/git-filter-repo/releases/download/v2.26.0/git-filter-repo-2.26.0.tar.xz
+ source = version.patch
+ sha256sums = 537ac38f49cb5bbb08b1feb7563bace54c34b4d04427e9245c2081654c3ca095
+ sha256sums = 68757bead7ef4a2ff5af3b8563889564f5105cb75da9a7a7513b8aa198027d6f
pkgname = git-filter-repo
diff --git a/PKGBUILD b/PKGBUILD
index c34d4f3dd3de..c03d1735917e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,31 +1,35 @@
# Maintainer: Allen Wild <allenwild93@gmail.com>
pkgname=git-filter-repo
-pkgver=2.25.0
+pkgver=2.26.0
pkgrel=1
pkgdesc="Quickly rewrite git repository history (filter-branch replacement)"
arch=('any')
url="https://github.com/newren/git-filter-repo"
license=('MIT')
depends=('git' 'python')
+makedepends=('python-setuptools')
checkdepends=('python-coverage')
-source=("${url}/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.xz")
-sha256sums=('ea8cdb7dca68111e819d141fc4d302b811c1e5362c12de7403882ba9908be29c')
+source=("${url}/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.xz"
+ "version.patch")
+sha256sums=('537ac38f49cb5bbb08b1feb7563bace54c34b4d04427e9245c2081654c3ca095'
+ '68757bead7ef4a2ff5af3b8563889564f5105cb75da9a7a7513b8aa198027d6f')
prepare() {
- # hard-code the shebang to the system python(3) to avoid confusion with virtualenvs
- sed -i 's|^#!.*|#!/usr/bin/python|' "$pkgname-$pkgver/git-filter-repo"
+ cd "$pkgname-$pkgver"
+ # use_scm_version in setup.py doesn't work from tarballs, inject $pkgver instead
+ patch -Np1 -i "$srcdir/version.patch"
+ sed -i "s|@PKGVER@|${pkgver}|" release/setup.py
}
check() {
- cd "$pkgname-$pkgver"
- make test
+ make -C "$pkgname-$pkgver" test
}
package() {
- cd "$pkgname-$pkgver"
- # Makefile doesn't support DESTDIR and installs the bare script as a Python module
- # without any egg-info metadata, which is undesirable. Just install manually.
- install -Dm755 git-filter-repo "${pkgdir}/usr/bin/git-filter-repo"
+ cd "$pkgname-$pkgver/release"
+ python setup.py install --root="$pkgdir" --optimize=1
+
+ cd ..
install -Dm644 Documentation/man1/git-filter-repo.1 "${pkgdir}/usr/share/man/man1/git-filter-repo.1"
install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}/" COPYING COPYING.mit
}
diff --git a/version.patch b/version.patch
new file mode 100644
index 000000000000..553ee0f820dc
--- /dev/null
+++ b/version.patch
@@ -0,0 +1,10 @@
+Index: git-filter-repo-2.26.0/release/setup.py
+===================================================================
+--- git-filter-repo-2.26.0.orig/release/setup.py
++++ git-filter-repo-2.26.0/release/setup.py
+@@ -5,4 +5,4 @@ for f in ['git-filter-repo', 'git_filter
+ os.symlink("../"+f, f)
+ except FileExistsError:
+ pass
+-setup(use_scm_version=dict(root="..", relative_to=__file__))
++setup(version='@PKGVER@')