summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllis Kenyo2020-04-02 09:44:07 +0100
committerEllis Kenyo2020-04-02 09:44:07 +0100
commit909c372df88ccfe552df178fd54a5a0f3af3af67 (patch)
tree6c2da4443c52fa360f3b40d830428a2ccf42f550
parenta18aa6be7c8e33563950d93686f1fe612b83c8a0 (diff)
downloadaur-909c372df88ccfe552df178fd54a5a0f3af3af67.tar.gz
Simplify PKGBUILD
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD140
3 files changed, 23 insertions, 139 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0059606f07af..78bbb876f979 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,14 @@
pkgbase = python-xxh
- pkgdesc = Bring your favorite shell wherever you go through the ssh
- pkgver = 0.7.5
- pkgrel = 00
- url = https://github.com/xxh/xxh
- arch = any
+ pkgdesc = Take your shell with you!
+ pkgver = 0.7.9
+ pkgrel = 1
+ url = https://pypi.org/project/xxh-xxh/
+ arch = x86_64
license = BSD
- makedepends = python-pip
depends = python
- depends = python-yaml
depends = python-pexpect
- noextract = xxh_xxh-0.7.5-py3-none-any.whl
- source = PKGBUILD_EXTRAS
- source = https://files.pythonhosted.org/packages/e3/cd/e9bee833ebb079ea50d897a04affce6b8cd86fc9422f0df4710a572ad2ce/xxh_xxh-0.7.5-py3-none-any.whl
- source = LICENSE
- md5sums = SKIP
- md5sums = e72c365321c84567362f5af674395f31
- md5sums = b281a66f71965a87c0e9c40ed38d099c
+ source = python-xxh-0.7.9::https://github.com/xxh/xxh/archive/0.7.9.tar.gz
+ md5sums = 55ec5a5aaf0a3092d9adfc1aa7e59e69
pkgname = python-xxh
diff --git a/.gitignore b/.gitignore
index a186b7af9f1e..3b93fcc05af8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
*.xz
pkg/
src/
+python-xxh*
diff --git a/PKGBUILD b/PKGBUILD
index 05d80d78cd9d..05d42eb5d05f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,129 +1,19 @@
-# Maintainer: Unknown Packager
-
-export PIP_CONFIG_FILE=/dev/null
-export PIP_DISABLE_PIP_VERSION_CHECK=true
+# Maintainer: Ellis Kenyo <me at elken dot dev>
pkgname=python-xxh
-epoch=
-pkgver=0.7.5
-pkgrel=00
-pkgdesc='Bring your favorite shell wherever you go through the ssh'
-arch=(any)
-url=https://github.com/xxh/xxh
-license=(BSD)
-depends=(python python-yaml python-pexpect)
-## EXTRA_DEPENDS ##
-makedepends=(python-pip)
-checkdepends=()
-provides=()
-conflicts=(${provides%=*}) # No quotes, to avoid an empty entry.
-source=(PKGBUILD_EXTRAS)
-md5sums=(SKIP)
-noextract=()
-source+=(https://files.pythonhosted.org/packages/e3/cd/e9bee833ebb079ea50d897a04affce6b8cd86fc9422f0df4710a572ad2ce/xxh_xxh-0.7.5-py3-none-any.whl)
-md5sums+=(e72c365321c84567362f5af674395f31)
-noextract+=(xxh_xxh-0.7.5-py3-none-any.whl)
-source+=(LICENSE)
-md5sums+=(b281a66f71965a87c0e9c40ed38d099c)
-
-_first_source() {
- echo " ${source_i686[@]} ${source_x86_64[@]} ${source[@]}" |
- tr ' ' '\n' | grep -Pv '^(PKGBUILD_EXTRAS)?$' | head -1
-}
-
-if [[ $(_first_source) =~ ^git+ ]]; then
- provides+=("${pkgname%-git}")
- conflicts+=("${pkgname%-git}")
-fi
-
-_is_wheel() {
- [[ $(_first_source) =~ \.whl$ ]]
+pkgver=0.7.9
+pkgrel=1
+pkgdesc="Take your shell with you!"
+arch=('x86_64')
+url="https://pypi.org/project/xxh-xxh/"
+depends=('python' 'python-pexpect')
+makedepends=()
+license=('BSD')
+source=($pkgname-$pkgver::https://github.com/xxh/xxh/archive/$pkgver.tar.gz)
+md5sums=('55ec5a5aaf0a3092d9adfc1aa7e59e69')
+
+package() {
+ cd "$srcdir"/$(echo $pkgname | cut -d- -f2)-$pkgver
+ python setup.py install --root="$pkgdir"
}
-if [[ _is_wheel &&
- $(basename "$(_first_source)" | rev | cut -d- -f1 | rev) =~ ^manylinux ]]; then
- options=(!strip) # https://github.com/pypa/manylinux/issues/119
-fi
-
-_dist_name() {
- find "$srcdir" -mindepth 1 -maxdepth 1 -type d -printf '%f
-' |
- grep -v '^_tmpenv$'
-}
-
-if [[ $(_first_source) =~ ^git+ ]]; then
- _pkgver() {
- ( set -o pipefail
- cd "$srcdir/$(_dist_name)"
- git describe --long --tags 2>/dev/null |
- sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
- printf "r%s.%s" \
- "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
- )
- }
-
- pkgver() { _pkgver; }
-fi
-
-_build() {
- if _is_wheel; then return; fi
- cd "$srcdir"
- # See Arch Wiki/PKGBUILD/license.
- # Get the first filename that matches.
- local test_name
- if [[ ${license[0]} =~ ^(BSD|MIT|ZLIB|Python)$ ]]; then
- for test_name in LICENSE LICENSE.txt license.txt COPYING COPYING.md COPYING.rst COPYING.txt COPYRIGHT; do
- if cp "$srcdir/$(_dist_name)/$test_name" "$srcdir/LICENSE" 2>/dev/null; then
- break
- fi
- done
- fi
- # Use the latest version of pip, as Arch's version is historically out of
- # date(!) and newer versions do fix bugs (sometimes).
- python -mvenv --clear --system-site-packages _tmpenv
- _tmpenv/bin/pip --quiet install -U pip
- # Build the wheel (which we allow to fail) only after fetching the license.
- # In order to isolate from ~/.pydistutils.cfg, we need to set $HOME to a
- # temporary directory, and thus first $XDG_CACHE_HOME back to its real
- # location, so that pip inserts the wheel in the wheel cache. We cannot
- # use --global-option=--no-user-cfg instead because that fully disables
- # wheels, causing a from-source build of build dependencies such as
- # numpy/scipy.
- XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}" HOME=_tmpenv \
- _tmpenv/bin/pip wheel -v --no-deps --wheel-dir="$srcdir" \
- "./$(_dist_name)" || true
-}
-
-build() { _build; }
-
-_check() {
- # Define check(), possibly using _check as a helper, to run the tests.
- # You may need to call `python setup.py build_ext -i` first.
- if _is_wheel; then return; fi
- cd "$srcdir/$(_dist_name)"
- /usr/bin/python setup.py -q test
-}
-
-_package() {
- cd "$srcdir"
- # pypa/pip#3063: pip always checks for a globally installed version.
- python -mvenv --clear --system-site-packages _tmpenv
- _tmpenv/bin/pip install --prefix="$pkgdir/usr" \
- --no-deps --ignore-installed --no-warn-script-location \
- "$(ls ./*.whl 2>/dev/null || echo ./"$(_dist_name)")"
- if [[ -d "$pkgdir/usr/etc" ]]; then
- mv "$pkgdir/usr/etc" "$pkgdir/etc"
- fi
- if [[ -f LICENSE ]]; then
- install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- fi
-}
-
-package() { _package; }
-
-. "$(dirname "$BASH_SOURCE")/PKGBUILD_EXTRAS"
-
-# Remove makedepends already in depends (which may have been listed for the
-# first build, but autodetected on the second.
-makedepends=($(printf '%s\n' "${makedepends[@]}" |
- grep -Pwv "^($(IFS='|'; echo "${depends[*]}"))$"))