diff --git a/recipe/install_shared.sh b/recipe/install_shared.sh index 35812a5d1..5dafbd13f 100644 --- a/recipe/install_shared.sh +++ b/recipe/install_shared.sh @@ -31,3 +31,23 @@ fi if [[ ${PY_INTERP_DEBUG} == yes ]]; then ln -s ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} ${PREFIX}/lib/libpython${VERABI_NO_DBG}${SHLIB_EXT} fi + +# create libpython3.dylib; linux builds only add this in release mode, do the same on osx +if [[ "$target_platform" == osx-* && ${PY_INTERP_DEBUG} == no ]]; then + # need to filter out windows-specific symbols & PyOS_CheckStack from + # https://github.com/python/cpython/blob/main/Doc/data/stable_abi.dat + awk -F',' ' + ($1 == "func" || $1 == "data") && + $4 != "on Windows" && + $2 != "PyOS_CheckStack" { + print "_" $2 + } + ' Doc/data/stable_abi.dat > stable_abi_exports.txt + + $CC -dynamiclib \ + -install_name @rpath/libpython3.dylib \ + -compatibility_version 3.0 -current_version ${PY_VER}.0 \ + -Wl,-reexport_library,${PREFIX}/lib/libpython${VERABI}.dylib \ + -Wl,-exported_symbols_list,stable_abi_exports.txt \ + -o ${PREFIX}/lib/libpython3.dylib +fi diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 5d73820b5..891b5e104 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -4,7 +4,7 @@ {% set ver2 = '.'.join(version.split('.')[0:2]) %} {% set ver2nd = ''.join(version.split('.')[0:2]) %} {% set ver3nd = ''.join(version.split('.')[0:3]) %} -{% set build_number = 2 %} +{% set build_number = 3 %} # this makes the linter happy {% set channel_targets = channel_targets or 'conda-forge main' %} @@ -355,9 +355,8 @@ outputs: {% if py_interp_debug == "yes" %} - VERABI=${VERABI}d # [not win] {% endif %} - - test -f ${PREFIX}/lib/libpython${VERABI}.so # [linux] - - test -f ${PREFIX}/lib/libpython3.so # [linux and build_type == "release"] - - test -f ${PREFIX}/lib/libpython${VERABI}.dylib # [osx] + - test -f ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} # [unix] + - test -f ${PREFIX}/lib/libpython3${SHLIB_EXT} # [unix and build_type == "release"] {% if freethreading == "yes" %} - if not exist %PREFIX%\python3t.dll exit 1 # [win] - if not exist %PREFIX%\python{{ ver2nd }}t.dll exit 1 # [win]