Skip to content

Commit a38c452

Browse files
author
Mișu Moldovan
committed
[#3723] Support for macOS 10.12 with Homebrew's OpenSSL.
1 parent a25da3c commit a38c452

28 files changed

Lines changed: 73 additions & 2133 deletions

chevah_build

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ BUILD_CFFI="yes"
2727
EXTRA_LIBRARIES="\
2828
python-modules/cffi-1.5.2 \
2929
python-modules/pycrypto-2.6.1 \
30-
python-modules/python-setproctitle-1.1.8.dev0 \
3130
"
32-
# Libraries for legecy systems not built around cffi.
31+
# Libraries for legacy systems not built around cffi and pip.
3332
EXTRA_LIBRARIES_NO_CFFI="\
3433
python-modules/pyOpenSSL-0.13 \
3534
python-modules/pycrypto-2.6.1 \
@@ -38,8 +37,9 @@ EXTRA_LIBRARIES_NO_CFFI="\
3837

3938
# List of python modules installed using pip
4039
PIP_LIBRARIES="\
40+
setproctitle==1.1.10 \
4141
cryptography==1.3.1 \
42-
pyOpenSSL==16.0.0
42+
pyOpenSSL==16.0.0 \
4343
"
4444
# Pre-combiled libraries distributed as wheels for Windows.
4545
PIP_LIBRARIES_WIN="$PIP_LIBRARIES \
@@ -65,6 +65,7 @@ BUILD_FOLDER='build'
6565
if [ "$?" -ne 0 ]; then
6666
exit 1
6767
fi
68+
6869
PYTHON_VERSION=`cut -d' ' -f 2 DEFAULT_VALUES`
6970
OS=`cut -d' ' -f 3 DEFAULT_VALUES`
7071
ARCH=`cut -d' ' -f 4 DEFAULT_VALUES`
@@ -198,11 +199,23 @@ case $OS in
198199
export MAKE=gmake
199200
;;
200201
osx*)
202+
# The extra params needed to fix the minimum target version to 10.8
203+
# have the important benefit of getting rid of the libgcc dependency.
201204
export CC="clang"
202205
export CXX="clang++"
203206
export CFLAGS="$CFLAGS -mmacosx-version-min=10.8"
204207
export MACOSX_DEPLOYMENT_TARGET=10.8
205208
;;
209+
macos*)
210+
# On macOS 10.12 or newer we need the Homebrew version of OpenSSL,
211+
# as Apple only provides an old OpenSSL version: 0.9.8.
212+
export CC="clang"
213+
export CXX="clang++"
214+
# The location of the Homebrew OpenSSL libs and include directories.
215+
export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"
216+
export CPPFLAGS="-I/usr/local/opt/openssl/include"
217+
;;
218+
206219
freebsd*)
207220
export CC="clang"
208221
export CXX="clang++"
@@ -268,6 +281,19 @@ install_dependencies() {
268281
install_command='sudo zypper --non-interactive install -l'
269282
check_command='rpm --query'
270283
;;
284+
macos*)
285+
# On macOS we need OpenSSL installed via homebrew, but we don't
286+
# do it automatically, here we only check that the expected
287+
# OpenSSL version is installed, as hardcoded below.
288+
homebrew_openssl_version=`brew list --versions openssl`
289+
if [[ $homebrew_openssl_version != "openssl 1.0.2"* ]]; then
290+
echo "Unsupported OpenSSL version: $homebrew_openssl_version"
291+
exit 102
292+
fi
293+
packages=''
294+
install_command=''
295+
check_command=''
296+
;;
271297
*)
272298
packages=''
273299
install_command=''

paver.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,15 @@ detect_os() {
497497
os_version_raw=$(sw_vers -productVersion)
498498
check_os_version "Mac OS X" 10.8 "$os_version_raw" os_version_chevah
499499

500-
# For now, no matter the actual OS X version returned, we use '108'.
501-
OS="osx108"
500+
if [ ${os_version_chevah:0:2} -eq 10 -a \
501+
${os_version_chevah:2:2} -ge 12 ]; then
502+
# For newer, macOS versions, we use '1012'.
503+
OS="macos1012"
504+
else
505+
# For older, OS X versions, we use '108'.
506+
OS="osx108"
507+
fi
508+
502509

503510
elif [ "${OS}" = "freebsd" ]; then
504511
ARCH=$(uname -m)

python-modules/chevah-python-test/test_python_binary_dist.py

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,30 @@ def get_allowed_deps():
168168
'libssl.so.1.0.0',
169169
])
170170
elif platform_system == 'darwin':
171-
# This is the list of deps for OS X 10.8, mostly sans versions.
171+
# Common deps for OS X 10.8 and macOS 10.12, with full path.
172172
allowed_deps = [
173-
'ApplicationServices.framework/Versions/A/ApplicationServices',
174-
'Carbon.framework/Versions/A/Carbon',
175-
'CoreFoundation.framework/Versions/A/CoreFoundation',
176-
'CoreServices.framework/Versions/A/CoreServices',
177-
'SystemConfiguration.framework/Versions/A/SystemConfiguration',
178-
'libSystem.B.dylib',
179-
'libcrypto.0.9.8.dylib',
180-
'libssl.0.9.8.dylib',
181-
'libz.1.dylib',
173+
'/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices',
174+
'/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon',
175+
'/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation',
176+
'/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices',
177+
'/System/Library/Frameworks/Security.framework/Versions/A/Security',
178+
'/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration',
179+
'/usr/lib/libSystem.B.dylib',
180+
'/usr/lib/libz.1.dylib',
182181
]
182+
if ('osx' in chevah_os):
183+
# Additional deps when using the OS-included OpenSSL.
184+
allowed_deps.extend([
185+
'/usr/lib/libcrypto.0.9.8.dylib',
186+
'/usr/lib/libssl.0.9.8.dylib',
187+
])
188+
elif ('macos' in chevah_os):
189+
# Additional deps when using Homebrew's OpenSSL.
190+
allowed_deps.extend([
191+
'/usr/lib/libgcc_s.1.dylib',
192+
'/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib',
193+
'/usr/local/opt/openssl/lib/libssl.1.0.0.dylib',
194+
])
183195
elif platform_system == 'freebsd':
184196
# This is the list of specific deps for FreeBSD 10.x, with paths.
185197
allowed_deps = [

python-modules/python-setproctitle-1.1.4.dev0/COPYRIGHT

Lines changed: 0 additions & 25 deletions
This file was deleted.

python-modules/python-setproctitle-1.1.4.dev0/HISTORY

Lines changed: 0 additions & 79 deletions
This file was deleted.

python-modules/python-setproctitle-1.1.4.dev0/MANIFEST.in

Lines changed: 0 additions & 8 deletions
This file was deleted.

python-modules/python-setproctitle-1.1.4.dev0/Makefile

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)