Skip to content

Commit

Permalink
Attempt to bring MacOS workflow back to work. This time building univ…
Browse files Browse the repository at this point in the history
…ersal binaries (both ARM64 and x86_64)
  • Loading branch information
pawelsalawa committed Feb 16, 2025
1 parent 9930ed8 commit cb8d4e7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 48 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/mac_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -487,20 +487,23 @@ jobs:
- name: Rename portable package
working-directory: output/SQLiteStudio
run: |
mv sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.dmg sqlitestudio-${{ env.PACKAGE_VERSION }}.dmg
mv SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}.dmg sqlitestudio-${{ env.PACKAGE_VERSION }}.dmg
- name: Create installer package
working-directory: output/SQLiteStudio
shell: bash
env:
IB_LICENSE: ${{ secrets.INSTALLER_LICENSE }}
run: |
echo "$IB_LICENSE" > lic.xml
hdiutil attach output/SQLiteStudio/sqlitestudio-${{ env.PACKAGE_VERSION }}.dmg
# hdiutil attach output/SQLiteStudio/sqlitestudio-${{ env.PACKAGE_VERSION }}.dmg
${{ env.INSTALLBUILDER_DIR }}/bin/builder build SQLiteStudio-installer.xml \
--license lic.xml \
--setvars project.outputDirectory=$(pwd) \
--setvars project.version=${{ env.SQLITESTUDIO_VERSION }}
mv SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-osx-installer.dmg SQLiteStudio-${{ env.PACKAGE_VERSION }}-installer.dmg
ls -l
mv SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-osx-installer.dmg ../../SQLiteStudio-${{ env.PACKAGE_VERSION }}-installer.dmg
cd ../../
ls -l
- name: SHA256 checksums
Expand Down
24 changes: 12 additions & 12 deletions Plugins/DbSqliteWx/DbSqliteWx.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ isEmpty(WXSQLITE_LIB): {
}

macx: {
exists( /opt/local/include/openssl-3/openssl/crypto.h ) {
message( "Configuring OpenSSL from MacPorts" )
INCLUDEPATH += /opt/local/include/openssl-3
LIBS += -L/opt/local/lib/openssl-3
} else {
message( "Configuring OpenSSL from HomeBrew" )
INCLUDEPATH += /usr/local/opt/openssl/include
LIBS += -L/usr/local/opt/openssl/lib
}
# exists( /opt/local/include/openssl-3/openssl/crypto.h ) {
# message( "Configuring OpenSSL from MacPorts" )
# INCLUDEPATH += /opt/local/include/openssl-3
# LIBS += -L/opt/local/lib/openssl-3
# } else {
# message( "Configuring OpenSSL from HomeBrew" )
# INCLUDEPATH += /usr/local/opt/openssl/include
# LIBS += -L/usr/local/opt/openssl/lib
# }
LIBS += -framework Security
}
!macx: {
LIBS += -L$${PWD}/../deps/lib/$${PLATFORM}/
# LIBS += -L$${PWD}/../deps/lib/$${PLATFORM}/
}
win32: {
INCLUDEPATH += $${PWD}/../deps/include/$${PLATFORM}/
DEPENDPATH += $${PWD}/../deps/include/$${PLATFORM}/
# INCLUDEPATH += $${PWD}/../deps/include/$${PLATFORM}/
# DEPENDPATH += $${PWD}/../deps/include/$${PLATFORM}/
LIBS += -lcoreSQLiteStudio
}

Expand Down
33 changes: 0 additions & 33 deletions SQLiteStudio3/create_macosx_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ set -e

printUsage() {
echo "$0 [-q]... <sqlitestudio build output directory> <qmake path> [dmg|dist|dist_full]"
echo "$0 -u <sqlitestudio.x86_64.dmg> <sqlitestudio.arm64.dmg> <sqlitestudio.universal.dmg>"
}

quiet=0
universalize=0
while getopts qu _flag; do
case "$_flag" in
q) : $(( quiet += 1 )) ;;
u) : $(( universalize += 1 )) ;;
*) printUsage; exit 1 ;;
esac
done
Expand Down Expand Up @@ -108,36 +105,6 @@ EOF
run rm "$_rw_image"
}

universalize() {
_mountpoint1=/Volumes/sqlitestudio-arch1
_mountpoint2=/Volumes/sqlitestudio-arch2
_device1="$(hdiutil_attach "$1" "$_mountpoint1")"
_device2="$(hdiutil_attach "$2" "$_mountpoint2")"
rm -fr _universalized
cp -RP "$_mountpoint1" _universalized
find "$_mountpoint1" -type f \( -perm +u+x -or -name '*.dylib' \) | while read -r _name1; do
case "$(file -b "$_name1")" in Mach-O*)
_relative_name="${_name1#"$_mountpoint1/"}"
run lipo "$_name1" "$_mountpoint2/$_relative_name" -create -output "_universalized/$_relative_name"
;;
esac
done
run hdiutil detach "$_device1"
run hdiutil detach "$_device2"
cd _universalized
codesign_app "SQLiteStudio.app"
# shellcheck disable=SC2086
pretty_dmg "SQLiteStudio.app" "universal_out" "$BACKGROUND_IMG" $BACKGROUND_RGB
cd ..
mv "_universalized/universal_out.dmg" "$3"
rm -fr _universalized
}

if [ "$universalize" -gt 0 ] && [ -f "$1" ] && [ -f "$2" ] && [ -n "$3" ]; then
universalize "$@"
exit
fi

if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
printUsage
exit 1
Expand Down

0 comments on commit cb8d4e7

Please sign in to comment.