diff options
author | Sameer Puri | 2021-03-11 23:06:56 -0500 |
---|---|---|
committer | Sameer Puri | 2021-03-11 23:06:56 -0500 |
commit | 402ea2c194cf4839c43fa5e51cfe1bacac67c181 (patch) | |
tree | c4fd1e4660f2b19e57b201c062e0986382195952 /PKGBUILD | |
parent | 440b055c3bb17a8fc29746c0e5c11f33fdbc905b (diff) | |
download | aur-402ea2c194cf4839c43fa5e51cfe1bacac67c181.tar.gz |
update to v0.4.5
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 66 |
1 files changed, 51 insertions, 15 deletions
@@ -5,7 +5,7 @@ export PIP_DISABLE_PIP_VERSION_CHECK=true pkgname=python-enamlx epoch= -pkgver=0.3.0 +pkgver=0.4.5 pkgrel=00 pkgdesc='Additional Qt Widgets for Enaml' arch=(any) @@ -19,28 +19,38 @@ provides=() conflicts=(${provides%=*}) # No quotes, to avoid an empty entry. source=(PKGBUILD_EXTRAS) md5sums=(SKIP) -source+=(https://files.pythonhosted.org/packages/be/5a/217fda69ee0e5fa2a9a558de29ead1591e6861b0b6869a075c1346810275/enamlx-0.3.0-py2.py3-none-any.whl) -md5sums+=(896f51bd17ae1f74190c9abdbf682913) -noextract=(enamlx-0.3.0-py2.py3-none-any.whl) +noextract=() +source+=(https://files.pythonhosted.org/packages/d2/2b/8a43e7ca191aa61522b3d441397aa74872f975f03d89852d470773b02d00/enamlx-0.4.5-py2.py3-none-any.whl) +md5sums+=(56f4580e0c134b0399578e99cc76d470) +noextract+=(enamlx-0.4.5-py2.py3-none-any.whl) source+=(LICENSE) md5sums+=(794244867fb0e2662f4faaca995758f9) + _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}") +_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() { - basename "$(_first_source)" | - sed 's/\(\.tar\.gz\|\.tgz\|\.tar\.bz2\|\.zip\|\.git\)$//' + find "$srcdir" -mindepth 1 -maxdepth 1 -type d -printf '%f +' | + grep -v '^_tmpenv$' } if [[ $(_first_source) =~ ^git+ ]]; then @@ -59,7 +69,7 @@ fi _build() { if _is_wheel; then return; fi - cd "$srcdir/$(_dist_name)" + cd "$srcdir" # See Arch Wiki/PKGBUILD/license. # Get the first filename that matches. local test_name @@ -70,11 +80,20 @@ _build() { 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. - /usr/bin/pip wheel -v --no-deps --wheel-dir="$srcdir" \ - --global-option=--no-user-cfg \ - --global-option=build --global-option=-j"$(nproc)" . || - true + # 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; } @@ -90,9 +109,20 @@ _check() { _package() { cd "$srcdir" # pypa/pip#3063: pip always checks for a globally installed version. - /usr/bin/pip --quiet install --root="$pkgdir" \ + 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 @@ -101,3 +131,9 @@ _package() { 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. |