mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 11:33:49 -05:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fadd939ad | ||
|
|
4e10692a1e | ||
|
|
fb757053c8 | ||
|
|
949c1dab8d | ||
|
|
d8559b9749 | ||
|
|
4469d51ef7 | ||
|
|
4f76be6a12 | ||
|
|
81b89e16db | ||
|
|
a62f1a4423 | ||
|
|
a02f5dde4f | ||
|
|
cf1beda362 | ||
|
|
8aebe3b43d | ||
|
|
9a10674ab9 | ||
|
|
66c8ca6cff | ||
|
|
3a1379cb34 | ||
|
|
740fbe4bda | ||
|
|
0c7224af95 | ||
|
|
93ece2ac16 | ||
|
|
36138f4901 | ||
|
|
bc8dba4bea | ||
|
|
1b35cfaa2c | ||
|
|
83e874a165 | ||
|
|
8eefa41a4d | ||
|
|
57a902f36a | ||
|
|
07fd1ae66b | ||
|
|
b8885e4fe2 | ||
|
|
a456528be8 | ||
|
|
6030ea51e4 | ||
|
|
2485257424 | ||
|
|
5c83c4abb7 | ||
|
|
4df7cf2dd6 |
@@ -1,5 +1,11 @@
|
||||
## Version History
|
||||
|
||||
## 1.0.0
|
||||
|
||||
* pyenv: Import latest changes from rbenv as of Aug 15, 2016 (#669)
|
||||
* pyenv: Add workaround for system python at `/bin/python` (#628)
|
||||
* python-build: Import changes from ruby-build v20160602 (#668)
|
||||
|
||||
## 20160726
|
||||
|
||||
* python-build: pypy-5.3.1: Remove stray text (#648)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
version="20160726"
|
||||
version="1.0.0"
|
||||
git_revision=""
|
||||
|
||||
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
||||
|
||||
@@ -32,6 +32,7 @@ OLDIFS="$IFS"
|
||||
if [ "$version" = "system" ]; then
|
||||
if PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python 2>/dev/null)"; then
|
||||
PYENV_PREFIX_PATH="${PYTHON_PATH%/bin/*}"
|
||||
PYENV_PREFIX_PATH="${PYENV_PREFIX_PATH:-/}"
|
||||
else
|
||||
echo "pyenv: system version not found in PATH" >&2
|
||||
exit 1
|
||||
|
||||
@@ -59,9 +59,6 @@ done
|
||||
|
||||
if [ -x "$PYENV_COMMAND_PATH" ]; then
|
||||
echo "$PYENV_COMMAND_PATH"
|
||||
elif [ "$PYENV_VERSION" != "system" ] && [ ! -d "${PYENV_ROOT}/versions/${PYENV_VERSION}" ]; then
|
||||
echo "pyenv: version \`$PYENV_VERSION' is not installed (set by $(pyenv-version-origin))" >&2
|
||||
exit 1
|
||||
else
|
||||
any_not_installed=0
|
||||
for version in "${versions[@]}"; do
|
||||
@@ -69,7 +66,7 @@ else
|
||||
continue
|
||||
fi
|
||||
if ! [ -d "${PYENV_ROOT}/versions/${version}" ]; then
|
||||
echo "pyenv: version \`$version' is not installed" >&2
|
||||
echo "pyenv: version \`$version' is not installed (set by $(pyenv-version-origin))" >&2
|
||||
any_not_installed=1
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
# -g/--debug Build a debug version
|
||||
#
|
||||
|
||||
PYTHON_BUILD_VERSION="20160130"
|
||||
PYTHON_BUILD_VERSION="20160602"
|
||||
|
||||
OLDIFS="$IFS"
|
||||
|
||||
@@ -1467,7 +1467,11 @@ apply_python_patch() {
|
||||
}
|
||||
|
||||
build_package_symlink_version_suffix() {
|
||||
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]] && [ ! -e "${PREFIX_PATH}/bin" ]; then
|
||||
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||
if [ -e "${PREFIX_PATH}/bin" ]; then
|
||||
# Always create `bin` as symlink to framework path if the version was built with `--enable-frameowrk` (#590)
|
||||
mv -f "${PREFIX_PATH}/bin" "${PREFIX_PATH}/bin.orig"
|
||||
fi
|
||||
# Only symlinks are installed in ${PREFIX_PATH}/bin
|
||||
ln -fs "${PREFIX_PATH}/Python.framework/Versions/Current/bin" "${PREFIX_PATH}/bin"
|
||||
fi
|
||||
@@ -1827,8 +1831,16 @@ fi
|
||||
#fi
|
||||
|
||||
if [ -z "$MAKE" ]; then
|
||||
if [ "FreeBSD" = "$(uname -s)" ] && [ "$(uname -r | sed 's/[^[:digit:]].*//')" -lt 10 ]; then
|
||||
export MAKE="gmake"
|
||||
if [ "FreeBSD" = "$(uname -s)" ]; then
|
||||
# if [ $(echo $1 | sed 's/-.*$//') = "jruby" ]; then
|
||||
# export MAKE="gmake"
|
||||
# else
|
||||
if [ "$(uname -r | sed 's/[^[:digit:]].*//')" -lt 10 ]; then
|
||||
export MAKE="gmake"
|
||||
else
|
||||
export MAKE="make"
|
||||
fi
|
||||
# fi
|
||||
else
|
||||
export MAKE="make"
|
||||
fi
|
||||
|
||||
@@ -5,6 +5,10 @@ export PYTHON_BUILD_SKIP_MIRROR=1
|
||||
export PYTHON_BUILD_CACHE_PATH=
|
||||
export PYTHON_BUILD_CURL_OPTS=
|
||||
|
||||
setup() {
|
||||
ensure_not_found_in_path aria2c
|
||||
}
|
||||
|
||||
|
||||
@test "package URL without checksum" {
|
||||
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
ensure_not_found_in_path aria2c
|
||||
export PYENV_ROOT="${TMP}/pyenv"
|
||||
export HOOK_PATH="${TMP}/i has hooks"
|
||||
mkdir -p "$HOOK_PATH"
|
||||
|
||||
@@ -6,6 +6,10 @@ export PYTHON_BUILD_CACHE_PATH=
|
||||
export PYTHON_BUILD_MIRROR_URL=http://mirror.example.com
|
||||
export PYTHON_BUILD_CURL_OPTS=
|
||||
|
||||
setup() {
|
||||
ensure_not_found_in_path aria2c
|
||||
}
|
||||
|
||||
|
||||
@test "package URL without checksum bypasses mirror" {
|
||||
stub shasum true
|
||||
|
||||
@@ -4,7 +4,6 @@ load test_helper
|
||||
export PYENV_ROOT="${TMP}/pyenv"
|
||||
|
||||
setup() {
|
||||
ensure_not_found_in_path aria2c
|
||||
stub pyenv-hooks 'install : true'
|
||||
stub pyenv-rehash 'true'
|
||||
}
|
||||
|
||||
@@ -38,10 +38,6 @@ ensure_not_found_in_path() {
|
||||
done
|
||||
}
|
||||
|
||||
setup() {
|
||||
ensure_not_found_in_path aria2c
|
||||
}
|
||||
|
||||
teardown() {
|
||||
rm -fr "${TMP:?}"/*
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
# Anaconda comes with binaries of system packages (e.g. `openssl`, `curl`).
|
||||
# Creating shims for those binaries will prevent pyenv users to run those
|
||||
# commands normally when not using Anaconda.
|
||||
#
|
||||
# This hooks is intended to skip creating shims for those executables.
|
||||
|
||||
conda_exists() {
|
||||
shopt -s nullglob
|
||||
local condas=($(echo "${PYENV_ROOT}/versions/"*"/bin/conda" "${PYENV_ROOT}/versions/"*"/envs/"*"/bin/conda"))
|
||||
shopt -u nullglob
|
||||
[ -n "${condas}" ]
|
||||
}
|
||||
|
||||
conda_shim() {
|
||||
case "${1##*/}" in
|
||||
"curl" | "curl-config" )
|
||||
return 0 # curl
|
||||
;;
|
||||
"fc-cache" | "fc-cat" | "fc-list" | "fc-match" | "fc-pattern" | "fc-query" | "fc-scan" | "fc-validate" )
|
||||
return 0 # fontconfig
|
||||
;;
|
||||
"freetype-config" )
|
||||
return 0 # freetype
|
||||
;;
|
||||
"libpng-config" )
|
||||
return 0 # libpng
|
||||
;;
|
||||
"openssl" )
|
||||
return 0 # openssl
|
||||
;;
|
||||
"assistant" | "designer" | "lconvert" | "linguist" | "lrelease" | "lupdate" | "moc" | "pixeltool" | "qcollectiongenerator" | "qdbus" | "qdbuscpp2xml" | "qdbusviewer" | "qdbusxml2cpp" | "qhelpconverter" | "qhelpgenerator" | "qmake" | "qmlplugindump" | "qmlviewer" | "qtconfig" | "rcc" | "uic" | "xmlpatterns" | "xmlpatternsvalidator" )
|
||||
return 0 # qtchooser
|
||||
;;
|
||||
"redis-benchmark" | "redis-check-aof" | "redis-check-dump" | "redis-cli" | "redis-server" )
|
||||
return 0 # redis
|
||||
;;
|
||||
"sqlite3" )
|
||||
return 0 # sqlite3
|
||||
;;
|
||||
"xml2-config" )
|
||||
return 0 # libxml2
|
||||
;;
|
||||
"xslt-config" )
|
||||
return 0 # libxslt
|
||||
;;
|
||||
"xsltproc" )
|
||||
return 0 # xsltproc
|
||||
;;
|
||||
"unxz" | "xz" | "xzcat" | "xzcmd" | "xzdiff" | "xzegrep" | "xzfgrep" | "xzgrep" | "xzless" | "xzmore" )
|
||||
return 0 # xz-utils
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
# override `make_shims` to avoid conflict between pyenv-virtualenv's `envs.bash`
|
||||
# https://github.com/yyuu/pyenv-virtualenv/blob/v20160716/etc/pyenv.d/rehash/envs.bash
|
||||
make_shims() {
|
||||
local file shim
|
||||
for file do
|
||||
shim="${file##*/}"
|
||||
if ! conda_shim "${shim}" 1>&2; then
|
||||
register_shim "$shim"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
deregister_conda_shims() {
|
||||
local shim
|
||||
local shims=()
|
||||
for shim in ${registered_shims}; do
|
||||
if ! conda_shim "${shim}" 1>&2; then
|
||||
shims[${#shims[*]}]="${shim}"
|
||||
fi
|
||||
done
|
||||
registered_shims=" ${shims[@]} "
|
||||
}
|
||||
|
||||
if conda_exists; then
|
||||
deregister_conda_shims
|
||||
fi
|
||||
47
pyenv.d/rehash/conda.bash
Normal file
47
pyenv.d/rehash/conda.bash
Normal file
@@ -0,0 +1,47 @@
|
||||
# Anaconda comes with binaries of system packages (e.g. `openssl`, `curl`).
|
||||
# Creating shims for those binaries will prevent pyenv users to run those
|
||||
# commands normally when not using Anaconda.
|
||||
#
|
||||
# This hooks is intended to skip creating shims for those executables.
|
||||
|
||||
conda_exists() {
|
||||
shopt -s nullglob
|
||||
local condas=($(echo "${PYENV_ROOT}/versions/"*"/bin/conda" "${PYENV_ROOT}/versions/"*"/envs/"*"/bin/conda"))
|
||||
shopt -u nullglob
|
||||
[ -n "${condas}" ]
|
||||
}
|
||||
|
||||
shims=()
|
||||
for shim in $(cat "${BASH_SOURCE%/*}/conda.txt"); do
|
||||
if [ -n "${shim%%#*}" ]; then
|
||||
shims[${#shims[*]}]="${shim})return 0;;"
|
||||
fi
|
||||
done
|
||||
eval "conda_shim(){ case \"\$1\" in ${shims[@]} *)return 1;;esac;}"
|
||||
|
||||
# override `make_shims` to avoid conflict between pyenv-virtualenv's `envs.bash`
|
||||
# https://github.com/yyuu/pyenv-virtualenv/blob/v20160716/etc/pyenv.d/rehash/envs.bash
|
||||
make_shims() {
|
||||
local file shim
|
||||
for file do
|
||||
shim="${file##*/}"
|
||||
if ! conda_shim "${shim}" 1>&2; then
|
||||
register_shim "$shim"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
deregister_conda_shims() {
|
||||
local shim
|
||||
local shims=()
|
||||
for shim in ${registered_shims}; do
|
||||
if ! conda_shim "${shim}" 1>&2; then
|
||||
shims[${#shims[*]}]="${shim}"
|
||||
fi
|
||||
done
|
||||
registered_shims=" ${shims[@]} "
|
||||
}
|
||||
|
||||
if conda_exists; then
|
||||
deregister_conda_shims
|
||||
fi
|
||||
78
pyenv.d/rehash/conda.txt
Normal file
78
pyenv.d/rehash/conda.txt
Normal file
@@ -0,0 +1,78 @@
|
||||
# curl
|
||||
curl
|
||||
curl-config
|
||||
# fontconfig
|
||||
fc-cache
|
||||
fc-cat
|
||||
fc-list
|
||||
fc-match
|
||||
fc-pattern
|
||||
fc-query
|
||||
fc-scan
|
||||
fc-validate
|
||||
# freetype
|
||||
freetype-config
|
||||
# libglib2.0-bin
|
||||
gapplication
|
||||
gdbus
|
||||
gresource
|
||||
gsettings
|
||||
gio-querymodules
|
||||
glib-compile-resources
|
||||
glib-compile-schemas
|
||||
# libpng
|
||||
libpng-config
|
||||
# libxml2
|
||||
xml2-config
|
||||
# libxml2-utils
|
||||
xmlcatalog
|
||||
xmllint
|
||||
# openssl
|
||||
openssl
|
||||
# qtchooser
|
||||
assistant
|
||||
designer
|
||||
lconvert
|
||||
linguist
|
||||
lrelease
|
||||
lupdate
|
||||
moc
|
||||
pixeltool
|
||||
qcollectiongenerator
|
||||
qdbus
|
||||
qdbuscpp2xml
|
||||
qdbusviewer
|
||||
qdbusxml2cpp
|
||||
qhelpconverter
|
||||
qhelpgenerator
|
||||
qmake
|
||||
qmlplugindump
|
||||
qmlviewer
|
||||
qtconfig
|
||||
rcc
|
||||
uic
|
||||
xmlpatterns
|
||||
xmlpatternsvalidator
|
||||
# redis
|
||||
redis-benchmark
|
||||
redis-check-aof
|
||||
redis-check-dump
|
||||
redis-cli
|
||||
redis-server
|
||||
# sqlite3
|
||||
sqlite3
|
||||
# xslt-config
|
||||
xslt-config
|
||||
# xsltproc
|
||||
xsltproc
|
||||
# xz
|
||||
unxz
|
||||
xz
|
||||
xzcat
|
||||
xzcmd
|
||||
xzdiff
|
||||
xzegrep
|
||||
xzfgrep
|
||||
xzgrep
|
||||
xzless
|
||||
xzmore
|
||||
176
src/shobj-conf
176
src/shobj-conf
@@ -10,21 +10,23 @@
|
||||
# Chet Ramey
|
||||
# chet@po.cwru.edu
|
||||
|
||||
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
# This file is part of GNU Bash, the Bourne Again SHell.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
|
||||
#
|
||||
# defaults
|
||||
@@ -62,7 +64,21 @@ while [ $# -gt 0 ]; do
|
||||
esac
|
||||
done
|
||||
|
||||
case "${host_os}-${SHOBJ_CC}" in
|
||||
case "${host_os}-${SHOBJ_CC}-${host_vendor}" in
|
||||
nsk-cc-tandem)
|
||||
SHOBJ_CFLAGS=-Wglobalized
|
||||
case `uname -m` in
|
||||
NSR*)
|
||||
SHOBJ_CFLAGS="${SHOBJ_CFLAGS} -Wcall_shared" # default on TNS/E, needed on TNS/R
|
||||
SHOBJ_LD=/usr/bin/ld # for TNS/R
|
||||
;;
|
||||
NSE*|NEO*)
|
||||
SHOBJ_LD=/usr/bin/eld
|
||||
;;
|
||||
esac
|
||||
SHOBJ_LDFLAGS='-shared -bglobalized -unres_symbols ignore'
|
||||
;;
|
||||
|
||||
sunos4*-*gcc*)
|
||||
SHOBJ_CFLAGS=-fpic
|
||||
SHOBJ_LD=/usr/bin/ld
|
||||
@@ -80,15 +96,17 @@ sunos4*)
|
||||
;;
|
||||
|
||||
sunos5*-*gcc*|solaris2*-*gcc*)
|
||||
SHOBJ_CFLAGS=-fpic
|
||||
SHOBJ_LD='${CC}'
|
||||
ld_used=`gcc -print-prog-name=ld`
|
||||
if ${ld_used} -V 2>&1 | grep GNU >/dev/null 2>&1; then
|
||||
# This line works for the GNU ld
|
||||
SHOBJ_LDFLAGS='-shared -Wl,-h,$@'
|
||||
# http://sourceware.org/ml/binutils/2001-08/msg00361.html
|
||||
SHOBJ_CFLAGS=-fPIC
|
||||
else
|
||||
# This line works for the Solaris linker in /usr/ccs/bin/ld
|
||||
SHOBJ_LDFLAGS='-shared -Wl,-i -Wl,-h,$@'
|
||||
SHOBJ_CFLAGS=-fpic
|
||||
fi
|
||||
|
||||
# SHLIB_XLDFLAGS='-R $(libdir)'
|
||||
@@ -104,8 +122,8 @@ sunos5*|solaris2*)
|
||||
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||
;;
|
||||
|
||||
# All versions of Linux or the semi-mythical GNU Hurd.
|
||||
linux*-*|gnu*-*|k*bsd*-gnu-*)
|
||||
# All versions of Linux (including Gentoo/FreeBSD) or the semi-mythical GNU Hurd.
|
||||
linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*-gentoo)
|
||||
SHOBJ_CFLAGS=-fPIC
|
||||
SHOBJ_LD='${CC}'
|
||||
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
|
||||
@@ -114,7 +132,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*)
|
||||
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
|
||||
;;
|
||||
|
||||
freebsd2* | netbsd*)
|
||||
freebsd2*)
|
||||
SHOBJ_CFLAGS=-fpic
|
||||
SHOBJ_LD=ld
|
||||
SHOBJ_LDFLAGS='-x -Bshareable'
|
||||
@@ -124,8 +142,8 @@ freebsd2* | netbsd*)
|
||||
;;
|
||||
|
||||
# FreeBSD-3.x ELF
|
||||
freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*|dragonfly*)
|
||||
SHOBJ_CFLAGS=-fpic
|
||||
freebsd3*|freebsdaout*)
|
||||
SHOBJ_CFLAGS=-fPIC
|
||||
SHOBJ_LD='${CC}'
|
||||
|
||||
if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
|
||||
@@ -141,39 +159,20 @@ freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*|dragonfly*)
|
||||
fi
|
||||
;;
|
||||
|
||||
# FreeBSD-4.x and later have only ELF
|
||||
freebsd[4-9]*|freebsd1[0-9]*|freebsdelf*|dragonfly*)
|
||||
SHOBJ_CFLAGS=-fPIC
|
||||
SHOBJ_LD='${CC}'
|
||||
|
||||
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
|
||||
SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
|
||||
|
||||
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||
;;
|
||||
|
||||
# Darwin/MacOS X
|
||||
darwin1*)
|
||||
SHOBJ_STATUS=supported
|
||||
SHLIB_STATUS=supported
|
||||
|
||||
SHOBJ_CFLAGS=''
|
||||
SHLIB_LIBSUFF='dylib'
|
||||
|
||||
SHOBJ_LD='${CC}'
|
||||
SHOBJ_LDFLAGS='-dynamiclib'
|
||||
;;
|
||||
|
||||
darwin8*)
|
||||
SHOBJ_STATUS=supported
|
||||
SHLIB_STATUS=supported
|
||||
|
||||
SHOBJ_CFLAGS='-fno-common'
|
||||
|
||||
SHOBJ_LD='MACOSX_DEPLOYMENT_TARGET=10.3 ${CC}'
|
||||
|
||||
SHLIB_LIBVERSION='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
|
||||
SHLIB_LIBSUFF='dylib'
|
||||
|
||||
SHOBJ_LDFLAGS='-undefined dynamic_lookup'
|
||||
SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
|
||||
|
||||
SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
|
||||
;;
|
||||
|
||||
darwin*|macosx*)
|
||||
SHOBJ_STATUS=unsupported
|
||||
SHLIB_STATUS=supported
|
||||
|
||||
darwin*)
|
||||
# Common definitions for all darwin/mac os x versions
|
||||
SHOBJ_CFLAGS='-fno-common'
|
||||
|
||||
SHOBJ_LD='${CC}'
|
||||
@@ -181,19 +180,39 @@ darwin*|macosx*)
|
||||
SHLIB_LIBVERSION='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
|
||||
SHLIB_LIBSUFF='dylib'
|
||||
|
||||
# unused at this time
|
||||
SHLIB_SONAME='$(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF)'
|
||||
|
||||
case "${host_os}" in
|
||||
darwin[78]*) SHOBJ_LDFLAGS=''
|
||||
SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
|
||||
# Darwin versions 1, 5, 6, 7 correspond to Mac OS X 10.0, 10.1, 10.2,
|
||||
# and 10.3, respectively.
|
||||
darwin[1-7].*)
|
||||
SHOBJ_STATUS=unsupported
|
||||
SHOBJ_LDFLAGS='-dynamic'
|
||||
SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
|
||||
;;
|
||||
# Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4
|
||||
*)
|
||||
case "${host_os}" in
|
||||
darwin[89]*|darwin1[012]*)
|
||||
SHOBJ_ARCHFLAGS='-arch_only `/usr/bin/arch`'
|
||||
;;
|
||||
*) SHOBJ_LDFLAGS='-dynamic'
|
||||
SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
|
||||
*) # Mac OS X 10.9 (Mavericks) and later
|
||||
SHOBJ_ARCHFLAGS=
|
||||
# for 32 and 64bit universal library
|
||||
#SHOBJ_ARCHFLAGS='-arch i386 -arch x86_64'
|
||||
#SHOBJ_CFLAGS=${SHOBJ_CFLAGS}' -arch i386 -arch x86_64'
|
||||
;;
|
||||
esac
|
||||
SHOBJ_LDFLAGS="-dynamiclib -dynamic -undefined dynamic_lookup ${SHOBJ_ARCHFLAGS}"
|
||||
SHLIB_XLDFLAGS="-dynamiclib ${SHOBJ_ARCHFLAGS}"' -install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
|
||||
;;
|
||||
esac
|
||||
|
||||
SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
|
||||
;;
|
||||
|
||||
openbsd*)
|
||||
openbsd*|netbsd*|mirbsd*)
|
||||
SHOBJ_CFLAGS=-fPIC
|
||||
SHOBJ_LD='${CC}'
|
||||
SHOBJ_LDFLAGS='-shared'
|
||||
@@ -258,7 +277,7 @@ osf*)
|
||||
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||
;;
|
||||
|
||||
aix4.[2-9]*-*gcc*) # lightly tested by jik@cisco.com
|
||||
aix4.[2-9]*-*gcc*|aix[5-9].*-*gcc*) # lightly tested by jik@cisco.com
|
||||
SHOBJ_CFLAGS=-fpic
|
||||
SHOBJ_LD='ld'
|
||||
SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
|
||||
@@ -269,7 +288,7 @@ aix4.[2-9]*-*gcc*) # lightly tested by jik@cisco.com
|
||||
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||
;;
|
||||
|
||||
aix4.[2-9]*)
|
||||
aix4.[2-9]*|aix[5-9].*)
|
||||
SHOBJ_CFLAGS=-K
|
||||
SHOBJ_LD='ld'
|
||||
SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
|
||||
@@ -340,7 +359,7 @@ hpux10*-*gcc*)
|
||||
SHOBJ_LD='${CC}'
|
||||
# if you have problems linking here, moving the `-Wl,+h,$@' from
|
||||
# SHLIB_XLDFLAGS to SHOBJ_LDFLAGS has been reported to work
|
||||
SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s'
|
||||
SHOBJ_LDFLAGS='-shared -fpic -Wl,-b -Wl,+s'
|
||||
|
||||
SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)'
|
||||
SHLIB_LIBSUFF='sl'
|
||||
@@ -500,20 +519,37 @@ msdos*)
|
||||
|
||||
cygwin*)
|
||||
SHOBJ_LD='$(CC)'
|
||||
SHOBJ_LDFLAGS='-shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=$(@).a'
|
||||
SHLIB_LIBPREF='cyg'
|
||||
SHLIB_LIBSUFF='dll'
|
||||
SHLIB_LIBVERSION='$(SHLIB_DLLVERSION).$(SHLIB_LIBSUFF)'
|
||||
SHLIB_LIBS='$(TERMCAP_LIB)'
|
||||
SHOBJ_LDFLAGS='-shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=$(@).a'
|
||||
SHLIB_LIBPREF='cyg'
|
||||
SHLIB_LIBSUFF='dll'
|
||||
SHLIB_LIBVERSION='$(SHLIB_DLLVERSION).$(SHLIB_LIBSUFF)'
|
||||
SHLIB_LIBS='$(TERMCAP_LIB)'
|
||||
|
||||
SHLIB_DOT=
|
||||
# For official cygwin releases, DLLVERSION will be defined in the
|
||||
# environment of configure, and will be incremented any time the API
|
||||
# changes in a non-backwards compatible manner. Otherwise, it is just
|
||||
# SHLIB_MAJOR.
|
||||
if [ -n "$DLLVERSION" ] ; then
|
||||
# For official cygwin releases, DLLVERSION will be defined in the
|
||||
# environment of configure, and will be incremented any time the API
|
||||
# changes in a non-backwards compatible manner. Otherwise, it is just
|
||||
# SHLIB_MAJOR.
|
||||
if [ -n "$DLLVERSION" ] ; then
|
||||
SHLIB_DLLVERSION="$DLLVERSION"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
mingw*)
|
||||
SHOBJ_LD='$(CC)'
|
||||
SHOBJ_LDFLAGS='-shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=$(@).a'
|
||||
SHLIB_LIBSUFF='dll'
|
||||
SHLIB_LIBVERSION='$(SHLIB_DLLVERSION).$(SHLIB_LIBSUFF)'
|
||||
SHLIB_LIBS='$(TERMCAP_LIB)'
|
||||
|
||||
SHLIB_DOT=
|
||||
# For official cygwin releases, DLLVERSION will be defined in the
|
||||
# environment of configure, and will be incremented any time the API
|
||||
# changes in a non-backwards compatible manner. Otherwise, it is just
|
||||
# SHLIB_MAJOR.
|
||||
if [ -n "$DLLVERSION" ] ; then
|
||||
SHLIB_DLLVERSION="$DLLVERSION"
|
||||
fi
|
||||
;;
|
||||
|
||||
#
|
||||
|
||||
@@ -19,7 +19,7 @@ git_commit() {
|
||||
assert [ ! -e "$PYENV_ROOT" ]
|
||||
run pyenv---version
|
||||
assert_success
|
||||
[[ $output == "pyenv 20"* ]]
|
||||
[[ $output == "pyenv "?.?.? ]]
|
||||
}
|
||||
|
||||
@test "doesn't read version from non-pyenv repo" {
|
||||
@@ -30,19 +30,19 @@ git_commit() {
|
||||
|
||||
run pyenv---version
|
||||
assert_success
|
||||
[[ $output == "pyenv 20"* ]]
|
||||
[[ $output == "pyenv "?.?.? ]]
|
||||
}
|
||||
|
||||
@test "reads version from git repo" {
|
||||
git init
|
||||
git remote add origin https://github.com/yyuu/pyenv.git
|
||||
git_commit
|
||||
git tag v20380119
|
||||
git tag v0.4.1
|
||||
git_commit
|
||||
git_commit
|
||||
|
||||
run pyenv---version
|
||||
assert_success "pyenv 20380119-2-g$(git rev-parse --short HEAD)"
|
||||
assert_success "pyenv 0.4.1-2-g$(git rev-parse --short HEAD)"
|
||||
}
|
||||
|
||||
@test "prints default version if no tags in git repo" {
|
||||
@@ -51,5 +51,5 @@ git_commit() {
|
||||
git_commit
|
||||
|
||||
run pyenv---version
|
||||
[[ $output == "pyenv 20"* ]]
|
||||
[[ $output == "pyenv "?.?.? ]]
|
||||
}
|
||||
|
||||
@@ -24,6 +24,30 @@ load test_helper
|
||||
assert_success "$PYENV_TEST_DIR"
|
||||
}
|
||||
|
||||
@test "prefix for system in /" {
|
||||
mkdir -p "${BATS_TEST_DIRNAME}/libexec"
|
||||
cat >"${BATS_TEST_DIRNAME}/libexec/pyenv-which" <<OUT
|
||||
#!/bin/sh
|
||||
echo /bin/python
|
||||
OUT
|
||||
chmod +x "${BATS_TEST_DIRNAME}/libexec/pyenv-which"
|
||||
PYENV_VERSION="system" run pyenv-prefix
|
||||
assert_success "/"
|
||||
rm -f "${BATS_TEST_DIRNAME}/libexec/pyenv-which"
|
||||
}
|
||||
|
||||
@test "prefix for system in /" {
|
||||
mkdir -p "${BATS_TEST_DIRNAME}/libexec"
|
||||
cat >"${BATS_TEST_DIRNAME}/libexec/pyenv-which" <<OUT
|
||||
#!/bin/sh
|
||||
echo /bin/python
|
||||
OUT
|
||||
chmod +x "${BATS_TEST_DIRNAME}/libexec/pyenv-which"
|
||||
PYENV_VERSION="system" run pyenv-prefix
|
||||
assert_success "/"
|
||||
rm -f "${BATS_TEST_DIRNAME}/libexec/pyenv-which"
|
||||
}
|
||||
|
||||
@test "prefix for invalid system" {
|
||||
PATH="$(path_without python)" run pyenv-prefix system
|
||||
assert_failure "pyenv: system version not found in PATH"
|
||||
|
||||
Reference in New Issue
Block a user