Skip to content

Commit

Permalink
Merge pull request #311 from MSoegtropIMC/fix-macos-dmg
Browse files Browse the repository at this point in the history
MacOS: fix issue with macpack during DMG installer creation
  • Loading branch information
MSoegtropIMC authored Nov 17, 2022
2 parents 039cf9c + 6196249 commit bb768b8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ jobs:
run: |
brew install findutils
brew install coreutils
brew install python@3.8
pip3 install macpack
- name: 'Build DMG installer'
Expand Down
19 changes: 17 additions & 2 deletions macos/create_installer_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,24 @@ source shell_scripts/get_names_from_switch.sh

###### Check if required system utilities are installed #####

# Output some information in case finding macpack needs to be debugged
echo "python3 = '$(which python3)' '$(python3 --version)'"
echo "pip3 = '$(which pip3)' '$(pip3 --version)'"
pip3 show --files macpack

# Determine the patch to the macpack binary.
# We filter these two lines from the output of 'pip3 show macpack --files'
# Location: /Users/msoegtrop/Library/Python/3.8/lib/python/site-packages
# ../../../bin/macpack
# and combine them with realpath to the path to the macpack binary
MACPACK="$(realpath "$(pip3 show macpack | grep 'Location:' | cut -f 2 -d ' ')/$(pip3 show macpack --files | grep "^[^:]*macpack$" | sed 's/^ *//')")"
echo "MACKPACK = '$MACPACK'"

command -v python3 &> /dev/null || ( echo "You don't have python3 - which is starnge because macOS supplies one" ; exit 1)
command -v pip3 &> /dev/null || ( echo "You don't have pip3 - which is starnge because macOS supplies one" ; exit 1)
command -v gfind &> /dev/null || ( echo "Please install gfind (eg. sudo port install findutils)" ; exit 1)
command -v grealpath &> /dev/null || ( echo "Please install grealpath (eg. sudo port install coreutils)" ; exit 1)
command -v macpack &> /dev/null || ( echo "Please install macpack (eg. sudo port install py38-pip; port select --set pip3 pip38; pip3 install macpack)" ; exit 1)
command -v "$MACPACK" &> /dev/null || ( echo "Please install macpack (eg. pip3 macpack)" ; exit 1)

###### Create root folder #####

Expand Down Expand Up @@ -149,7 +164,7 @@ function add_shared_library_dependencies {
if [ "${type}" == 'Mach-O 64-bit executable x86_64' ] || [ "${type}" == 'Mach-O 64-bit bundle x86_64' ]
then
echo "Adding shared libraries for $1"
macpack -v -d "$2"/lib/dylib $1 >> logs/macpack.log
"${MACPACK}" -v -d "$2"/lib/dylib $1 >> logs/macpack.log
else
echo "INFO: File '$1' with type '${type}' ignored in shared library analysis."
fi
Expand Down

0 comments on commit bb768b8

Please sign in to comment.