summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Chen2022-12-25 20:52:36 -0500
committerEvan Chen2022-12-25 20:52:36 -0500
commitbf9868ebc4e3ffdddc89b84cad387a35ee6d3236 (patch)
tree0df7b0f1cd40e7b1fc7c4d4b5d5dba04bff106ad
parentf2582b01a283410e57ad24c9f9007a9d2121df22 (diff)
downloadaur-bf9868ebc4e3ffdddc89b84cad387a35ee6d3236.tar.gz
Follow Mark Wagie's advice
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD145
-rw-r--r--PKGBUILD_EXTRAS0
3 files changed, 22 insertions, 139 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 13d1455874cd..3e2a32c605a1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,19 +1,19 @@
pkgbase = python-grilops
pkgdesc = GRId LOgic Puzzle Solver
pkgver = 0.9.1
- pkgrel = 00
+ pkgrel = 2
url = https://github.com/obijywk/grilops
arch = any
license = custom:MIT
- makedepends = python-pip
+ makedepends = python-build
+ makedepends = python-installer
+ makedepends = python-setuptools
+ makedepends = python-wheel
depends = python
depends = python-z3-solver
- noextract = grilops-0.9.1-py3-none-any.whl
- source = PKGBUILD_EXTRAS
- source = https://files.pythonhosted.org/packages/6e/77/2a4d8d492140b9174f5792ea90cd4e36c38d32b3e74c5b03517a89c5bd98/grilops-0.9.1-py3-none-any.whl
+ source = https://files.pythonhosted.org/packages/source///-0.9.1.tar.gz
source = LICENSE
- md5sums = SKIP
- md5sums = ddf881cebc05824f397a4506f6e98bd3
- md5sums = 5610fa5a3d7c703057b359bcd76e38d3
+ sha256sums = b078394eadcabe6aaef1fc3c6d1c9c341214c778a812364ea79f2e5904365d5b
+ sha256sums = 7161cd1ef6b37818a00e227eadcbf69472f89978754145f3904d1e6d53dfc282
pkgname = python-grilops
diff --git a/PKGBUILD b/PKGBUILD
index 24dab64313e6..86888c552aa0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,143 +1,26 @@
# Maintainer: Evan Chen <evan@evanchen.cc>
-export PIP_CONFIG_FILE=/dev/null
-export PIP_DISABLE_PIP_VERSION_CHECK=true
-
pkgname=python-grilops
-epoch=
+_name=${pkgname#python-}
pkgver=0.9.1
-pkgrel=00
+pkgrel=2
pkgdesc='GRId LOgic Puzzle Solver'
arch=(any)
url=https://github.com/obijywk/grilops
license=(custom:MIT)
depends=(python python-z3-solver)
-## 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/6e/77/2a4d8d492140b9174f5792ea90cd4e36c38d32b3e74c5b03517a89c5bd98/grilops-0.9.1-py3-none-any.whl)
-md5sums+=(ddf881cebc05824f397a4506f6e98bd3)
-noextract+=(grilops-0.9.1-py3-none-any.whl)
-source+=(LICENSE)
-md5sums+=(5610fa5a3d7c703057b359bcd76e38d3)
-
-_first_source() {
- echo " ${source_i686[@]} ${source_x86_64[@]} ${source[@]}" |
- tr ' ' '\n' | grep -Pv '^(PKGBUILD_EXTRAS)?$' | head -1
-}
-
-_vcs="$(grep -Po '^[a-z]+(?=\+)' <<<"$(_first_source)")"
-if [[ "$_vcs" ]]; then
- makedepends+=("$(pkgfile --quiet /usr/bin/$_vcs)")
- provides+=("${pkgname%-$_vcs}")
- conflicts+=("${pkgname%-$_vcs}")
-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
+makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
+source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz"
+ LICENSE)
+sha256sums=('b078394eadcabe6aaef1fc3c6d1c9c341214c778a812364ea79f2e5904365d5b'
+ '7161cd1ef6b37818a00e227eadcbf69472f89978754145f3904d1e6d53dfc282')
+
+build() {
+ cd "$_name-$pkgver"
+ python -m build --wheel --no-isolation
}
-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 "$_name-$pkgver"
+ python -m installer --destdir="$pkgdir" dist/*.whl
}
-
-_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/bin" ]]; then # Fix entry points.
- for f in "$pkgdir/usr/bin/"*; do
- if [[ $(head -n1 "$f") == "#!$(readlink -f _tmpenv)/bin/python" ]]; then
- sed -i '1c#!/usr/bin/python' "$f"
- fi
- done
- fi
- 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[*]}"
- ))$"))
-: # Apparently ending with makedepends assignment sometimes fails.
diff --git a/PKGBUILD_EXTRAS b/PKGBUILD_EXTRAS
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/PKGBUILD_EXTRAS
+++ /dev/null