Remove scripts and resources for building and installing Python framework

This commit is contained in:
Greg Neagle
2025-10-06 14:41:33 -07:00
parent 3ab392727c
commit 029bb5ab46
5 changed files with 0 additions and 133 deletions
-88
View File
@@ -1,88 +0,0 @@
#!/bin/bash
#
# Build script for universal Python 3 framework for Munki
TOOLSDIR=$(dirname "$0")
REQUIREMENTS="${TOOLSDIR}/py3_requirements.txt"
PYTHON_FRAMEWORK_VERSION=3.12
PYTHON_VERSION=3.12.2
PYTHON_PRERELEASE_VERSION=
PYTHON_BASEURL="https://www.python.org/ftp/python/%s/python-%s${PYTHON_PRERELEASE_VERSION}-macos%s.pkg"
MACOS_VERSION=11
CODEDIR=$(dirname "${TOOLSDIR}")
MUNKIROOT=$(dirname "${CODEDIR}")
# Sanity checks.
GIT=$(which git)
WHICH_GIT_RESULT="$?"
if [ "${WHICH_GIT_RESULT}" != "0" ]; then
echo "Could not find git in command path. Maybe it's not installed?" 1>&2
echo "You can get a Git package here:" 1>&2
echo " https://git-scm.com/download/mac"
exit 1
fi
if [ ! -d "${MUNKIROOT}/code" ]; then
echo "Does not look like you are running this script from a Munki git repo." 1>&2
exit 1
fi
if [ ! -f "${REQUIREMENTS}" ]; then
echo "Missing requirements file at ${REQUIREMENTS}." 1>&2
exit 1
fi
# clone our relocatable-python tool
PYTHONTOOLDIR="/tmp/relocatable-python-git"
if [ -d "${PYTHONTOOLDIR}" ]; then
rm -rf "${PYTHONTOOLDIR}"
fi
echo "Cloning relocatable-python tool from github..."
git clone https://github.com/gregneagle/relocatable-python.git "${PYTHONTOOLDIR}"
CLONE_RESULT="$?"
if [ "${CLONE_RESULT}" != "0" ]; then
echo "Error cloning relocatable-python tool repo: ${CLONE_RESULT}" 1>&2
exit 1
fi
# remove existing Python.framework if present
if [ -d "${MUNKIROOT}/Python.framework" ]; then
rm -rf "${MUNKIROOT}/Python.framework"
fi
# build the framework
"${PYTHONTOOLDIR}/make_relocatable_python_framework.py" \
--baseurl "${PYTHON_BASEURL}" \
--python-version "${PYTHON_VERSION}" \
--os-version "${MACOS_VERSION}" \
--upgrade-pip \
--pip-requirements "${REQUIREMENTS}" \
--destination "${MUNKIROOT}"
# verify we actually have a universal build
echo "Verifying Universal2 builds..."
STATUS=0
# ensure all .so and .dylibs are universal
LIB_COUNT=$(find "${MUNKIROOT}/Python.framework" -name "*.so" -or -name "*.dylib" | wc -l)
UNIVERSAL_COUNT=$(find "${MUNKIROOT}/Python.framework" -name "*.so" -or -name "*.dylib" | xargs file | grep "2 architectures" | wc -l)
if [ "$LIB_COUNT" != "$UNIVERSAL_COUNT" ] ; then
echo "$LIB_COUNT libraries (*.so and *.dylib) found in the framework; only $UNIVERSAL_COUNT are universal!"
echo "The following libraries are not universal:"
find "${MUNKIROOT}"/Python.framework -name "*.so" -or -name "*.dylib" | xargs file | grep -v "2 architectures" | grep -v "(for architecture"
STATUS=1
fi
# test some more files in the framework
MORE_FILES="Python.framework/Versions/${PYTHON_FRAMEWORK_VERSION}/Resources/Python.app/Contents/MacOS/Python
Python.framework/Versions/Current/Python
Python.framework/Versions/Current/bin/python${PYTHON_FRAMEWORK_VERSION}"
for TESTFILE in $MORE_FILES ; do
ARCH_TEST=$(file "${MUNKIROOT}/$TESTFILE" | grep "2 architectures")
if [ "$ARCH_TEST" == "" ] ; then
echo "${MUNKIROOT}/$TESTFILE is not universal!"
STATUS=1
fi
done
exit $STATUS
@@ -1,4 +0,0 @@
#!/bin/sh
# undo the removal prevention done in preinstall
/usr/bin/chflags -fR noschg,nouchg "$3/usr/local/munki/Python.framework/Versions/"3.*
@@ -1,10 +0,0 @@
#!/bin/sh
# we're going to install version 3.12
# prevent installer from removing a version currently in use
# (must update this script when we move to a new Python version)
for OLDVERS in 3.7 3.8 3.9 3.10 ; do
if [ -d "$3/usr/local/munki/Python.framework/Versions/$OLDVERS" ] ; then
/usr/bin/chflags -fR schg,uchg "$3/usr/local/munki/Python.framework/Versions/$OLDVERS"
fi
done
@@ -1,16 +0,0 @@
#!/bin/sh
set -e
# remove old python symlink if it exists
if [ -f "/usr/local/munki/python" ]; then
/bin/rm /usr/local/munki/python
fi
# sometimes old versions are left behind in the framework. remove them.
for OLDVERS in 3.7 3.8 3.9 3.10 ; do
if [ -d "/usr/local/munki/Python.framework/Versions/${OLDVERS}" ]; then
/bin/rm -r "/usr/local/munki/Python.framework/Versions/${OLDVERS}"
fi
done
-15
View File
@@ -1,15 +0,0 @@
asn1crypto==1.5.1
cffi==1.16.0
pycparser==2.21
pyobjc-core==10.1
pyobjc-framework-CFNetwork==10.1
pyobjc-framework-LaunchServices==10.1
pyobjc-framework-OpenDirectory==10.1
pyobjc-framework-Quartz==10.1
pyobjc-framework-Security==10.1
pyobjc-framework-SystemConfiguration==10.1
six==1.16.0
xattr==1.1.0
--no-binary :all: