diff options
author | Kevin | 2019-04-02 11:06:28 -0500 |
---|---|---|
committer | Kevin | 2019-04-02 11:10:21 -0500 |
commit | 227a668de5b682a79ad9288b4c5d8a76c714fa13 (patch) | |
tree | 90cf8434fa34e479cc12c82f31aaa08847c468cc | |
parent | cafc242ad51d56775a788ae6415ae051843f631e (diff) | |
download | aur-227a668de5b682a79ad9288b4c5d8a76c714fa13.tar.gz |
fix for symlinked scripts, fix issue 308
updated pkgrel: 3
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 26 | ||||
-rw-r--r-- | fix-symlink-308.patch | 54 |
3 files changed, 76 insertions, 9 deletions
@@ -1,15 +1,16 @@ pkgbase = pyenv-virtualenv pkgdesc = pyenv plugin to manage virtualenv (a.k.a. python-virtualenv) pkgver = 1.1.5 - pkgrel = 2 - epoch = 1 + pkgrel = 3 url = https://github.com/pyenv/pyenv-virtualenv arch = any license = MIT depends = pyenv depends = bash source = https://github.com/pyenv/pyenv-virtualenv/archive/v1.1.5.tar.gz + source = fix-symlink-308.patch md5sums = 2ebab171a403915d695c383855ac78e4 + md5sums = 476790c1f9643d76efbb188b35ed19e0 pkgname = pyenv-virtualenv @@ -1,27 +1,39 @@ # Maintainer: Ayrton Araujo <root@ayr-ton.net> +# Co-maintainer: Kevin Del Castillo R. <lans9831@gmail.com> # Contributor: Nuno Araujo <nuno.araujo@russo79.com> pkgname=pyenv-virtualenv pkgver=1.1.5 -pkgrel=2 -epoch=1 +pkgrel=3 pkgdesc="pyenv plugin to manage virtualenv (a.k.a. python-virtualenv)" arch=('any') url="https://github.com/pyenv/pyenv-virtualenv" license=('MIT') depends=('pyenv' 'bash') -source=("https://github.com/pyenv/$pkgname/archive/v$pkgver.tar.gz") -md5sums=('2ebab171a403915d695c383855ac78e4') +source=("https://github.com/pyenv/$pkgname/archive/v$pkgver.tar.gz" + "fix-symlink-308.patch") +md5sums=('2ebab171a403915d695c383855ac78e4' + '476790c1f9643d76efbb188b35ed19e0') package() { mkdir -p "${pkgdir?}"/{opt/pyenv/plugins/pyenv-virtualenv,usr/bin} cd "${srcdir?}/$pkgname-$pkgver" - cp -a -- * "$pkgdir"/opt/pyenv/plugins/pyenv-virtualenv - for bin in $pkgdir/opt/pyenv/plugins/pyenv-virtualenv/bin/*; do - ln -s /opt/pyenv/plugins/pyenv-virtualenv/bin/"$(basename $bin)" "$pkgdir/usr/bin/$(basename $bin)" + # Fix issue #308 + patch -p1 < ../fix-symlink-308.patch + + # Intall using the script + PREFIX="${pkgdir}/opt/pyenv/plugins/pyenv-virtualenv" ./install.sh + + # Link binaries + pushd bin &> /dev/null + for bin in *; do + ln -s /opt/pyenv/plugins/pyenv-virtualenv/bin/"$bin" "$pkgdir/usr/bin/$bin" done + popd &> /dev/null # License mkdir -p "$pkgdir"/usr/share/licenses/pyenv-virtualenv cp LICENSE "$pkgdir"/usr/share/licenses/pyenv-virtualenv } + +# vim:set sw=2 sts=2 et: diff --git a/fix-symlink-308.patch b/fix-symlink-308.patch new file mode 100644 index 000000000000..00e5e3c30a40 --- /dev/null +++ b/fix-symlink-308.patch @@ -0,0 +1,54 @@ +diff --git a/bin/pyenv-virtualenv-prefix b/bin/pyenv-virtualenv-prefix +index aa71777..bbe5871 100755 +--- a/bin/pyenv-virtualenv-prefix ++++ b/bin/pyenv-virtualenv-prefix +@@ -6,7 +6,21 @@ + + set -e + [ -n "$PYENV_DEBUG" ] && set -x +-. "${BASH_SOURCE%/*}"/../libexec/pyenv-virtualenv-realpath ++if [ -L "${BASH_SOURCE}" ]; then ++ READLINK=$(type -p greadlink readlink | head -1) ++ if [ -z "$READLINK" ]; then ++ echo "pyenv: cannot find readlink - are you missing GNU coreutils?" >&2 ++ exit 1 ++ fi ++ resolve_link() { ++ $READLINK -f "$1" ++ } ++ script_path=$(resolve_link ${BASH_SOURCE}) ++else ++ script_path=${BASH_SOURCE} ++fi ++ ++. ${script_path%/*}/../libexec/pyenv-virtualenv-realpath + + if [ -z "$PYENV_ROOT" ]; then + PYENV_ROOT="${HOME}/.pyenv" +diff --git a/bin/pyenv-virtualenvs b/bin/pyenv-virtualenvs +index 173278b..b441e78 100755 +--- a/bin/pyenv-virtualenvs ++++ b/bin/pyenv-virtualenvs +@@ -7,7 +7,21 @@ + + set -e + [ -n "$PYENV_DEBUG" ] && set -x +-. "${BASH_SOURCE%/*}"/../libexec/pyenv-virtualenv-realpath ++if [ -L "${BASH_SOURCE}" ]; then ++ READLINK=$(type -p greadlink readlink | head -1) ++ if [ -z "$READLINK" ]; then ++ echo "pyenv: cannot find readlink - are you missing GNU coreutils?" >&2 ++ exit 1 ++ fi ++ resolve_link() { ++ $READLINK -f "$1" ++ } ++ script_path=$(resolve_link ${BASH_SOURCE}) ++else ++ script_path=${BASH_SOURCE} ++fi ++ ++. ${script_path%/*}/../libexec/pyenv-virtualenv-realpath + + if [ -z "$PYENV_ROOT" ]; then + PYENV_ROOT="${HOME}/.pyenv" |