Skip to content

Commit

Permalink
macos: move dylib fixer into a dedicated script
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Jan 11, 2025
1 parent c92b453 commit 11be8bc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 38 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ jobs:
echo "GIT_REV=`git rev-parse --short HEAD`" >> $GITHUB_ENV
echo "QTDIR=${{ github.workspace }}/qt/Qt/${{ env.QT_VERSION }}/clang_64" >> $GITHUB_ENV
echo "NPROC=`sysctl -n hw.ncpu`" >> $GITHUB_ENV
echo "HOMEBREW_PREFIX=${{ env.HOMEBREW_PREFIX }}" >> $GITHUB_ENV
- name: Print ENV vars
shell: bash
Expand Down Expand Up @@ -580,24 +581,8 @@ jobs:
- name: Fix non-Qt dependencies
shell: bash
run: |
fix_dep () {
echo "Processing \$1..."
for dep in `otool -L \$1 | grep opt | cut -d ' ' -f 1`
do
if [[ "\$dep" == *\$HOMEBREW_PREFIX* ]]; then
subst=\${dep##*/}
echo "Regular lib: \$dep (\$subst)"
# check missing dependency
if [ ! -f ~/QLC+.app/Contents/Frameworks/\$subst ]; then
echo "Dependency missing: \$subst. Adding it to target..."
cp \$dep ~/QLC+.app/Contents/Frameworks/
fi
install_name_tool -change \$dep @executable_path/../Frameworks/\$subst \$1
fi
done
}
fix_dep ~/QLC+.app/Contents/Frameworks/libsndfile.1.dylib
run: |-
platforms/macos/fix_dylib_deps.sh ~/QLC+.app/Contents/Frameworks/libsndfile.1.dylib
- name: Run macosdeploy
shell: bash
Expand Down
21 changes: 1 addition & 20 deletions create-dmg-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,7 @@ fi
cd ..

echo "Fix non-Qt dependencies..."

fix_dep () {
echo "Processing $1..."
for dep in `otool -L $1 | grep opt | cut -d ' ' -f 1`
do
if [[ "$dep" == *$HOMEBREW_PREFIX* ]]; then
subst=${dep##*/}
echo "Regular lib: $dep ($subst)"
# check missing dependency
if [ ! -f ~/QLC+.app/Contents/Frameworks/$subst ]; then
echo "Dependency missing: $subst. Adding it to target..."
cp $dep ~/QLC+.app/Contents/Frameworks/
fi
#install_name_tool -id @executable_path/../Frameworks/$subst $1
install_name_tool -change $dep @executable_path/../Frameworks/$subst $1
fi
done
}

fix_dep ~/QLC+.app/Contents/Frameworks/libsndfile.1.dylib
platforms/macos/fix_dylib_deps.sh ~/QLC+.app/Contents/Frameworks/libsndfile.1.dylib

echo "Run macdeployqt..."
$QTDIR/bin/macdeployqt ~/QLC+.app
Expand Down
15 changes: 15 additions & 0 deletions platforms/macos/fix_dylib_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
echo "Processing $1..."
for dep in `otool -L $1 | grep opt | cut -d ' ' -f 1`
do
if [[ "$dep" == *$HOMEBREW_PREFIX* ]]; then
subst=${dep##*/}
echo "Regular lib: $dep ($subst)"
# check missing dependency
if [ ! -f ~/QLC+.app/Contents/Frameworks/$subst ]; then
echo "Dependency missing: $subst. Adding it to target..."
cp $dep ~/QLC+.app/Contents/Frameworks/
fi

install_name_tool -change $dep @executable_path/../Frameworks/$subst $1
fi
done

0 comments on commit 11be8bc

Please sign in to comment.