diff options
author | Ellis Kenyo | 2020-03-30 15:45:28 +0100 |
---|---|---|
committer | Ellis Kenyo | 2020-03-30 15:45:28 +0100 |
commit | a18aa6be7c8e33563950d93686f1fe612b83c8a0 (patch) | |
tree | 4a2410977b74c1f4436e939a10197191598a0cab | |
download | aur-a18aa6be7c8e33563950d93686f1fe612b83c8a0.tar.gz |
Init
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | LICENSE | 25 | ||||
-rw-r--r-- | PKGBUILD | 129 | ||||
-rw-r--r-- | PKGBUILD_EXTRAS | 0 |
5 files changed, 179 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..0059606f07af --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +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 + 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 + +pkgname = python-xxh + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..a186b7af9f1e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.whl +*.xz +pkg/ +src/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..e63e627d7cd9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,25 @@ +BSD 2-Clause License + +Copyright (c) 2020, xxh +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..05d80d78cd9d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,129 @@ +# Maintainer: Unknown Packager + +export PIP_CONFIG_FILE=/dev/null +export PIP_DISABLE_PIP_VERSION_CHECK=true + +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$ ]] +} + +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[*]}"))$")) diff --git a/PKGBUILD_EXTRAS b/PKGBUILD_EXTRAS new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/PKGBUILD_EXTRAS |