Skip to content

Commit 93c6837

Browse files
committed
update macOS build script
1 parent 7eea73e commit 93c6837

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

tools/jenkins/build-OSX-installer.sh

+26-14
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,9 @@ if otool -L "${natron_binary}" | grep -F -q "@rpath/libc++"; then
433433
fi
434434
fi
435435
if [ "${COPY_LIBCXX}" = 1 ]; then
436-
echo "* Will copy lib++ from ${COPY_LIBCXX_FROM}"
436+
echo "* Will copy libc++ from ${COPY_LIBCXX_FROM}"
437437
else
438-
echo "* Will not copy lib++"
438+
echo "* Will not copy libc++"
439439
fi
440440

441441
if [ -f "${pkglib}/libc++.1.dylib" ] || [ -f "${pkglib}/libc++abi.1.dylib" ]; then
@@ -808,21 +808,33 @@ popd
808808

809809
#############################################################################
810810
# Other binaries
811-
echo "*** Fixing sonames in other binaries and dynamic libraries..."
811+
echo "*** Fixing sonames in binaries and dynamic libraries..."
812812
pushd "${package}/Contents"
813813
# We also check dynamic libraries, because we've seen issues, e.g. with libavdevice.*.dylib, which is a dependency of ffmpeg and ffprobe
814-
bins=( "${otherbins[@]/#/MacOS/}" )
814+
bins=( "${natronbins[@]/#/MacOS/}" "${otherbins[@]/#/MacOS/}" )
815815
while [ ${#bins[@]} -gt 0 ]; do
816816
more_bins=( )
817-
for bin in "${bins[@]}"; do
817+
for binary in "${bins[@]}"; do
818+
if [ ! -e "${binary}" ]; then
819+
continue
820+
fi
821+
# Fix Qt libs
822+
for f in "${qt_libs[@]}"; do
823+
install_name_tool -change "${qt_frameworks_dir}/${f}.framework/Versions/${QT_VERSION_MAJOR}/${f}" "@executable_path/../Frameworks/${f}.framework/Versions/${QT_VERSION_MAJOR}/${f}" "${binary}"
824+
done
825+
for l in pyside${pypart}.${SBKVER} shiboken${pypart}.${SBKVER}; do
826+
dylib="lib${l}.dylib"
827+
install_name_tool -change "${SDK_HOME}/lib/${dylib}" "@executable_path/../Frameworks/${dylib}" "${binary}"
828+
done
829+
818830
# fix macports libs
819-
MPLIBS0="$(otool -L "${bin}" | grep -F "${SDK_HOME}/lib" | grep -F -v ':' |sort|uniq |awk '{print $1}')"
831+
MPLIBS0="$(otool -L "${binary}" | grep -F "${SDK_HOME}/lib" | grep -F -v ':' |sort|uniq |awk '{print $1}')"
820832
# also add first-level and second-level dependencies
821833
MPLIBS1="$(for i in ${MPLIBS0}; do echo "$i"; otool -L "$i" | grep -F "${SDK_HOME}/lib" | grep -F -v ':'; done |sort|uniq |awk '{print $1}')"
822834
MPLIBS="$(for i in ${MPLIBS1}; do echo "$i"; otool -L "$i" | grep -F "${SDK_HOME}/lib" | grep -F -v ':'; done |sort|uniq |awk '{print $1}')"
823835
for mplib in ${MPLIBS}; do
824836
if [ ! -f "${mplib}" ]; then
825-
echo "Error: missing ${bin} depend ${mplib}"
837+
echo "Error: missing ${binary} depend ${mplib}"
826838
exit 1
827839
fi
828840
lib="$(echo "${mplib}" | awk -F / '{print $NF}')"
@@ -837,30 +849,30 @@ while [ ${#bins[@]} -gt 0 ]; do
837849
install_name_tool -id "@executable_path/../Frameworks/${lib}" "${pkglib}/${lib}"
838850
more_bins+=( "${pkglib}/${lib}" )
839851
fi
840-
install_name_tool -change "${mplib}" "@executable_path/../Frameworks/${lib}" "${bin}"
852+
install_name_tool -change "${mplib}" "@executable_path/../Frameworks/${lib}" "${binary}"
841853
done
842854
# Fix rpath
843-
if [ ! -x "${bin}" ]; then
855+
if [ ! -x "${binary}" ]; then
844856
continue
845857
fi
846858
if [ "${LIBGCC}" = "1" ]; then
847859
for l in ${gcclibs}; do
848860
lib="lib${l}.dylib"
849-
install_name_tool -change "${SDK_HOME}/lib/libgcc/${lib}" "@executable_path/../Frameworks/${lib}" "${bin}" || true
861+
install_name_tool -change "${SDK_HOME}/lib/libgcc/${lib}" "@executable_path/../Frameworks/${lib}" "${binary}" || true
850862
done
851863
fi
852864
if [ "${COMPILER}" = "clang-omp" ]; then
853865
for l in ${omplibs}; do
854866
lib="lib${l}.dylib"
855-
install_name_tool -change "${SDK_HOME}/lib/libomp/${lib}" "@executable_path/../Frameworks/${lib}" "${bin}" || true
867+
install_name_tool -change "${SDK_HOME}/lib/libomp/${lib}" "@executable_path/../Frameworks/${lib}" "${binary}" || true
856868
done
857869
fi
858870
for f in Python; do
859-
install_name_tool -change "${SDK_HOME}/Library/Frameworks/${f}.framework/Versions/${PYVER}/${f}" "@executable_path/../Frameworks/${f}.framework/Versions/${PYVER}/${f}" "${bin}" || true
871+
install_name_tool -change "${SDK_HOME}/Library/Frameworks/${f}.framework/Versions/${PYVER}/${f}" "@executable_path/../Frameworks/${f}.framework/Versions/${PYVER}/${f}" "${binary}" || true
860872
done
861873
if [ "${QT_VERSION_MAJOR}" -ge 5 ]; then
862-
install_name_tool -rpath "${SDK_HOME}/Library/Frameworks/${PYSHIBOKEN}" "@executable_path/../Frameworks/${PYSHIBOKEN}" "${bin}" || true
863-
install_name_tool -rpath "${SDK_HOME}/Library/Frameworks/${PYSIDE}" "@executable_path/../Frameworks/${PYSIDE}" "${bin}" || true
874+
install_name_tool -rpath "${SDK_HOME}/Library/Frameworks/${PYSHIBOKEN}" "@executable_path/../Frameworks/${PYSHIBOKEN}" "${binary}" || true
875+
install_name_tool -rpath "${SDK_HOME}/Library/Frameworks/${PYSIDE}" "@executable_path/../Frameworks/${PYSIDE}" "${binary}" || true
864876
fi
865877
done
866878
if [ ${#more_bins[@]} -gt 0 ]; then

tools/jenkins/compiler-common.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if [ "$PKGOS" = "OSX" ]; then
2222
osxver=$(uname -r)
2323

2424
# if clang-mp-5.0 or clang-mp-4.0 is available
25-
if command -v clang-mp-15 >/dev/null 2>&1 || command -v clang-mp-14 >/dev/null 2>&1 || command -v clang-mp-13 >/dev/null 2>&1 || command -v clang-mp-12 >/dev/null 2>&1 || command -v clang-mp-11 >/dev/null 2>&1 || command -v clang-mp-9.0 >/dev/null 2>&1 || command -v clang-mp-8.0 >/dev/null 2>&1 || command -v clang-mp-7.0 >/dev/null 2>&1 || command -v clang-mp-6.0 >/dev/null 2>&1 || command -v clang-mp-5.0 >/dev/null 2>&1 || command -v clang-mp-4.0 >/dev/null 2>&1; then
25+
if command -v clang-mp-18 >/dev/null 2>&1 || clang-mp-17 >/dev/null 2>&1 || clang-mp-16 >/dev/null 2>&1 || clang-mp-15 >/dev/null 2>&1 || command -v clang-mp-14 >/dev/null 2>&1 || command -v clang-mp-13 >/dev/null 2>&1 || command -v clang-mp-12 >/dev/null 2>&1 || command -v clang-mp-11 >/dev/null 2>&1 || command -v clang-mp-9.0 >/dev/null 2>&1 || command -v clang-mp-8.0 >/dev/null 2>&1 || command -v clang-mp-7.0 >/dev/null 2>&1 || command -v clang-mp-6.0 >/dev/null 2>&1 || command -v clang-mp-5.0 >/dev/null 2>&1 || command -v clang-mp-4.0 >/dev/null 2>&1; then
2626
COMPILER=clang-omp
2727
if grep -q "configure.optflags.*-Os" /opt/local/libexec/macports/lib/port1.0/portconfigure.tcl; then
2828
true

0 commit comments

Comments
 (0)